Commit f1d23095 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Add skeleton GPIO device

Changes from Willi Theiss.
Built, but not tested here.

Version 0.16. Tagged as 'OMAP4-0_16'
parent 5052676f
/* (0.15)
/* (0.16)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.15
#define Module_MajorVersion_CMHG 0.16
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Apr 2013
#define Module_Date_CMHG 13 Apr 2013
#define Module_MajorVersion "0.15"
#define Module_Version 15
#define Module_MajorVersion "0.16"
#define Module_Version 16
#define Module_MinorVersion ""
#define Module_Date "10 Apr 2013"
#define Module_Date "13 Apr 2013"
#define Module_ApplicationDate "10-Apr-13"
#define Module_ApplicationDate "13-Apr-13"
#define Module_ComponentName "OMAP4"
#define Module_ComponentPath "castle/RiscOS/Sources/HAL/OMAP4"
#define Module_FullVersion "0.15"
#define Module_HelpVersion "0.15 (10 Apr 2013)"
#define Module_LibraryVersionInfo "0:15"
#define Module_FullVersion "0.16"
#define Module_HelpVersion "0.16 (13 Apr 2013)"
#define Module_LibraryVersionInfo "0:16"
......@@ -23,6 +23,7 @@
GET hdr.board
GET <Lib$Dir>.USB.hdr.usbhal
GET Hdr:SDHCIDevice
GET Hdr:GPIODevice
sb RN 9
......@@ -99,6 +100,7 @@ VideoDevice # Video_DeviceSize
VideoBoardConfig # VideoBoardConfig_Size
AudioWS # Audio_WorkspaceSize
GPIOWS # HALDevice_GPIO_Size
SDIOWS # SDHCISize * MaxSDControllers
......
......@@ -24,7 +24,6 @@
GET Hdr:Proc
GET Hdr:OSEntries
GET Hdr:HALEntries
GET Hdr:GPIODevice
GET hdr.omap4430
GET hdr.StaticWS
......@@ -176,6 +175,7 @@ HALdescriptor DATA
IMPORT GPMC_Init
IMPORT GPIO_Init
IMPORT GPIOx_SetAsOutput
IMPORT GPIO_InitDevice
IMPORT SDIO_InitDevices
IMPORT NVMemory_Init
......@@ -579,34 +579,15 @@ HAL_Init
; Make sure all GPIO IRQs are disabled before we potentially start enabling them
BL GPIO_Init
; nothing to do here for OMAP4
[ {FALSE}
; Do extra board-specific GPIO init
; Touchbook & classic beagle need TPS LED A turning off for EHCI
; Beagle xM needs TPS GPIO 1 off and TPS LED A on for DVI & EHCI
; For the moment, just work out what board it is based around the
; Linux machine ID & OMAP type
LDR a1, [sb, #BoardConfig_MachID]
LDR a2, =MachID_BeagleBoard
CMP a1, a2
LDRNE a2, =MachID_TouchBook
CMPNE a1, a2
BNE %FT20
10
MOV a1, #(GPIO_PIN_MAX + TPS_GPIO_PIN_MAX)
BL GPIOx_SetAsOutput
20
] ; not for OMAP4
[ MoreDebug
DebugTX "Video_init"
] ; MoreDebug
BL Video_init ; Uses GPTIMER5
BL Video_init
[ MoreDebug
DebugTX "USB_Init"
] ; MoreDebug
BL USB_Init ; Uses GPTIMER5
BL USB_Init
[ MoreDebug
DebugTX "NVMemory_Init"
......@@ -761,14 +742,18 @@ Board_InitDevices_Panda
; SD needs boardtype and revision to configure the devices correctly
; for OMAP4 we just differentiate between ES (4460) and non-ES (4430)
LDR a2, L4_Core_Log
ADD a2, a2, #((L4_CONTROL_IDCODE - L4_Core) :AND: &FF00)
LDR a2, [a2, #((L4_CONTROL_IDCODE - L4_Core) :AND: &00FF)]
LDR a1, =(L4_CONTROL_IDCODE - L4_Core)
LDR a2, [a2, a1]
LDR v2, =HAWKEYE_OMAP4460_ES10
MOV a2, a2, LSL #4
CMP v2, a2, LSR #16
UBFX a2, a2, #12, #16
CMP v2, a2
MOV a1, #GPIOType_OMAP4_Panda
MOVNE a2, #GPIORevision_Panda
MOVEQ a2, #GPIORevision_PandaES
Push "a1-a2"
BL GPIO_InitDevice
; SD needs the same parameters to configure the device correctly
Pull "a1-a2"
BL SDIO_InitDevices
DebugTime a1, "Done @ "
EXIT
......@@ -844,14 +829,14 @@ HAL_PhysInfo
TEQ a1, #PhysInfo_GetTableSize
MOVEQ a1, #1:SHL:(32-ByteShift)
STREQ a1, [a2]
MVNEQ a1, #0 ; Supported
MVNEQ a1, #0 ; Supported
MOVEQ pc, lr
TEQ a1, #PhysInfo_HardROM
MOVEQ a1, #0 ; No hard ROM, since the NAND flash isn't yet supported
MOVEQ a1, #0 ; No hard ROM, since the NAND flash isn't yet supported
MOVEQ a2, #0
STMEQIA a3, {a1-a2}
MVNEQ a1, #0 ; Supported
MVNEQ a1, #0 ; Supported
MOVEQ pc, lr
TEQ a1, #PhysInfo_WriteTable
......@@ -860,7 +845,7 @@ HAL_PhysInfo
; Do the PhysInfo_WriteTable table output
Push "v1-v2,lr"
MOV a1, #&80000000 ; Physical RAM from &80000000 and up?
MOV a1, #&80000000 ; Physical RAM from &80000000 and up?
LDR lr, =&FFFFE000-1
STMIA a3, {a1,lr}
MOV v1, a2
......@@ -875,7 +860,7 @@ HAL_PhysInfo
TEQ a1, #0
BNE %BT10
MVN a1, #0 ; Supported
MVN a1, #0 ; Supported
Pull "v1,v2,pc"
; HAL_PhysInfo uses memset to fill the table, so all regions
......@@ -911,7 +896,7 @@ HAL_Reset
MOV a2, #1
STR a2, [a3, #PRM_RSTCTRL]
DebugTX "HAL_Reset failed!"
B . ; Just in case
B . ; Just in case
LTORG
......
......@@ -34,9 +34,10 @@
EXPORT GPIOx_SetAsOutput
EXPORT GPIOx_SetOutput
EXPORT GPIOx_SetAndEnableIRQ
IMPORT IIC_DoOp_Poll
EXPORT GPIO_InitDevice
IMPORT DebugHALPrint
IMPORT DebugHALPrintReg
IMPORT memcpy
GPIO_Init
; Don't bother resetting the controllers for now, just make sure no IRQs are enabled
......@@ -107,4 +108,55 @@ GPIOx_SetAndEnableIRQ
MSR CPSR_c, ip ; interrupts restored
MOV pc, lr
; Init the GPIO HAL device
; a1 = GPIOType value
; a2 = GPIORevision value
GPIO_InitDevice
Push "a1-a2,lr"
ADRL a1, GPIOWS
ADR a2, GPIOTemplate
MOV a3, #HALDeviceSize
BL memcpy
Pull "a1-a2,lr"
ADRL a3, GPIOWS
STR a1, [a3, #HALDevice_GPIOType]
STR a2, [a3, #HALDevice_GPIORevision]
MOV a2, a3
MOV a1, #0
LDR pc, OSentries + 4*OS_AddDevice ; Tail call
; Generic HAL device used for all board types
GPIOTemplate
DCW HALDeviceType_Comms + HALDeviceComms_GPIO
DCW HALDeviceID_GPIO_OMAP4
DCD HALDeviceBus_Interconnect + HALDeviceInterconnectBus_L4
DCD 0 ; API version
DCD GPIODesc ; Description
DCD 0 ; Address (none)
% 12 ; Reserved
DCD GPIOActivate
DCD GPIODeactivate
DCD GPIOReset
DCD GPIOSleep
DCD -1 ; Device (none)
DCD 0 ; TestIRQ
DCD 0 ; ClearIRQ
% 4
ASSERT (.-GPIOTemplate) = HALDeviceSize
GPIODesc
= "OMAP4 GPIO interface", 0
ALIGN
; These don't do much
GPIOActivate
MOV a1, #1
GPIODeactivate
GPIOReset
MOV pc, lr
GPIOSleep
MOV a1, #0
MOV pc, lr
END
......@@ -37,7 +37,6 @@
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:OSEntries
GET Hdr:GPIODevice
GET hdr.omap4430
GET hdr.GPIO
GET hdr.irqs44xx
......
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