* [U-Boot-Users] [PATCH] 4xx: Add bootcount limit handling for APC405 boards
@ 2008-04-24 9:33 Matthias Fuchs
2008-04-24 14:58 ` Stefan Roese
0 siblings, 1 reply; 4+ messages in thread
From: Matthias Fuchs @ 2008-04-24 9:33 UTC (permalink / raw)
To: u-boot
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
board/esd/apc405/apc405.c | 7 ++++++-
include/configs/APC405.h | 14 ++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/board/esd/apc405/apc405.c b/board/esd/apc405/apc405.c
index b663184..2cb743e 100644
--- a/board/esd/apc405/apc405.c
+++ b/board/esd/apc405/apc405.c
@@ -385,11 +385,16 @@ int misc_init_r(void)
}
out_be16((u16 *)(FUJI_BASE + LCDBL_PWM), 0xff);
- if (getenv("usb_self") == NULL) {
+ /*
+ * fix environment for field updated units
+ */
+ if (getenv("altbootcmd") == NULL) {
setenv("usb_load", CFG_USB_LOAD_COMMAND);
setenv("usbargs", CFG_USB_ARGS);
setenv("bootcmd", CONFIG_BOOTCOMMAND);
setenv("usb_self", CFG_USB_SELF_COMMAND);
+ setenv("bootlimit", CFG_BOOTLIMIT);
+ setenv("altbootcmd", CFG_ALT_BOOTCOMMAND);
saveenv();
}
diff --git a/include/configs/APC405.h b/include/configs/APC405.h
index 5b04888..3402db9 100644
--- a/include/configs/APC405.h
+++ b/include/configs/APC405.h
@@ -48,6 +48,7 @@
#define CONFIG_BAUDRATE 115200
#define CONFIG_BOOTDELAY 1 /* autoboot after 3 seconds */
+#define CONFIG_BOOTCOUNT_LIMIT 1
#undef CONFIG_BOOTARGS
@@ -57,6 +58,8 @@
"run ramargs addip addcon usbargs;" \
"bootm 200000 300000"
#define CFG_USB_ARGS "setenv bootargs $(bootargs) usbboot=1"
+#define CFG_BOOTLIMIT "3"
+#define CFG_ALT_BOOTCOMMAND "run usb_self;reset"
#define CONFIG_EXTRA_ENV_SETTINGS \
"hostname=abg405\0" \
@@ -88,8 +91,10 @@
"usb_load="CFG_USB_LOAD_COMMAND"\0" \
"usb_self="CFG_USB_SELF_COMMAND"\0" \
"usbargs="CFG_USB_ARGS"\0" \
+ "bootlimit="CFG_BOOTLIMIT"\0" \
+ "altbootcmd="CFG_ALT_BOOTCOMMAND"\0" \
""
-#define CONFIG_BOOTCOMMAND "run flash_self;run usb_self"
+#define CONFIG_BOOTCOMMAND "run flash_self;reset"
#define CONFIG_ETHADDR 00:02:27:8e:00:00
@@ -414,7 +419,12 @@ extern int flash_banks;
#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of used area in RAM */
#define CFG_GBL_DATA_SIZE 128 /* reserved bytes for initial data */
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
-#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+/* reserve some memory for BOOT limit info */
+#define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - 16)
+
+#ifdef CONFIG_BOOTCOUNT_LIMIT /* reserve 2 word for bootcount limit */
+#define CFG_BOOTCOUNT_ADDR (CFG_GBL_DATA_OFFSET - 8)
+#endif
/*
* Internal Definitions
--
1.5.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot-Users] [PATCH] 4xx: Add bootcount limit handling for APC405 boards
2008-04-24 9:33 [U-Boot-Users] [PATCH] 4xx: Add bootcount limit handling for APC405 boards Matthias Fuchs
@ 2008-04-24 14:58 ` Stefan Roese
2008-04-25 10:01 ` [U-Boot-Users] [PATCH V2] ppc4xx: " Matthias Fuchs
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Roese @ 2008-04-24 14:58 UTC (permalink / raw)
To: u-boot
On Thursday 24 April 2008, Matthias Fuchs wrote:
> Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
This patch does not apply anymore. Please resubmit against the latest
u-boot-ppc4xx repository.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot-Users] [PATCH V2] ppc4xx: Add bootcount limit handling for APC405 boards
2008-04-24 14:58 ` Stefan Roese
@ 2008-04-25 10:01 ` Matthias Fuchs
2008-04-25 11:38 ` Stefan Roese
0 siblings, 1 reply; 4+ messages in thread
From: Matthias Fuchs @ 2008-04-25 10:01 UTC (permalink / raw)
To: u-boot
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
board/esd/apc405/apc405.c | 7 ++++++-
include/configs/APC405.h | 14 ++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/board/esd/apc405/apc405.c b/board/esd/apc405/apc405.c
index b663184..2cb743e 100644
--- a/board/esd/apc405/apc405.c
+++ b/board/esd/apc405/apc405.c
@@ -385,11 +385,16 @@ int misc_init_r(void)
}
out_be16((u16 *)(FUJI_BASE + LCDBL_PWM), 0xff);
- if (getenv("usb_self") == NULL) {
+ /*
+ * fix environment for field updated units
+ */
+ if (getenv("altbootcmd") == NULL) {
setenv("usb_load", CFG_USB_LOAD_COMMAND);
setenv("usbargs", CFG_USB_ARGS);
setenv("bootcmd", CONFIG_BOOTCOMMAND);
setenv("usb_self", CFG_USB_SELF_COMMAND);
+ setenv("bootlimit", CFG_BOOTLIMIT);
+ setenv("altbootcmd", CFG_ALT_BOOTCOMMAND);
saveenv();
}
diff --git a/include/configs/APC405.h b/include/configs/APC405.h
index e2ab39d..8ad33f1 100644
--- a/include/configs/APC405.h
+++ b/include/configs/APC405.h
@@ -48,6 +48,7 @@
#define CONFIG_BAUDRATE 115200
#define CONFIG_BOOTDELAY 1 /* autoboot after 3 seconds */
+#define CONFIG_BOOTCOUNT_LIMIT 1
#undef CONFIG_BOOTARGS
@@ -57,6 +58,8 @@
"run ramargs addip addcon usbargs;" \
"bootm 200000 300000"
#define CFG_USB_ARGS "setenv bootargs $(bootargs) usbboot=1"
+#define CFG_BOOTLIMIT "3"
+#define CFG_ALT_BOOTCOMMAND "run usb_self;reset"
#define CONFIG_EXTRA_ENV_SETTINGS \
"hostname=abg405\0" \
@@ -88,8 +91,10 @@
"usb_load="CFG_USB_LOAD_COMMAND"\0" \
"usb_self="CFG_USB_SELF_COMMAND"\0" \
"usbargs="CFG_USB_ARGS"\0" \
+ "bootlimit="CFG_BOOTLIMIT"\0" \
+ "altbootcmd="CFG_ALT_BOOTCOMMAND"\0" \
""
-#define CONFIG_BOOTCOMMAND "run flash_self;run usb_self"
+#define CONFIG_BOOTCOMMAND "run flash_self;reset"
#define CONFIG_ETHADDR 00:02:27:8e:00:00
@@ -414,7 +419,12 @@ extern int flash_banks;
#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of used area in RAM */
#define CFG_GBL_DATA_SIZE 128 /* reserved bytes for initial data */
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
-#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+/* reserve some memory for BOOT limit info */
+#define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - 16)
+
+#ifdef CONFIG_BOOTCOUNT_LIMIT /* reserve 2 word for bootcount limit */
+#define CFG_BOOTCOUNT_ADDR (CFG_GBL_DATA_OFFSET - 8)
+#endif
/*
* Internal Definitions
--
1.5.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot-Users] [PATCH V2] ppc4xx: Add bootcount limit handling for APC405 boards
2008-04-25 10:01 ` [U-Boot-Users] [PATCH V2] ppc4xx: " Matthias Fuchs
@ 2008-04-25 11:38 ` Stefan Roese
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2008-04-25 11:38 UTC (permalink / raw)
To: u-boot
On Friday 25 April 2008, Matthias Fuchs wrote:
> Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Applied to u-boot-ppc4xx. Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-25 11:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-24 9:33 [U-Boot-Users] [PATCH] 4xx: Add bootcount limit handling for APC405 boards Matthias Fuchs
2008-04-24 14:58 ` Stefan Roese
2008-04-25 10:01 ` [U-Boot-Users] [PATCH V2] ppc4xx: " Matthias Fuchs
2008-04-25 11:38 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox