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