Kconfig 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. #
  2. # Boot count configuration
  3. #
  4. menuconfig BOOTCOUNT_LIMIT
  5. bool "Enable support for checking boot count limit"
  6. help
  7. Enable checking for exceeding the boot count limit.
  8. More information: http://www.denx.de/wiki/DULG/UBootBootCountLimit
  9. if BOOTCOUNT_LIMIT
  10. choice
  11. prompt "Boot count device"
  12. default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
  13. default BOOTCOUNT_AT91 if AT91SAM9XE
  14. default BOOTCOUNT_GENERIC
  15. config BOOTCOUNT_GENERIC
  16. bool "Generic default boot counter"
  17. help
  18. Generic bootcount stored at SYS_BOOTCOUNT_ADDR.
  19. SYS_BOOTCOUNT_ADDR:
  20. Set to the address where the bootcount and bootcount magic
  21. will be stored.
  22. config BOOTCOUNT_EXT
  23. bool "Boot counter on EXT filesystem"
  24. depends on FS_EXT4
  25. select EXT4_WRITE
  26. help
  27. Add support for maintaining boot count in a file on an EXT
  28. filesystem.
  29. config BOOTCOUNT_AM33XX
  30. bool "Boot counter in AM33XX RTC IP block"
  31. depends on AM33XX || SOC_DA8XX
  32. select SPL_AM33XX_ENABLE_RTC32K_OSC if AM33XX
  33. help
  34. A bootcount driver for the RTC IP block found on many TI platforms.
  35. This requires the RTC clocks, etc, to be enabled prior to use and
  36. not all boards with this IP block on it will have the RTC in use.
  37. config BOOTCOUNT_AM33XX_NVMEM
  38. bool "Boot counter in AM33XX RTC IP block with upgrade_available flag"
  39. depends on AM33XX
  40. select SPL_AM33XX_ENABLE_RTC32K_OSC if AM33XX
  41. help
  42. Add support for maintaining bootcount,upgrade_available,
  43. version and BOOTMAGIC in a AM33xx RTC IP block
  44. scratch register2.
  45. A bootcount driver for the RTC IP block found on many TI platforms.
  46. This requires the RTC clocks, etc, to be enabled prior to use and
  47. not all boards with this IP block on it will have the RTC in use.
  48. If there is upgrade in software then "upgrade_available" is 1,
  49. "bootcount" is incremented otherwise "upgrade_available" and
  50. "bootcount" is always 0. So the Userspace Application must set
  51. the "upgrade_available" and "bootcount" variable to 0, if a boot
  52. was successfully.
  53. config BOOTCOUNT_ENV
  54. bool "Boot counter in environment"
  55. help
  56. If no softreset save registers are found on the hardware
  57. "bootcount" is stored in the environment. To prevent a
  58. saveenv on all reboots, the environment variable
  59. "upgrade_available" is used. If "upgrade_available" is
  60. 0, "bootcount" is always 0, if "upgrade_available" is
  61. 1 "bootcount" is incremented in the environment.
  62. So the Userspace Application must set the "upgrade_available"
  63. and "bootcount" variable to 0, if a boot was successfully.
  64. config BOOTCOUNT_RAM
  65. bool "Boot counter in RAM"
  66. help
  67. Store the bootcount in DRAM protected against against bit errors
  68. due to short power loss or holding a system in RESET.
  69. config BOOTCOUNT_I2C
  70. bool "Boot counter on I2C device"
  71. help
  72. Enable support for the bootcounter on an i2c (like RTC) device.
  73. CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
  74. CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
  75. the bootcounter.
  76. config BOOTCOUNT_AT91
  77. bool "Boot counter for Atmel AT91SAM9XE"
  78. depends on AT91SAM9XE
  79. config DM_BOOTCOUNT
  80. bool "Boot counter in a device-model device"
  81. help
  82. Enables reading/writing the bootcount in a device-model based
  83. backing store. If an entry in /chosen/u-boot,bootcount-device
  84. exists, this will be the preferred bootcount device; otherwise
  85. the first available bootcount device will be used.
  86. endchoice
  87. if DM_BOOTCOUNT
  88. menu "Backing stores for device-model backed bootcount"
  89. config DM_BOOTCOUNT_RTC
  90. bool "Support RTC devices as a backing store for bootcount"
  91. depends on DM_RTC
  92. help
  93. Enabled reading/writing the bootcount in a DM RTC device.
  94. The wrapper device is to be specified with the compatible string
  95. 'u-boot,bootcount-rtc' and the 'rtc'-property (a phandle pointing
  96. to the underlying RTC device) and an optional 'offset' property
  97. are supported.
  98. Accesses to the backing store are performed using the write16
  99. and read16 ops of DM RTC devices.
  100. config DM_BOOTCOUNT_I2C_EEPROM
  101. bool "Support i2c eeprom devices as a backing store for bootcount"
  102. depends on I2C_EEPROM
  103. help
  104. Enabled reading/writing the bootcount in a DM i2c eeprom device.
  105. The wrapper device is to be specified with the compatible string
  106. 'u-boot,bootcount-i2c-eeprom' and the 'i2c-eeprom'-property (a phandle
  107. pointing to the underlying i2c eeprom device) and an optional 'offset'
  108. property are supported.
  109. config DM_BOOTCOUNT_SPI_FLASH
  110. bool "Support SPI flash devices as a backing store for bootcount"
  111. depends on DM_SPI_FLASH
  112. help
  113. Enabled reading/writing the bootcount in a DM SPI flash device.
  114. The wrapper device is to be specified with the compatible string
  115. 'u-boot,bootcount-spi-flash' and the 'spi-flash'-property (a phandle
  116. pointing to the underlying SPI flash device) and an optional 'offset'
  117. property are supported.
  118. config BOOTCOUNT_MEM
  119. bool "Support memory based bootcounter"
  120. help
  121. Enabling Memory based bootcount, typically in a SoC register which
  122. is not cleared on softreset.
  123. compatible = "u-boot,bootcount";
  124. config DM_BOOTCOUNT_SYSCON
  125. bool "Support SYSCON devices as a backing store for bootcount"
  126. select REGMAP
  127. select SYSCON
  128. help
  129. Enable reading/writing the bootcount value in a DM SYSCON device.
  130. The driver supports a fixed 32 bits size register using the native
  131. endianness. However, this can be controlled from the SYSCON DT node
  132. configuration.
  133. Accessing the backend is done using the regmap interface.
  134. endmenu
  135. endif
  136. config BOOTCOUNT_BOOTLIMIT
  137. int "Maximum number of reboot cycles allowed"
  138. default 0
  139. help
  140. Set the Maximum number of reboot cycles allowed without the boot
  141. counter being cleared.
  142. If set to 0 do not set a boot limit in the environment.
  143. config BOOTCOUNT_ALEN
  144. int "I2C address length"
  145. default 1
  146. depends on BOOTCOUNT_I2C
  147. help
  148. Length of the the I2C address at SYS_BOOTCOUNT_ADDR for storing
  149. the boot counter.
  150. config SYS_BOOTCOUNT_SINGLEWORD
  151. bool "Use single word to pack boot count and magic value"
  152. depends on BOOTCOUNT_GENERIC
  153. help
  154. This option enables packing boot count magic value and boot count
  155. into single word (32 bits).
  156. config SYS_BOOTCOUNT_EXT_INTERFACE
  157. string "Interface on which to find boot counter EXT filesystem"
  158. default "mmc"
  159. depends on BOOTCOUNT_EXT
  160. help
  161. Set the interface to use when locating the filesystem to use for the
  162. boot counter.
  163. config SYS_BOOTCOUNT_EXT_DEVPART
  164. string "Partition of the boot counter EXT filesystem"
  165. default "0:1"
  166. depends on BOOTCOUNT_EXT
  167. help
  168. Set the partition to use when locating the filesystem to use for the
  169. boot counter.
  170. config SYS_BOOTCOUNT_EXT_NAME
  171. string "Path and filename of the EXT filesystem based boot counter"
  172. default "/boot/failures"
  173. depends on BOOTCOUNT_EXT
  174. help
  175. Set the filename and path of the file used to store the boot counter.
  176. config SYS_BOOTCOUNT_ADDR
  177. hex "RAM address used for reading and writing the boot counter"
  178. default 0x44E3E000 if BOOTCOUNT_AM33XX || BOOTCOUNT_AM33XX_NVMEM
  179. default 0xE0115FF8 if ARCH_LS1043A || ARCH_LS1021A
  180. depends on BOOTCOUNT_AM33XX || BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
  181. BOOTCOUNT_I2C || BOOTCOUNT_AM33XX_NVMEM
  182. help
  183. Set the address used for reading and writing the boot counter.
  184. config SYS_BOOTCOUNT_MAGIC
  185. hex "Magic value for the boot counter"
  186. default 0xB001C041 if BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
  187. BOOTCOUNT_AM33XX || BOOTCOUNT_ENV || \
  188. BOOTCOUNT_RAM || BOOTCOUNT_I2C || \
  189. BOOTCOUNT_AT91 || DM_BOOTCOUNT
  190. default 0xB0 if BOOTCOUNT_AM33XX_NVMEM
  191. depends on BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
  192. BOOTCOUNT_AM33XX || BOOTCOUNT_ENV || \
  193. BOOTCOUNT_RAM || BOOTCOUNT_I2C || \
  194. BOOTCOUNT_AT91 || DM_BOOTCOUNT || \
  195. BOOTCOUNT_AM33XX_NVMEM
  196. help
  197. Set the magic value used for the boot counter.
  198. endif