summaryrefslogtreecommitdiff
path: root/packages/linux/ixp4xx-kernel/2.6.15/94-nas100d-setup.patch
blob: adf20823f8cfe6a9b80f52f7ff8684a38cb910fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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,53 @@ 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.
+ *
+ * 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 nas100d_command_line[] __initdata =
+	"root=/dev/mtdblock2 rw rootfstype=jffs2 init=/linuxrc "
+	"pcf8563.hctosys=1 "
+	CONFIG_CMDLINE;
+
+static void __init nas100d_fixup(struct machine_desc *desc,
+		struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+	/* The NAS100D has one bank of 64MByte 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.
+	 */
+	strlcpy(*cmdline, nas100d_command_line, COMMAND_LINE_SIZE);
+}
+
 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,