diff -Naur linux-2.6.19-rc5.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c linux-2.6.19-rc5/arch/arm/mach-ixp4xx/dsmg600-setup.c --- linux-2.6.19-rc5.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c 2006-11-25 23:01:30.000000000 -0600 +++ linux-2.6.19-rc5/arch/arm/mach-ixp4xx/dsmg600-setup.c 2006-11-25 23:28:59.000000000 -0600 @@ -14,10 +14,12 @@ #include #include #include +#include #include #include #include +#include static struct flash_platform_data dsmg600_flash_data = { .map_name = "cfi_probe", @@ -157,11 +159,54 @@ #endif } +/* + * The DSM-G600 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 dsmg600_command_line[] __initdata = + "root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc " + "rtc-pcf8563.probe=0,0x51 " + CONFIG_CMDLINE; + + +static void __init dsmg600_fixup(struct machine_desc *desc, + struct tag *tags, char **cmdline, struct meminfo *mi) +{ + /* The DSM-G600 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, dsmg600_command_line, COMMAND_LINE_SIZE); +} + MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") /* Maintainer: www.nslu2-linux.org */ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, .boot_params = 0x00000100, + .fixup = dsmg600_fixup, .map_io = ixp4xx_map_io, .init_irq = ixp4xx_init_irq, .timer = &ixp4xx_timer,