Commit 419bb1d2 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix build error. Add HAL_PlatformName implementation.

Detail:
  s/Stubs, s/Top - Remove references to deleted HAL ATA calls
  s/GPIO, s/Top - Add implementation of HAL_PlatformName. Located in s/GPIO to allow easy re-use of the board revision table.
Admin:
  Tested on Pi 2 Model B


Version 0.51. Tagged as 'BCM2835-0_51'
parent 76db1228
/* (0.50)
/* (0.51)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.50
#define Module_MajorVersion_CMHG 0.51
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Nov 2015
#define Module_Date_CMHG 08 Jan 2016
#define Module_MajorVersion "0.50"
#define Module_Version 50
#define Module_MajorVersion "0.51"
#define Module_Version 51
#define Module_MinorVersion ""
#define Module_Date "14 Nov 2015"
#define Module_Date "08 Jan 2016"
#define Module_ApplicationDate "14-Nov-15"
#define Module_ApplicationDate "08-Jan-16"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.50"
#define Module_HelpVersion "0.50 (14 Nov 2015)"
#define Module_LibraryVersionInfo "0:50"
#define Module_FullVersion "0.51"
#define Module_HelpVersion "0.51 (08 Jan 2016)"
#define Module_LibraryVersionInfo "0:51"
......@@ -35,6 +35,7 @@
GET hdr.StaticWS
EXPORT GPIO_InitDevices
EXPORT HAL_PlatformName
IMPORT memcpy
MACRO
......@@ -82,6 +83,16 @@ GPIO HALDeviceField Revision, 0 ; Filled in at runtime
GPIO_Description
= "BCM2835 GPIO interface", 0
Name_B_1 = "Raspberry Pi B PCB 1.0", 0
Name_B_2 = "Raspberry Pi B PCB 2.0", 0
Name_A_2 = "Raspberry Pi A", 0
Name_C_1 = "Raspberry Pi Compute Module", 0
Name_APlus = "Raspberry Pi A+", 0
Name_BPlus = "Raspberry Pi B+", 0
Name_Mk2_B_1 = "Raspberry Pi 2 Model B", 0
Name_Zero = "Raspberry Pi Zero", 0
Name_Unknown = "Raspberry Pi Unknown", 0
ALIGN
; Lookup table to determine board type
......@@ -91,8 +102,13 @@ GPIO_Description
DCD $minrev
DCD $maxrev
DCD GPIORevision_RaspberryPi_$type
DCD Name_$type
MEND
; The Zero has the same pinout as the 2 B, so there's currently no distinction between the two in the GPIO device
GPIORevision_RaspberryPi_Zero * GPIORevision_RaspberryPi_Mk2_B_1
; Ref: http://elinux.org/RPi_HardwareHistory#Board_Revision_History
GPIO_BoardTypes
BoardType 0, &02, &03, B_1
BoardType 0, &04, &06, B_2
......@@ -101,7 +117,10 @@ GPIO_BoardTypes
BoardType 0, &10, &10, BPlus
BoardType 0, &11, &11, C_1
BoardType 0, &12, &12, APlus
BoardType 0, &13, &ffffffff, Mk2_B_1
BoardType 0, &13, &13, BPlus
BoardType 0, &a01041, &a01041, Mk2_B_1
BoardType 0, &a21041, &a21041, Mk2_B_1
BoardType 0, &900092, &900092, Zero
GPIO_BoardTypes_End
; Initialise our HAL devices
......@@ -119,6 +138,7 @@ GPIO_InitDevices ROUT
CMP v1, ip
EXIT EQ ; Unknown model, give up
LDMIA v1!, {a1-a4}
ADD v1, v1, #4
CMP a1, v2
BNE %BT10
CMP a2, v3
......@@ -142,4 +162,25 @@ GPIO_Sleep
MOV a1, #0
MOV pc, lr
HAL_PlatformName
Entry "v1-v3"
ADR v1, GPIO_BoardTypes
LDR v2, Board_Model
LDR v3, Board_Revision
ADR ip, GPIO_BoardTypes_End
10
CMP v1, ip
ADREQL a1, Name_Unknown
EXIT EQ ; Unknown model, give up
LDMIA v1!, {a1-a4}
ADD v1, v1, #4
CMP a1, v2
BNE %BT10
CMP a2, v3
CMPLS v3, a3
BHI %BT10
; Found a match
LDR a1, [v1, #-4]
EXIT
END
......@@ -39,8 +39,6 @@
IMPORT workspace
EXPORT HAL_ATAControllerInfo
EXPORT HAL_KbdScanSetup
EXPORT HAL_KbdScan
EXPORT HAL_KbdScanFinish
......@@ -51,11 +49,6 @@
; Might want to make this do something again?
MEND
HAL_ATAControllerInfo
HALStub "HAL_ATAControllerInfo"
MOV pc,lr
HAL_KbdScanSetup
HALStub "HAL_KbdScanSetup"
MOV pc,lr
......
......@@ -110,7 +110,7 @@
IMPORT HAL_DebugRX
IMPORT HAL_DebugTX
IMPORT HAL_ATAControllerInfo
IMPORT HAL_PlatformName
IMPORT HAL_KbdScanSetup
IMPORT HAL_KbdScan
......@@ -512,9 +512,9 @@ HAL_EntryTable DATA
NullEntry ; HAL_PCISlotTable
NullEntry ; HAL_PCIAddresses
HALEntry HAL_ATAControllerInfo
NullEntry ; HAL_ATASetModes
NullEntry ; HAL_ATACableID
HALEntry HAL_PlatformName
NullEntry
NullEntry
HALEntry HAL_InitDevices
......
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