Skip to contentSkip to conversation

bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

PATCH New Tom Rini 3 participants 7 messages Feb 25, 2018 Arm i.MX and Layerscape

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 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.

---
 configs/calimain_defconfig          |  1 +
 configs/dh_imx6_defconfig           |  1 +
 configs/ge_b450v3_defconfig         |  1 +
 configs/ge_b650v3_defconfig         |  1 +
 configs/ge_b850v3_defconfig         |  1 +
 configs/highbank_defconfig          |  1 +
 configs/ids8313_defconfig           |  1 +
 configs/kmcoge4_defconfig           |  1 +
 configs/kmcoge5ne_defconfig         |  1 +
 configs/kmeter1_defconfig           |  1 +
 configs/kmlion1_defconfig           |  1 +
 configs/kmopti2_defconfig           |  1 +
 configs/kmsupx5_defconfig           |  1 +
 configs/kmtegr1_defconfig           |  1 +
 configs/kmtepr2_defconfig           |  1 +
 configs/kmvect1_defconfig           |  1 +
 configs/mx53ppd_defconfig           |  1 +
 configs/socfpga_is1_defconfig       |  1 +
 configs/socfpga_sr1500_defconfig    |  1 +
 configs/suvd3_defconfig             |  1 +
 configs/tqma6s_wru4_mmc_defconfig   |  1 +
 configs/tuge1_defconfig             |  1 +
 configs/tuxx1_defconfig             |  1 +
 configs/x600_defconfig              |  1 +
 drivers/bootcount/Kconfig           |  6 ++++--
 drivers/bootcount/bootcount.c       | 16 ----------------
 include/configs/brppt1.h            |  3 ---
 include/configs/calimain.h          |  1 -
 include/configs/dh_imx6.h           |  1 -
 include/configs/ge_bx50v3.h         |  2 --
 include/configs/highbank.h          |  1 -
 include/configs/ids8313.h           |  3 ---
 include/configs/km/kmp204x-common.h |  3 ---
 include/configs/socfpga_is1.h       |  2 --
 include/configs/socfpga_sr1500.h    |  2 --
 include/configs/ti_am335x_common.h  |  7 -------
 include/configs/tqma6_wru4.h        |  1 -
 include/configs/x600.h              |  4 ----
 38 files changed, 28 insertions(+), 48 deletions(-)
configs/calimain_defconfig +1 -0
index cbb31f6bf321..234b1a593567 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_DIAG=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_BOOTP_DNS=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x01C23000
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_SYS_NS16550=y
configs/dh_imx6_defconfig +1 -0
index 251fcd01b69a..2b4fe9c2c596 100644
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DWC_AHSATA=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
configs/ge_b450v3_defconfig +1 -0
index ee1cc432e0e0..045380b6de8e 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
configs/ge_b650v3_defconfig +1 -0
index 27a89b0be782..9d4b8aeebedc 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
configs/ge_b850v3_defconfig +1 -0
index af4ba9754331..94785681be7d 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
configs/highbank_defconfig +1 -0
index 7b9c0e7d4770..55f83ed1e17c 100644
@@ -17,6 +17,7 @@ CONFIG_ENV_IS_IN_NVRAM=y
 CONFIG_SCSI_AHCI=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xfff3cf0c
 # CONFIG_MMC is not set
 CONFIG_SCSI=y
 CONFIG_OF_LIBFDT=y
configs/ids8313_defconfig +1 -0
index 5ca77030104f..44b411cc5932 100644
@@ -36,6 +36,7 @@ CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTP_SUBNETMASK=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_I2C=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x9
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_PHYLIB=y
configs/kmcoge4_defconfig +1 -0
index fe731dc3c76d..9d22c211a37e 100644
@@ -35,6 +35,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xFB000020
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/kmcoge5ne_defconfig +1 -0
index c360d06a1e42..3426adf5981b 100644
@@ -28,6 +28,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE011BFF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmeter1_defconfig +1 -0
index 3e9ba80e9961..e795ac40d182 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE011BFF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmlion1_defconfig +1 -0
index 9d4f3d7395a5..12c06cc54486 100644
@@ -35,6 +35,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xFB000020
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/kmopti2_defconfig +1 -0
index 484804ab0c3c..f3babb6a7e57 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmsupx5_defconfig +1 -0
index 0a82ca344736..ac3f336204db 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmtegr1_defconfig +1 -0
index 1b2d3df78593..a5930ef6a764 100644
@@ -29,6 +29,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmtepr2_defconfig +1 -0
index c3dcf86e32f4..7441e4a888cc 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmvect1_defconfig +1 -0
index 0dc165e31297..b415c9d2030f 100644
@@ -28,6 +28,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/mx53ppd_defconfig +1 -0
index 8fb512651f5a..f4a0b9b639ff 100644
@@ -25,6 +25,7 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_NETDEVICES=y
 CONFIG_RTC_S35392A=y
 CONFIG_USB=y
configs/socfpga_is1_defconfig +1 -0
index 4da9356baf68..53b5c34fd4c1 100644
@@ -34,6 +34,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xfffffff8
 CONFIG_FPGA_SOCFPGA=y
 CONFIG_DM_GPIO=y
 CONFIG_DWAPB_GPIO=y
configs/socfpga_sr1500_defconfig +1 -0
index bdc12e4a6af9..d7df688f5012 100644
@@ -38,6 +38,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xfffffff8
 CONFIG_FPGA_SOCFPGA=y
 CONFIG_DM_GPIO=y
 CONFIG_DWAPB_GPIO=y
configs/suvd3_defconfig +1 -0
index c75c8022408b..0213101d2fbf 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/tqma6s_wru4_mmc_defconfig +1 -0
index b6f5974fd49f..995a1ced0f5e 100644
@@ -34,6 +34,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000
 CONFIG_LED_STATUS=y
 CONFIG_LED_STATUS0=y
 CONFIG_LED_STATUS_BIT=0
configs/tuge1_defconfig +1 -0
index 262a5c54793c..278d35ae61a5 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/tuxx1_defconfig +1 -0
index a2c101e275a0..6414ac29364b 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/x600_defconfig +1 -0
index d1711e01fd45..b63bf41c2452 100644
@@ -38,6 +38,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:64M(ubi0),64M(ubi1)"
 CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xD2801FF8
 CONFIG_FPGA_XILINX=y
 CONFIG_SYS_I2C_DW=y
 # CONFIG_MMC is not set
drivers/bootcount/Kconfig +4 -2
index c41b1316cd09..73972b7f9c37 100644
@@ -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.
 
drivers/bootcount/bootcount.c +0 -16
index 8b499fe12861..67554fa4a9b8 100644
@@ -8,22 +8,7 @@
 #include <bootcount.h>
 #include <linux/compiler.h>
 
-/*
- * 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 <linux/immap_qe.h>
-#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) */
include/configs/brppt1.h +0 -3
index 30ea2d22e894..02e989ad7ad0 100644
@@ -20,9 +20,6 @@
 #define CONFIG_LCD_DT_SIMPLEFB
 #define LCD_BPP				LCD_COLOR32
 
-/* Bootcount using the RTC block */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x44E3E000
-
 /* memory */
 #define CONFIG_SYS_MALLOC_LEN		(5 * 1024 * 1024)
 
include/configs/calimain.h +0 -1
index 854dc1ffedf0..364066feb21b 100644
@@ -274,7 +274,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR		(0x8001ff00)
 
 #define CONFIG_SYS_BOOTCOUNT_LE		/* Use little-endian accessors */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	DAVINCI_RTC_BASE
 
 #ifndef __ASSEMBLY__
 int calimain_get_osc_freq(void);
include/configs/dh_imx6.h +0 -1
index 1f7fccad3fbc..abe393e44c94 100644
@@ -42,7 +42,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(4 * SZ_1M)
 
 /* Bootcounter */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* FEC ethernet */
include/configs/ge_bx50v3.h +0 -2
index e4673d812dc2..cbfe30d536d0 100644
@@ -263,6 +263,4 @@
 
 #define CONFIG_BCH
 
-#define CONFIG_SYS_BOOTCOUNT_ADDR		0x7000A000
-
 #endif	/* __GE_BX50V3_CONFIG_H */
include/configs/highbank.h +0 -1
index 0aa59bcafde1..785cad7762e9 100644
@@ -25,7 +25,6 @@
 #define CONFIG_CONS_INDEX		0
 
 #define CONFIG_SYS_BOOTCOUNT_LE		/* Use little-endian accessors */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0xfff3cf0c
 
 #define CONFIG_MISC_INIT_R
 #define CONFIG_SCSI_AHCI_PLAT
include/configs/ids8313.h +0 -3
index 12c3aff4166d..a4acaa65b2d5 100644
@@ -508,9 +508,6 @@
 /* UBI Support */
 #define CONFIG_MTD_PARTITIONS
 
-/* bootcount support */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x9
-
 #define CONFIG_IMAGE_FORMAT_LEGACY
 
 #endif	/* __CONFIG_H */
include/configs/km/kmp204x-common.h +0 -3
index 7f735e0ac67e..f49f4361204f 100644
@@ -188,9 +188,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_BR1_PRELIM  CONFIG_SYS_QRIO_BR_PRELIM /* QRIO Base Address */
 #define CONFIG_SYS_OR1_PRELIM  CONFIG_SYS_QRIO_OR_PRELIM /* QRIO Options */
 
-/* bootcounter in QRIO */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	(CONFIG_SYS_QRIO_BASE + 0x20)
-
 #define CONFIG_BOARD_EARLY_INIT_R	/* call board_early_init_r function */
 #define CONFIG_MISC_INIT_F
 #define CONFIG_MISC_INIT_R
include/configs/socfpga_is1.h +0 -2
index f2c3f405549a..88f9d4a46d07 100644
@@ -30,8 +30,6 @@
 /*
  * Bootcounter
  */
-/* last 2 lwords in OCRAM */
-#define CONFIG_SYS_BOOTCOUNT_ADDR       0xfffffff8
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 #endif	/* __CONFIG_SOCFPGA_IS1_H__ */
include/configs/socfpga_sr1500.h +0 -2
index 8879817b3020..492869bd37f6 100644
@@ -29,8 +29,6 @@
 /*
  * Bootcounter
  */
-/* last 2 lwords in OCRAM */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0xfffffff8
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* Environment setting for SPI flash */
include/configs/ti_am335x_common.h +0 -7
index 6c93fd3f9b6f..8251ceb63fa0 100644
@@ -38,13 +38,6 @@
 
 #define CONFIG_DRIVER_TI_CPSW		/* Driver for IP block */
 /*
- * RTC related defines. To use bootcount you must set bootlimit in the
- * environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT
- * in the board config.
- */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x44E3E000
-
-/*
  * SPL related defines.  The Public RAM memory map the ROM defines the
  * area between 0x402F0400 and 0x4030B800 as a download area and
  * 0x4030B800 to 0x4030CE00 as a public stack area.  The ROM also
include/configs/tqma6_wru4.h +0 -1
index d94f790148dc..24b62e701c10 100644
@@ -34,7 +34,6 @@
 /* LED */
 
 /* Bootcounter */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 #endif /* __CONFIG_TQMA6_WRU4_H */
include/configs/x600.h +0 -4
index 4bf8b1051e58..485522cd8729 100644
@@ -116,10 +116,6 @@
 #define CONFIG_SYS_MALLOC_LEN			(8 << 20)
 #define CONFIG_SYS_LOAD_ADDR			0x00800000
 
-/* Use last 2 lwords in internal SRAM for bootcounter */
-#define CONFIG_SYS_BOOTCOUNT_ADDR		(CONFIG_SRAM_BASE + \
-						 CONFIG_SRAM_SIZE)
-
 #define CONFIG_HOSTNAME				x600
 #define CONFIG_UBI_PART				ubi0
 #define CONFIG_UBIFS_VOLUME			rootfs
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

Hi Tom,

Quoted 7 lines

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.

Thanks for your patch.

I suppose, that it is a last puzzle to convert BOOTCOUNT to Kconfig.

Please correct me if I'm wrong, but it shall be applied on top of Alex's series:

http://patchwork.ozlabs.org/cover/874539/

Quoted 546 lines
---
 configs/calimain_defconfig          |  1 +
 configs/dh_imx6_defconfig           |  1 +
 configs/ge_b450v3_defconfig         |  1 +
 configs/ge_b650v3_defconfig         |  1 +
 configs/ge_b850v3_defconfig         |  1 +
 configs/highbank_defconfig          |  1 +
 configs/ids8313_defconfig           |  1 +
 configs/kmcoge4_defconfig           |  1 +
 configs/kmcoge5ne_defconfig         |  1 +
 configs/kmeter1_defconfig           |  1 +
 configs/kmlion1_defconfig           |  1 +
 configs/kmopti2_defconfig           |  1 +
 configs/kmsupx5_defconfig           |  1 +
 configs/kmtegr1_defconfig           |  1 +
 configs/kmtepr2_defconfig           |  1 +
 configs/kmvect1_defconfig           |  1 +
 configs/mx53ppd_defconfig           |  1 +
 configs/socfpga_is1_defconfig       |  1 +
 configs/socfpga_sr1500_defconfig    |  1 +
 configs/suvd3_defconfig             |  1 +
 configs/tqma6s_wru4_mmc_defconfig   |  1 +
 configs/tuge1_defconfig             |  1 +
 configs/tuxx1_defconfig             |  1 +
 configs/x600_defconfig              |  1 +
 drivers/bootcount/Kconfig           |  6 ++++--
 drivers/bootcount/bootcount.c       | 16 ----------------
 include/configs/brppt1.h            |  3 ---
 include/configs/calimain.h          |  1 -
 include/configs/dh_imx6.h           |  1 -
 include/configs/ge_bx50v3.h         |  2 --
 include/configs/highbank.h          |  1 -
 include/configs/ids8313.h           |  3 ---
 include/configs/km/kmp204x-common.h |  3 ---
 include/configs/socfpga_is1.h       |  2 --
 include/configs/socfpga_sr1500.h    |  2 --
 include/configs/ti_am335x_common.h  |  7 -------
 include/configs/tqma6_wru4.h        |  1 -
 include/configs/x600.h              |  4 ----
 38 files changed, 28 insertions(+), 48 deletions(-)
configs/calimain_defconfig +1 -0
index cbb31f6bf321..234b1a593567 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_DIAG=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_BOOTP_DNS=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x01C23000
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_SYS_NS16550=y
configs/dh_imx6_defconfig +1 -0
index 251fcd01b69a..2b4fe9c2c596 100644
@@ -35,6 +35,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DWC_AHSATA=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
configs/ge_b450v3_defconfig +1 -0
index ee1cc432e0e0..045380b6de8e 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
configs/ge_b650v3_defconfig +1 -0
index 27a89b0be782..9d4b8aeebedc 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
configs/ge_b850v3_defconfig +1 -0
index af4ba9754331..94785681be7d 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
configs/highbank_defconfig +1 -0
index 7b9c0e7d4770..55f83ed1e17c 100644
@@ -17,6 +17,7 @@ CONFIG_ENV_IS_IN_NVRAM=y
 CONFIG_SCSI_AHCI=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xfff3cf0c
 # CONFIG_MMC is not set
 CONFIG_SCSI=y
 CONFIG_OF_LIBFDT=y
configs/ids8313_defconfig +1 -0
index 5ca77030104f..44b411cc5932 100644
@@ -36,6 +36,7 @@ CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTP_SUBNETMASK=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_I2C=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x9
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_PHYLIB=y
configs/kmcoge4_defconfig +1 -0
index fe731dc3c76d..9d22c211a37e 100644
@@ -35,6 +35,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xFB000020
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/kmcoge5ne_defconfig +1 -0
index c360d06a1e42..3426adf5981b 100644
@@ -28,6 +28,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE011BFF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmeter1_defconfig +1 -0
index 3e9ba80e9961..e795ac40d182 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE011BFF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmlion1_defconfig +1 -0
index 9d4f3d7395a5..12c06cc54486 100644
@@ -35,6 +35,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xFB000020
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/kmopti2_defconfig +1 -0
index 484804ab0c3c..f3babb6a7e57 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmsupx5_defconfig +1 -0
index 0a82ca344736..ac3f336204db 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmtegr1_defconfig +1 -0
index 1b2d3df78593..a5930ef6a764 100644
@@ -29,6 +29,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmtepr2_defconfig +1 -0
index c3dcf86e32f4..7441e4a888cc 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/kmvect1_defconfig +1 -0
index 0dc165e31297..b415c9d2030f 100644
@@ -28,6 +28,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/mx53ppd_defconfig +1 -0
index 8fb512651f5a..f4a0b9b639ff 100644
@@ -25,6 +25,7 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
+CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_NETDEVICES=y
 CONFIG_RTC_S35392A=y
 CONFIG_USB=y
(quoted diff) +0 -0

b/configs/socfpga_is1_defconfig index 4da9356baf68..53b5c34fd4c1 100644 --- a/configs/socfpga_is1_defconfig
+++ b/configs/socfpga_is1_defconfig

configs/socfpga_is1_defconfig +1 -0
@@ -34,6 +34,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xfffffff8
 CONFIG_FPGA_SOCFPGA=y
 CONFIG_DM_GPIO=y
 CONFIG_DWAPB_GPIO=y
(quoted diff) +0 -0

b/configs/socfpga_sr1500_defconfig index bdc12e4a6af9..d7df688f5012 100644 --- a/configs/socfpga_sr1500_defconfig
+++ b/configs/socfpga_sr1500_defconfig

configs/socfpga_is1_defconfig +1 -0
@@ -38,6 +38,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xfffffff8
 CONFIG_FPGA_SOCFPGA=y
 CONFIG_DM_GPIO=y
 CONFIG_DWAPB_GPIO=y
configs/suvd3_defconfig +1 -0
index c75c8022408b..0213101d2fbf 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
(quoted diff) +0 -0

b/configs/tqma6s_wru4_mmc_defconfig index b6f5974fd49f..995a1ced0f5e 100644 --- a/configs/tqma6s_wru4_mmc_defconfig
+++ b/configs/tqma6s_wru4_mmc_defconfig

configs/tqma6s_wru4_mmc_defconfig +1 -0
@@ -34,6 +34,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x00900000
 CONFIG_LED_STATUS=y
 CONFIG_LED_STATUS0=y
 CONFIG_LED_STATUS_BIT=0
configs/tuge1_defconfig +1 -0
index 262a5c54793c..278d35ae61a5 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/tuxx1_defconfig +1 -0
index a2c101e275a0..6414ac29364b 100644
@@ -27,6 +27,7 @@ CONFIG_BOOTP_BOOTPATH=y
 CONFIG_BOOTP_GATEWAY=y
 CONFIG_BOOTP_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0xE0113FF8
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 # CONFIG_PCI is not set
configs/x600_defconfig +0 -0
index d1711e01fd45..b63bf41c2452 100644
@@ -38,6 +38,7 @@

CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:64M(ubi0),64M(ubi1)" CONFIG_CMD_UBI=y CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTCOUNT_LIMIT=y

configs/x600_defconfig +1 -0
+CONFIG_SYS_BOOTCOUNT_ADDR=0xD2801FF8
 CONFIG_FPGA_XILINX=y
 CONFIG_SYS_I2C_DW=y
 # CONFIG_MMC is not set
drivers/bootcount/Kconfig +0 -0
index c41b1316cd09..73972b7f9c37 100644
@@ -111,8 +111,10 @@ config SYS_BOOTCOUNT_EXT_NAME
 
 config SYS_BOOTCOUNT_ADDR
 	hex "RAM address used for reading and writing the boot

counter"

drivers/bootcount/Kconfig +3 -2
-	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 || \

drivers/bootcount/Kconfig +1 -0
+		   BOOTCOUNT_I2C
 	help
 	  Set the address used for reading and writing the boot

counter.

(quoted diff) +0 -0

b/drivers/bootcount/bootcount.c index 8b499fe12861..67554fa4a9b8 100644 --- a/drivers/bootcount/bootcount.c
+++ b/drivers/bootcount/bootcount.c

drivers/bootcount/Kconfig +0 -2
@@ -8,22 +8,7 @@
 #include <bootcount.h>
 #include <linux/compiler.h>
 
-/*
- * Only override CONFIG_SYS_BOOTCOUNT_ADDR if not already defined.

This
- * way, some boards can define it directly in their config header.
- */

drivers/bootcount/Kconfig +1 -6
-#if !defined(CONFIG_SYS_BOOTCOUNT_ADDR)
-
-#if defined(CONFIG_QE)
-#include <linux/immap_qe.h>
-#define CONFIG_SYS_BOOTCOUNT_ADDR	(CONFIG_SYS_IMMR + 0x110000
+ \
-					 QE_MURAM_SIZE - 2 *

sizeof(u32)) -#endif /* defined(CONFIG_QE) */

drivers/bootcount/Kconfig +0 -5
-
-#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) */
include/configs/brppt1.h +0 -3
index 30ea2d22e894..02e989ad7ad0 100644
@@ -20,9 +20,6 @@
 #define CONFIG_LCD_DT_SIMPLEFB
 #define LCD_BPP				LCD_COLOR32
 
-/* Bootcount using the RTC block */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x44E3E000
-
 /* memory */
 #define CONFIG_SYS_MALLOC_LEN		(5 * 1024 * 1024)
 
include/configs/calimain.h +0 -0
index 854dc1ffedf0..364066feb21b 100644
@@ -274,7 +274,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR		(0x8001ff00)
 
 #define CONFIG_SYS_BOOTCOUNT_LE		/* Use little-endian

accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR
DAVINCI_RTC_BASE
#ifndef __ASSEMBLY__
int calimain_get_osc_freq(void);

include/configs/dh_imx6.h +0 -1
index 1f7fccad3fbc..abe393e44c94 100644
@@ -42,7 +42,6 @@
 #define CONFIG_SYS_MALLOC_LEN		(4 * SZ_1M)
 
 /* Bootcounter */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* FEC ethernet */
include/configs/ge_bx50v3.h +0 -2
index e4673d812dc2..cbfe30d536d0 100644
@@ -263,6 +263,4 @@
 
 #define CONFIG_BCH
 
-#define CONFIG_SYS_BOOTCOUNT_ADDR		0x7000A000
-
 #endif	/* __GE_BX50V3_CONFIG_H */
include/configs/highbank.h +0 -0
index 0aa59bcafde1..785cad7762e9 100644
@@ -25,7 +25,6 @@
 #define CONFIG_CONS_INDEX		0
 
 #define CONFIG_SYS_BOOTCOUNT_LE		/* Use little-endian

accessors */ -#define CONFIG_SYS_BOOTCOUNT_ADDR 0xfff3cf0c

#define CONFIG_MISC_INIT_R
#define CONFIG_SCSI_AHCI_PLAT

include/configs/ids8313.h +0 -3
index 12c3aff4166d..a4acaa65b2d5 100644
@@ -508,9 +508,6 @@
 /* UBI Support */
 #define CONFIG_MTD_PARTITIONS
 
-/* bootcount support */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x9
-
 #define CONFIG_IMAGE_FORMAT_LEGACY
 
 #endif	/* __CONFIG_H */
(quoted diff) +0 -0

b/include/configs/km/kmp204x-common.h index 7f735e0ac67e..f49f4361204f 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -188,9 +188,6 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_QRIO_BR_PRELIM /* QRIO Base Address */ #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_QRIO_OR_PRELIM /* QRIO Options */ -/* bootcounter in QRIO */
-#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_QRIO_BASE +
0x20) -
#define CONFIG_BOARD_EARLY_INIT_R /* call board_early_init_r
function */ #define CONFIG_MISC_INIT_F
#define CONFIG_MISC_INIT_R

(quoted diff) +0 -0

b/include/configs/socfpga_is1.h index f2c3f405549a..88f9d4a46d07 100644 --- a/include/configs/socfpga_is1.h
+++ b/include/configs/socfpga_is1.h

include/configs/socfpga_is1.h +0 -2
@@ -30,8 +30,6 @@
 /*
  * Bootcounter
  */
-/* last 2 lwords in OCRAM */
-#define CONFIG_SYS_BOOTCOUNT_ADDR       0xfffffff8
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 #endif	/* __CONFIG_SOCFPGA_IS1_H__ */
(quoted diff) +0 -0

b/include/configs/socfpga_sr1500.h index 8879817b3020..492869bd37f6 100644 --- a/include/configs/socfpga_sr1500.h
+++ b/include/configs/socfpga_sr1500.h

include/configs/socfpga_sr1500.h +0 -2
@@ -29,8 +29,6 @@
 /*
  * Bootcounter
  */
-/* last 2 lwords in OCRAM */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0xfffffff8
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* Environment setting for SPI flash */
(quoted diff) +0 -0

b/include/configs/ti_am335x_common.h index 6c93fd3f9b6f..8251ceb63fa0 100644 --- a/include/configs/ti_am335x_common.h
+++ b/include/configs/ti_am335x_common.h

(quoted diff) +0 -1
@@ -38,13 +38,6 @@
 
 #define CONFIG_DRIVER_TI_CPSW		/* Driver for IP block
 */ /*
- * RTC related defines. To use bootcount you must set bootlimit in

the
- * environment to a non-zero value and enable CONFIG_BOOTCOUNT_LIMIT
- * in the board config.
- */

include/configs/ti_am335x_common.h +0 -3
-#define CONFIG_SYS_BOOTCOUNT_ADDR	0x44E3E000
-
-/*
  * SPL related defines.  The Public RAM memory map the ROM defines

the
* area between 0x402F0400 and 0x4030B800 as a download area and
* 0x4030B800 to 0x4030CE00 as a public stack area. The ROM also

(quoted diff) +0 -0

b/include/configs/tqma6_wru4.h index d94f790148dc..24b62e701c10 100644

include/configs/tqma6_wru4.h +0 -1
@@ -34,7 +34,6 @@
 /* LED */
 
 /* Bootcounter */
-#define CONFIG_SYS_BOOTCOUNT_ADDR	IRAM_BASE_ADDR
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 #endif /* __CONFIG_TQMA6_WRU4_H */
include/configs/x600.h +0 -4
index 4bf8b1051e58..485522cd8729 100644
@@ -116,10 +116,6 @@
 #define CONFIG_SYS_MALLOC_LEN			(8 << 20)
 #define CONFIG_SYS_LOAD_ADDR			0x00800000
 
-/* Use last 2 lwords in internal SRAM for bootcounter */
-#define CONFIG_SYS_BOOTCOUNT_ADDR		(CONFIG_SRAM_BASE +
 \
-						 CONFIG_SRAM_SIZE)
-
 #define CONFIG_HOSTNAME				x600
 #define CONFIG_UBI_PART				ubi0
Quoted 1 line

#define CONFIG_UBIFS_VOLUME rootfs

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180225/d35bc857/attachment.sig>

author
#2 lore raw

PATCH 1/1 bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

Quoted 10 lines · Lukasz Majewski

Hi Tom,

Quoted 7 lines

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.

Quoted 8 lines

Thanks for your patch.

I suppose, that it is a last puzzle to convert BOOTCOUNT to Kconfig.

Please correct me if I'm wrong, but it shall be applied on top of Alex's series:

http://patchwork.ozlabs.org/cover/874539/

Correct. I tested that and the only part I wasn't 100% confident in after transition was the addresses.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180225/460b063d/attachment.sig>
#3 lore raw

PATCH 1/1 bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

Quoted 15 lines · Tom Rini
Quoted 14 lines · Lukasz Majewski

Hi Tom,

Quoted 7 lines

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.

Thanks for your patch.

I suppose, that it is a last puzzle to convert BOOTCOUNT to Kconfig.

Quoted 8 lines
Quoted 4 lines

Please correct me if I'm wrong, but it shall be applied on top of Alex's series:

http://patchwork.ozlabs.org/cover/874539/

Correct. I tested that and the only part I wasn't 100% confident in after transition was the addresses.

Having looked at it both ways (migrate CONFIG_SYS_BOOTCOUNT_ADDR into Kconfig, migrate everything out of the CONFIG_ namespace) they both seem to have downsides... either you have magic numbers in Kconfig or you have configuration littered through include files. It feels like it wants some piece of machinery we don't really have today.

Signature · 1 line
Alex Kiernan
author
#4 lore raw

PATCH 1/1 bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

Quoted 25 lines · Alex Kiernan
Quoted 15 lines · Tom Rini
Quoted 14 lines · Lukasz Majewski

Hi Tom,

Quoted 7 lines

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.

Thanks for your patch.

I suppose, that it is a last puzzle to convert BOOTCOUNT to Kconfig.

Quoted 8 lines
Quoted 4 lines

Please correct me if I'm wrong, but it shall be applied on top of Alex's series:

http://patchwork.ozlabs.org/cover/874539/

Correct. I tested that and the only part I wasn't 100% confident in after transition was the addresses.

Quoted 5 lines

Having looked at it both ways (migrate CONFIG_SYS_BOOTCOUNT_ADDR into Kconfig, migrate everything out of the CONFIG_ namespace) they both seem to have downsides... either you have magic numbers in Kconfig or you have configuration littered through include files. It feels like it wants some piece of machinery we don't really have today.

Long term, I think cases like this should be handled either way default 0xF00 if BAR or yes, we re-work things so it's out of the CONFIG namespace. In the case of bootcount_davinci.c we could easily key that off of CONFIG_AM33XX #elif CONFIG_SOC_DA8XX as we're talking about an on-chip RTC and that's not going to vary much in location. But for the generic driver that really is harder to say.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180225/9aa84e4e/attachment.sig>
#5 lore raw

PATCH 1/1 bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

In reply to Tom Rini
Quoted 9 lines · Tom Rini

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.

Signature · 1 line
Alex Kiernan
author
#6 lore raw

PATCH 1/1 bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDR

In reply to Tom Rini
Quoted 9 lines · Tom Rini

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.

With R-B's added, applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180225/9330ea45/attachment.sig>