Commit 0f6c0f83 authored by Ben Avison's avatar Ben Avison
Browse files

Adapt to release version of Raspberry Pi 2 firmware

Detail:
  The board revision scheme has changed since pre-release firmware, so the
  previous version of the SD code would have misidentified a Pi 2 (as well
  as the model A+) as a Compute module. It looks like in future, board
  revisions could be a more meaningful bitfield rather than the order-of-
  release index that's been used up to now, but at this point we can still
  manage with a cunning combination of CMP and TEQ tests. Note that the GPIO
  part of the HAL hasn't yet been updated to be aware of the new board
  revisions.


Version 0.41. Tagged as 'BCM2835-0_41'
parent 60752490
/* (0.40)
/* (0.41)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.40
#define Module_MajorVersion_CMHG 0.41
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 02 Feb 2015
#define Module_MajorVersion "0.40"
#define Module_Version 40
#define Module_MajorVersion "0.41"
#define Module_Version 41
#define Module_MinorVersion ""
#define Module_Date "02 Feb 2015"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.40"
#define Module_HelpVersion "0.40 (02 Feb 2015)"
#define Module_LibraryVersionInfo "0:40"
#define Module_FullVersion "0.41"
#define Module_HelpVersion "0.41 (02 Feb 2015)"
#define Module_LibraryVersionInfo "0:41"
......@@ -57,7 +57,11 @@ REGISTER_WRITE_PACE * 2
MIN_SDCLK * 400
; Significant board revisions
BoardRevision_BPlus * &10 ; they took away my card detect line!
BoardRevision_BPlus * &10
BoardRevision_Compute * &11
BoardRevision_APlus * &12
; Starting with the Pi 2, board revisions appear to have changed to a bitfield
; scheme. Any bitfield value will significantly exceed these old "enum" revisions.
; Base address of controller as an offset from PeriBase
EMMC_Base * &00300000
......@@ -329,11 +333,13 @@ SDIO_InitDevices ROUT
LDR a3, Board_Revision
CMP a3, #BoardRevision_BPlus
TEQ a3, #BoardRevision_Compute
; So now LO => model A or B, EQ => Compute, HI => A+, B+ or Pi 2
; Activate
ADRLO a1, Activate_AB
ADREQ a1, Activate_BPlus
ADRHI a1, Activate_Compute
ADRHI a1, Activate_BPlus
ADREQ a1, Activate_Compute
STR a1, SDHCIDevice + HALDevice_Activate
; Address and SlotInfo_StdRegs
......@@ -348,19 +354,19 @@ SDIO_InitDevices ROUT
; SlotInfo_Flags
MOV a1, #HALDeviceSDHCI_SlotFlag_Bus4Bit
ORREQ a1, a1, #HALDeviceSDHCI_SlotFlag_NoCardDetect
ORRHI a1, a1, #HALDeviceSDHCI_SlotFlag_IntegratedMem
ORRHI a1, a1, #HALDeviceSDHCI_SlotFlag_NoCardDetect
ORREQ a1, a1, #HALDeviceSDHCI_SlotFlag_IntegratedMem
STR a1, SDHCISlotInfo + HALDeviceSDHCI_SlotInfo_Flags
; GetCapabilities
ADR a1, GetCapabilities_AB_BPlus
ADDHI a1, a1, #GetCapabilities_Compute - GetCapabilities_AB_BPlus
ADDEQ a1, a1, #GetCapabilities_Compute - GetCapabilities_AB_BPlus
STR a1, SDHCIDevice + HALDevice_SDHCIGetCapabilities
; SetActivity and GetCardDetect
ADRL a1, SetActivity_AB
ADDEQ a1, a1, #SetActivity_BPlus - SetActivity_AB
ADDHI a1, a1, #SetActivity_Compute - SetActivity_AB
ADDHI a1, a1, #SetActivity_BPlus - SetActivity_AB
ADDEQ a1, a1, #SetActivity_Compute - SetActivity_AB
ADRL a2, GetCardDetect_AB
ADDHS a2, a2, #GetCardDetect_BPlus_Compute - GetCardDetect_AB
STR a1, SDHCIDevice + HALDevice_SDHCISetActivity
......
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