From 39bcbb7740b099b487b20ff6e345eb790a85712c Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Sat, 24 Feb 2018 16:50:41 -0500 Subject: bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR Migrate the users of CONFIG_SYS_BOOTCOUNT_ADDR to Kconfig. We can provide a default for BOOTCOUNT_AM33XX as that's a specific part of the RTC in use. We can also provide a default for ARCH_LS1043A and ARCH_LS1021A as they had been previously calculated and their symbols are in Kconfig. In the case of other QE-enabled platforms, they are not so we must update the relevant defconfig files. The previous default only applied in some cases, even on a specific SoC family. Reviewed-by: Lukasz Majewski Reviewed-by: Alex Kiernan Signed-off-by: Tom Rini --- drivers/bootcount/Kconfig | 6 ++++-- drivers/bootcount/bootcount.c | 16 ---------------- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'drivers/bootcount') diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index c41b1316cd..73972b7f9c 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -111,8 +111,10 @@ config SYS_BOOTCOUNT_EXT_NAME config SYS_BOOTCOUNT_ADDR hex "RAM address used for reading and writing the boot counter" - default 0x7000A000 - depends on BOOTCOUNT_EXT + default 0x44E3E000 if BOOTCOUNT_AM33XX + default 0xE0115FF8 if ARCH_LS1043A || ARCH_LS1021A + depends on BOOTCOUNT_AM33XX || BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \ + BOOTCOUNT_I2C help Set the address used for reading and writing the boot counter. diff --git a/drivers/bootcount/bootcount.c b/drivers/bootcount/bootcount.c index 8b499fe128..67554fa4a9 100644 --- a/drivers/bootcount/bootcount.c +++ b/drivers/bootcount/bootcount.c @@ -8,22 +8,7 @@ #include #include -/* - * Only override CONFIG_SYS_BOOTCOUNT_ADDR if not already defined. This - * way, some boards can define it directly in their config header. - */ -#if !defined(CONFIG_SYS_BOOTCOUNT_ADDR) - -#if defined(CONFIG_QE) -#include -#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x110000 + \ - QE_MURAM_SIZE - 2 * sizeof(u32)) -#endif /* defined(CONFIG_QE) */ - -#endif /* !defined(CONFIG_SYS_BOOTCOUNT_ADDR) */ - /* Now implement the generic default functions */ -#if defined(CONFIG_SYS_BOOTCOUNT_ADDR) __weak void bootcount_store(ulong a) { void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR; @@ -54,4 +39,3 @@ __weak ulong bootcount_load(void) return raw_bootcount_load(reg); #endif /* defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) */ } -#endif /* defined(CONFIG_SYS_BOOTCOUNT_ADDR) */ -- cgit