merge of '178eac00dc5aa8338d42e8e203633bec7817bbf6'
[vuplus_openembedded] / packages / linux / linux-rp-2.6.24 / tosa / 0020-Provide-dew-device-clock-backports-from-2.6.24-git.patch
1 From ee8ca5742e0000dd2369ef4d328c2c1117276a3b Mon Sep 17 00:00:00 2001
2 From: Dmitry Baryshkov <dbaryshkov@gmail.com>
3 Date: Mon, 4 Feb 2008 02:56:28 +0300
4 Subject: [PATCH 20/64] Provide dew device/clock backports from 2.6.24-git
5
6 Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
7 ---
8  arch/arm/Kconfig            |    1 +
9  arch/arm/mach-pxa/devices.h |   12 ++++++++++++
10  arch/arm/mach-pxa/pxa25x.c  |   18 ++++++++++++------
11  arch/arm/mach-pxa/pxa27x.c  |   22 ++++++++++++++++------
12  arch/arm/mach-pxa/pxa3xx.c  |   30 ++++++++++++++++++++++++++++++
13  kernel/Makefile             |    1 +
14  6 files changed, 72 insertions(+), 12 deletions(-)
15
16 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
17 index 1be7182..10faf9c 100644
18 --- a/arch/arm/Kconfig
19 +++ b/arch/arm/Kconfig
20 @@ -367,6 +367,7 @@ config ARCH_SA1100
21         select ARCH_DISCONTIGMEM_ENABLE
22         select ARCH_MTD_XIP
23         select GENERIC_GPIO
24 +       select GENERIC_TIME
25         help
26           Support for StrongARM 11x0 based boards.
27  
28 diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
29 index 94c8d5c..96c7c89 100644
30 --- a/arch/arm/mach-pxa/devices.h
31 +++ b/arch/arm/mach-pxa/devices.h
32 @@ -1,4 +1,6 @@
33  extern struct platform_device pxa_device_mci;
34 +extern struct platform_device pxa3xx_device_mci2;
35 +extern struct platform_device pxa3xx_device_mci3;
36  extern struct platform_device pxa_device_udc;
37  extern struct platform_device pxa_device_fb;
38  extern struct platform_device pxa_device_ffuart;
39 @@ -12,3 +14,13 @@ extern struct platform_device pxa_device_rtc;
40  
41  extern struct platform_device pxa27x_device_i2c_power;
42  extern struct platform_device pxa27x_device_ohci;
43 +
44 +extern struct platform_device pxa25x_device_ssp;
45 +extern struct platform_device pxa25x_device_nssp;
46 +extern struct platform_device pxa25x_device_assp;
47 +extern struct platform_device pxa27x_device_ssp1;
48 +extern struct platform_device pxa27x_device_ssp2;
49 +extern struct platform_device pxa27x_device_ssp3;
50 +extern struct platform_device pxa3xx_device_ssp4;
51 +
52 +void __init pxa_register_device(struct platform_device *dev, void *data);
53 diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
54 index 006a6e0..5988d99 100644
55 --- a/arch/arm/mach-pxa/pxa25x.c
56 +++ b/arch/arm/mach-pxa/pxa25x.c
57 @@ -123,12 +123,15 @@ static struct clk pxa25x_clks[] = {
58         INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa_device_udc.dev),
59         INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev),
60         INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev),
61 +
62 +       INIT_CKEN("SSPCLK",  SSP, 3686400, 0, &pxa25x_device_ssp.dev),
63 +       INIT_CKEN("SSPCLK", NSSP, 3686400, 0, &pxa25x_device_nssp.dev),
64 +       INIT_CKEN("SSPCLK", ASSP, 3686400, 0, &pxa25x_device_assp.dev),
65 +
66         /*
67         INIT_CKEN("PWMCLK",  PWM0, 3686400,  0, NULL),
68         INIT_CKEN("PWMCLK",  PWM0, 3686400,  0, NULL),
69 -       INIT_CKEN("SSPCLK",  SSP,  3686400,  0, NULL),
70         INIT_CKEN("I2SCLK",  I2S,  14745600, 0, NULL),
71 -       INIT_CKEN("NSSPCLK", NSSP, 3686400,  0, NULL),
72         */
73         INIT_CKEN("FICPCLK", FICP, 47923000, 0, NULL),
74  };
75 @@ -216,8 +219,6 @@ static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
76  
77  static void pxa25x_cpu_pm_enter(suspend_state_t state)
78  {
79 -       CKEN = 0;
80 -
81         switch (state) {
82         case PM_SUSPEND_MEM:
83                 /* set resume return address */
84 @@ -239,6 +240,8 @@ static void __init pxa25x_init_pm(void)
85  {
86         pxa_cpu_pm_fns = &pxa25x_cpu_pm_fns;
87  }
88 +#else
89 +static inline void pxa25x_init_pm(void) {}
90  #endif
91  
92  /* PXA25x: supports wakeup from GPIO0..GPIO15 and RTC alarm
93 @@ -300,6 +303,9 @@ static struct platform_device *pxa25x_devices[] __initdata = {
94         &pxa_device_i2s,
95         &pxa_device_ficp,
96         &pxa_device_rtc,
97 +       &pxa25x_device_ssp,
98 +       &pxa25x_device_nssp,
99 +       &pxa25x_device_assp,
100  };
101  
102  static int __init pxa25x_init(void)
103 @@ -315,9 +321,9 @@ static int __init pxa25x_init(void)
104  
105                 if ((ret = pxa_init_dma(16)))
106                         return ret;
107 -#ifdef CONFIG_PM
108 +
109                 pxa25x_init_pm();
110 -#endif
111 +
112                 ret = platform_add_devices(pxa25x_devices,
113                                            ARRAY_SIZE(pxa25x_devices));
114         }
115 diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
116 index 8e126e6..30ca4fd 100644
117 --- a/arch/arm/mach-pxa/pxa27x.c
118 +++ b/arch/arm/mach-pxa/pxa27x.c
119 @@ -150,11 +150,12 @@ static struct clk pxa27x_clks[] = {
120         INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
121         INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL),
122  
123 +       INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
124 +       INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
125 +       INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
126 +
127         /*
128         INIT_CKEN("PWMCLK",  PWM0, 13000000, 0, NULL),
129 -       INIT_CKEN("SSPCLK",  SSP1, 13000000, 0, NULL),
130 -       INIT_CKEN("SSPCLK",  SSP2, 13000000, 0, NULL),
131 -       INIT_CKEN("SSPCLK",  SSP3, 13000000, 0, NULL),
132         INIT_CKEN("MSLCLK",  MSL,  48000000, 0, NULL),
133         INIT_CKEN("USIMCLK", USIM, 48000000, 0, NULL),
134         INIT_CKEN("MSTKCLK", MEMSTK, 19500000, 0, NULL),
135 @@ -304,6 +305,8 @@ static void __init pxa27x_init_pm(void)
136  {
137         pxa_cpu_pm_fns = &pxa27x_cpu_pm_fns;
138  }
139 +#else
140 +static inline void pxa27x_init_pm(void) {}
141  #endif
142  
143  /* PXA27x:  Various gpios can issue wakeup events.  This logic only
144 @@ -423,6 +426,11 @@ struct platform_device pxa27x_device_i2c_power = {
145         .num_resources  = ARRAY_SIZE(i2c_power_resources),
146  };
147  
148 +void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info)
149 +{
150 +       pxa27x_device_i2c_power.dev.platform_data = info;
151 +}
152 +
153  static struct platform_device *devices[] __initdata = {
154         &pxa_device_mci,
155         &pxa_device_udc,
156 @@ -435,7 +443,9 @@ static struct platform_device *devices[] __initdata = {
157         &pxa_device_ficp,
158         &pxa_device_rtc,
159         &pxa27x_device_i2c_power,
160 -       &pxa27x_device_ohci,
161 +       &pxa27x_device_ssp1,
162 +       &pxa27x_device_ssp2,
163 +       &pxa27x_device_ssp3,
164  };
165  
166  static int __init pxa27x_init(void)
167 @@ -446,9 +456,9 @@ static int __init pxa27x_init(void)
168  
169                 if ((ret = pxa_init_dma(32)))
170                         return ret;
171 -#ifdef CONFIG_PM
172 +
173                 pxa27x_init_pm();
174 -#endif
175 +
176                 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
177         }
178         return ret;
179 diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
180 index 61d9c9d..ccab9da 100644
181 --- a/arch/arm/mach-pxa/pxa3xx.c
182 +++ b/arch/arm/mach-pxa/pxa3xx.c
183 @@ -189,8 +189,31 @@ static struct clk pxa3xx_clks[] = {
184  
185         PXA3xx_CKEN("I2CCLK", I2C,  32842000, 0, &pxa_device_i2c.dev),
186         PXA3xx_CKEN("UDCCLK", UDC,  48000000, 5, &pxa_device_udc.dev),
187 +       PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev),
188 +
189 +       PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
190 +       PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
191 +       PXA3xx_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
192 +       PXA3xx_CKEN("SSPCLK", SSP4, 13000000, 0, &pxa3xx_device_ssp4.dev),
193 +
194 +       PXA3xx_CKEN("MMCCLK", MMC1, 19500000, 0, &pxa_device_mci.dev),
195 +       PXA3xx_CKEN("MMCCLK", MMC2, 19500000, 0, &pxa3xx_device_mci2.dev),
196 +       PXA3xx_CKEN("MMCCLK", MMC3, 19500000, 0, &pxa3xx_device_mci3.dev),
197  };
198  
199 +#ifdef CONFIG_PM
200 +#define SLEEP_SAVE_SIZE        4
201 +
202 +#define ISRAM_START    0x5c000000
203 +#define ISRAM_SIZE     SZ_256K
204 +
205 +static inline void pxa3xx_init_pm(void) {}
206 +static inline void pxa3xx_init_irq_pm(void) {}
207 +#else
208 +static inline void pxa3xx_init_pm(void) {}
209 +static inline void pxa3xx_init_irq_pm(void) {}
210 +#endif
211 +
212  void __init pxa3xx_init_irq(void)
213  {
214         /* enable CP6 access */
215 @@ -202,6 +225,7 @@ void __init pxa3xx_init_irq(void)
216         pxa_init_irq_low();
217         pxa_init_irq_high();
218         pxa_init_irq_gpio(128);
219 +       pxa3xx_init_irq_pm();
220  }
221  
222  /*
223 @@ -219,6 +243,10 @@ static struct platform_device *devices[] __initdata = {
224         &pxa_device_i2s,
225         &pxa_device_ficp,
226         &pxa_device_rtc,
227 +       &pxa27x_device_ssp1,
228 +       &pxa27x_device_ssp2,
229 +       &pxa27x_device_ssp3,
230 +       &pxa3xx_device_ssp4,
231  };
232  
233  static int __init pxa3xx_init(void)
234 @@ -231,6 +259,8 @@ static int __init pxa3xx_init(void)
235                 if ((ret = pxa_init_dma(32)))
236                         return ret;
237  
238 +               pxa3xx_init_pm();
239 +
240                 return platform_add_devices(devices, ARRAY_SIZE(devices));
241         }
242         return 0;
243 diff --git a/kernel/Makefile b/kernel/Makefile
244 index dfa9695..6d9a87c 100644
245 --- a/kernel/Makefile
246 +++ b/kernel/Makefile
247 @@ -57,6 +57,7 @@ obj-$(CONFIG_SYSCTL) += utsname_sysctl.o
248  obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
249  obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
250  obj-$(CONFIG_MARKERS) += marker.o
251 +obj-$(CONFIG_LATENCYTOP) += latencytop.o
252  
253  ifneq ($(CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER),y)
254  # According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
255 -- 
256 1.5.3.8
257