GitLab has been upgraded to 13.3.6. If you encounter any issues mail code@riscosopen.org

Commit 510fba3f authored by Jeffrey Lee's avatar Jeffrey Lee

Misc housekeeping

Detail:
  Makefile, !MkDebug,fd7 - Debug version of module can now be built just by passing "DEBUG=TRUE" to amu
  c/cmodule, c/musb_hal - Only accept USB controllers if HAL_USBControllerInfo says the struct size is an exact match with what we expect
  s/bufman - Delete unused file
  s/call_veneer, s/triggercbs - Use Entry/EXIT macros to avoid single-reg LDM/STM performance warnings. Convert tabs to spaces.
Admin:
  Tested on rev A2 BB-xM


Version 0.17. Tagged as 'MUSBDriver-0_17'
parent 894346c0
......@@ -13,5 +13,5 @@
| limitations under the License.
|
dir <obey$dir>
amu COPTIONS="-fn -g -DDEBUGLIB -DMUSB_DEBUG" CDEBUG="-DDEBUGLIB -DMUSB_DEBUG" THROWBACK=-throwback
amu gpa.MUSBDriver COPTIONS="-fn -g -DDEBUGLIB -DMUSB_DEBUG" CDEBUG="-DDEBUGLIB -DMUSB_DEBUG"
amu CFLAGS="-fn -g" DEBUG=TRUE THROWBACK=-throwback
amu gpa.MUSBDriver CFLAGS="-fn -g" DEBUG=TRUE
......@@ -20,25 +20,31 @@ COMPONENT = MUSBDriver
RES_OBJ = msgs
OBJS = cmodule call_veneer musb musb_debug musb_peri musb_root musb_usb musb_util port triggercbs tps
OBJS_HAL = o_hal.musb o_hal.musb_peri o_hal.musb_root o_hal.musb_usb o_hal.musb_util o_hal.tps o_hal.musb_hal
LIBS = ${DEBUGLIBS} ${NET5LIBS} ${CALLXLIB} ${ASMUTILS} ${TBOXLIBS}
LIBS = ${CALLXLIB} ${ASMUTILS} ${TBOXLIBS}
CMHGFILE = modhead
HDRS =
USBDIR = <Lib$Dir>.USB
CUSTOMEXP = custom
CFLAGS += -ff -wp -wc
CDEFINES += ${CDEBUG} -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED
#
# Debug switch
#
DEBUG ?= FALSE
ifeq (${DEBUG},TRUE)
CFLAGS += -DDEBUGLIB -DMUSB_DEBUG
CMHGDEFINES += -DMUSB_DEBUG
LIBS += ${DEBUGLIBS} ${NET5LIBS}
endif
CFLAGS += -wp -wc
CDEFINES += -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED
CINCLUDES = -Itbox:,TCPIPLibs:,^.^.NetBSD.,OS:
CMHGDEFINES = -DCOMPONENT=${COMPONENT} ${CDEBUG}
CMHGDEFINES += -DCOMPONENT=${COMPONENT}
CMHGDEPENDS = cmodule musb tps
LDFLAGS = -Symbols rm.sym${TARGET}
VPATH = ^.^.build ^.^.dev.usb
include StdTools
include ModStdRule
include ModuleLibs
include DbgRules
include CModule
${DIRS}::
......
/* (0.16)
/* (0.17)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.16
#define Module_MajorVersion_CMHG 0.17
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 04 Dec 2011
#define Module_Date_CMHG 07 Jun 2012
#define Module_MajorVersion "0.16"
#define Module_Version 16
#define Module_MajorVersion "0.17"
#define Module_Version 17
#define Module_MinorVersion ""
#define Module_Date "04 Dec 2011"
#define Module_Date "07 Jun 2012"
#define Module_ApplicationDate "04-Dec-11"
#define Module_ApplicationDate "07-Jun-12"
#define Module_ComponentName "MUSBDriver"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/Controllers/MUSBDriver"
#define Module_FullVersion "0.16"
#define Module_HelpVersion "0.16 (04 Dec 2011)"
#define Module_LibraryVersionInfo "0:16"
#define Module_FullVersion "0.17"
#define Module_HelpVersion "0.17 (07 Jun 2012)"
#define Module_LibraryVersionInfo "0:17"
......@@ -258,7 +258,7 @@ _kernel_oserror* module_init (const char *cmd_tail, int podule_base, void *pw)
hal_device, &usbinfo, sizeof usbinfo,
0, EntryNo_HAL_USBControllerInfo,
&usbinfolen);
if (!e && (usbinfolen >= sizeof(usbinfo)) && usbinfo.type == 2)
if (!e && (usbinfolen == sizeof(usbinfo)) && usbinfo.type == 2)
{
device_number = usbinfo.devno;
musb_base = usbinfo.hw;
......
......@@ -84,7 +84,7 @@ void USBHAL_MUSBDriver_Init(void)
do {
usbinfo info;
size_t usbinfolen = HAL_USBControllerInfo(idx,&info,sizeof(info));
if((usbinfolen >= sizeof(info)) && (info.type == 2))
if((usbinfolen == sizeof(info)) && (info.type == 2))
init_device(&info,idx);
else if(!usbinfolen)
return;
......
; Copyright 2009 Castle Technology Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; little assembler stub to buffer service routine
AREA |C$$data|, DATA
EXPORT BuffManService
BuffManService
DCD 0
EXPORT BuffManWS
BuffManWS
DCD 0
AREA |C$$code|, CODE, READONLY
EXPORT call_buffermanager
call_buffermanager
STMFD R13!,{R4,R5,LR}
MOV R4,R0
MOV R5,R1
MOV R12,R2
LDMIA R4!,{R0-R3}
MOV LR,PC
MOV PC,R5
STMDB R4,{R2-R3}
MOV R0,PC
LDMFD R13!,{R4,R5,PC}
END
......@@ -15,80 +15,81 @@
; little assembler stub to call an interrupt handler with an argument i r12
GET Hdr:ListOpts
OPT OptNoList
GET Hdr:Macros ; system wide macro definitions
GET Hdr:System ; swis and hardware declarations
OPT OptNoList
GET Hdr:Macros ; system wide macro definitions
GET Hdr:System ; swis and hardware declarations
GET Hdr:Proc
AREA |C$$code|, CODE, READONLY
EXPORT init_veneer
IMPORT memcpy
AREA |C$$code|, CODE, READONLY
EXPORT init_veneer
IMPORT memcpy
init_veneer
STMFD sp!, {lr}
Entry
; claim memory for block, exit with NULL on error
MOV r0, #6
MOV r3, #magic_end - magic_start
SWI XOS_Module
MOVVS a1, #0
LDMVSFD sp!, {pc}
MOV r0, #6
MOV r3, #magic_end - magic_start
SWI XOS_Module
MOVVS a1, #0
EXIT VS
; memcpy the existing block
MOV a1, r2
ADR a2, magic_start
MOV a3, #magic_end - magic_start
BL memcpy
MOV a1, r2
ADR a2, magic_start
MOV a3, #magic_end - magic_start
BL memcpy
; poke the magic words
SUB sl, sl, #540
LDMIA sl, {a2,a3}
STMIA a1, {a2,a3}
ADD sl, sl, #540
; Flush the cache!
MOV a2, a1
ADD a3, a2, #magic_end - magic_start
MOV a1, #1
SWI XOS_SynchroniseCodeAreas
MOV a1, a2
SUB sl, sl, #540
LDMIA sl, {a2,a3}
STMIA a1, {a2,a3}
ADD sl, sl, #540
; Flush the cache!
MOV a2, a1
ADD a3, a2, #magic_end - magic_start
MOV a1, #1
SWI XOS_SynchroniseCodeAreas
MOV a1, a2
; return pointing to the block
LDMFD sp!, {pc}
EXIT
magic_start
mwords DCD 0
DCD 0
common STMFD sp!, {v1,v2,fp,lr}
SUB sl, sl, #540
LDMIA sl, {v1,v2}
ADR fp, mwords
LDMIA fp, {fp,lr}
STMIA sl, {fp,lr}
ADD sl, sl, #540
MOV fp, #0
MOV lr, pc
MOV pc, ip
SUB sl, sl, #540
STMIA sl, {v1,v2}
ADD sl, sl, #540
LDMFD sp!, {v1,v2,fp,pc}
common Entry "v1,v2,fp"
SUB sl, sl, #540
LDMIA sl, {v1,v2}
ADR fp, mwords
LDMIA fp, {fp,lr}
STMIA sl, {fp,lr}
ADD sl, sl, #540
MOV fp, #0
MOV lr, pc
MOV pc, ip
SUB sl, sl, #540
STMIA sl, {v1,v2}
ADD sl, sl, #540
EXIT
magic_end
; hal_veneer(code, ws) up to 2 arguments supported
EXPORT hal_veneer2
hal_veneer2
STMFD sp!,{r9,lr}
Entry "r9"
MOV ip, a1
MOV r9, a2
MOV a1, a3
MOV a2, a4
MOV lr, pc
MOV pc, ip
LDMFD sp!,{r9,pc}
EXIT
END
END
......@@ -21,6 +21,7 @@
GET Hdr:Macros
GET Hdr:System
GET Hdr:OSRSI6
GET Hdr:Proc
AREA |C$$data|, DATA
ptr_IRQsema
......@@ -30,7 +31,7 @@ ptr_IRQsema
EXPORT triggercbs
triggercbs
stmfd r13!, {lr}
Entry
LDR r3, =ptr_IRQsema
LDR r1, [sl,#-536] ; Get relocation
ADD r3, r3, r1
......@@ -48,10 +49,10 @@ triggercbs
10
LDR lr, [r2]
MOVS lr, lr
LDMNEFD r13!,{pc} ; NZ is within IRQ.. so no CB allowed
EXIT NE ; NZ is within IRQ.. so no CB allowed
SWI OS_LeaveOS
SWI OS_EnterOS
ldmfd r13!,{pc}
EXIT
LTORG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment