Commit e85c1977 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Add startup check for presence of NVRAM HAL device

Logic is now
 * if NVRAM device is present, go dormant
 * if CMOS file is absent, go dormant
 * otherwise shadow it
or if StoreInHAL, behave as before.
Unrelated, added Hdr prefixes to includes so they can be double clicked on to open. Swap out OS_Word subreasons for symbolic names.

Version 0.10. Tagged as 'SDCMOS-0_10'
parent 56a2247e
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.09"
Module_Version SETA 9
Module_MajorVersion SETS "0.10"
Module_Version SETA 10
Module_MinorVersion SETS ""
Module_Date SETS "16 Oct 2012"
Module_ApplicationDate SETS "16-Oct-12"
Module_Date SETS "14 Jul 2013"
Module_ApplicationDate SETS "14-Jul-13"
Module_ComponentName SETS "SDCMOS"
Module_ComponentPath SETS "cddl/RiscOS/Sources/HWSupport/SD/SDCMOS"
Module_FullVersion SETS "0.09"
Module_HelpVersion SETS "0.09 (16 Oct 2012)"
Module_FullVersion SETS "0.10"
Module_HelpVersion SETS "0.10 (14 Jul 2013)"
END
/* (0.09)
/* (0.10)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.09
#define Module_MajorVersion_CMHG 0.10
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Oct 2012
#define Module_Date_CMHG 14 Jul 2013
#define Module_MajorVersion "0.09"
#define Module_Version 9
#define Module_MajorVersion "0.10"
#define Module_Version 10
#define Module_MinorVersion ""
#define Module_Date "16 Oct 2012"
#define Module_Date "14 Jul 2013"
#define Module_ApplicationDate "16-Oct-12"
#define Module_ApplicationDate "14-Jul-13"
#define Module_ComponentName "SDCMOS"
#define Module_ComponentPath "cddl/RiscOS/Sources/HWSupport/SD/SDCMOS"
#define Module_FullVersion "0.09"
#define Module_HelpVersion "0.09 (16 Oct 2012)"
#define Module_LibraryVersionInfo "0:9"
#define Module_FullVersion "0.10"
#define Module_HelpVersion "0.10 (14 Jul 2013)"
#define Module_LibraryVersionInfo "0:10"
......@@ -28,20 +28,22 @@
StoreInHAL SETL {FALSE};
]
GET ListOpts
GET Macros
GET System
GET Proc
GET HighFSI
GET ModHand
GET OsBytes
GET OsWords
GET CMOS
GET FSNumbers
GET NewErrors
GET Territory
GET FileTypes
GET Services
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Proc
GET Hdr:HighFSI
GET Hdr:ModHand
GET Hdr:OsBytes
GET Hdr:OsWords
GET Hdr:CMOS
GET Hdr:FSNumbers
GET Hdr:NewErrors
GET Hdr:Territory
GET Hdr:FileTypes
GET Hdr:Services
GET Hdr:HALDevice
GET Hdr:HALEntries
GET VersionASM
AREA |Asm$$Code|, CODE, READONLY, PIC
......@@ -88,6 +90,8 @@ NonCanonicalisedPath2
= "SDFS::0.$.!Boot.Loader.CMOS", 0
ALIGN
ReqdAPIMajor * 0
SaveCMOS
= "SaveCMOS "
Len_SaveCMOS * .-SaveCMOS
......@@ -97,6 +101,36 @@ Len_SaveCMOS * .-SaveCMOS
Init ROUT
Entry
[ :LNOT: StoreInHAL
; If the HAL proclaims hardware CMOS is present, go dormant
MOV r6, r8
MOV r1, #0
10
LDR r0, =(HALDeviceType_SysPeri + HALDeviceSysPeri_NVRAM) :OR: (ReqdAPIMajor:SHL:16)
MOV r8, #OSHW_DeviceEnumerate
SWI XOS_Hardware
EXIT VS
CMP r1, #-1 ; All done with no matches, try file
BEQ %FT30
LDRH r3, [r2, #HALDevice_ID]
TEQ r3, #HALDeviceID_NVRAM_24C02
TEQNE r3, #HALDeviceID_NVRAM_24C04
TEQNE r3, #HALDeviceID_NVRAM_24C08
TEQNE r3, #HALDeviceID_NVRAM_24C16
BNE %BT10 ; Was NVRAM, but not a known one
ADR r0, %FT20
SETV
EXIT
20
DCD 0
DCB "Redundant", 0
ALIGN
30
MOV r8, r6
]
; This module is designed to be included in a ROM, in which case we have
; to take account of the fact that SDFS::0 isn't properly initialised
; until the callbacks after ROM init.
......@@ -225,7 +259,7 @@ TryInit ROUT
; clock, and NetTime hasn't picked up a link yet
SUB sp, sp, #8
MOV r0, #OsWord_ReadRealTimeClock
MOV r1, #3 ; time as UTC 5 byte cs
MOV r1, #OWReadRTC_5ByteInt
STRB r1, [sp]
MOV r1, sp
SWI XOS_Word
......@@ -396,7 +430,7 @@ MyByteV
; Refresh the timestamp
MOV r0, #OsWord_ReadRealTimeClock
MOV r1, #3 ; time as UTC 5 byte cs
MOV r1, #OWReadRTC_5ByteInt
STRB r1, [sp]
MOV r1, sp
SWI XOS_Word
......
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