Kconfig 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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 1,
  61. "bootcount" is incremented in the environment.
  62. So the Userspace Application must set the "upgrade_available"
  63. and "bootcount" variables to 0, if the system booted successfully.
  64. config BOOTCOUNT_RAM
  65. bool "Boot counter in RAM"
  66. help
  67. Store the bootcount in DRAM protected 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. CFG_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_PMIC_PFUZE100
  110. bool "Enable Bootcount driver for PMIC PFUZE100"
  111. depends on DM_PMIC_PFUZE100
  112. help
  113. Enable support for the bootcounter using PMIC PFUZE100 registers.
  114. This works only, if the PMIC is not connected to a battery.
  115. config DM_BOOTCOUNT_SPI_FLASH
  116. bool "Support SPI flash devices as a backing store for bootcount"
  117. depends on DM_SPI_FLASH
  118. help
  119. Enabled reading/writing the bootcount in a DM SPI flash device.
  120. The wrapper device is to be specified with the compatible string
  121. 'u-boot,bootcount-spi-flash' and the 'spi-flash'-property (a phandle
  122. pointing to the underlying SPI flash device) and an optional 'offset'
  123. property are supported.
  124. config BOOTCOUNT_MEM
  125. bool "Support memory based bootcounter"
  126. help
  127. Enabling Memory based bootcount, typically in a SoC register which
  128. is not cleared on softreset.
  129. compatible = "u-boot,bootcount";
  130. config DM_BOOTCOUNT_SYSCON
  131. bool "Support SYSCON devices as a backing store for bootcount"
  132. select REGMAP
  133. select SYSCON
  134. help
  135. Enable reading/writing the bootcount value in a DM SYSCON device.
  136. The driver supports a fixed 32 bits size register using the native
  137. endianness. However, this can be controlled from the SYSCON DT node
  138. configuration.
  139. Accessing the backend is done using the regmap interface.
  140. endmenu
  141. endif
  142. config BOOTCOUNT_BOOTLIMIT
  143. int "Maximum number of reboot cycles allowed"
  144. default 0
  145. help
  146. Set the Maximum number of reboot cycles allowed without the boot
  147. counter being cleared.
  148. If set to 0, do not set a boot limit in the environment.
  149. config BOOTCOUNT_ALEN
  150. int "I2C address length"
  151. default 1
  152. depends on BOOTCOUNT_I2C
  153. help
  154. Length of the the I2C address at SYS_BOOTCOUNT_ADDR for storing
  155. the boot counter.
  156. config SYS_BOOTCOUNT_SINGLEWORD
  157. bool "Use single word to pack boot count and magic value"
  158. depends on BOOTCOUNT_GENERIC
  159. help
  160. This option enables packing boot count magic value and boot count
  161. into single word (32 bits).
  162. config SYS_BOOTCOUNT_EXT_INTERFACE
  163. string "Interface on which to find boot counter EXT filesystem"
  164. default "mmc"
  165. depends on BOOTCOUNT_EXT
  166. help
  167. Set the interface to use when locating the filesystem to use for the
  168. boot counter.
  169. config SYS_BOOTCOUNT_EXT_DEVPART
  170. string "Partition of the boot counter EXT filesystem"
  171. default "0:1"
  172. depends on BOOTCOUNT_EXT
  173. help
  174. Set the partition to use when locating the filesystem to use for the
  175. boot counter.
  176. config SYS_BOOTCOUNT_EXT_NAME
  177. string "Path and filename of the EXT filesystem based boot counter"
  178. default "/boot/failures"
  179. depends on BOOTCOUNT_EXT
  180. help
  181. Set the filename and path of the file used to store the boot counter.
  182. config SYS_BOOTCOUNT_ADDR
  183. hex "RAM address used for reading and writing the boot counter"
  184. default 0x44E3E000 if BOOTCOUNT_AM33XX || BOOTCOUNT_AM33XX_NVMEM
  185. default 0xE0115FF8 if ARCH_LS1043A || ARCH_LS1021A
  186. depends on BOOTCOUNT_AM33XX || BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
  187. BOOTCOUNT_I2C || BOOTCOUNT_AM33XX_NVMEM
  188. help
  189. Set the address used for reading and writing the boot counter.
  190. config SYS_BOOTCOUNT_MAGIC
  191. hex "Magic value for the boot counter"
  192. default 0xB001C041 if BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
  193. BOOTCOUNT_AM33XX || BOOTCOUNT_ENV || \
  194. BOOTCOUNT_RAM || BOOTCOUNT_I2C || \
  195. BOOTCOUNT_AT91 || DM_BOOTCOUNT
  196. default 0xB0 if BOOTCOUNT_AM33XX_NVMEM
  197. depends on BOOTCOUNT_GENERIC || BOOTCOUNT_EXT || \
  198. BOOTCOUNT_AM33XX || BOOTCOUNT_ENV || \
  199. BOOTCOUNT_RAM || BOOTCOUNT_I2C || \
  200. BOOTCOUNT_AT91 || DM_BOOTCOUNT || \
  201. BOOTCOUNT_AM33XX_NVMEM
  202. help
  203. Set the magic value used for the boot counter.
  204. choice
  205. prompt "Endianness of bootcount accessors"
  206. default SYS_BOOTCOUNT_LE
  207. config SYS_BOOTCOUNT_LE
  208. bool "Little endian accessors"
  209. config SYS_BOOTCOUNT_BE
  210. bool "Big endian accessors"
  211. endchoice
  212. endif