aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <lg@denx.de>2008-02-29 15:12:57 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-03-06 07:18:17 -0500
commitbe73a347ec7799aec0aa1008bd991f93dbfa80e8 (patch)
treef1eb1420be7e9c593c303392b955d7ebd0582f14 /arch
parent29e8c3c304b62f31b799565c9ee85d42bd163f80 (diff)
[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 5f0ee4b8a9b7..2d6d413f0235 100644
--- a/arch/arm/mach-orion/common.c
+++ b/arch/arm/mach-orion/common.c
@@ -17,7 +17,9 @@
17#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
18#include <linux/mv643xx_i2c.h> 18#include <linux/mv643xx_i2c.h>
19#include <asm/page.h> 19#include <asm/page.h>
20#include <asm/setup.h>
20#include <asm/timex.h> 21#include <asm/timex.h>
22#include <asm/mach/arch.h>
21#include <asm/mach/map.h> 23#include <asm/mach/map.h>
22#include <asm/arch/hardware.h> 24#include <asm/arch/hardware.h>
23#include "common.h" 25#include "common.h"
@@ -347,3 +349,21 @@ void __init orion_init(void)
347 platform_device_register(&orion_ehci1); 349 platform_device_register(&orion_ehci1);
348 platform_device_register(&orion_i2c); 350 platform_device_register(&orion_i2c);
349} 351}
352
353/*
354 * Many orion-based systems have buggy bootloader implementations.
355 * This is a common fixup for bogus memory tags.
356 */
357void __init tag_fixup_mem32(struct machine_desc *mdesc, struct tag *t,
358 char **from, struct meminfo *meminfo)
359{
360 for (; t->hdr.size; t = tag_next(t))
361 if (t->hdr.tag == ATAG_MEM &&
362 (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK ||
363 t->u.mem.start & ~PAGE_MASK)) {
364 printk(KERN_WARNING
365 "Clearing invalid memory bank %dKB@0x%08x\n",
366 t->u.mem.size / 1024, t->u.mem.start);
367 t->hdr.tag = 0;
368 }
369}
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h
index 10154ec885df..501497cc2c4d 100644
--- a/arch/arm/mach-orion/common.h
+++ b/arch/arm/mach-orion/common.h
@@ -83,4 +83,10 @@ struct mv_sata_platform_data;
83 83
84void __init orion_sata_init(struct mv_sata_platform_data *sata_data); 84void __init orion_sata_init(struct mv_sata_platform_data *sata_data);
85 85
86struct machine_desc;
87struct meminfo;
88struct tag;
89extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
90 char **, struct meminfo *);
91
86#endif /* __ARCH_ORION_COMMON_H__ */ 92#endif /* __ARCH_ORION_COMMON_H__ */
diff --git a/arch/arm/mach-orion/dns323-setup.c b/arch/arm/mach-orion/dns323-setup.c
index 02b280c24820..076e155ad510 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")
319 .map_io = orion_map_io, 319 .map_io = orion_map_io,
320 .init_irq = orion_init_irq, 320 .init_irq = orion_init_irq,
321 .timer = &orion_timer, 321 .timer = &orion_timer,
322 .fixup = tag_fixup_mem32,
322MACHINE_END 323MACHINE_END
diff --git a/arch/arm/mach-orion/kurobox_pro-setup.c b/arch/arm/mach-orion/kurobox_pro-setup.c
index 6817aca4aa26..785a07bdf1e2 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")
240 .map_io = orion_map_io, 240 .map_io = orion_map_io,
241 .init_irq = orion_init_irq, 241 .init_irq = orion_init_irq,
242 .timer = &orion_timer, 242 .timer = &orion_timer,
243 .fixup = tag_fixup_mem32,
243MACHINE_END 244MACHINE_END
diff --git a/arch/arm/mach-orion/ts209-setup.c b/arch/arm/mach-orion/ts209-setup.c
index b8cfe6813e9d..45764dad16d0 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")
357 .map_io = orion_map_io, 357 .map_io = orion_map_io,
358 .init_irq = orion_init_irq, 358 .init_irq = orion_init_irq,
359 .timer = &orion_timer, 359 .timer = &orion_timer,
360 .fixup = tag_fixup_mem32,
360MACHINE_END 361MACHINE_END