Commit 23a21f07 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Sanitise HAL_USBControllerInfo

Detail:
  s/USB - For valid controllers, HAL_USBControllerInfo now always returns the correct USB struct size and fills in the controller type. The rest of the buffer is filled in only if the supplied size is large enough. This allows for proper probing of controllers without knowing the required buffer sizes beforehand.
Admin:
  Builds, but untested at runtime
  (Code identical to OMAP3 HAL anyway)


Version 0.08. Tagged as 'OMAP4-0_08'
parent fe123b46
/* (0.07)
/* (0.08)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.07
#define Module_MajorVersion_CMHG 0.08
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Mar 2012
#define Module_Date_CMHG 07 Jun 2012
#define Module_MajorVersion "0.07"
#define Module_Version 7
#define Module_MajorVersion "0.08"
#define Module_Version 8
#define Module_MinorVersion ""
#define Module_Date "25 Mar 2012"
#define Module_Date "07 Jun 2012"
#define Module_ApplicationDate "25-Mar-12"
#define Module_ApplicationDate "07-Jun-12"
#define Module_ComponentName "OMAP4"
#define Module_ComponentPath "castle/RiscOS/Sources/HAL/OMAP4"
#define Module_FullVersion "0.07"
#define Module_HelpVersion "0.07 (25 Mar 2012)"
#define Module_LibraryVersionInfo "0:7"
#define Module_FullVersion "0.08"
#define Module_HelpVersion "0.08 (07 Jun 2012)"
#define Module_LibraryVersionInfo "0:8"
......@@ -148,11 +148,9 @@ USB_Init
; a1 = interface #
; a2 = usbinfo ptr
; a3 = sizeof(usbinfo)
; Return sizeof(usbinfo) or 0 for fail
; Return sizeof(usbinfo) or 0 for no more devices
; If supplied size isn't large enough, only the controller type will be filled in
HAL_USBControllerInfo
CMP a3, #USBINFO_SIZEOF
MOVNE a1, #0
MOVNE pc, lr
CMP a1, #1
MOVHI a1, #0
MOVHI pc, lr
......@@ -160,25 +158,29 @@ HAL_USBControllerInfo
; Fill in the usbinfo struct
MOV a1, #1 ; EHCI
STR a1, [a2, #USBINFO_TYPE]
MOV a1, #USBINFO_FLAG_32bit_Regs ; EHCI did seem to work OK without forcing 32bit register access, but it is technically needed so I'll leave it set.
STR a1, [a2, #USBINFO_FLAGS]
LDR a1, L4_USB_Host_Log
ADD a1, a1, #EHCI_BASE
STR a1, [a2, #USBINFO_HW]
MOV a1, #EHCI_IRQ
STR a1, [a2, #USBINFO_DEVNO]
CMP a3, #USBINFO_SIZEOF
MOV a1, #USBINFO_SIZEOF
MOVLO pc, lr
MOV a4, #USBINFO_FLAG_32bit_Regs ; EHCI did seem to work OK without forcing 32bit register access, but it is technically needed so I'll leave it set.
STR a4, [a2, #USBINFO_FLAGS]
LDR a4, L4_USB_Host_Log
ADD a4, a4, #EHCI_BASE
STR a4, [a2, #USBINFO_HW]
MOV a4, #EHCI_IRQ
STR a4, [a2, #USBINFO_DEVNO]
MOV pc, lr
10
MOV a1, #2 ; MUSBMHDRC
STR a1, [a2, #USBINFO_TYPE]
MOV a1, #0
STR a1, [a2, #USBINFO_FLAGS]
LDR a1, L4_USB_OTG_Log
STR a1, [a2, #USBINFO_HW]
MOV a1, #MUSB_IRQ
STR a1, [a2, #USBINFO_DEVNO]
CMP a3, #USBINFO_SIZEOF
MOV a1, #USBINFO_SIZEOF
MOVLO pc, lr
MOV a4, #0
STR a4, [a2, #USBINFO_FLAGS]
LDR a4, L4_USB_OTG_Log
STR a4, [a2, #USBINFO_HW]
MOV a4, #MUSB_IRQ
STR a4, [a2, #USBINFO_DEVNO]
MOV pc, lr
......
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