Commit d56f8a14 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Strip out video code & on-screen debug

Detail:
  Makefile, s/Display - Deleted on-screen debug code
  hdr/BCM2835, hdr/StaticWS, s/IIC, s/Messaging, s/Stubs, s/Top, s/UART - Strip out calls to on-screen debug code, and a few bits of video code
  s/Video - Video code removed and replaced with stub functions similar to other HALs. Only remaining useful code is HAL_Video_StartupMode, which in time should probably be moved to BCMVideo as well.
Admin:
  Tested on Raspberry Pi with high processor vectors


Version 0.21. Tagged as 'BCM2835-0_21'
parent ade8e2c2
......@@ -17,7 +17,7 @@
COMPONENT = BCM2835 HAL
TARGET = BCM2835
OBJS = Top CLib CMOS Debug Display Interrupts SDIO Stubs Timers UART USB Video DMA Messaging GPIO VCHIQ IIC
OBJS = Top CLib CMOS Debug Interrupts SDIO Stubs Timers UART USB Video DMA Messaging GPIO VCHIQ IIC
HDRS =
CMHGFILE =
......
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.20"
Module_Version SETA 20
Module_MajorVersion SETS "0.21"
Module_Version SETA 21
Module_MinorVersion SETS ""
Module_Date SETS "29 Aug 2012"
Module_ApplicationDate SETS "29-Aug-12"
Module_Date SETS "02 Sep 2012"
Module_ApplicationDate SETS "02-Sep-12"
Module_ComponentName SETS "BCM2835"
Module_ComponentPath SETS "mixed/RiscOS/Sources/HAL/BCM2835"
Module_FullVersion SETS "0.20"
Module_HelpVersion SETS "0.20 (29 Aug 2012)"
Module_FullVersion SETS "0.21"
Module_HelpVersion SETS "0.21 (02 Sep 2012)"
END
/* (0.20)
/* (0.21)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.20
#define Module_MajorVersion_CMHG 0.21
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 29 Aug 2012
#define Module_Date_CMHG 02 Sep 2012
#define Module_MajorVersion "0.20"
#define Module_Version 20
#define Module_MajorVersion "0.21"
#define Module_Version 21
#define Module_MinorVersion ""
#define Module_Date "29 Aug 2012"
#define Module_Date "02 Sep 2012"
#define Module_ApplicationDate "29-Aug-12"
#define Module_ApplicationDate "02-Sep-12"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.20"
#define Module_HelpVersion "0.20 (29 Aug 2012)"
#define Module_LibraryVersionInfo "0:20"
#define Module_FullVersion "0.21"
#define Module_HelpVersion "0.21 (02 Sep 2012)"
#define Module_LibraryVersionInfo "0:21"
......@@ -37,14 +37,6 @@
GBLL HALDebug
HALDebug SETL {TRUE}
GBLL ExtFramestore
ExtFramestore SETL {TRUE}
GBLL SCR32
SCR32 SETL {TRUE}
; Debugging in the serial port (HAL_DebugTX, HAL_DebugRX)
GBLL Debug
Debug SETL {TRUE}
......
......@@ -96,54 +96,17 @@ FB_Size # 4
FB_CacheMode # 4
; info interrogated from the VC side
VC_Memory # 4
ARM_Memory # 4
ARM_Base # 4
ARM_Size # 4
VC_Base # 4
VC_Size # 4
VC_Logical # 4
; align to 16 byte boundary NB this isnt aligned once hal initialised
# (((:INDEX:@)+15):AND::NOT:15)-(:INDEX:@)
! 0,"tagbuffer at ":CC::STR:(&fc001000+:INDEX:@),0
tagbuffer # 256 ;; for now ; platform query buffer
; align to 16 byte boundary NB this isnt aligned once hal initialised
# (((:INDEX:@)+15):AND::NOT:15)-(:INDEX:@)
mbram # 0 ; structure needed for frame buffer descriptor
mbxres # 4
mbyres # 4
mbxvres # 4
mbyvres # 4
mbpitch # 4
mbbpp # 4
mbxoff # 4
mbyoff # 4
mbbase # 4
mbscrsz # 4
ScreenBase # 4
FTextPixel # 4
BTextPixel # 4
FTextPixRepl # 4
BTextPixRepl # 4
BitsPerPixel # 4
InvertFont # 4
InvertPixel # 4
Columns # 4
Rows # 4
OutputX # 4
OutputY # 4
BytesPerRow # 4
BytesPerChar # 4
LastInt # 4
KM_State # 4
KM_Num # 4
KM_NumY # 4
PixelTable # 256*4
CurAddr # 4
CurHeight # 4
CurPalette # 4*4
vrmsize * :INDEX: @ - :INDEX:mbram
NCNBAddr # 4 ;NCNB workspace
NCNBPhysAddr # 4 ;VC physical address of NCNB workspace
......@@ -167,9 +130,6 @@ DMAChannelList # DMA_CH_Count*4 ; List of channel devices for Enumerate
DMAController # HALDevice_DMAC_Size_0_1 ; see Hdr:HALDevice
DMAChannels # DMAC_DeviceSize*DMA_CH_Count ; List of channel devices (indexed by physical channel #)
CurUnder # 32*4*32
CurShape # 32/4*32
VCHIQDevice # HALDevice_VCHIQ_Size
HAL_WsSize * :INDEX:@
......
This diff is collapsed.
......@@ -35,13 +35,6 @@
IMPORT workspace
[ HALDebug
IMPORT output_hex8
IMPORT output_newline
IMPORT output_text
IMPORT output_text_at
]
EXPORT IIC_Init
EXPORT HAL_IICBuses
EXPORT HAL_IICType
......@@ -49,22 +42,6 @@
EXPORT HAL_IICTransfer
EXPORT HAL_IICMonitorTransfer
MACRO
HALStub $str
[ HALDebug
STMFD sp!,{a1,lr}
ADR a1,%FT01
ADR lr,%FT02
B output_text
01 = "$str called from "
ALIGN
02 LDR a1,[sp,#4]
BL output_hex8
BL output_newline
LDMFD sp!,{a1,lr}
]
MEND
MACRO
$label BaseAddr $r ; Form a pointer to the device's
LDR $r, PeriBase ; base address in register $r
......@@ -132,8 +109,7 @@ HAL_IICType
MOV pc,lr
HAL_IICDevice
HALStub "HAL_IICDevice"
LDMFD sp!, {v1, pc}
MOV pc,lr
; Get the total length of transfers linked with nostart set
; Enter with
......
......@@ -37,14 +37,10 @@
IMPORT workspace
[ HALDebug
IMPORT output_hex8
IMPORT output_newline
IMPORT output_text
IMPORT output_text_at
IMPORT HAL_DebugTX
IMPORT HAL_DebugHexTX4
IMPORT HAL_DebugTXStrInline
]
EXPORT HAL_SendHostMessage
EXPORT HAL_QueryPlatform
EXPORT MacAdd
......@@ -118,45 +114,14 @@ lp1 ldr r3, [r0], #4 ; copy to workspace buffer
BL HAL_SendHostMessage ; ask the questions
ADRL r5, tagbuffer ; now read the answers
ADD r0,r5,#VCbs-tagb ; VC address and size
LDMIA r0, {r1, r2}
STR r1, VC_Base
STR r2, VC_Size
ADD r0,r5,#Dispbs-tagb ; frame buffer address and size
LDMIA r0, {r1, r2}
STR r1, FB_Base
STR r1, mbbase
STR r2, FB_Size
STR r2, mbscrsz
[ HALDebug
mov a1,a2
bl HAL_DebugHexTX4
mov a1,a3
bl HAL_DebugHexTX4
]
add r0,r5,#phyx-tagb ; physical screen dimensions
LDMIA r0, {r1, r2}
STR r1, mbxres
STR r2, mbyres
[ HALDebug
mov a1,a2
bl HAL_DebugHexTX4
mov a1,a3
bl HAL_DebugHexTX4
]
add r0,r5,#virtx-tagb ; virtual screen dimensions
LDMIA r0, {r1, r2}
STR r1, mbxvres
STR r2, mbyvres
[ HALDebug
mov a1,a2
bl HAL_DebugHexTX4
mov a1,a3
bl HAL_DebugHexTX4
]
add r0,r5,#vxoff-tagb ; virtual screen offset
LDMIA r0, {r1, r2}
STR r1, mbxoff
STR r2, mbyoff
[ HALDebug
mov a1,a2
bl HAL_DebugHexTX4
......@@ -164,20 +129,6 @@ lp1 ldr r3, [r0], #4 ; copy to workspace buffer
bl HAL_DebugHexTX4
]
add r0,r5,#dispbpp-tagb ; bits per pixel
LDR r0, [r0]
STR r0, mbbpp
[ HALDebug
bl HAL_DebugHexTX4
]
add r0,r5,#dispit-tagb ; display pitch
LDR r0, [r0]
STR r0, mbpitch
[ HALDebug
bl HAL_DebugHexTX4
]
; copy out and construct machine ID from MAC address
ADRL r0, tagbuffer
ADD r0, r0,#:INDEX:MAClo-:INDEX:tagb
......@@ -237,10 +188,10 @@ gbit ;
]
LDMFD R13!, {r0-r5, pc}
MacAdd DCD :INDEX:MAClo - :INDEX:tagb + :INDEX:tagbuffer
RamAd DCD :INDEX:ARMbs - :INDEX:tagb + :INDEX:tagbuffer
SerNo DCD :INDEX:SNlo - :INDEX:tagb + :INDEX:tagbuffer
Displ DCD :INDEX:Dispbs - :INDEX:tagb + :INDEX:tagbuffer
MacAdd DCD :INDEX:MAClo - :INDEX:tagb + :INDEX:tagbuffer
RamAd DCD :INDEX:ARMbs - :INDEX:tagb + :INDEX:tagbuffer
SerNo DCD :INDEX:SNlo - :INDEX:tagb + :INDEX:tagbuffer
Displ DCD :INDEX:Dispbs - :INDEX:tagb + :INDEX:tagbuffer
; series of VC side query tags. Using inline code as this is writable at this
......
......@@ -38,14 +38,6 @@
IMPORT workspace
[ HALDebug
IMPORT output_hex8
IMPORT output_newline
IMPORT output_text
IMPORT output_text_at
]
EXPORT HAL_ATAControllerInfo
EXPORT HAL_KbdScanSetup
......@@ -55,18 +47,7 @@
MACRO
HALStub $str
[ HALDebug
STMFD sp!,{a1,lr}
ADR a1,%FT01
ADR lr,%FT02
B output_text
01 = "$str called from "
ALIGN
02 LDR a1,[sp,#4]
BL output_hex8
BL output_newline
LDMFD sp!,{a1,lr}
]
; Might want to make this do something again?
MEND
HAL_UARTPorts
......
......@@ -141,6 +141,7 @@
IMPORT HAL_USBPortIRQ
IMPORT HAL_Video_FramestoreAddress
IMPORT HAL_Video_StartupMode
IMPORT SDIO_InitDevices
......@@ -161,14 +162,6 @@
HAL_Base
[ HALDebug
IMPORT clear_block
IMPORT set_text_colours
IMPORT output_char
IMPORT output_hex8
IMPORT output_newline
IMPORT output_regs
IMPORT output_text
IMPORT output_text_at
EXPORT HAL_DebugHexTX4
EXPORT HAL_DebugTXStrInline
]
......@@ -205,92 +198,22 @@ workspace
; in case something goes wrong
interrupt
ADRL sb,workspace
ADRL R13,end_stack
[ HALDebug
ADR R0,irq_text
MOV R1,#0
MOV R2,#0
ADR R14,interrupt
B output_text_at
|
B interrupt
]
B .
fast_interrupt
ADRL sb,workspace
ADRL R13,end_stack
[ HALDebug
ADR R0,fiq_text
MOV R1,#0
MOV R2,#0
ADR R14,fast_interrupt
B output_text_at
|
B fast_interrupt
]
B .
swi_instr
ADRL sb,workspace
ADRL R13,end_stack
[ HALDebug
ADR R0,swi_text
MOV R1,#0
MOV R2,#0
ADR R14,swi_instr
B output_text_at
|
B swi_instr
]
B .
prefetch_abort
ADRL sb,workspace
ADRL R13,end_stack
[ HALDebug
ADR R0,pabt_text
MOV R1,#0
MOV R2,#0
ADR R14,prefetch_abort
B output_text_at
|
B prefetch_abort
]
B .
data_abort
ADRL sb,workspace
ADRL R13,end_stack
[ HALDebug
ADR R0,dabt_text
MOV R1,#0
MOV R2,#0
ADR R14,data_abort
B output_text_at
|
B data_abort
]
B .
undefined_instr
ADRL sb,workspace
ADRL R13,end_stack
[ HALDebug
ADR R0,und_text
MOV R1,#0
MOV R2,#5
ADR R14,undefined_instr
B output_text_at
|
B undefined_instr
]
[ HALDebug
fiq_text = "FIQ",0
irq_text = "IRQ",0
swi_text = "SWI",0
pabt_text = "Prefetch Abort",0
dabt_text = "Data Abort",0
und_text = "Undefined Instruction",0
ALIGN
]
B .
start MSR CPSR_c,#F32_bit+I32_bit+SVC32_mode
......@@ -326,76 +249,16 @@ start MSR CPSR_c,#F32_bit+I32_bit+SVC32_mode
; query the platform and set up a frame buffer.
BL HAL_QueryPlatform
; ADR R0, mbram
; ORR R2, R0, #GPU_L2CnonAl + MB_Chan_FB; L2 cache on
; MOV R0, R2
; MOV r1, #0
;; BL HAL_SendHostMessage
;
; ldr r3, mbscrsz
; str r3, FB_Size
; mov r0,r3
; bl HAL_DebugHexTX4
; ldr r3, mbbase
; bic r3, r3, #GPU_CacheMask
; str r3, FB_Base
LDR r3, FB_Base
mov r0,r3
bl HAL_DebugHexTX4
[ HALDebug
STR R3,ScreenBase ; for HAL use, remember address we were given
LDR r0,mbbpp
STR R0,BytesPerChar
LDR r3,mbxres
MUL r3, r0, r3
STR R0,BytesPerRow
1002 MOV R0, R3, LSR #3
STR R0,Columns
LDR R0, mbyres
MOV R0, r0, lsr #3
STR R0,Rows
MOV R0,#0
STR R0,InvertFont
STR R0,OutputX
STR R0,OutputY
LDR r8, mbbpp
CMP r8, #16
MOVGT R0,#&FF000000
MOVGT R1,#&FF000000
MVNLE R0,#0
MOVLE R1,#0
STR R8,BitsPerPixel
BL set_text_colours
MOV R0,#0
MOV R1,#0
LDR R2,Columns
LDR R3,Rows
BL clear_block
LDR r8, mbbpp
CMP r8, #16
MVNGT R0,#0
MOVGT R1,#&FF000000
MOV R8,#32
MOVLE R0,#&1F<<10
MOVLE R1,#0
BL set_text_colours
MOV R0,#0
MOV R1,#0
ADR R2,sign_on
BL output_text_at
[ HALDebug
bl HAL_DebugTXStrInline
DCB "HalStartup2",10,0
ALIGN
]
]
ROMTOP * 6 <<20
ADRL a3, workspace
ADRL lr,RamAd
......@@ -459,13 +322,6 @@ clear_lp
STR a1,[sp] ;ref for next call
[ HALDebug
ADR R0,start_os
BL output_text
]
; OS kernel informed of RAM areas
LDR a4,[sp],#4 ;!!! ref from last AddRAM
......@@ -636,6 +492,10 @@ HAL_EntryTable DATA
HALEntry HAL_Video_FramestoreAddress
NullEntry ; HALEntry HAL_UARTDefault
HALEntry HAL_Video_StartupMode
HAL_Entries * (.-HAL_EntryTable)/4
;--------------------------------------------------------------------------------------
......@@ -648,6 +508,21 @@ HAL_Init
MOV R8,a2
BL SetUpOSEntries
MOV a1, #0 ; map in the IO space
LDR a2, =IO_Base
LDR a3, =IO_Size
CallOS OS_MapInIO
STR a1, PeriBase
MOV a1,#0 ; start the uart ..we use it for debug
BL HAL_UARTStartUp ; restart to capture logical io address
bl HAL_DebugTXStrInline
DCB "HalStart from OS",10,0
ALIGN
MOV a4, sb ; confirm the caching mode in use in GPU
ADRL sb, workspace ; where we remembered it is
LDR a3, FB_Size
......@@ -658,13 +533,26 @@ HAL_Init
STR a2, FB_Base ; for HAL_FramestoreAddress use
STR a1, FB_CacheMode
ADRL sb, workspace ; where we remembered it is
LDR a1, mbxres
LDR a2, mbyres
LDR a3, mbbpp
LDR a3, VC_Size ; VC Start
LDR a2, VC_Base ; VC_Size
mov sb, a4
STR a1, mbxres
STR a2, mbyres
STR a3, mbbpp
STR a3, VC_Size ; VC Start
STR a2, VC_Base ; VC_Size
MOV a1, #0 ; map in the whole of the VC memory as
; IO to avoid subsequent logical
; address space fragmentation
LDR a2, VC_Base
LDR a3, VC_Size
mov r0,a2
bl HAL_DebugHexTX4
mov r0,a3
bl HAL_DebugHexTX4
CallOS OS_MapInIO
STR a1, VC_Logical
bl HAL_DebugHexTX4
; Get the physical address of NCNB workspace
; R8 -> start of NCNB workspace
......@@ -676,70 +564,11 @@ HAL_Init
ORR a1, a1, a3
STR a1, NCNBPhysAddr
MOV a1, #0 ; map in the IO space
LDR a2, =IO_Base
LDR a3, =IO_Size
CallOS OS_MapInIO
STR a1, PeriBase
BL Interrupt_Init ; initialise our interrupts
BL Timer_Init
BL IIC_Init
MOV a1,#0 ; start the uart ..we use it for debug
BL HAL_UARTStartUp ; restart to capture logical io address
; Map in the frame buffer
; and initialise the display driver
LDR a3, FB_Size
LDR a2, FB_Base ; effectively part of the ROM image
mov r0,a2
bl HAL_DebugHexTX4
mov r0,a3
bl HAL_DebugHexTX4
MOV a1, #0
STR a1, LastInt
STR a1, CurAddr
CallOS OS_MapInIO
STR a1,ScreenBase
bl HAL_DebugHexTX4
LDR a1,mbxres
LDR a2,mbbpp ;=1920*8*4
STR a2,BitsPerPixel
MUL a1, a2, a1