Consolidate bootcount code into drivers/bootcount
This patch moves all bootcount implementations into a common directory: drivers/bootcount. The generic bootcount driver is now usable not only by powerpc platforms, but others as well. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Valentin Longchamp <valentin.longchamp@keymile.com> Cc: Christian Riesch <christian.riesch@omicron.at> Cc: Manfred Rudigier <manfred.rudigier@omicron.at> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Reinhard Meyer <reinhard.meyer@emk-elektronik.de> Tested-by: Valentin Longchamp <valentin.longchamp@keymile.com> Tested-by: Christian Riesch <christian.riesch@omicron.at> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
committed by
Wolfgang Denk
parent
7fe7701d32
commit
0044c42e94
@@ -157,32 +157,3 @@ void hw_watchdog_reset(void)
|
||||
davinci_hw_watchdog_reset();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BOOTCOUNT_LIMIT)
|
||||
void bootcount_store(ulong a)
|
||||
{
|
||||
struct davinci_rtc *reg =
|
||||
(struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
|
||||
|
||||
/*
|
||||
* write RTC kick register to enable write
|
||||
* for RTC Scratch registers. Scratch0 and 1 are
|
||||
* used for bootcount values.
|
||||
*/
|
||||
writel(RTC_KICK0R_WE, ®->kick0r);
|
||||
writel(RTC_KICK1R_WE, ®->kick1r);
|
||||
writel(a, ®->scratch0);
|
||||
writel(BOOTCOUNT_MAGIC, ®->scratch1);
|
||||
}
|
||||
|
||||
ulong bootcount_load(void)
|
||||
{
|
||||
struct davinci_rtc *reg =
|
||||
(struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
|
||||
|
||||
if (readl(®->scratch1) != BOOTCOUNT_MAGIC)
|
||||
return 0;
|
||||
else
|
||||
return readl(®->scratch0);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user