[ixp4xx] update Avila patches
[openwrt-10.03/.git] / target / linux / ixp4xx / patches-2.6.24 / 298-avila_rtc_fixup.patch
1 Index: linux-2.6.24.2/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.24.2.orig/arch/arm/mach-ixp4xx/avila-setup.c
4 +++ linux-2.6.24.2/arch/arm/mach-ixp4xx/avila-setup.c
5 @@ -163,6 +163,35 @@ static struct platform_device *avila_dev
6         &avila_uart
7  };
8  
9 +static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
10 +
11 +static void __init avila_fixup(struct machine_desc *desc,
12 +                       struct tag *tags, char **cmdline, struct meminfo *mi)
13 +{
14 +       struct tag *t = tags;
15 +       char *p = *cmdline;
16 +
17 +       /* Find the end of the tags table, taking note of any cmdline tag. */
18 +       for (; t->hdr.size; t = tag_next(t)) {
19 +               if (t->hdr.tag == ATAG_CMDLINE) {
20 +                       p = t->u.cmdline.cmdline;
21 +               }
22 +       }
23 +
24 +       /* Overwrite the end of the table with a new cmdline tag. */
25 +       t->hdr.tag = ATAG_CMDLINE;
26 +       t->hdr.size = (sizeof (struct tag_header) +
27 +               strlen(avila_rtc_probe) + strlen(p) + 1 + 4) >> 2;
28 +       strlcpy(t->u.cmdline.cmdline, avila_rtc_probe, COMMAND_LINE_SIZE);
29 +       strlcpy(t->u.cmdline.cmdline + strlen(avila_rtc_probe), p,
30 +               COMMAND_LINE_SIZE - strlen(avila_rtc_probe));
31 +
32 +       /* Terminate the table. */
33 +       t = tag_next(t);
34 +       t->hdr.tag = ATAG_NONE;
35 +       t->hdr.size = 0;
36 +}
37 +
38  static void __init avila_init(void)
39  {
40         ixp4xx_sys_init();
41 @@ -192,6 +221,7 @@ MACHINE_START(AVILA, "Gateworks Avila Ne
42         /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
43         .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
44         .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
45 +       .fixup          = avila_fixup,
46         .map_io         = ixp4xx_map_io,
47         .init_irq       = ixp4xx_init_irq,
48         .timer          = &ixp4xx_timer,
49 @@ -209,6 +239,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc 
50         /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
51         .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
52         .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
53 +       .fixup          = avila_fixup,
54         .map_io         = ixp4xx_map_io,
55         .init_irq       = ixp4xx_init_irq,
56         .timer          = &ixp4xx_timer,