[ixp4xx] refresh kernel patches
[openwrt.git] / target / linux / ixp4xx / patches-2.6.24 / 162-wg302v1_mem_fixup.patch
1 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
2 ===================================================================
3 --- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/wg302v1-setup.c
4 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
5 @@ -100,6 +100,36 @@ static struct platform_device *wg302v1_d
6         &wg302_eth[0],
7  };
8  
9 +static char wg302v1_mem_fixup[] __initdata = "mem=32M ";
10 +
11 +static void __init wg302v1_fixup(struct machine_desc *desc,
12 +               struct tag *tags, char **cmdline, struct meminfo *mi)
13 +
14 +{
15 +       struct tag *t = tags;
16 +       char *p = *cmdline;
17 +
18 +       /* Find the end of the tags table, taking note of any cmdline tag. */
19 +       for (; t->hdr.size; t = tag_next(t)) {
20 +               if (t->hdr.tag == ATAG_CMDLINE) {
21 +                       p = t->u.cmdline.cmdline;
22 +               }
23 +       }
24 +
25 +       /* Overwrite the end of the table with a new cmdline tag. */
26 +       t->hdr.tag = ATAG_CMDLINE;
27 +       t->hdr.size = (sizeof (struct tag_header) +
28 +               strlen(wg302v1_mem_fixup) + strlen(p) + 1 + 4) >> 2;
29 +       strlcpy(t->u.cmdline.cmdline, wg302v1_mem_fixup, COMMAND_LINE_SIZE);
30 +       strlcpy(t->u.cmdline.cmdline + strlen(wg302v1_mem_fixup), p,
31 +               COMMAND_LINE_SIZE - strlen(wg302v1_mem_fixup));
32 +
33 +       /* Terminate the table. */
34 +       t = tag_next(t);
35 +       t->hdr.tag = ATAG_NONE;
36 +       t->hdr.size = 0;
37 +}
38 +
39  static void __init wg302v1_init(void)
40  {
41         ixp4xx_sys_init();
42 @@ -118,6 +148,7 @@ MACHINE_START(WG302V1, "Netgear WG302 v1
43         /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
44         .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
45         .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
46 +       .fixup          = wg302v1_fixup,
47         .map_io         = ixp4xx_map_io,
48         .init_irq       = ixp4xx_init_irq,
49         .timer          = &ixp4xx_timer,