[PATCH 1/2] ARM: use arm_system_rev from environment
Sascha Hauer
s.hauer at pengutronix.de
Thu Oct 13 10:58:28 EDT 2011
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
arch/arm/lib/armlinux.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index e3a74f4..f636f12 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -198,7 +198,14 @@ void armlinux_set_architecture(int architecture)
void armlinux_set_revision(unsigned int rev)
{
+ char *revstr = asprintf("%d", rev);
+
system_rev = rev;
+
+ setenv("arm_system_rev", revstr);
+ export("arm_system_rev");
+
+ kfree(revstr);
}
void armlinux_set_serial(u64 serial)
@@ -209,6 +216,10 @@ void armlinux_set_serial(u64 serial)
void start_linux(void *adr, int swap, struct image_data *data)
{
void (*kernel)(int zero, int arch, void *params) = adr;
+ const char *revstr = getenv("arm_system_rev");
+
+ if (revstr)
+ system_rev = simple_strtoul(revstr, NULL, 0);
setup_tags(data, swap);
--
1.7.7
More information about the barebox
mailing list