]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: ge: mx53ppd: add i2c eeprom bootcount storage
authorRobert Beckett <bob.beckett@collabora.com>
Fri, 31 Jan 2020 13:07:56 +0000 (15:07 +0200)
committerStefano Babic <sbabic@denx.de>
Sun, 9 Feb 2020 20:47:20 +0000 (21:47 +0100)
Add bootcount node, linking to i2c eeprom "bootcount" partitions for
storage.
Enable i2c eeprom bootcount backend storage.
Enable bootcount command and use it for failbootcmd.

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
arch/arm/dts/imx53-ppd-uboot.dtsi
configs/mx53ppd_defconfig
include/configs/mx53ppd.h

index 8e45ee7679ae33d74987b4d02e93f9acef1fe5e3..0f819478124db09e3727669a6d072cda953db680 100644 (file)
@@ -9,6 +9,11 @@
                compatible = "wdt-reboot";
                wdt = <&wdog1>;
        };
+
+       bootcount {
+               compatible = "u-boot,bootcount-i2c-eeprom";
+               i2c-eeprom = <&bootcount>;
+       };
 };
 
 &eeprom {
@@ -20,7 +25,7 @@
                        size = <1022>;
                };
 
-               bootcount {
+               bootcount: bootcount {
                        offset = <1022>;
                        size = <2>;
                };
index 55889ee12732263f77302e06e50494f6ace6abe2..b5f00cf5365f8253d1dbb4b7dba10bd5360ee18c 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_TARGET_MX53PPD=y
 CONFIG_ENV_SIZE=0x2800
 CONFIG_ENV_OFFSET=0xC0000
 CONFIG_BOOTCOUNT_BOOTLIMIT=10
-CONFIG_SYS_BOOTCOUNT_ADDR=0x7000A000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
@@ -23,6 +22,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
+CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
@@ -36,8 +36,8 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
-CONFIG_BOOTCOUNT_EXT=y
-CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
+CONFIG_DM_BOOTCOUNT=y
+CONFIG_DM_BOOTCOUNT_I2C_EEPROM=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
index a11b085db86aba44df6da75f840324185776e64c..e7eca82798fa88933e5a819c6f5a9177cf139f85 100644 (file)
@@ -98,9 +98,7 @@
                "setenv stdout vga; " \
                "echo \"\n\n\n\n    \" $msg; " \
                "setenv stdout serial; " \
-               "mw.b 0x7000A000 0xbc; " \
-               "mw.b 0x7000A001 0x00; " \
-               "ext4write ${dev} ${devnum}:5 0x7000A000 /boot/failures 2\0" \
+               "bootcount reset; \0" \
        "altbootcmd=" \
                "run doquiet; " \
                "setenv partnum 1; run hasfirstboot || setenv partnum 2; " \