Commit 12a389b2 authored by Robert Sprowson's avatar Robert Sprowson Committed by Joe Bloggs
Browse files

Add Compute Module 3+ support

GPIO.s,hdr/BCM2835: Table of known ids updated
SPI.s: Fix long broken compute module support (only the original CM1 would have exported SPI2 due to not checking for the new id scheme).
Unrelated, SDIO.s: Use CallOS macro.

Thanks to Chris Hall for testing this on a CM3+ 8GB model.

Version 0.79. Tagged as 'HAL_BCM2835-0_79'
parent 7c2fe7dc
/* (0.78)
/* (0.79)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.78
#define Module_MajorVersion_CMHG 0.79
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Feb 2019
#define Module_Date_CMHG 18 Jun 2019
#define Module_MajorVersion "0.78"
#define Module_Version 78
#define Module_MajorVersion "0.79"
#define Module_Version 79
#define Module_MinorVersion ""
#define Module_Date "25 Feb 2019"
#define Module_Date "18 Jun 2019"
#define Module_ApplicationDate "25-Feb-19"
#define Module_ApplicationDate "18-Jun-19"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_ComponentName "HAL_BCM2835"
#define Module_FullVersion "0.78"
#define Module_HelpVersion "0.78 (25 Feb 2019)"
#define Module_LibraryVersionInfo "0:78"
#define Module_FullVersion "0.79"
#define Module_HelpVersion "0.79 (18 Jun 2019)"
#define Module_LibraryVersionInfo "0:79"
......@@ -315,6 +315,7 @@ BoardRevision_Manuf_Egoman * 1 :SHL: BoardRevision_Manuf_Shift
BoardRevision_Manuf_Embest * 2 :SHL: BoardRevision_Manuf_Shift
BoardRevision_Manuf_SonyJP * 3 :SHL: BoardRevision_Manuf_Shift
BoardRevision_Manuf_Embest2 * 4 :SHL: BoardRevision_Manuf_Shift
BoardRevision_Manuf_Stadium * 5 :SHL: BoardRevision_Manuf_Shift
BoardRevision_Proc_Shift * 12
BoardRevision_Proc_Mask * 15 :SHL: BoardRevision_Proc_Shift
BoardRevision_Proc_2835 * 0 :SHL: BoardRevision_Proc_Shift
......@@ -334,6 +335,7 @@ BoardRevision_Model_Compute3 * 10 :SHL: BoardRevision_Model_Shift
BoardRevision_Model_ZeroW * 12 :SHL: BoardRevision_Model_Shift
BoardRevision_Model_B3Plus * 13 :SHL: BoardRevision_Model_Shift
BoardRevision_Model_A3Plus * 14 :SHL: BoardRevision_Model_Shift
BoardRevision_Model_Compute3Plus * 16 :SHL: BoardRevision_Model_Shift
BoardRevision_Rev_Shift * 0
BoardRevision_Rev_Mask * 15 :SHL: BoardRevision_Rev_Shift
......
......@@ -214,6 +214,7 @@ GPIORevision_RaspberryPi_ZeroW # 1 ; Model ZeroW
GPIORevision_RaspberryPi_Mk3_B # 1 ; Model Pi 3 B
GPIORevision_RaspberryPi_Mk3_BPlus # 1 ; Model Pi 3 B+
GPIORevision_RaspberryPi_Mk3_APlus # 1 ; Model Pi 3 A+
GPIORevision_RaspberryPi_C_3Plus # 1 ; Model CM3+
GPIORevision_RaspberryPi_Max # 0
Name_B_1 = "Raspberry Pi B PCB 1.0", 0
......@@ -229,6 +230,7 @@ Name_ZeroW = "Raspberry Pi Zero W", 0
Name_Mk3_B = "Raspberry Pi 3 Model B", 0
Name_Mk3_BPlus = "Raspberry Pi 3 Model B+", 0
Name_Mk3_APlus = "Raspberry Pi 3 Model A+", 0
Name_C_3Plus = "Raspberry Pi Compute Module 3+", 0
Name_Unknown = "Raspberry Pi Unknown", 0
ALIGN
......@@ -246,6 +248,7 @@ GPIO_Board_Names_Table ; same order as GPIORevision_RaspberryPi types
DCD Name_Mk3_B
DCD Name_Mk3_BPlus
DCD Name_Mk3_APlus
DCD Name_C_3Plus
ASSERT (.-GPIO_Board_Names_Table) :SHR: 2 = GPIORevision_RaspberryPi_Max
; Lookup table to determine board type (old style)
......@@ -307,6 +310,8 @@ GPIO_Board_Conversion_Table
DCD GPIORevision_RaspberryPi_Mk3_BPlus
DCD BoardRevision_Mem_512M+BoardRevision_Model_A3Plus+(0:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_Mk3_APlus
DCD BoardRevision_Mem_1G+BoardRevision_Model_Compute3Plus+(0:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_C_3Plus
DCD &FF
; Initialise our HAL devices
......@@ -891,6 +896,8 @@ GPIOFreeToUse
DCD 2_00000000000000000000000000000000
DCD 2_00001111111111111111111111111111 ; 3A+
DCD 2_00000000000000000000000000000000
DCD 2_11111111111111111111111111111111 ; Compute CM3+
DCD 2_00000000000000000011111111111111
ASSERT (.-GPIOFreeToUse) :SHR: 3 = GPIORevision_RaspberryPi_Max
; Pin enumerations
......
......@@ -36,6 +36,7 @@
GET Hdr:ListOpts
GET Hdr:CPU.Arch
GET Hdr:Macros
GET hdr.CastleMacros
GET hdr.BCM2835
GET hdr.StaticWS
......@@ -396,7 +397,7 @@ SDIO_InitDevices ROUT
MOV a1, #0 ; flags
ADR a2, SDHCIDevice
Pull "lr"
LDR pc, OSentries+4*OS_AddDevice ; tail call
CallOS OS_AddDevice, tailcall
; a1 = GPIO pin
; a2 = function select number
......
......@@ -162,7 +162,15 @@ SPI_InitDevices ROUT
LDR a2, Board_Revision
CMP a2, #BoardRevision_Compute_Sony
CMPNE a2, #BoardRevision_Compute_Embest
BEQ %FT10
TST a2, #BoardRevision_NewScheme
EXIT EQ
AND a2, a2, #BoardRevision_Model_Mask
TEQ a2, #BoardRevision_Model_Compute
TEQNE a2, #BoardRevision_Model_Compute3
TEQNE a2, #BoardRevision_Model_Compute3Plus
EXIT NE
10
ADRL a1, SPI2Device
ADR a2, SPI2_Dev
MOV a3, #HALDeviceSize
......
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