aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion/common.c
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/arm/mach-orion/common.c
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/arm/mach-orion/common.c')
-rw-r--r--arch/arm/mach-orion/common.c20
1 files changed, 20 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}