summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <lg@denx.de>2008-02-29 21:12:57 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-03-06 12:18:17 +0000
commitbe73a347ec7799aec0aa1008bd991f93dbfa80e8 (patch)
treef1eb1420be7e9c593c303392b955d7ebd0582f14 /arch
parent29e8c3c304b62f31b799565c9ee85d42bd163f80 (diff)
downloadop-kernel-dev-be73a347ec7799aec0aa1008bd991f93dbfa80e8.zip
op-kernel-dev-be73a347ec7799aec0aa1008bd991f93dbfa80e8.tar.gz
[ARM] 4845/1: Orion: Ignore memory tags with invalid data
The DNS-323, Kurobox-Pro / Linkstation-Pro, QNAP TS-109/TS-209 and some other orion-based systems have several bogus memory entries in the tag table, which causes the system to crash at startup. Ignore them by resetting the tag ID to 0 in a machine fixup function. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-orion/common.c20
-rw-r--r--arch/arm/mach-orion/common.h6
-rw-r--r--arch/arm/mach-orion/dns323-setup.c1
-rw-r--r--arch/arm/mach-orion/kurobox_pro-setup.c1
-rw-r--r--arch/arm/mach-orion/ts209-setup.c1
5 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-orion/common.c b/arch/arm/mach-orion/common.c
index 5f0ee4b..2d6d413 100644
--- a/arch/arm/mach-orion/common.c
+++ b/arch/arm/mach-orion/common.c
@@ -17,7 +17,9 @@
#include <linux/mv643xx_eth.h>
#include <linux/mv643xx_i2c.h>
#include <asm/page.h>
+#include <asm/setup.h>
#include <asm/timex.h>
+#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/arch/hardware.h>
#include "common.h"
@@ -347,3 +349,21 @@ void __init orion_init(void)
platform_device_register(&orion_ehci1);
platform_device_register(&orion_i2c);
}
+
+/*
+ * Many orion-based systems have buggy bootloader implementations.
+ * This is a common fixup for bogus memory tags.
+ */
+void __init tag_fixup_mem32(struct machine_desc *mdesc, struct tag *t,
+ char **from, struct meminfo *meminfo)
+{
+ for (; t->hdr.size; t = tag_next(t))
+ if (t->hdr.tag == ATAG_MEM &&
+ (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK ||
+ t->u.mem.start & ~PAGE_MASK)) {
+ printk(KERN_WARNING
+ "Clearing invalid memory bank %dKB@0x%08x\n",
+ t->u.mem.size / 1024, t->u.mem.start);
+ t->hdr.tag = 0;
+ }
+}
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h
index 10154ec8..501497c 100644
--- a/arch/arm/mach-orion/common.h
+++ b/arch/arm/mach-orion/common.h
@@ -83,4 +83,10 @@ struct mv_sata_platform_data;
void __init orion_sata_init(struct mv_sata_platform_data *sata_data);
+struct machine_desc;
+struct meminfo;
+struct tag;
+extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
+ char **, struct meminfo *);
+
#endif /* __ARCH_ORION_COMMON_H__ */
diff --git a/arch/arm/mach-orion/dns323-setup.c b/arch/arm/mach-orion/dns323-setup.c
index 02b280c..076e155 100644
--- a/arch/arm/mach-orion/dns323-setup.c
+++ b/arch/arm/mach-orion/dns323-setup.c
@@ -319,4 +319,5 @@ MACHINE_START(DNS323, "D-Link DNS-323")
.map_io = orion_map_io,
.init_irq = orion_init_irq,
.timer = &orion_timer,
+ .fixup = tag_fixup_mem32,
MACHINE_END
diff --git a/arch/arm/mach-orion/kurobox_pro-setup.c b/arch/arm/mach-orion/kurobox_pro-setup.c
index 6817aca..785a07bd 100644
--- a/arch/arm/mach-orion/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion/kurobox_pro-setup.c
@@ -240,4 +240,5 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
.map_io = orion_map_io,
.init_irq = orion_init_irq,
.timer = &orion_timer,
+ .fixup = tag_fixup_mem32,
MACHINE_END
diff --git a/arch/arm/mach-orion/ts209-setup.c b/arch/arm/mach-orion/ts209-setup.c
index b8cfe68..45764da 100644
--- a/arch/arm/mach-orion/ts209-setup.c
+++ b/arch/arm/mach-orion/ts209-setup.c
@@ -357,4 +357,5 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209")
.map_io = orion_map_io,
.init_irq = orion_init_irq,
.timer = &orion_timer,
+ .fixup = tag_fixup_mem32,
MACHINE_END
OpenPOWER on IntegriCloud