[kernel] add a chip_fixup function to the plat_nand driver on 2.6.23 as well (closes...
[openwrt.git] / target / linux / ixp4xx / patches / 070-ixp4xx_freq_fixup.patch
1 This patch is required as the frequency fixup in nslu2_init does not
2 run sufficiently early in the boot sequence to take effect. In
3 addition the dsmg600 setup code behaviour has been improved such
4 that a 'fixup' routine is avoided.
5
6 Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
7
8 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
9 ===================================================================
10 --- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
11 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
12 @@ -22,6 +22,7 @@
13 #include <asm/mach-types.h>
14 #include <asm/mach/arch.h>
15 #include <asm/mach/flash.h>
16 +#include <asm/mach/time.h>
17
18 static struct flash_platform_data nslu2_flash_data = {
19 .map_name = "cfi_probe",
20 @@ -157,10 +158,21 @@ static void nslu2_power_off(void)
21 gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
22 }
23
24 -static void __init nslu2_init(void)
25 +static void __init nslu2_timer_init(void)
26 {
27 - ixp4xx_timer_freq = NSLU2_FREQ;
28 + /* The xtal on this machine is non-standard. */
29 + ixp4xx_timer_freq = NSLU2_FREQ;
30 +
31 + /* Call standard timer_init function. */
32 + ixp4xx_timer_init();
33 +}
34
35 +static struct sys_timer nslu2_timer = {
36 + .init = nslu2_timer_init,
37 +};
38 +
39 +static void __init nslu2_init(void)
40 +{
41 ixp4xx_sys_init();
42
43 nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
44 @@ -185,6 +197,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
45 .boot_params = 0x00000100,
46 .map_io = ixp4xx_map_io,
47 .init_irq = ixp4xx_init_irq,
48 - .timer = &ixp4xx_timer,
49 + .timer = &nslu2_timer,
50 .init_machine = nslu2_init,
51 MACHINE_END
52 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/common.c
53 ===================================================================
54 --- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/common.c
55 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/common.c
56 @@ -269,7 +269,7 @@ static struct irqaction ixp4xx_timer_irq
57 .handler = ixp4xx_timer_interrupt,
58 };
59
60 -static void __init ixp4xx_timer_init(void)
61 +void __init ixp4xx_timer_init(void)
62 {
63 /* Clear Pending Interrupt by writing '1' to it */
64 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
65 Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/platform.h
66 ===================================================================
67 --- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/platform.h
68 +++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/platform.h
69 @@ -113,6 +113,7 @@ extern unsigned long ixp4xx_timer_freq;
70 extern void ixp4xx_map_io(void);
71 extern void ixp4xx_init_irq(void);
72 extern void ixp4xx_sys_init(void);
73 +extern void ixp4xx_timer_init(void);
74 extern struct sys_timer ixp4xx_timer;
75 extern void ixp4xx_pci_preinit(void);
76 struct pci_sys_data;
77 Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
78 ===================================================================
79 --- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
80 +++ linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
81 @@ -18,6 +18,7 @@
82 #include <asm/mach-types.h>
83 #include <asm/mach/arch.h>
84 #include <asm/mach/flash.h>
85 +#include <asm/mach/time.h>
86
87 static struct flash_platform_data dsmg600_flash_data = {
88 .map_name = "cfi_probe",
89 @@ -128,6 +129,19 @@ static void dsmg600_power_off(void)
90 gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
91 }
92
93 +static void __init dsmg600_timer_init(void)
94 +{
95 + /* The xtal on this machine is non-standard. */
96 + ixp4xx_timer_freq = DSMG600_FREQ;
97 +
98 + /* Call standard timer_init function. */
99 + ixp4xx_timer_init();
100 +}
101 +
102 +static struct sys_timer dsmg600_timer = {
103 + .init = dsmg600_timer_init,
104 +};
105 +
106 static void __init dsmg600_init(void)
107 {
108 ixp4xx_sys_init();
109 @@ -155,21 +169,13 @@ static void __init dsmg600_init(void)
110 #endif
111 }
112
113 -static void __init dsmg600_fixup(struct machine_desc *desc,
114 - struct tag *tags, char **cmdline, struct meminfo *mi)
115 -{
116 - /* The xtal on this machine is non-standard. */
117 - ixp4xx_timer_freq = DSMG600_FREQ;
118 -}
119 -
120 MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
121 /* Maintainer: www.nslu2-linux.org */
122 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
123 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
124 .boot_params = 0x00000100,
125 - .fixup = dsmg600_fixup,
126 .map_io = ixp4xx_map_io,
127 .init_irq = ixp4xx_init_irq,
128 - .timer = &ixp4xx_timer,
129 + .timer = &dsmg600_timer,
130 .init_machine = dsmg600_init,
131 MACHINE_END
This page took 0.046351 seconds and 5 git commands to generate.