summaryrefslogtreecommitdiff
path: root/drivers/bootcount
AgeCommit message (Collapse)Author
2022-12-05global: Move remaining CONFIG_SYS_* to CFG_SYS_*Tom Rini
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-11bootcount: pmic: Correct misleading commentPhilip Oberfichtner
Fix a copy-paste error I did when inserting the comment. Signed-off-by: Philip Oberfichtner <pro@denx.de> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-07-07Convert CONFIG_SYS_BOOTCOUNT_LE et al to KconfigTom Rini
This converts the following to Kconfig: CONFIG_SYS_BOOTCOUNT_LE CONFIG_SYS_BOOTCOUNT_BE Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-28Merge tag 'v2022.04-rc5' into nextTom Rini
Prepare v2022.04-rc5
2022-03-25bootcount: Add pmic pfuze100 bootcount driverPhilip Oberfichtner
Use the MEMA - MEMD registers on the PFUZE100 as bootcount registers. Based on work from Heiko Schocher <hs@denx.de>. Signed-off-by: Philip Oberfichtner <pro@denx.de>
2022-03-23bootcount: clarify documentationMichael Opdenacker
- Grammar fixes - Clarify explanations Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-01-28bootcount: fix printf() codeHeinrich Schuchardt
For printing phys_addr_t we should use %pa to avoid warning like: drivers/bootcount/bootcount_syscon.c:110:17: note: in expansion of macro ‘dev_err’ 110 | dev_err(dev, "%s: Unsupported register size: %d\n", __func__, | ^~~~~~~ seen for sandbox_defconfig with CONFIG_PHYS_64BIT=y. Cf. commit 1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-08-22bootcount: add a new driver with syscon as backendNandor Han
The driver will use a syscon regmap as backend and supports both 16 and 32 size value. The value will be stored in the CPU's endianness. Signed-off-by: Nandor Han <nandor.han@vaisala.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-15am335x, guardian: software update available status is stored in AM3352 RTC ↵Gireesh Hiremath
scracth register RTC second scratch register[32-bit]: -zero byte hold boot count value -first byte hold update available state -second byte hold version -third byte hold magic number Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Link: https://lore.kernel.org/r/20210611161350.2141-17-Gireesh.Hiremath@in.bosch.com Gbp-Pq: Topic apertis/guardian Gbp-Pq: Name am335x-guardian-software-update-available-status-is-store.patch
2021-07-06dm: define LOG_CATEGORY for all uclassPatrick Delaunay
Define LOG_CATEGORY for all uclass to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-12-13dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-01bootcount: add a DM SPI flash backing store for bootcountSebastian Reichel
This driver allows to use SPI flash as backing store for boot counter values with DM enabled. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-06-02bootcount_ext: Add Ext4 build dependencyFrédéric Danis
This config option depends on EXT4 support. If Ext4 write capability is not selected, it generate write error messages and is unable to maintain boot counter. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop net.h from common headerSimon Glass
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-24bootcount_ext: Add flag to enable/disable bootcountFrédéric Danis
After a successful upgrade, multiple problem during boot sequence may trigger the altbootcmd process. This patch adds a version and an upgrade_available entries to the bootcount file to enable/disable the bootcount check. When failing to read the bootcount file it will consider that bootcount is enabled, acting as previously, and update the file accordingly. The bootcount file is only saved when `upgrade_available` is true, this allows to save writes to the filesystem. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-16bootcounter: add DM support for memory based bootcounterHeiko Schocher
add DM/DTS support for the memory based bootcounter in drivers/bootcount/bootcount.c. Let the old implementation in, so boards which have not yet convert to DM/DTS do not break. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-01-10bootcount: add a DM i2c eeprom backing store for bootcountRobert Beckett
This driver allows the use of i2c eeprom device or partition as backing store for boot counter values with DM enabled. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
2019-12-02common: Move ARM cache operations out of common.hSimon Glass
These functions are CPU-related and do not use driver model. Move them to cpu_func.h Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-08-11env: Drop environment.h header file where not neededSimon Glass
This header file is now only used by files that access internal environment features. Drop it from various places where it is not needed. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set_ulong() to env.hSimon Glass
Move env_set_ulong() over to the new header file. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-12-10bootcount: add a DM RTC backing store for bootcountPhilipp Tomsich
This implements a driver using a RTC-based backing store for the DM bootcount implementation. The node configuring this feature will be compatible with 'u-boot,bootcount-rtc' and the underlying RTC device shall be reference through the property 'rtc'. An offset into the RTC device's register space can be provided through the 'offset' property. Tested on a RK3399-Q7 on a Flamingo carrier board using the SRAM area of the carrier board's RV3029 RTC. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-10bootcount: add uclass for bootcountPhilipp Tomsich
The original bootcount methods do not provide an interface to DM and rely on a static configuration for I2C devices (e.g. bus, chip-addr, etc. are configured through defines statically). On a modern system that exposes multiple devices in a DTS-configurable way, this is less than optimal and a interface to DM-based devices will be desirable. This adds a simple driver that is DM-aware and configurable via DTS. If ambiguous (i.e. multiple bootcount-devices are present) the /chosen/u-boot,bootcount-device property can be used to select one bootcount device. Initially, this provides support for the following DM devices: * RTC devices Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-10-19bootcount: Make bootcount magic configurableMarek Vasut
Add new Kconfig option, SYS_BOOTCOUNT_MAGIC, to select the boot counter magic word. This can be useful ie. in case the entire boot counter register is not usable. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com>
2018-08-17Add BOOTCOUNT_BOOTLIMIT to set reboot limitAlex Kiernan
Add ability to set environment bootlimit from Kconfig Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-08-03bootcount: Fix misaligned cache operationAlex Kiernan
1947c2d2a0 introduces cache line flushes for the bootcounter, but if the start address is not aligned then the flush causes warnings of the form: CACHE: Misaligned operation at range [4030b7fc, 4030b83c] Align both the start and end of the buffer (possibly crossing multiple lines). Fixes: 1947c2d2a0 ("bootcount: flush after storing the bootcounter") Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Acked-by: Stefano Babic <sbabic@denx.de>
2018-07-23bootcount: flush after storing the bootcounterStefano Babic
If the bootcounter address is in a cached memory, a flush of dcache must occur after updateing the bootcounter. Issue found on i.MX6 where bootcounter is put into the internal (cached) IRAM. Signed-off-by: Stefano Babic <sbabic@denx.de>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-06Migrate CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSCAlex Kiernan
This converts CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC to Kconfig Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-25bootcount: Migrate CONFIG_SYS_BOOTCOUNT_ADDRTom Rini
Migrate the users of CONFIG_SYS_BOOTCOUNT_ADDR to Kconfig. We can provide a default for BOOTCOUNT_AM33XX as that's a specific part of the RTC in use. We can also provide a default for ARCH_LS1043A and ARCH_LS1021A as they had been previously calculated and their symbols are in Kconfig. In the case of other QE-enabled platforms, they are not so we must update the relevant defconfig files. The previous default only applied in some cases, even on a specific SoC family. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-02-24Migrate CONFIG_BOOTCOUNT_ALEN to KconfigAlex Kiernan
Convert CONFIG_BOOTCOUNT_ALEN to Kconfig Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-24Migrate generic bootcount to KconfigAlex Kiernan
Make generate boot counter selected in the same way as other boot count drivers Reviewed-by: Lukasz Majewski <lukma@denx.de> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-24Integrate AT91 bootcount driverAlex Kiernan
Integrate Boot counter for Atmel AT91SAM9XE into Kconfig Reviewed-by: Lukasz Majewski <lukma@denx.de> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-24Convert CONFIG_BOOTCOUNT_I2C to KconfigAlex Kiernan
This converts the following to Kconfig: CONFIG_BOOTCOUNT_I2C Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-02-24Convert CONFIG_BOOTCOUNT_RAM to KconfigAlex Kiernan
This converts the following to Kconfig: CONFIG_BOOTCOUNT_RAM Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-02-24Convert CONFIG_BOOTCOUNT_ENV to KconfigAlex Kiernan
This converts the following to Kconfig: CONFIG_BOOTCOUNT_ENV Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-02-24Convert CONFIG_BOOTCOUNT_AM33XX to KconfigAlex Kiernan
This converts the following to Kconfig: CONFIG_BOOTCOUNT_AM33XX Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Acked-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-24Prepare for multiple bootcount driversAlex Kiernan
Reviewed-by: Lukasz Majewski <lukma@denx.de> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-24Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMITAlex Kiernan
CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with CONFIG_BOOTCOUNT_LIMIT Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-02-15Convert CONFIG_SYS_BOOTCOUNT_SINGLEWORD to KconfigLukasz Majewski
This converts the following to Kconfig: CONFIG_SYS_BOOTCOUNT_SINGLEWORD Signed-off-by: Lukasz Majewski <lukma@denx.de> Tested-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-02-15Convert CONFIG_BOOTCOUNT_LIMIT to KconfigLukasz Majewski
This converts the following to Kconfig: CONFIG_BOOTCOUNT_LIMIT Signed-off-by: Lukasz Majewski <lukma@denx.de> Tested-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> Acked-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2017-11-20bootcount: add support for bootcounter on EXT filesystemIan Ray
Add support for bootcounter on an EXT filesystem. Sync configuration whitelist. Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
2017-09-12cosmetic: bootcount: correct comment for used scratch registerTomas Melin
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
2017-08-16env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()Simon Glass
We are now using an env_ prefix for environment functions. Rename these for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename common functions related to setenv()Simon Glass
We are now using an env_ prefix for environment functions. Rename these commonly used functions, for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-15env: Drop saveenv() in favour of env_save()Simon Glass
Use the env_save() function directly now that there is only one implementation of saveenv(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-07-03powerpc: remove 4xx supportHeiko Schocher
There was for long time no activity in the 4xx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 4xx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-16powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512xHeiko Schocher
There was for long time no activity in the mpx5xxx area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in mpc5xxx, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12powerpc, 8260: remove support for mpc8260Heiko Schocher
There was for long time no activity in the 8260 area. We need to go further and convert to Kconfig, but it turned out, nobody is interested anymore in 8260, so remove it. Signed-off-by: Heiko Schocher <hs@denx.de>