Commit 752d8b83 authored by Ben Avison's avatar Ben Avison
Browse files

Added SD support for Pandaboard

Detail:
  SDHCI HAL device created. Also, Entry HAL_UARTDefault added (supports
  OS_SerialOp) and HALDoesVideo switch, previously disabled, is now removed.
Admin:
  Requires SDIODriver 0.04.
  Changes received from Willi Theiss.

Version 0.10. Tagged as 'OMAP4-0_10'
parent a9f7850d
......@@ -17,7 +17,7 @@
COMPONENT = OMAP-4 HAL
TARGET = OMAP4
OBJS = Top Boot Interrupts Timers CLib CLibAsm Stubs UART Debug PRCM Video USB I2C RTC SDMA TPS Audio GPIO GPMC NVMemory KbdScan #CPUClk
OBJS = Top Boot Interrupts Timers CLib CLibAsm Stubs UART Debug PRCM Video USB I2C RTC SDMA TPS Audio GPIO GPMC NVMemory KbdScan SDIO #CPUClk
USBDIR = <Lib$Dir>.USB
HDRS =
......
/* (0.09)
/* (0.10)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.09
#define Module_MajorVersion_CMHG 0.10
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jun 2012
#define Module_Date_CMHG 04 Jul 2012
#define Module_MajorVersion "0.09"
#define Module_Version 9
#define Module_MajorVersion "0.10"
#define Module_Version 10
#define Module_MinorVersion ""
#define Module_Date "11 Jun 2012"
#define Module_Date "04 Jul 2012"
#define Module_ApplicationDate "11-Jun-12"
#define Module_ApplicationDate "04-Jul-12"
#define Module_ComponentName "OMAP4"
#define Module_ComponentPath "castle/RiscOS/Sources/HAL/OMAP4"
#define Module_FullVersion "0.09"
#define Module_HelpVersion "0.09 (11 Jun 2012)"
#define Module_LibraryVersionInfo "0:9"
#define Module_FullVersion "0.10"
#define Module_HelpVersion "0.10 (04 Jul 2012)"
#define Module_LibraryVersionInfo "0:10"
......@@ -22,11 +22,23 @@
GET hdr.I2C
GET hdr.board
GET <Lib$Dir>.USB.hdr.usbhal
GET Hdr:SDHCIDevice
sb RN 9
; Per-SDHCI workspace
^ 0
SDHCIDevice # HALDevice_SDHCISize ; see Hdr:SDHCIDevice
SDHCISB # 4 ; pointer to HAL workspace for HAL calls
SDHCISlotInfo # HALDeviceSDHCI_SlotInfo_Size ; each of our controllers has just the 1 slot
SDHCISize * :INDEX:@
MaxSDControllers * 2 ; I don't think any platform uses all 3 controllers?
^ 0,sb
BoardConfig # BoardConfig_Size ; NOTE: Almost all code assumes the board config is at the start. You have been warned!
BoardConfig # BoardConfig_Size
; NOTE: Almost all code assumes the board config is at the start. You have been warned!
OSheader # 4
OSentries # 4*(HighestOSEntry+1)
L3_Log # 4 ; L3 base logical address
......@@ -49,16 +61,6 @@ Timer_DelayMul # 4 ; sys_clk/100KHz
HALInitialised # 4 ; Flag for whether HAL_Init is done yet
NVMemoryFound # 4 ; Size of EEPROM detected (may be 0)
L4_Display_Log # 4 ; L4_Display base address
[ HALDoesVideo
video_palette # 4 ; Logical addr of palette regs
cursor_image # 4 ; Logical addr of hardware cursor image
cursor_palette # 4*4 ; 4 palette entries for hardware cursor
cursor_update # 4 ; Cursor update flag (set when palette is changed)
pixel_rate # 4 ; Last pixel rate we programmed DISPC with
video_gobits # 4 ; Which go bits need setting in DISPC_CONTROL
video_maxporch # 4 ; Max H/V F/B porch values supported by OMAP revision
video_maxsync # 4 ; Max H/V sync values supported by OMAP revision
]
L4_sDMA_Log # 4 ; L4_sDMA logical address
IntSRAM_Log # 4 ; SRAM logical address
......@@ -93,19 +95,25 @@ USBHAL_WS # USBHAL_WS_Size ; USB workspace for keyboard scan
SDMAWS # SDMA_WorkspaceSize
[ :LNOT: HALDoesVideo
VideoDevice # Video_DeviceSize
VideoBoardConfig # VideoBoardConfig_Size
]
AudioWS # Audio_WorkspaceSize
SDIOWS # SDHCISize * MaxSDControllers
; align on 16 byte boundary
# (((:INDEX:@)+15):AND::NOT:15)-(:INDEX:@)
USBAllocAreaSize * 16*1024 ; With an ordinary setup, about half of this memory gets used. About 3K goes to some big allocs (looks like the bus structs)
USBAllocAreaSize * 16*1024
; With an ordinary setup, about half of this memory gets used.
; About 3K goes to some big allocs (looks like the bus structs)
USBAllocArea # USBAllocAreaSize
HAL_WsSize * :INDEX:@
] ; __HAL_STATICWS_HDR__
......
......@@ -23,6 +23,8 @@ BoardConfig_DebugUART # 4 ; Physical address of debug UART
BoardConfig_HALUART # 4*4 ; Physical addresses of UARTs, in HAL API order
BoardConfig_HALUARTIRQ # 4 ; 4 bytes of IRQ numbers for HAL UARTs
BoardConfig_DefaultUART # 1 ; Default UART index
# 3 ; Spare
BoardConfig_HALI2C # 4*3 ; Physical addresses of I2Cs, in HAL API order
BoardConfig_HALI2CIRQ # 3 ; 3 bytes of IRQ numbers of HAL I2Cs
......
......@@ -43,11 +43,6 @@ DebugInterrupts SETL Debug :LAND: {TRUE}
GBLL ExtraDebugInterrupts
ExtraDebugInterrupts SETL DebugInterrupts :LAND: {FALSE}
; Does the HAL do video or does RISC OS do it? (via VDU HAL device)
GBLL HALDoesVideo
HALDoesVideo SETL {FALSE}
;HALDoesVideo SETL {TRUE}
; Physical memory map. All unmentioned ranges are reserved.
; 00000000-3FFFFFFF GPMC
......
......@@ -170,16 +170,16 @@ HALdescriptor DATA
IMPORT USB_Init
IMPORT I2C_Init
IMPORT SDMA_Init
[ :LNOT: HALDoesVideo
IMPORT VideoDevice_Init
]
IMPORT Audio_Init
IMPORT GPMC_Init
IMPORT GPIO_Init
IMPORT GPIOx_SetAsOutput
IMPORT SDIO_InitDevices
IMPORT NVMemory_Init
EXPORT Board_InitDevices_None
EXPORT Board_InitDevices_Panda
IMPORT HAL_IRQEnable
IMPORT HAL_IRQDisable
......@@ -256,6 +256,7 @@ HALdescriptor DATA
IMPORT HAL_UARTModemControl
IMPORT HAL_UARTModemStatus
IMPORT HAL_UARTDevice
IMPORT HAL_UARTDefault
IMPORT HAL_DebugRX
IMPORT HAL_DebugTX
......@@ -415,6 +416,10 @@ HAL_EntryTable DATA
HALEntry HAL_ExtMachineID
NullEntry ; HAL_Video_FramestoreAddress
HALEntry HAL_UARTDefault
HAL_Entries * (. - HAL_EntryTable) / 4
......@@ -742,13 +747,30 @@ HAL_InitDevices
; Common HAL devices
BL RTC_Init
BL SDMA_Init
[ :LNOT: HALDoesVideo
BL VideoDevice_Init
]
BL Audio_Init
; Board-specific HAL devices
LDR pc, [sb, #BoardConfig_InitDevices]
Board_InitDevices_None
EXIT
GPIOType_OMAP4_Panda * 0
GPIORevision_Panda * 0
GPIORevision_PandaES * 1
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 v2, =HAWKEYE_OMAP4460_ES10
MOV a2, a2, LSL #4
CMP v2, a2, LSR #16
MOV a1, #GPIOType_OMAP4_Panda
MOVNE a2, #GPIORevision_Panda
MOVEQ a2, #GPIORevision_PandaES
BL SDIO_InitDevices
DebugTime a1, "Done @ "
EXIT
......
......@@ -205,14 +205,6 @@ HAL_IRQClear
DebugReg a1, "HAL_IRQClear: "
Pull "lr"
10
]
[ HALDoesVideo
CMP a1, #VIDEO_IRQ
LDREQ a2, L4_Display_Log
ADDEQ a2, a2, #DISPC_BASE
MVNEQ a3, #0 ; Clear all DSS IRQs, just in case
STREQ a3, [a2, #(DISPC_IRQSTATUS - DISPC_BASE)]
BEQ %FT10
]
SUB a2, a1, #TIMER_IRQ_BASE
CMP a2, #TIMER_MAX
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
EXPORT HAL_UARTModemControl
EXPORT HAL_UARTModemStatus
EXPORT HAL_UARTDevice
EXPORT HAL_UARTDefault
GET Hdr:ListOpts
GET Hdr:Macros
......@@ -301,7 +302,7 @@ HAL_UARTFIFOEnable
CMP a2, a3
BEQ %FT10
STRB a3, [v1, #:INDEX:UARTFCRSoftCopy]
STRB a2, [v1, #:INDEX:UARTFCRSoftCopy]
; Must disable the baud clock to flush the FIFO
MOV lr, #UART_MDR1_MODE_SELECT_DISABLE
......@@ -466,4 +467,12 @@ HAL_UARTDevice
LDRB a1, [a1, #BoardConfig_HALUARTIRQ]
MOV pc, lr
; int Default(void)
;
; Return the default UART for the OS to use, or -1 for none
;
HAL_UARTDefault
LDRB a1, [sb, #BoardConfig_DefaultUART]
MOV pc, lr
END
......@@ -51,11 +51,13 @@ string2 SETS " DCBArray " :CC: ("$string" :RIGHT: ((:LEN: "$string")-1)) :CC:
; Big ugly macro for defining a board config
; Note - $mixers is the set of enabled mixers (not including the system)
MACRO
BOARDCFG $name, $debuguart, $haluarts, $hali2cs, $numi2c, $videoi2c, $apll_ctl, $videogpio, $usbgpio, $machid, $mixers, $vbcflags, $vbclcdnum, $vbclcdptr, $haldevices
BOARDCFG $name, $debuguart, $haluarts, $defaultuart, $hali2cs, $numi2c, $videoi2c, $apll_ctl, $videogpio, $usbgpio, $machid, $mixers, $vbcflags, $vbclcdnum, $vbclcdptr, $haldevices
01
DCD $debuguart
DCDArray "$haluarts", 4, L4_UART
DCBArray "$haluarts", 4, UART, _IRQ
DCB $defaultuart-1
% 3
ASSERT (:LEN: "$hali2cs") >= $numi2c
ASSERT ((:LEN: "$hali2cs") >= $videoi2c) :LOR: ($videoi2c = 255)
DCDArray "$hali2cs", 3, L4_I2C
......@@ -124,9 +126,9 @@ VBC_C * VideoBoardConfig_Flags_Composite
; And now the table of board configs
BoardConfigTable
; Name DebugUART UARTs I2Cs NumI2C VideoI2C APLL_CTL VideoGPIO USBGPIO MachID MixerChans VBC_Flags VBC_LCDNum VBC_LCDPtr InitDevices
BOARDCFG "PandaBoard", L4_UART3, "123", "123", 3, 2, &16, 0, 1, MachID_PandaBoard, M_HSO+M_AI, VBC_C, 1, VBC_DVI, None
BOARDCFG "SDP4430", L4_UART3, "123", "123", 3, 2, &16, 170, 24, MachID_OMAP4430SDP, M_HSO+M_AI, 0, 1, VBC_DVI, None
; Name DebugUART UARTs DefaultUART I2Cs NumI2C VideoI2C APLL_CTL VideoGPIO USBGPIO MachID MixerChans VBC_Flags VBC_LCDNum VBC_LCDPtr InitDevices
BOARDCFG "PandaBoard", L4_UART3, "123", 3, "123", 3, 2, &16, 0, 1, MachID_PandaBoard, M_HSO+M_AI, VBC_C, 1, VBC_DVI, Panda
BOARDCFG "SDP4430", L4_UART3, "123", 3, "123", 3, 2, &16, 170, 24, MachID_OMAP4430SDP, M_HSO+M_AI, 0, 1, VBC_DVI, None
BoardConfigTable_End
; DSI_BPP DSI_LANES ACBias_freq LCDType Flags LCDTimings Max_PixelRate
......
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