summaryrefslogtreecommitdiff
path: root/packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch')
-rw-r--r--packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch b/packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch
new file mode 100644
index 0000000000..bd766a3ccc
--- /dev/null
+++ b/packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch
@@ -0,0 +1,67 @@
+Include a fixup machine start function in nas100d-setup.c to handle
+the command line and memory setup parameters which are not specifiable
+in the boot loader.
+
+Signed-off-by: John Bowler <jbowler@acm.org>
+
+--- linux-2.6.15/arch/arm/mach-ixp4xx/nas100d-setup.c 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.15/arch/arm/mach-ixp4xx/nas100d-setup.c 1970-01-01 00:00:00.000000000 +0000
+@@ -17,6 +17,8 @@
+ #include <linux/serial_8250.h>
+ #include <linux/mtd/mtd.h>
+
++#include <asm/setup.h>
++#include <asm/memory.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/flash.h>
+@@ -164,12 +166,49 @@ static void __init nas100d_init(void)
+ platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+ }
+
++/*
++ * NAS100D bootstrap may pass in parameters, but we zap the mem
++ * settings to be safe (the box always has 64MByte at 0). The
++ * passed in command line can override this default, we prepend
++ * to the config'ed default.
++ */
++static void __init nas100d_fixup(struct machine_desc *desc,
++ struct tag *tags, char **cmdline, struct meminfo *mi)
++{
++ char saved_command_line[COMMAND_LINE_SIZE];
++ /* Put NAS100D specific known-required-for-certain stuff here, leave
++ * a trailing space!
++ */
++ static char nas100d_command_line[] =
++ "root=/dev/mtdblock2 rw rootfstype=jffs2 init=/linuxrc "
++ "pcf8563.hctosys=1 ";
++ const int len = (sizeof nas100d_command_line)-1;
++
++ /* The NAS100D has one bank of 32MByte memory.
++ * NOTE: setting nr_banks != 0 causes kernel/setup.c to remove
++ * the mem tags from the tag list. We need do nothing here!
++ */
++ mi->nr_banks=1;
++ mi->bank[0].start = 0;
++ mi->bank[0].size = (64*1024*1024);
++ mi->bank[0].node = PHYS_TO_NID(0);
++
++ /* A command line in the ATAG list will override this one,
++ * as is intended.
++ */
++ memcpy(saved_command_line, *cmdline, COMMAND_LINE_SIZE);
++ memcpy(*cmdline, nas100d_command_line, len);
++ memcpy(*cmdline + len, saved_command_line, COMMAND_LINE_SIZE - len);
++ *cmdline[COMMAND_LINE_SIZE-1] = 0;
++}
++
+ MACHINE_START(NAS100D, "Iomega NAS 100d")
+ /* Maintainer: www.nslu2-linux.org */
+ .phys_ram = PHYS_OFFSET,
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
+ .boot_params = 0x00000100,
++ .fixup = nas100d_fixup,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,