#
# Boot count configuration
#

menuconfig BOOTCOUNT_LIMIT
	bool "Enable support for checking boot count limit"
	help
	  Enable checking for exceeding the boot count limit.
	  More information: http://www.denx.de/wiki/DULG/UBootBootCountLimit

if BOOTCOUNT_LIMIT

choice
	prompt "Boot count device"
	default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
	default BOOTCOUNT_AT91 if AT91SAM9XE
	default BOOTCOUNT_GENERIC

config BOOTCOUNT_GENERIC
	bool "Generic default boot counter"
	help
	  Generic bootcount stored at SYS_BOOTCOUNT_ADDR.

	  SYS_BOOTCOUNT_ADDR:
	    Set to the address where the bootcount and bootcount magic
	    will be stored.

config BOOTCOUNT_EXT
	bool "Boot counter on EXT filesystem"
	depends on FS_EXT4
	select EXT4_WRITE
	help
	  Add support for maintaining boot count in a file on an EXT
	  filesystem.

config BOOTCOUNT_AM33XX
	bool "Boot counter in AM33XX RTC IP block"
	depends on AM33XX || SOC_DA8XX
	select SPL_AM33XX_ENABLE_RTC32K_OSC if AM33XX
	help
	  A bootcount driver for the RTC IP block found on many TI platforms.
	  This requires the RTC clocks, etc, to be enabled prior to use and
	  not all boards with this IP block on it will have the RTC in use.

config BOOTCOUNT_AM33XX_NVMEM
	bool "Boot counter in AM33XX RTC IP block with upgrade_available flag"
	depends on AM33XX
        select SPL_AM33XX_ENABLE_RTC32K_OSC if AM33XX
	help
	  Add support for maintaining bootcount,upgrade_available,
	  version and BOOTMAGIC in a AM33xx RTC IP block
	  scratch register2.

	  A bootcount driver for the RTC IP block found on many TI platforms.
	  This requires the RTC clocks, etc, to be enabled prior to use and
	  not all boards with this IP block on it will have the RTC in use.

	  If there is upgrade in software then "upgrade_available" is 1,
	  "bootcount" is incremented otherwise "upgrade_available" and
	  "bootcount" is  always 0. So the Userspace Application must set
	  the "upgrade_available" and "bootcount" variable to 0, if a boot
	  was successfully.

config BOOTCOUNT_ENV
	bool "Boot counter in environment"
	help
	  If no softreset save registers are found on the hardware
	  "bootcount" is stored in the environment. To prevent a
	  saveenv on all reboots, the environment variable
	  "upgrade_available" is used. If "upgrade_available" is
	  0, "bootcount" is always 0, if "upgrade_available" is
	  1 "bootcount" is incremented in the environment.
	  So the Userspace Application must set the "upgrade_available"
	  and "bootcount" variable to 0, if a boot was successfully.

config BOOTCOUNT_RAM
	bool "Boot counter in RAM"
	help
	  Store the bootcount in DRAM protected against against bit errors
	  due to short power loss or holding a system in RESET.

config BOOTCOUNT_I2C
	bool "Boot counter on I2C device"
	help
	  Enable support for the bootcounter on an i2c (like RTC) device.
	  CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
	  CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
	                              the bootcounter.

config BOOTCOUNT_AT91
	bool "Boot counter for Atmel AT91SAM9XE"
	depends on AT91SAM9XE

config DM_BOOTCOUNT
        bool "Boot counter in a device-model device"
	help
	  Enables reading/writing the bootcount in a device-model based
	  backing store.  If an entry in /chosen/u-boot,bootcount-device
	  exists, this will be the preferred bootcount device; otherwise
	  the first available bootcount device will be used.

endchoice

if DM_BOOTCOUNT

menu "Backing stores for device-model backed bootcount"
config DM_BOOTCOUNT_RTC
	bool "Support RTC devices as a backing store for bootcount"
	depends on DM_RTC
	help
	  Enabled reading/writing the bootcount in a DM RTC device.
	  The wrapper device is to be specified with the compatible string
	  'u-boot,bootcount-rtc' and the 'rtc'-property (a phandle pointing
	  to the underlying RTC device) and an optional 'offset' property
	  are supported.

	  Accesses to the backing store are performed using the write16
	  and read16 ops of DM RTC devices.

config DM_BOOTCOUNT_I2C_EEPROM
	bool "Support i2c eeprom devices as a backing store for bootcount"
	depends on I2C_EEPROM
	help
	  Enabled reading/writing the bootcount in a DM i2c eeprom device.
	  The wrapper device is to be specified with the compatible string
	  'u-boot,bootcount-i2c-eeprom' and the 'i2c-eeprom'-property (a phandle
	  pointing to the underlying i2c eeprom device) and an optional 'offset'
	  property are supported.

config DM_BOOTCOUNT_SPI_FLASH
	bool "Support SPI flash devices as a backing store for bootcount"
	depends on DM_SPI_FLASH
	help
	  Enabled reading/writing the bootcount in a DM SPI flash device.
	  The wrapper device is to be specified with the compatible string
	  'u-boot,bootcount-spi-flash' and the 'spi-flash'-property (a phandle
	  pointing to the underlying SPI flash device) and an optional 'offset'
	  property are supported.

config BOOTCOUNT_MEM
	bool "Support memory based bootcounter"
	help
	  Enabling Memory based bootcount, typically in a SoC register which
	  is not cleared on softreset.
	  compatible = "u-boot,bootcount";

endmenu

endif

config BOOTCOUNT_BOOTLIMIT
	int "Maximum number of reboot cycles allowed"
	default 0
	help
	  Set the Maximum number of reboot cycles allowed without the boot
	  counter being cleared.
	  If set to 0 do not set a boot limit in the environment.

config BOOTCOUNT_ALEN
	int "I2C address length"
	default 1
	depends on BOOTCOUNT_I2C
	help
	  Length of the the I2C address at SYS_BOOTCOUNT_ADDR for storing
	  the boot counter.

config SYS_BOOTCOUNT_SINGLEWORD
	bool "Use single word to pack boot count and magic value"
	depends on BOOTCOUNT_GENERIC
	help
	  This option enables packing boot count magic value and boot count
	  into single word (32 bits).

config SYS_BOOTCOUNT_EXT_INTERFACE
	string "Interface on which to find boot counter EXT filesystem"
	default "mmc"
	depends on BOOTCOUNT_EXT
	help
	  Set the interface to use when locating the filesystem to use for the
	  boot counter.

config SYS_BOOTCOUNT_EXT_DEVPART
	string "Partition of the boot counter EXT filesystem"
	default "0:1"
	depends on BOOTCOUNT_EXT
	help
	  Set the partition to use when locating the filesystem to use for the
	  boot counter.

config SYS_BOOTCOUNT_EXT_NAME
	string "Path and filename of the EXT filesystem based boot counter"
	default "/boot/failures"
	depends on BOOTCOUNT_EXT
	help
	  Set the filename and path of the file used to store the boot counter.

config SYS_BOOTCOUNT_ADDR
	hex "RAM address used for reading and writing the boot counter"
	default 0x44E3E000 if BOOTCOUNT_AM33XX || BOOTCOUNT_AM33XX_NVMEM
	default 0xE0115FF8 if ARCH_LS1043A || ARCH_LS1021A
	depends on BOOTCOUNT_AM33XX || BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
		   BOOTCOUNT_I2C || BOOTCOUNT_AM33XX_NVMEM
	help
	  Set the address used for reading and writing the boot counter.

config SYS_BOOTCOUNT_MAGIC
	hex "Magic value for the boot counter"
	default 0xB001C041 if BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
			      BOOTCOUNT_AM33XX || BOOTCOUNT_ENV || \
			      BOOTCOUNT_RAM || BOOTCOUNT_I2C || \
			      BOOTCOUNT_AT91 || DM_BOOTCOUNT
	default 0xB0 if BOOTCOUNT_AM33XX_NVMEM
	depends on BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
		   BOOTCOUNT_AM33XX || BOOTCOUNT_ENV || \
		   BOOTCOUNT_RAM || BOOTCOUNT_I2C || \
		   BOOTCOUNT_AT91 || DM_BOOTCOUNT || \
		   BOOTCOUNT_AM33XX_NVMEM
	help
	  Set the magic value used for the boot counter.

endif
