summaryrefslogtreecommitdiff
path: root/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
diff options
context:
space:
mode:
authorFlorian Boor <florian.boor@kernelconcepts.de>2006-01-18 11:00:53 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-01-18 11:00:53 +0000
commit9c62a6b5ca6c606d670955061ae4f570270aa3af (patch)
treea5d043f261cf7765672c35046be4d5a4bc1b5dfe /packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
parentc8508a346bd0d33126fef88406bab42320514abd (diff)
parent1cff8772528f5bf97ac732a157b9daf63feab5c2 (diff)
merge of c7620f4faaa4b7b9a2f58272644e99ef17e66c9c
and b78c38c1ca7715097407f79c1f432372e7b8c258
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.patch55
1 files changed, 28 insertions, 27 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
index 0ed39d9302..55aad7c440 100644
--- a/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
+++ b/packages/linux/ixp4xx-kernel/2.6.15/94-nslu2-setup.patch
@@ -15,47 +15,48 @@ Signed-off-by: John Bowler <jbowler@acm.org>
#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)
+@@ -165,12 +167,53 @@ 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...
++ * NSLU2 RedBoot passes garbage atag/parameter values because it copies
++ * the kernel zImage on top of the parameter list before branching into
++ * the zImage. The machine description causes the ATAG list to be
++ * skipped (by setting boot_params to 0) and this code fixes up the
++ * memory info and command line by supplying a command line with the
++ * NSLU2 specific config prepended.
++ *
++ * NOTE: the startup sequence is:
++ * 1) Call the machine fixup
++ * 2) Parse the ATAG list, the ATAG_CMDLINE is copied in
++ * to default_command_line which is the value of *from
++ * 3) Parse the command line in *from (*not*
++ * default_command_line unless they are the same!)
++ *
++ * Setting mi->nr_banks causes (2) to 'squash' (set to ATAG_NONE)
++ * any ATAG_MEM tags, but mem= command line options cause nr_banks
++ * to be reset to 0 (on the first mem=)
+ */
++static char nslu2_command_line[] __initdata =
++ "root=/dev/mtdblock4 rootfstype=jffs2 init=/linuxrc "
++ "rtc-x1205.probe=0,0x6f rtc-x1205.hctosys=1 "
++ CONFIG_CMDLINE;
++
+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!
++ * NOTE: to make a 'fatslug' work append the appropriate
++ * mem= to the CONFIG_CMDLINE - this will override the
++ * setting below.
+ */
+ 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;
++ strlcpy(*cmdline, nslu2_command_line, COMMAND_LINE_SIZE);
+}
+
MACHINE_START(NSLU2, "Linksys NSLU2")
@@ -64,7 +65,7 @@ Signed-off-by: John Bowler <jbowler@acm.org>
.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 */
++ .boot_params = 0, /* because they are garbage - see above */
+ .fixup = nslu2_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,