Commit 9192c127 authored by Robert Sprowson's avatar Robert Sprowson

Groundwork

IIC.s/Stubs.s:
Don't import workspace when it's not used
Top.s:
Move the dead loops to just after the vectors. In practice these are ineffectual because the firmware (now) loads the image at &8000 to please Linux, so we're mostly wasting our time producing ROM images with vectors at the start.
Pad image to &8000 so it can be loaded at 0 (using Kernel_Old=1 in config.txt) or &8000 (default).
Line up/capitalise a few stray mnemonics, use APCS register naming.
Call HAL_DebugTXStrInline for "HAL Init completed" rather than an inline loop, since earlier in the same function we called HAL_DebugTXStrInline happily.

Version 0.60. Tagged as 'BCM2835-0_60'
parent b5d4e1d0
/* (0.59)
/* (0.60)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.59
#define Module_MajorVersion_CMHG 0.60
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Oct 2016
#define Module_Date_CMHG 15 Oct 2016
#define Module_MajorVersion "0.59"
#define Module_Version 59
#define Module_MajorVersion "0.60"
#define Module_Version 60
#define Module_MinorVersion ""
#define Module_Date "09 Oct 2016"
#define Module_Date "15 Oct 2016"
#define Module_ApplicationDate "09-Oct-16"
#define Module_ApplicationDate "15-Oct-16"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.59"
#define Module_HelpVersion "0.59 (09 Oct 2016)"
#define Module_LibraryVersionInfo "0:59"
#define Module_FullVersion "0.60"
#define Module_HelpVersion "0.60 (15 Oct 2016)"
#define Module_LibraryVersionInfo "0:60"
......@@ -34,8 +34,6 @@
GET hdr.BCM2835
GET hdr.StaticWS
IMPORT workspace
EXPORT IIC_Init
EXPORT HAL_IICBuses
EXPORT HAL_IICType
......
......@@ -37,8 +37,6 @@
GET hdr.BCM2835
GET hdr.StaticWS
IMPORT workspace
EXPORT HAL_KbdScanSetup
EXPORT HAL_KbdScan
EXPORT HAL_KbdScanFinish
......@@ -66,5 +64,5 @@ HAL_KbdScanInterrupt
HALStub "HAL_KbdScanInterrupt"
MOV pc,lr
END
END
......@@ -152,7 +152,6 @@
IMPORT SerNo
HAL_Base
[ HALDebug
EXPORT HAL_DebugHexTX4
EXPORT HAL_DebugTXStrInline
......@@ -163,6 +162,8 @@ HAL_Base
ENTRY
HAL_Base
reset B start
undef B undefined_instr
swi B swi_instr
......@@ -171,6 +172,21 @@ dabort B data_abort
irq B interrupt
fiq B fast_interrupt
; exception handlers just for use during HAL init,
; in case something goes wrong
undefined_instr
B .
swi_instr
B .
prefetch_abort
B .
data_abort
B .
interrupt
B .
fast_interrupt
B .
ALIGN 256
atags ; list of 'atags' structures constructed here by the loader code
......@@ -184,28 +200,8 @@ end_stack
workspace
% sizeof_workspace
LTORG
; exception handlers just for use during HAL init,
; in case something goes wrong
interrupt
B .
fast_interrupt
B .
swi_instr
B .
prefetch_abort
B .
data_abort
B .
undefined_instr
B .
ALIGN 32768
ASSERT . - HAL_Base = 32768
start
MRC p15, 0, lr, c0, c0, 0 ; read Main ID Register
......@@ -218,7 +214,7 @@ start
MRC p15, 0, lr, c0, c0, 5 ; read MPIDR
TST lr, #&FF
01 WFINE
BNE %BT01
BNE %BT01
; Some versions of the firmware call us in HYP mode, which requires
; a secret handshake to drop into SVC mode
......@@ -268,7 +264,7 @@ start
LDR r0,=(16:SHL:MB_Pwr_USB)+MB_Chan_Pwr
BL HAL_SendHostMessage
; query the platform and set up a frame buffer.
; Query the platform and set up a frame buffer.
BL HAL_QueryPlatform
[ HALDebug
......@@ -412,16 +408,16 @@ clear_lp1
STMDB a1!,{a2-a4,v1,v4,v5,v7,lr}
CMP a1, v3
BHI clear_lp1
mov a2, v3
MOV a2, v3
MOV a3, ip
[ HALDebug
bl HAL_DebugTXStrInline
BL HAL_DebugTXStrInline
DCB "HalStartup3 .. rst rend",10,0
ALIGN
mov a1,a2
bl HAL_DebugHexTX4
mov a1,a3
bl HAL_DebugHexTX4
MOV a1, a2
BL HAL_DebugHexTX4
MOV a1, a3
BL HAL_DebugHexTX4
]
MVN a4, #0
MOV a1, #0
......@@ -650,9 +646,9 @@ HAL_Entries * (.-HAL_EntryTable)/4
;--------------------------------------------------------------------------------------
HAL_Init
STMFD R13!,{R8,R14}
Push "v5, lr"
MOV R8,a2
MOV v5, a2
BL SetUpOSEntries
MOV a1, #0 ; map in the IO space
......@@ -671,11 +667,9 @@ HAL_Init
[ HALDebug
bl HAL_DebugTXStrInline
DCB "HalStart from OS",10,0
ALIGN
]
]
ALIGN
MOV a4, sb ; confirm the caching mode in use in GPU
ADRL sb, workspace ; where we remembered it is
......@@ -707,18 +701,19 @@ HAL_Init
LDR a2, VC_Base
LDR a3, VC_Size
[ HALDebug
mov r0,a2
bl HAL_DebugHexTX4
mov r0,a3
bl HAL_DebugHexTX4
]
[ HALDebug
MOV a1, a2
BL HAL_DebugHexTX4
MOV a1, a3
BL HAL_DebugHexTX4
]
; Get the physical address of NCNB workspace
; R8 -> start of NCNB workspace
STR R8, NCNBAddr
; v5 -> start of NCNB workspace
STR v5, NCNBAddr
MOV a1,R8
MOV a1, v5
CallOS OS_LogToPhys
LDR a3, FB_CacheMode
ORR a1, a1, a3
......@@ -740,31 +735,12 @@ HAL_Init
BL IIC_Init
[ HALDebug
STR v1,[sp,#-4]!
ADRL v1,hal_init
txloop
txbusylp
MOV a1,#0
BL HAL_UARTLineStatus
TST a1,#&20
BEQ txbusylp
MOV a1,#0
LDRB a2,[v1],#1
BL HAL_UARTTransmitByte
LDRB a1,[v1]
TEQ a1,#0
BNE txloop
LDR v1,[sp],#4
LDMFD R13!,{R8,PC}
uart_started = " UART started",13,10,0
hal_init = " HAL Init completed",13,10,0
BL HAL_DebugTXStrInline
DCB "HAL Init completed",10,0
ALIGN
|
LDMFD R13!,{R8,PC}
]
Pull "v5, pc"
; Initialise and relocate the entry table.
SetUpOSEntries ROUT
......
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