aspeed: spi driver: fmc wdt2

张健 zhangjian.3032 at bytedance.com
Wed Apr 27 00:09:53 AEST 2022


Hi Guys;

I would like implement the flash toggle function in ast2600.
That function about ast2400/2500 implement at linux/aspeed_wdt.c at
aspeed-master-v5.15 · AspeedTech-BMC/linux (
<https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v5.15/drivers/watchdog/aspeed_wdt.c#L172>
github.com
<https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v5.15/drivers/watchdog/aspeed_wdt.c#L172>
)
<https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v5.15/drivers/watchdog/aspeed_wdt.c#L172>

Here is my design, just an idea. I would like to see your suggestions.
Thanks.

There are some differences between ast2600 and ast2500/2400. For the
ast2600 SoC abr function, there is a set of registers named `FMC_WDT2` in
FMC(SPI).
FMC_WDT2 is not a full function WDT, thus, I can't use aspeed_wdt driver to
do that.

In ast2400/2500 used a sysfs attr `access_cs0`, can make cs0->cs1 and
cs1->cs0.
For cs0->cs1, ast2400/2500 use the wdt2's self timer, cs1->cs0, use
`access_cs0` to set the `flash indicate` bit.
But ast2600 without the FMC_WDT2 timer driver to trigger `cs0`->`cs1`,
thus, I would like to add 2 sysfs attrs in spi driver.
Because ast2600 supports single image abr mode, i'd like to use
primary/backup instead of cs0/1.

attr1 "access_backup": (only appears in primary and compatible is
"aspeed,ast2600-fmc")
store: The parameter is the timeout time for fmc_wdt2, if written, timer
will be enabled, if timeout, will reboot from backup.
show: the time left in fmc_wdt2 timer. 0 means timer is not enabled.

attr2 "access_primary”: (only appears in backup, and compatible is
"aspeed,ast2600-fmc")
store: Non-zero values indicate access to primary, 0 indicate access to
backup
show: 0: next reboot will boot from backup, 1 : will boot from primary.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20220426/0318974e/attachment.htm>


More information about the openbmc mailing list