summaryrefslogtreecommitdiff
path: root/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@nslu2-linux.org>2006-01-16 10:13:55 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-01-16 10:13:55 +0000
commit2b9be5e324beee66740c311c67c660f544b8497d (patch)
tree6439ae8d48b84142b7d33a0290fe74a305185327 /packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
parentf2cfb2628d56ad31d4fe97a08b1012c252109b90 (diff)
ixp4xx-kernel: fix boot setup parameters in 2.6.15
- there is now a default machine-specific command line and an override for the memory config to provide a useable default per-machine.
Diffstat (limited to 'packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch')
-rw-r--r--packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch b/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
new file mode 100644
index 0000000000..0ed39d9302
--- /dev/null
+++ b/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
@@ -0,0 +1,71 @@
+Include a fixup machine start function in nslu2-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/nslu2-setup.c 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.15/arch/arm/mach-ixp4xx/nslu2-setup.c 1970-01-01 00:00:00.000000000 +0000
+@@ -18,6 +18,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>
+@@ -165,12 +167,52 @@ static void __init nslu2_init(void)
+ platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+ }
+
++/*
++ * NSLU2 RedBoot passes garbage atag/parameter values - i.e. r2
++ * on entry is not useable - so we get to set the right values
++ * here...
++ */
++static void __init nslu2_fixup(struct machine_desc *desc,
++ struct tag *tags, char **cmdline, struct meminfo *mi)
++{
++ char saved_command_line[COMMAND_LINE_SIZE];
++ /* Put NSLU2 specific known-required-for-certain stuff here, leave
++ * a trailing space!
++ */
++ static char nslu2_command_line[] =
++ "root=/dev/mtdblock4 rw rootfstype=jffs2 init=/linuxrc "
++ "rtc-x1205.probe=0,0x6f rtc-x1205.hctosys=1 ";
++ const int len = (sizeof nslu2_command_line)-1;
++
++ /* The NSLU2 has one bank of 32MByte memory.
++ * NOTE: this will totally destroy attempts to make fatslugs work,
++ * FATSLUG FATSLUG FATSLUG: please parameterise this!
++ * 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 = (32*1024*1024);
++ mi->bank[0].node = PHYS_TO_NID(0);
++
++ /* The tag list is the one from kernel/setup.c, it has no
++ * command line, so we are free to make one up, do this by
++ * prepending to the default command line which has been
++ * passed in (so that can override if necessary).
++ */
++ memcpy(saved_command_line, *cmdline, COMMAND_LINE_SIZE);
++ memcpy(*cmdline, nslu2_command_line, len);
++ memcpy(*cmdline + len, saved_command_line, COMMAND_LINE_SIZE - len);
++ *cmdline[COMMAND_LINE_SIZE-1] = 0;
++}
++
+ MACHINE_START(NSLU2, "Linksys NSLU2")
+ /* 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,
++ .boot_params = 0, /* because they are garbage */
++ .fixup = nslu2_fixup,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,