ARM-software / ebbr

Embedded Base Boot Requirements Specification
Creative Commons Attribution Share Alike 4.0 International
113 stars 36 forks source link

RTC should be optional #14

Closed wmamills closed 6 years ago

wmamills commented 6 years ago

Not all embedded platforms have an RTC, UEFI requires it. Should it be optional in EBBR? At least for early levels? Should we recommend OS actions to deal with this?

glikely commented 6 years ago

Yes, should be optional in EBBR, and need to make sure the behaviour of {Get,Set}Time() is defined when there is no RTC available.

That said, even when there is an RTC, it may not be possible to access it via a runtime service. If the RTC is on an i2c bus shared with other devices, then the OS will control the bus and firmware must not try to perform its own transactions.

daniel-thompson commented 6 years ago

On Thu, May 17, 2018 at 08:45:46AM -0700, Bill MIlls wrote:

Not all embedded platforms have an RTC, UEFI requires it. Should it be optional in EBBR?

Yes, I think this should be optional.

At least for early levels?

Personally I'd argue this should always be optional.

Including an RTC hits the BoM and implies the addition of a battery or a largish slow leakage capacitor either of which could easily become the shortest lifespan component on the board. I think omitting the RTC is a defensible design decision for some applications and thus IMHO is not a mistake that EBBR should seek to correct in later levels.

Should we recommend OS actions to deal with this?

Not sure if this is needed. We'd probably end up describing what Linux kernel already does w.r.t. time keeping. If we did end up doing something like that then we would arguably be solving an already solved problem whilst at the same time elevating Linux's position too high within an OS agnostic standard.

Daniel.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/ARM-software/ebbr/issues/14

Uditkr commented 6 years ago

That said, even when there is an RTC, it may not be possible to access it via a runtime service. If the RTC is on an i2c bus shared with other devices, then the OS will control the bus and firmware must not try to perform its own transactions.

i2c driver can sit in EL3 and OS or UEFI may do smc call to get i2c work done. So exclusive access is maintained.

Uditkr commented 6 years ago

@daniel-thompson , This is okay to make RTC optional at all level, But how we are making doing it i.e. 1) allowing set/get functions to return an error or 2) just passing to OS as no-run time

IMO, with this first Linux will register rtc0 as efi-rtc and rtc1 could be cmos or other sort of RTC. is this okay for OS ?

daniel-thompson commented 6 years ago

IMO, with this first Linux will register rtc0 as efi-rtc and rtc1 could be cmos or other sort of RTC. is this okay for OS ?

I'd prefer to define optional differently.

IMHO we should not require boards to include an RTC (at any level) but that boards with an RTC should expose it via EFI although I don't have particularly strong opinions about whether the "if you have it, expose it via EFI" should kick in at level 0 or level 1.

From Linux point-of-view I don't think it matters. efi-rtc will not probe if the GetTime() returns an error so rtc0 will never be efi-rtc if EFI has no RTC.