aspeed: spi driver: fmc wdt2

Cédric Le Goater clg at kaod.org
Wed Apr 27 23:31:30 AEST 2022


On 4/26/22 16:09, 张健 wrote:
> Hi Guys;
> 
> I would like implement the flash toggle function in ast2600.

It would be nice to have the support in QEMU also.

> 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.


yes. The FMC_WDT2 is a standalone logic under FMC which is simplified
compared to the other watchdogs.

I spent sometime adding WDT2 on the FMC AST2600 (not mainline but in OpenBMC
QEMU) but I didn't handle the CS switch. It shouldn't be too hard.

Keep me updated on your progress.

Thanks,

C.

> 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.
> 
> 
> 
> 



More information about the openbmc mailing list