Commit 5a8b82be authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Implement HAL_PhysInfo. Other misc tweaks.

Detail:
  s/Top - Added HAL_PhysInfo implementation. Tweaked HAL_Reset to reduce chances of failure.
  s/Stubs - Removed obsolete, unused UART stubs. Use KbdFlag_Done instead of magic number.
Admin:
  Tested on Raspberry Pi


Version 0.23. Tagged as 'BCM2835-0_23'
parent 59e36802
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.22"
Module_Version SETA 22
Module_MajorVersion SETS "0.23"
Module_Version SETA 23
Module_MinorVersion SETS ""
Module_Date SETS "08 Sep 2012"
Module_ApplicationDate SETS "08-Sep-12"
Module_Date SETS "09 Sep 2012"
Module_ApplicationDate SETS "09-Sep-12"
Module_ComponentName SETS "BCM2835"
Module_ComponentPath SETS "mixed/RiscOS/Sources/HAL/BCM2835"
Module_FullVersion SETS "0.22"
Module_HelpVersion SETS "0.22 (08 Sep 2012)"
Module_FullVersion SETS "0.23"
Module_HelpVersion SETS "0.23 (09 Sep 2012)"
END
/* (0.22)
/* (0.23)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.22
#define Module_MajorVersion_CMHG 0.23
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 08 Sep 2012
#define Module_Date_CMHG 09 Sep 2012
#define Module_MajorVersion "0.22"
#define Module_Version 22
#define Module_MajorVersion "0.23"
#define Module_Version 23
#define Module_MinorVersion ""
#define Module_Date "08 Sep 2012"
#define Module_Date "09 Sep 2012"
#define Module_ApplicationDate "08-Sep-12"
#define Module_ApplicationDate "09-Sep-12"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.22"
#define Module_HelpVersion "0.22 (08 Sep 2012)"
#define Module_LibraryVersionInfo "0:22"
#define Module_FullVersion "0.23"
#define Module_HelpVersion "0.23 (09 Sep 2012)"
#define Module_LibraryVersionInfo "0:23"
......@@ -33,6 +33,7 @@
AREA |ARM$$code|, CODE, READONLY, PIC
GET Hdr:ListOpts
GET Hdr:HALEntries
GET hdr.BCM2835
GET hdr.StaticWS
......@@ -50,32 +51,6 @@
; Might want to make this do something again?
MEND
HAL_UARTPorts
HALStub "HAL_UARTPorts"
MOV a1,#0
MOV pc,lr
HAL_UARTStartUp
HAL_UARTShutdown
HAL_UARTFeatures
HAL_UARTReceiveByte
HAL_UARTTransmitByte
HAL_UARTLineStatus
HAL_UARTInterruptEnable
HAL_UARTRate
HAL_UARTFormat
HAL_UARTFIFOSize
HAL_UARTFIFOClear
HAL_UARTFIFOEnable
HAL_UARTFIFOThreshold
HAL_UARTInterruptID
HAL_UARTBreak
HAL_UARTModemControl
HAL_UARTModemStatus
HAL_UARTDevice
HALStub "HAL_UART<>"
MOV pc,lr
HAL_ATAControllerInfo
HALStub "HAL_ATAControllerInfo"
......@@ -87,7 +62,7 @@ HAL_KbdScanSetup
HAL_KbdScan
HALStub "HAL_KbdScan"
MOV a1,#&80000000 ; signal keyboard scan complete
MOV a1,#KbdFlag_Done ; signal keyboard scan complete
MOV pc,lr
HAL_KbdScanFinish
......
......@@ -264,6 +264,8 @@ start MSR CPSR_c,#F32_bit+I32_bit+SVC32_mode
LDR lr, [lr]
ADD a3, a3, lr
LDMIA a3, {v3, v4} ; v3=base, v4=size
STR v3, ARM_Base
STR v4, ARM_Size
[ HALDebug
ADRL a1, reset
BL HAL_DebugHexTX4
......@@ -577,9 +579,13 @@ HAL_Init
ADRL sb, workspace ; where we remembered it is
LDR a3, VC_Size ; VC Start
LDR a2, VC_Base ; VC_Size
LDR a1, ARM_Base
LDR ip, ARM_Size
mov sb, a4
STR a3, VC_Size ; VC Start
STR a2, VC_Base ; VC_Size
STR a1, ARM_Base
STR ip, ARM_Size
ADRL sb, workspace ; where we remembered it is
LDR a3, Board_Model
LDR a2, Board_Revision
......@@ -704,8 +710,12 @@ HAL_ExtMachineID
MOV pc, lr
HAL_Reset
MRS a1, CPSR
ORR a1, a1, #I32_bit+F32_bit ; paranoia, don't allow reset to be interrupted
MSR CPSR_c, a1
LDR a1, PeriBase
ADD a1, a1, #PM_Base
DoMemBarrier a3
LDR a2, [a1, #PM_Rstc]
MOV a3, #PM_Password
BIC a2, a2, #PM_Rst_WCfgSet
......@@ -714,11 +724,66 @@ HAL_Reset
ADD a3, a3, #10
STR a3, [a1, #PM_Wdog]
STR a2, [a1, #PM_Rstc]
MOV pc, lr
B .
HAL_PhysInfo ROUT
TEQ a1, #PhysInfo_GetTableSize
MOVEQ a1, #524288 ; Two pages in each byte, so (2^32)/(4096*2)
STREQ a1, [a2]
MVNEQ a1, #0
MOVEQ pc, lr
TEQ a1, #PhysInfo_HardROM
MOVEQ a1, #0 ; No hard ROM
MOVEQ a2, #0
STMEQIA a3, {a1-a2}
MVNEQ a1, #0
MOVEQ pc, lr
TEQ a1, #PhysInfo_WriteTable
MOVNE a1, #0
MOVNE pc, lr
Push "v1-v5,lr"
LDR v1, ARM_Base
LDR v2, ARM_Size
ADD v2, v1, v2
STMIA a3, {v1-v2} ; All RAM the OS knows about will be here
; Majority of table is unused, so prefill it
LDR v3, =&88888888 ; Unused regions (or RAM)
MOV a1, v3
MOV a3, v3
MOV a4, v3
ADD v4, a2, #524288
10
STMIA a2!, {a1,a3,a4,v3}
CMP a2, v4
BLO %BT10
; Fill in IO region
SUB a2, a2, #524288-(IO_Base>>13)
ORR a1, a1, a1, LSR #1 ; Pattern for IO regions
ORR a3, a3, a3, LSR #1
ORR a4, a4, a4, LSR #1
ORR v3, v3, v3, LSR #1
ADD v5, a2, #IO_Size>>13
20
STMIA a2!, {a1,a3,a4,v3}
CMP a2, v5
BLO %BT20
; VC memory is effectively IO, so fill it in as such
SUB a2, v4, #524288
LDR v1, VC_Base
LDR v2, VC_Size
ADD a2, a2, v1, LSR #13
ADD v5, a2, v2, LSR #13
30
STMIA a2!, {a1,a3,a4,v3}
CMP a2, v5
BLO %BT30
MVN a1, #0
Pull "v1-v5,pc"
HAL_PhysInfo
HAL_Null
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