xref: /openbmc/u-boot/drivers/bootcount/Kconfig (revision c9ad6bc23543fbfa9735118b93b5f4741ab0ad6f)
1f31dac4eSIan Ray#
2f31dac4eSIan Ray# Boot count configuration
3f31dac4eSIan Ray#
4f31dac4eSIan Ray
5c1e1c1ecSAlex Kiernanmenuconfig BOOTCOUNT_LIMIT
6d1ec9461SLukasz Majewski	bool "Enable support for checking boot count limit"
7d1ec9461SLukasz Majewski	help
8d1ec9461SLukasz Majewski	  Enable checking for exceeding the boot count limit.
9d1ec9461SLukasz Majewski	  More information: http://www.denx.de/wiki/DULG/UBootBootCountLimit
10d1ec9461SLukasz Majewski
113dccc10eSAlex Kiernanif BOOTCOUNT_LIMIT
12f31dac4eSIan Ray
13c1e1c1ecSAlex Kiernanchoice
14c1e1c1ecSAlex Kiernan	prompt "Boot count device"
15c35e2d91SAlex Kiernan	default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
16bec8c647SAlex Kiernan	default BOOTCOUNT_AT91 if AT91SAM9XE
17aa5a8632SAlex Kiernan	default BOOTCOUNT_GENERIC
18aa5a8632SAlex Kiernan
19aa5a8632SAlex Kiernanconfig BOOTCOUNT_GENERIC
20aa5a8632SAlex Kiernan	bool "Generic default boot counter"
21aa5a8632SAlex Kiernan	help
22aa5a8632SAlex Kiernan	  Generic bootcount stored at SYS_BOOTCOUNT_ADDR.
23aa5a8632SAlex Kiernan
24aa5a8632SAlex Kiernan	  SYS_BOOTCOUNT_ADDR:
25aa5a8632SAlex Kiernan	    Set to the address where the bootcount and bootcount magic
26aa5a8632SAlex Kiernan	    will be stored.
27c1e1c1ecSAlex Kiernan
28f31dac4eSIan Rayconfig BOOTCOUNT_EXT
29f31dac4eSIan Ray	bool "Boot counter on EXT filesystem"
30f31dac4eSIan Ray	help
31f31dac4eSIan Ray	  Add support for maintaining boot count in a file on an EXT
32f31dac4eSIan Ray	  filesystem.
33f31dac4eSIan Ray
34c35e2d91SAlex Kiernanconfig BOOTCOUNT_AM33XX
35c35e2d91SAlex Kiernan	bool "Boot counter in AM33XX RTC IP block"
36c35e2d91SAlex Kiernan	depends on AM33XX || SOC_DA8XX
373bf5f13cSAlex Kiernan	select SPL_AM33XX_ENABLE_RTC32K_OSC if AM33XX
38c35e2d91SAlex Kiernan	help
39c35e2d91SAlex Kiernan	  A bootcount driver for the RTC IP block found on many TI platforms.
40c35e2d91SAlex Kiernan	  This requires the RTC clocks, etc, to be enabled prior to use and
41c35e2d91SAlex Kiernan	  not all boards with this IP block on it will have the RTC in use.
42c35e2d91SAlex Kiernan
4304c96ed2SAlex Kiernanconfig BOOTCOUNT_ENV
4404c96ed2SAlex Kiernan	bool "Boot counter in environment"
4504c96ed2SAlex Kiernan	help
4604c96ed2SAlex Kiernan	  If no softreset save registers are found on the hardware
4704c96ed2SAlex Kiernan	  "bootcount" is stored in the environment. To prevent a
4804c96ed2SAlex Kiernan	  saveenv on all reboots, the environment variable
4904c96ed2SAlex Kiernan	  "upgrade_available" is used. If "upgrade_available" is
5004c96ed2SAlex Kiernan	  0, "bootcount" is always 0, if "upgrade_available" is
5104c96ed2SAlex Kiernan	  1 "bootcount" is incremented in the environment.
5204c96ed2SAlex Kiernan	  So the Userspace Application must set the "upgrade_available"
5304c96ed2SAlex Kiernan	  and "bootcount" variable to 0, if a boot was successfully.
5404c96ed2SAlex Kiernan
55ff5410d3SAlex Kiernanconfig BOOTCOUNT_RAM
56ff5410d3SAlex Kiernan	bool "Boot counter in RAM"
57ff5410d3SAlex Kiernan	help
58ff5410d3SAlex Kiernan	  Store the bootcount in DRAM protected against against bit errors
59ff5410d3SAlex Kiernan	  due to short power loss or holding a system in RESET.
60ff5410d3SAlex Kiernan
616cdd70ebSAlex Kiernanconfig BOOTCOUNT_I2C
626cdd70ebSAlex Kiernan	bool "Boot counter on I2C device"
636cdd70ebSAlex Kiernan	help
646cdd70ebSAlex Kiernan	  Enable support for the bootcounter on an i2c (like RTC) device.
656cdd70ebSAlex Kiernan	  CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
666cdd70ebSAlex Kiernan	  CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
676cdd70ebSAlex Kiernan	                              the bootcounter.
686cdd70ebSAlex Kiernan
69bec8c647SAlex Kiernanconfig BOOTCOUNT_AT91
70bec8c647SAlex Kiernan	bool "Boot counter for Atmel AT91SAM9XE"
71bec8c647SAlex Kiernan	depends on AT91SAM9XE
72bec8c647SAlex Kiernan
73c1e1c1ecSAlex Kiernanendchoice
74c1e1c1ecSAlex Kiernan
75*c9ad6bc2SAlex Kiernanconfig BOOTCOUNT_BOOTLIMIT
76*c9ad6bc2SAlex Kiernan	int "Maximum number of reboot cycles allowed"
77*c9ad6bc2SAlex Kiernan	default 0
78*c9ad6bc2SAlex Kiernan	help
79*c9ad6bc2SAlex Kiernan	  Set the Maximum number of reboot cycles allowed without the boot
80*c9ad6bc2SAlex Kiernan	  counter being cleared.
81*c9ad6bc2SAlex Kiernan	  If set to 0 do not set a boot limit in the environment.
82*c9ad6bc2SAlex Kiernan
834bc4f8a6SAlex Kiernanconfig BOOTCOUNT_ALEN
844bc4f8a6SAlex Kiernan	int "I2C address length"
854bc4f8a6SAlex Kiernan	default 1
864bc4f8a6SAlex Kiernan	depends on BOOTCOUNT_I2C
874bc4f8a6SAlex Kiernan	help
884bc4f8a6SAlex Kiernan	  Length of the the I2C address at SYS_BOOTCOUNT_ADDR for storing
894bc4f8a6SAlex Kiernan	  the boot counter.
904bc4f8a6SAlex Kiernan
91c1e1c1ecSAlex Kiernanconfig SYS_BOOTCOUNT_SINGLEWORD
92c1e1c1ecSAlex Kiernan	bool "Use single word to pack boot count and magic value"
93aa5a8632SAlex Kiernan	depends on BOOTCOUNT_GENERIC
94c1e1c1ecSAlex Kiernan	help
95c1e1c1ecSAlex Kiernan	  This option enables packing boot count magic value and boot count
96c1e1c1ecSAlex Kiernan	  into single word (32 bits).
97f31dac4eSIan Ray
98f31dac4eSIan Rayconfig SYS_BOOTCOUNT_EXT_INTERFACE
99f31dac4eSIan Ray	string "Interface on which to find boot counter EXT filesystem"
100f31dac4eSIan Ray	default "mmc"
101f31dac4eSIan Ray	depends on BOOTCOUNT_EXT
102f31dac4eSIan Ray	help
103f31dac4eSIan Ray	  Set the interface to use when locating the filesystem to use for the
104f31dac4eSIan Ray	  boot counter.
105f31dac4eSIan Ray
106f31dac4eSIan Rayconfig SYS_BOOTCOUNT_EXT_DEVPART
107f31dac4eSIan Ray	string "Partition of the boot counter EXT filesystem"
108f31dac4eSIan Ray	default "0:1"
109f31dac4eSIan Ray	depends on BOOTCOUNT_EXT
110f31dac4eSIan Ray	help
111f31dac4eSIan Ray	  Set the partition to use when locating the filesystem to use for the
112f31dac4eSIan Ray	  boot counter.
113f31dac4eSIan Ray
114f31dac4eSIan Rayconfig SYS_BOOTCOUNT_EXT_NAME
115f31dac4eSIan Ray	string "Path and filename of the EXT filesystem based boot counter"
116f31dac4eSIan Ray	default "/boot/failures"
117f31dac4eSIan Ray	depends on BOOTCOUNT_EXT
118f31dac4eSIan Ray	help
119f31dac4eSIan Ray	  Set the filename and path of the file used to store the boot counter.
120f31dac4eSIan Ray
121f31dac4eSIan Rayconfig SYS_BOOTCOUNT_ADDR
122f31dac4eSIan Ray	hex "RAM address used for reading and writing the boot counter"
12339bcbb77STom Rini	default 0x44E3E000 if BOOTCOUNT_AM33XX
12439bcbb77STom Rini	default 0xE0115FF8 if ARCH_LS1043A || ARCH_LS1021A
12539bcbb77STom Rini	depends on BOOTCOUNT_AM33XX || BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
12639bcbb77STom Rini		   BOOTCOUNT_I2C
127f31dac4eSIan Ray	help
128f31dac4eSIan Ray	  Set the address used for reading and writing the boot counter.
129f31dac4eSIan Ray
130f31dac4eSIan Rayendif
131