summaryrefslogtreecommitdiffstats
path: root/drivers/bootcount
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-11-09 12:51:47 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-11-09 22:59:47 +0100
commit85b8c5c4bf80025de4632ae6c9a8a606e51508a4 (patch)
tree7a89b428296ab5baca8f07c4019e3485e452cf42 /drivers/bootcount
parent15c5cdf5aa6b292145e5e3e220ec1f42b11eff6f (diff)
parent3285d4ca197928a048d3dda86751b5d26e6e0e86 (diff)
downloadblackbird-obmc-uboot-85b8c5c4bf80025de4632ae6c9a8a606e51508a4.tar.gz
blackbird-obmc-uboot-85b8c5c4bf80025de4632ae6c9a8a606e51508a4.zip
Merge branch 'iu-boot/master' into 'u-boot-arm/master'
Conflicts: arch/arm/cpu/arm926ejs/mxs/Makefile board/compulab/cm_t35/Makefile board/corscience/tricorder/Makefile board/ppcag/bg0900/Makefile drivers/bootcount/Makefile include/configs/omap4_common.h include/configs/pdnb3.h Makefile conflicts are due to additions/removals of object files on the ARM branch vs KBuild introduction on the main branch. Resolution consists in adjusting the list of object files in the main branch version. This also applies to two files which are not listed as conflicting but had to be modified: board/compulab/common/Makefile board/udoo/Makefile include/configs/omap4_common.h conflicts are due to the OMAP4 conversion to ti_armv7_common.h on the ARM side, and CONFIG_SYS_HZ removal on the main side. Resolution is to convert as this icludes removal of CONFIG_SYS_HZ. include/configs/pdnb3.h is due to a removal on ARM side. Trivial resolution is to remove the file. Note: 'git show' will also list two files just because they are new: include/configs/am335x_igep0033.h include/configs/omap3_igep00x0.h
Diffstat (limited to 'drivers/bootcount')
-rw-r--r--drivers/bootcount/Makefile1
-rw-r--r--drivers/bootcount/bootcount_davinci.c13
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
index 012acef9dd..8256ed0f46 100644
--- a/drivers/bootcount/Makefile
+++ b/drivers/bootcount/Makefile
@@ -6,4 +6,5 @@ obj-y += bootcount.o
obj-$(CONFIG_AT91SAM9XE) += bootcount_at91.o
obj-$(CONFIG_BLACKFIN) += bootcount_blackfin.o
obj-$(CONFIG_SOC_DA8XX) += bootcount_davinci.o
+obj-$(CONFIG_AM33XX) += bootcount_davinci.o
obj-$(CONFIG_BOOTCOUNT_RAM) += bootcount_ram.o
diff --git a/drivers/bootcount/bootcount_davinci.c b/drivers/bootcount/bootcount_davinci.c
index efa4d42cbf..f0acfad805 100644
--- a/drivers/bootcount/bootcount_davinci.c
+++ b/drivers/bootcount/bootcount_davinci.c
@@ -6,8 +6,7 @@
*/
#include <bootcount.h>
-#include <asm/arch/da850_lowlevel.h>
-#include <asm/arch/davinci_misc.h>
+#include <asm/davinci_rtc.h>
void bootcount_store(ulong a)
{
@@ -21,17 +20,19 @@ void bootcount_store(ulong a)
*/
writel(RTC_KICK0R_WE, &reg->kick0r);
writel(RTC_KICK1R_WE, &reg->kick1r);
- raw_bootcount_store(&reg->scratch0, a);
- raw_bootcount_store(&reg->scratch1, BOOTCOUNT_MAGIC);
+ raw_bootcount_store(&reg->scratch2,
+ (BOOTCOUNT_MAGIC & 0xffff0000) | (a & 0x0000ffff));
}
ulong bootcount_load(void)
{
+ unsigned long val;
struct davinci_rtc *reg =
(struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
- if (raw_bootcount_load(&reg->scratch1) != BOOTCOUNT_MAGIC)
+ val = raw_bootcount_load(&reg->scratch2);
+ if ((val & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
return 0;
else
- return raw_bootcount_load(&reg->scratch0);
+ return val & 0x0000ffff;
}
OpenPOWER on IntegriCloud