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

Fix Pi 3 UART clock rate. Add HAL device for the GPU mailboxes.

Detail:
  s/Messaging - Ensure the PL011 UART module clock is set to 3MHz on startup, in order to allow the debug terminal to work
  hdr/StaticWS, s/Top - Add a basic HAL device to expose the GPU mailboxes
Admin:
  Tested on Raspberry Pi 1B/2B/3B
  Fixes garbled debug terminal input/output on Pi 3


Version 0.52. Tagged as 'BCM2835-0_52'
parent 419bb1d2
/* (0.51)
/* (0.52)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.51
#define Module_MajorVersion_CMHG 0.52
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 08 Jan 2016
#define Module_Date_CMHG 25 Mar 2016
#define Module_MajorVersion "0.51"
#define Module_Version 51
#define Module_MajorVersion "0.52"
#define Module_Version 52
#define Module_MinorVersion ""
#define Module_Date "08 Jan 2016"
#define Module_Date "25 Mar 2016"
#define Module_ApplicationDate "08-Jan-16"
#define Module_ApplicationDate "25-Mar-16"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.51"
#define Module_HelpVersion "0.51 (08 Jan 2016)"
#define Module_LibraryVersionInfo "0:51"
#define Module_FullVersion "0.52"
#define Module_HelpVersion "0.52 (25 Mar 2016)"
#define Module_LibraryVersionInfo "0:52"
......@@ -161,6 +161,7 @@ SPI0Device # HALDeviceSize
SPI1Device # HALDeviceSize
SPI2Device # HALDeviceSize
TouchDevice # HALDeviceSize
MBoxDevice # HALDeviceSize
HAL_WsSize * :INDEX:@
sizeof_workspace * :INDEX:@
......
......@@ -31,6 +31,7 @@
AREA |ARM$$code|, CODE, READONLY, PIC
GET Hdr:ListOpts
GET Hdr:Proc
GET hdr.BCM2835
GET hdr.StaticWS
......@@ -41,8 +42,10 @@
IMPORT HAL_DebugHexTX4
IMPORT HAL_DebugTXStrInline
]
IMPORT memcpy
EXPORT HAL_SendHostMessage
EXPORT HAL_QueryPlatform
EXPORT BCMMBox_InitDevices
EXPORT MacAdd
EXPORT RamAd
EXPORT SerNo
......@@ -251,11 +254,85 @@ dmachans DCD 0
DCD 4
DCD 0
touchbuf DCD 0
DCD ARM2VC_Tag_SetClockRate
DCD 12
DCD 12
DCD 2
DCD 3000000 ; Reset PL011 UART clock to default (Pi 3 has this set to 48MHz for BT, but currently we want to use it for plain serial)
DCD 0
tagslen * . - tagb
ASSERT tagslen <= ?tagbuffer
MACRO
$class HALDeviceField $field, $value
LCLS myvalue
[ "$value" = ""
myvalue SETS "$field"
|
myvalue SETS "$value"
]
ASSERT . - %A0 = HALDevice_$class$field
[ ?HALDevice_$class$field = 2
DCW $myvalue
ELIF ?HALDevice_$class$field = 4
DCD $myvalue
|
% ?HALDevice_$class$field
]
MEND
; Template for mailbox device
BCMMBox_Dev
0
HALDeviceField Type, HALDeviceType_Comms + HALDeviceComms_InterProc
HALDeviceField ID, HALDeviceID_InterProc_BCMMBox
HALDeviceField Location, HALDeviceBus_Sys + HALDeviceSysBus_AHB ; Guess
HALDeviceField Version, 0
HALDeviceField Description, BCMMBox_Description
HALDeviceField Address, 0
HALDeviceField Reserved1, 0
HALDeviceField Activate, BCMMBox_Activate
HALDeviceField Deactivate, BCMMBox_Deactivate
HALDeviceField Reset, BCMMBox_Reset
HALDeviceField Sleep, BCMMBox_Sleep
HALDeviceField Device, iDev_ARM_Mbx
HALDeviceField TestIRQ, 0
HALDeviceField ClearIRQ, 0
HALDeviceField Reserved2, 0
ASSERT . - %A0 = HALDeviceSize
BCMMBox_Description
= "BCM283x VideoCore mailboxes", 0
ALIGN
; Initialise our HAL devices
BCMMBox_InitDevices ROUT
Entry
ADRL a1, MBoxDevice
ADR a2, BCMMBox_Dev
MOV a3, #HALDeviceSize
BL memcpy
ADRL a2, MBoxDevice
LDR a1, PeriBase
ADD a1, a1, #MB_Base
STR a1, [a2, #HALDevice_Address]
MOV a1, #0
MOV lr, pc
LDR pc, OSentries+4*OS_AddDevice
EXIT
BCMMBox_Activate
MOV a1, #1
BCMMBox_Deactivate
BCMMBox_Reset
MOV pc, lr
BCMMBox_Sleep
MOV a1, #0
MOV pc, lr
END
......@@ -135,6 +135,8 @@
IMPORT Touch_InitDevices
IMPORT BCMMBox_InitDevices
IMPORT HAL_SendHostMessage
IMPORT HAL_QueryPlatform
......@@ -803,6 +805,7 @@ HAL_InitDevices
BL RTC_InitDevices
BL SPI_InitDevices
BL Touch_InitDevices
BL BCMMBox_InitDevices
LDR pc, [sp], #4
......
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