aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-12-29 13:08:11 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-12-29 13:08:11 -0500
commit47992cbdaef2f18a47871b2ed01ad27f568c8b73 (patch)
treebfed4f8c7ea3164afc75a85ab3624586c37c37f4 /arch
parent4655a0de36e8e903e99a8d152818e3aae86dae1a (diff)
parent198fc108ee4c2cd3f08954eae6a819c81c03214b (diff)
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/generic.c16
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa930.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/pxafb.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-lcd.h60
-rw-r--r--arch/arm/mach-pxa/include/mach/timex.h8
-rw-r--r--arch/arm/mach-pxa/tavorevb.c412
-rw-r--r--arch/arm/mach-pxa/time.c10
-rw-r--r--arch/arm/mach-sa1100/include/mach/hardware.h4
9 files changed, 480 insertions, 34 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 85ed0b33331..0ccc91c92c4 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -24,6 +24,7 @@
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/mach-types.h>
27 28
28#include <mach/pxa-regs.h> 29#include <mach/pxa-regs.h>
29#include <mach/reset.h> 30#include <mach/reset.h>
@@ -39,6 +40,21 @@ void clear_reset_status(unsigned int mask)
39 pxa3xx_clear_reset_status(mask); 40 pxa3xx_clear_reset_status(mask);
40} 41}
41 42
43unsigned long get_clock_tick_rate(void)
44{
45 unsigned long clock_tick_rate;
46
47 if (cpu_is_pxa25x())
48 clock_tick_rate = 3686400;
49 else if (machine_is_mainstone())
50 clock_tick_rate = 3249600;
51 else
52 clock_tick_rate = 3250000;
53
54 return clock_tick_rate;
55}
56EXPORT_SYMBOL(get_clock_tick_rate);
57
42/* 58/*
43 * Get the clock frequency as reflected by CCCR and the turbo flag. 59 * Get the clock frequency as reflected by CCCR and the turbo flag.
44 * We assume these values have been applied via a fcs. 60 * We assume these values have been applied via a fcs.
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index 4e782ec3866..16ab79547da 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -291,6 +291,8 @@
291 */ 291 */
292extern unsigned int get_memclk_frequency_10khz(void); 292extern unsigned int get_memclk_frequency_10khz(void);
293 293
294/* return the clock tick rate of the OS timer */
295extern unsigned long get_clock_tick_rate(void);
294#endif 296#endif
295 297
296#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) 298#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa930.h b/arch/arm/mach-pxa/include/mach/mfp-pxa930.h
index fabd9b4df82..fa73f56a137 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa930.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa930.h
@@ -421,6 +421,7 @@
421#define GPIO20_PWM0 MFP_CFG_LPM(GPIO20, AF2, PULL_LOW) 421#define GPIO20_PWM0 MFP_CFG_LPM(GPIO20, AF2, PULL_LOW)
422#define GPIO21_PWM2 MFP_CFG_LPM(GPIO21, AF3, PULL_LOW) 422#define GPIO21_PWM2 MFP_CFG_LPM(GPIO21, AF3, PULL_LOW)
423#define GPIO22_PWM3 MFP_CFG_LPM(GPIO22, AF3, PULL_LOW) 423#define GPIO22_PWM3 MFP_CFG_LPM(GPIO22, AF3, PULL_LOW)
424#define GPIO32_PWM0 MFP_CFG_LPM(GPIO32, AF4, PULL_LOW)
424 425
425/* CIR */ 426/* CIR */
426#define GPIO46_CIR_OUT MFP_CFG(GPIO46, AF1) 427#define GPIO46_CIR_OUT MFP_CFG(GPIO46, AF1)
diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h
index 4201a889ff4..6932720ba04 100644
--- a/arch/arm/mach-pxa/include/mach/pxafb.h
+++ b/arch/arm/mach-pxa/include/mach/pxafb.h
@@ -113,6 +113,7 @@ struct pxafb_mach_info {
113 unsigned int num_modes; 113 unsigned int num_modes;
114 114
115 unsigned int lcd_conn; 115 unsigned int lcd_conn;
116 unsigned long video_mem_size;
116 117
117 u_int fixed_modes:1, 118 u_int fixed_modes:1,
118 cmap_inverse:1, 119 cmap_inverse:1,
diff --git a/arch/arm/mach-pxa/include/mach/regs-lcd.h b/arch/arm/mach-pxa/include/mach/regs-lcd.h
index f817878d256..f82dcea792d 100644
--- a/arch/arm/mach-pxa/include/mach/regs-lcd.h
+++ b/arch/arm/mach-pxa/include/mach/regs-lcd.h
@@ -12,27 +12,29 @@
12#define LCCR3 (0x00C) /* LCD Controller Control Register 3 */ 12#define LCCR3 (0x00C) /* LCD Controller Control Register 3 */
13#define LCCR4 (0x010) /* LCD Controller Control Register 4 */ 13#define LCCR4 (0x010) /* LCD Controller Control Register 4 */
14#define LCCR5 (0x014) /* LCD Controller Control Register 5 */ 14#define LCCR5 (0x014) /* LCD Controller Control Register 5 */
15#define DFBR0 (0x020) /* DMA Channel 0 Frame Branch Register */ 15#define LCSR (0x038) /* LCD Controller Status Register 0 */
16#define DFBR1 (0x024) /* DMA Channel 1 Frame Branch Register */ 16#define LCSR1 (0x034) /* LCD Controller Status Register 1 */
17#define LCSR (0x038) /* LCD Controller Status Register */
18#define LIIDR (0x03C) /* LCD Controller Interrupt ID Register */ 17#define LIIDR (0x03C) /* LCD Controller Interrupt ID Register */
19#define TMEDRGBR (0x040) /* TMED RGB Seed Register */ 18#define TMEDRGBR (0x040) /* TMED RGB Seed Register */
20#define TMEDCR (0x044) /* TMED Control Register */ 19#define TMEDCR (0x044) /* TMED Control Register */
21 20
21#define FBR0 (0x020) /* DMA Channel 0 Frame Branch Register */
22#define FBR1 (0x024) /* DMA Channel 1 Frame Branch Register */
23#define FBR2 (0x028) /* DMA Channel 2 Frame Branch Register */
24#define FBR3 (0x02C) /* DMA Channel 2 Frame Branch Register */
25#define FBR4 (0x030) /* DMA Channel 2 Frame Branch Register */
26#define FBR5 (0x110) /* DMA Channel 2 Frame Branch Register */
27#define FBR6 (0x114) /* DMA Channel 2 Frame Branch Register */
28
29#define OVL1C1 (0x050) /* Overlay 1 Control Register 1 */
30#define OVL1C2 (0x060) /* Overlay 1 Control Register 2 */
31#define OVL2C1 (0x070) /* Overlay 2 Control Register 1 */
32#define OVL2C2 (0x080) /* Overlay 2 Control Register 2 */
33
22#define CMDCR (0x100) /* Command Control Register */ 34#define CMDCR (0x100) /* Command Control Register */
23#define PRSR (0x104) /* Panel Read Status Register */ 35#define PRSR (0x104) /* Panel Read Status Register */
24 36
25#define LCCR3_1BPP (0 << 24) 37#define LCCR3_BPP(x) ((((x) & 0x7) << 24) | (((x) & 0x8) ? (1 << 29) : 0))
26#define LCCR3_2BPP (1 << 24)
27#define LCCR3_4BPP (2 << 24)
28#define LCCR3_8BPP (3 << 24)
29#define LCCR3_16BPP (4 << 24)
30#define LCCR3_18BPP (5 << 24)
31#define LCCR3_18BPP_P (6 << 24)
32#define LCCR3_19BPP (7 << 24)
33#define LCCR3_19BPP_P (1 << 29)
34#define LCCR3_24BPP ((1 << 29) | (1 << 24))
35#define LCCR3_25BPP ((1 << 29) | (2 << 24))
36 38
37#define LCCR3_PDFOR_0 (0 << 30) 39#define LCCR3_PDFOR_0 (0 << 30)
38#define LCCR3_PDFOR_1 (1 << 30) 40#define LCCR3_PDFOR_1 (1 << 30)
@@ -42,19 +44,16 @@
42#define LCCR4_PAL_FOR_0 (0 << 15) 44#define LCCR4_PAL_FOR_0 (0 << 15)
43#define LCCR4_PAL_FOR_1 (1 << 15) 45#define LCCR4_PAL_FOR_1 (1 << 15)
44#define LCCR4_PAL_FOR_2 (2 << 15) 46#define LCCR4_PAL_FOR_2 (2 << 15)
47#define LCCR4_PAL_FOR_3 (3 << 15)
45#define LCCR4_PAL_FOR_MASK (3 << 15) 48#define LCCR4_PAL_FOR_MASK (3 << 15)
46 49
47#define FDADR0 (0x200) /* DMA Channel 0 Frame Descriptor Address Register */ 50#define FDADR0 (0x200) /* DMA Channel 0 Frame Descriptor Address Register */
48#define FSADR0 (0x204) /* DMA Channel 0 Frame Source Address Register */
49#define FIDR0 (0x208) /* DMA Channel 0 Frame ID Register */
50#define LDCMD0 (0x20C) /* DMA Channel 0 Command Register */
51#define FDADR1 (0x210) /* DMA Channel 1 Frame Descriptor Address Register */ 51#define FDADR1 (0x210) /* DMA Channel 1 Frame Descriptor Address Register */
52#define FSADR1 (0x214) /* DMA Channel 1 Frame Source Address Register */ 52#define FDADR2 (0x220) /* DMA Channel 2 Frame Descriptor Address Register */
53#define FIDR1 (0x218) /* DMA Channel 1 Frame ID Register */ 53#define FDADR3 (0x230) /* DMA Channel 3 Frame Descriptor Address Register */
54#define LDCMD1 (0x21C) /* DMA Channel 1 Command Register */ 54#define FDADR4 (0x240) /* DMA Channel 4 Frame Descriptor Address Register */
55#define FDADR5 (0x250) /* DMA Channel 5 Frame Descriptor Address Register */
55#define FDADR6 (0x260) /* DMA Channel 6 Frame Descriptor Address Register */ 56#define FDADR6 (0x260) /* DMA Channel 6 Frame Descriptor Address Register */
56#define FSADR6 (0x264) /* DMA Channel 6 Frame Source Address Register */
57#define FIDR6 (0x268) /* DMA Channel 6 Frame ID Register */
58 57
59#define LCCR0_ENB (1 << 0) /* LCD Controller enable */ 58#define LCCR0_ENB (1 << 0) /* LCD Controller enable */
60#define LCCR0_CMS (1 << 1) /* Color/Monochrome Display Select */ 59#define LCCR0_CMS (1 << 1) /* Color/Monochrome Display Select */
@@ -126,9 +125,6 @@
126#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */ 125#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */
127#define LCCR3_PixClkDiv(Div) (((Div) << FShft (LCCR3_PCD))) 126#define LCCR3_PixClkDiv(Div) (((Div) << FShft (LCCR3_PCD)))
128 127
129#define LCCR3_BPP Fld (3, 24) /* Bit Per Pixel */
130#define LCCR3_Bpp(Bpp) (((Bpp) << FShft (LCCR3_BPP)))
131
132#define LCCR3_ACB Fld (8, 8) /* AC Bias */ 128#define LCCR3_ACB Fld (8, 8) /* AC Bias */
133#define LCCR3_Acb(Acb) (((Acb) << FShft (LCCR3_ACB))) 129#define LCCR3_Acb(Acb) (((Acb) << FShft (LCCR3_ACB)))
134 130
@@ -157,8 +153,22 @@
157#define LCSR_RD_ST (1 << 11) /* read status */ 153#define LCSR_RD_ST (1 << 11) /* read status */
158#define LCSR_CMD_INT (1 << 12) /* command interrupt */ 154#define LCSR_CMD_INT (1 << 12) /* command interrupt */
159 155
156#define LCSR1_IU(x) (1 << ((x) + 23)) /* Input FIFO underrun */
157#define LCSR1_BS(x) (1 << ((x) + 15)) /* Branch Status */
158#define LCSR1_EOF(x) (1 << ((x) + 7)) /* End of Frame Status */
159#define LCSR1_SOF(x) (1 << ((x) - 1)) /* Start of Frame Status */
160
160#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ 161#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */
161 162
163/* overlay control registers */
164#define OVLxC1_PPL(x) ((((x) - 1) & 0x3ff) << 0) /* Pixels Per Line */
165#define OVLxC1_LPO(x) ((((x) - 1) & 0x3ff) << 10) /* Number of Lines */
166#define OVLxC1_BPP(x) (((x) & 0xf) << 20) /* Bits Per Pixel */
167#define OVLxC1_OEN (1 << 31) /* Enable bit for Overlay */
168#define OVLxC2_XPOS(x) (((x) & 0x3ff) << 0) /* Horizontal Position */
169#define OVLxC2_YPOS(x) (((x) & 0x3ff) << 10) /* Vertical Position */
170#define OVL2C2_PFOR(x) (((x) & 0x7) << 20) /* Pixel Format */
171
162/* smartpanel related */ 172/* smartpanel related */
163#define PRSR_DATA(x) ((x) & 0xff) /* Panel Data */ 173#define PRSR_DATA(x) ((x) & 0xff) /* Panel Data */
164#define PRSR_A0 (1 << 8) /* Read Data Source */ 174#define PRSR_A0 (1 << 8) /* Read Data Source */
diff --git a/arch/arm/mach-pxa/include/mach/timex.h b/arch/arm/mach-pxa/include/mach/timex.h
index b05fc6683c4..af6760a50e1 100644
--- a/arch/arm/mach-pxa/include/mach/timex.h
+++ b/arch/arm/mach-pxa/include/mach/timex.h
@@ -10,6 +10,14 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13/* Various drivers are still using the constant of CLOCK_TICK_RATE, for
14 * those drivers to at least work, the definition is provided here.
15 *
16 * NOTE: this is no longer accurate when multiple processors and boards
17 * are selected, newer drivers should not depend on this any more. Use
18 * either the clocksource/clockevent or get this at run-time by calling
19 * get_clock_tick_rate() (as defined in generic.c).
20 */
13 21
14#if defined(CONFIG_PXA25x) 22#if defined(CONFIG_PXA25x)
15/* PXA250/210 timer base */ 23/* PXA250/210 timer base */
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 589d32b4fc4..58ef08a5224 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -18,12 +18,15 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/smc91x.h> 20#include <linux/smc91x.h>
21#include <linux/pwm_backlight.h>
21 22
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <mach/hardware.h> 25#include <mach/hardware.h>
25#include <mach/pxa3xx-regs.h> 26#include <mach/pxa3xx-regs.h>
26#include <mach/mfp-pxa930.h> 27#include <mach/mfp-pxa930.h>
28#include <mach/pxafb.h>
29#include <mach/pxa27x_keypad.h>
27 30
28#include "devices.h" 31#include "devices.h"
29#include "generic.h" 32#include "generic.h"
@@ -33,6 +36,45 @@ static mfp_cfg_t tavorevb_mfp_cfg[] __initdata = {
33 /* Ethernet */ 36 /* Ethernet */
34 DF_nCS1_nCS3, 37 DF_nCS1_nCS3,
35 GPIO47_GPIO, 38 GPIO47_GPIO,
39
40 /* LCD */
41 GPIO23_LCD_DD0,
42 GPIO24_LCD_DD1,
43 GPIO25_LCD_DD2,
44 GPIO26_LCD_DD3,
45 GPIO27_LCD_DD4,
46 GPIO28_LCD_DD5,
47 GPIO29_LCD_DD6,
48 GPIO44_LCD_DD7,
49 GPIO21_LCD_CS,
50 GPIO22_LCD_CS2,
51
52 GPIO17_LCD_FCLK_RD,
53 GPIO18_LCD_LCLK_A0,
54 GPIO19_LCD_PCLK_WR,
55
56 /* LCD Backlight */
57 GPIO43_PWM3, /* primary backlight */
58 GPIO32_PWM0, /* secondary backlight */
59
60 /* Keypad */
61 GPIO0_KP_MKIN_0,
62 GPIO2_KP_MKIN_1,
63 GPIO4_KP_MKIN_2,
64 GPIO6_KP_MKIN_3,
65 GPIO8_KP_MKIN_4,
66 GPIO10_KP_MKIN_5,
67 GPIO12_KP_MKIN_6,
68 GPIO1_KP_MKOUT_0,
69 GPIO3_KP_MKOUT_1,
70 GPIO5_KP_MKOUT_2,
71 GPIO7_KP_MKOUT_3,
72 GPIO9_KP_MKOUT_4,
73 GPIO11_KP_MKOUT_5,
74 GPIO13_KP_MKOUT_6,
75
76 GPIO14_KP_DKIN_2,
77 GPIO15_KP_DKIN_3,
36}; 78};
37 79
38#define TAVOREVB_ETH_PHYS (0x14000000) 80#define TAVOREVB_ETH_PHYS (0x14000000)
@@ -64,12 +106,382 @@ static struct platform_device smc91x_device = {
64 }, 106 },
65}; 107};
66 108
109#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
110static unsigned int tavorevb_matrix_key_map[] = {
111 /* KEY(row, col, key_code) */
112 KEY(0, 4, KEY_A), KEY(0, 5, KEY_B), KEY(0, 6, KEY_C),
113 KEY(1, 4, KEY_E), KEY(1, 5, KEY_F), KEY(1, 6, KEY_G),
114 KEY(2, 4, KEY_I), KEY(2, 5, KEY_J), KEY(2, 6, KEY_K),
115 KEY(3, 4, KEY_M), KEY(3, 5, KEY_N), KEY(3, 6, KEY_O),
116 KEY(4, 5, KEY_R), KEY(4, 6, KEY_S),
117 KEY(5, 4, KEY_U), KEY(5, 4, KEY_V), KEY(5, 6, KEY_W),
118
119 KEY(6, 4, KEY_Y), KEY(6, 5, KEY_Z),
120
121 KEY(0, 3, KEY_0), KEY(2, 0, KEY_1), KEY(2, 1, KEY_2), KEY(2, 2, KEY_3),
122 KEY(2, 3, KEY_4), KEY(1, 0, KEY_5), KEY(1, 1, KEY_6), KEY(1, 2, KEY_7),
123 KEY(1, 3, KEY_8), KEY(0, 2, KEY_9),
124
125 KEY(6, 6, KEY_SPACE),
126 KEY(0, 0, KEY_KPASTERISK), /* * */
127 KEY(0, 1, KEY_KPDOT), /* # */
128
129 KEY(4, 1, KEY_UP),
130 KEY(4, 3, KEY_DOWN),
131 KEY(4, 0, KEY_LEFT),
132 KEY(4, 2, KEY_RIGHT),
133 KEY(6, 0, KEY_HOME),
134 KEY(3, 2, KEY_END),
135 KEY(6, 1, KEY_DELETE),
136 KEY(5, 2, KEY_BACK),
137 KEY(6, 3, KEY_CAPSLOCK), /* KEY_LEFTSHIFT), */
138
139 KEY(4, 4, KEY_ENTER), /* scroll push */
140 KEY(6, 2, KEY_ENTER), /* keypad action */
141
142 KEY(3, 1, KEY_SEND),
143 KEY(5, 3, KEY_RECORD),
144 KEY(5, 0, KEY_VOLUMEUP),
145 KEY(5, 1, KEY_VOLUMEDOWN),
146
147 KEY(3, 0, KEY_F22), /* soft1 */
148 KEY(3, 3, KEY_F23), /* soft2 */
149};
150
151static struct pxa27x_keypad_platform_data tavorevb_keypad_info = {
152 .matrix_key_rows = 7,
153 .matrix_key_cols = 7,
154 .matrix_key_map = tavorevb_matrix_key_map,
155 .matrix_key_map_size = ARRAY_SIZE(tavorevb_matrix_key_map),
156 .debounce_interval = 30,
157};
158
159static void __init tavorevb_init_keypad(void)
160{
161 pxa_set_keypad_info(&tavorevb_keypad_info);
162}
163#else
164static inline void tavorevb_init_keypad(void) {}
165#endif /* CONFIG_KEYBOARD_PXA27x || CONFIG_KEYBOARD_PXA27x_MODULE */
166
167#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
168static struct platform_pwm_backlight_data tavorevb_backlight_data[] = {
169 [0] = {
170 /* primary backlight */
171 .pwm_id = 2,
172 .max_brightness = 100,
173 .dft_brightness = 100,
174 .pwm_period_ns = 100000,
175 },
176 [1] = {
177 /* secondary backlight */
178 .pwm_id = 0,
179 .max_brightness = 100,
180 .dft_brightness = 100,
181 .pwm_period_ns = 100000,
182 },
183};
184
185static struct platform_device tavorevb_backlight_devices[] = {
186 [0] = {
187 .name = "pwm-backlight",
188 .id = 0,
189 .dev = {
190 .platform_data = &tavorevb_backlight_data[0],
191 },
192 },
193 [1] = {
194 .name = "pwm-backlight",
195 .id = 1,
196 .dev = {
197 .platform_data = &tavorevb_backlight_data[1],
198 },
199 },
200};
201
202static uint16_t panel_init[] = {
203 /* DSTB OUT */
204 SMART_CMD(0x00),
205 SMART_CMD_NOOP,
206 SMART_DELAY(1),
207
208 SMART_CMD(0x00),
209 SMART_CMD_NOOP,
210 SMART_DELAY(1),
211
212 SMART_CMD(0x00),
213 SMART_CMD_NOOP,
214 SMART_DELAY(1),
215
216 /* STB OUT */
217 SMART_CMD(0x00),
218 SMART_CMD(0x1D),
219 SMART_DAT(0x00),
220 SMART_DAT(0x05),
221 SMART_DELAY(1),
222
223 /* P-ON Init sequence */
224 SMART_CMD(0x00), /* OSC ON */
225 SMART_CMD(0x00),
226 SMART_DAT(0x00),
227 SMART_DAT(0x01),
228 SMART_CMD(0x00),
229 SMART_CMD(0x01), /* SOURCE DRIVER SHIFT DIRECTION and display RAM setting */
230 SMART_DAT(0x01),
231 SMART_DAT(0x27),
232 SMART_CMD(0x00),
233 SMART_CMD(0x02), /* LINE INV */
234 SMART_DAT(0x02),
235 SMART_DAT(0x00),
236 SMART_CMD(0x00),
237 SMART_CMD(0x03), /* IF mode(1) */
238 SMART_DAT(0x01), /* 8bit smart mode(8-8),high speed write mode */
239 SMART_DAT(0x30),
240 SMART_CMD(0x07),
241 SMART_CMD(0x00), /* RAM Write Mode */
242 SMART_DAT(0x00),
243 SMART_DAT(0x03),
244 SMART_CMD(0x00),
245
246 /* DISPLAY Setting, 262K, fixed(NO scroll), no split screen */
247 SMART_CMD(0x07),
248 SMART_DAT(0x40), /* 16/18/19 BPP */
249 SMART_DAT(0x00),
250 SMART_CMD(0x00),
251 SMART_CMD(0x08), /* BP, FP Seting, BP=2H, FP=3H */
252 SMART_DAT(0x03),
253 SMART_DAT(0x02),
254 SMART_CMD(0x00),
255 SMART_CMD(0x0C), /* IF mode(2), using internal clock & MPU */
256 SMART_DAT(0x00),
257 SMART_DAT(0x00),
258 SMART_CMD(0x00),
259 SMART_CMD(0x0D), /* Frame setting, 1Min. Frequence, 16CLK */
260 SMART_DAT(0x00),
261 SMART_DAT(0x10),
262 SMART_CMD(0x00),
263 SMART_CMD(0x12), /* Timing(1),ASW W=4CLK, ASW ST=1CLK */
264 SMART_DAT(0x03),
265 SMART_DAT(0x02),
266 SMART_CMD(0x00),
267 SMART_CMD(0x13), /* Timing(2),OEV ST=0.5CLK, OEV ED=1CLK */
268 SMART_DAT(0x01),
269 SMART_DAT(0x02),
270 SMART_CMD(0x00),
271 SMART_CMD(0x14), /* Timing(3), ASW HOLD=0.5CLK */
272 SMART_DAT(0x00),
273 SMART_DAT(0x00),
274 SMART_CMD(0x00),
275 SMART_CMD(0x15), /* Timing(4), CKV ST=0CLK, CKV ED=1CLK */
276 SMART_DAT(0x20),
277 SMART_DAT(0x00),
278 SMART_CMD(0x00),
279 SMART_CMD(0x1C),
280 SMART_DAT(0x00),
281 SMART_DAT(0x00),
282 SMART_CMD(0x03),
283 SMART_CMD(0x00),
284 SMART_DAT(0x04),
285 SMART_DAT(0x03),
286 SMART_CMD(0x03),
287 SMART_CMD(0x01),
288 SMART_DAT(0x03),
289 SMART_DAT(0x04),
290 SMART_CMD(0x03),
291 SMART_CMD(0x02),
292 SMART_DAT(0x04),
293 SMART_DAT(0x03),
294 SMART_CMD(0x03),
295 SMART_CMD(0x03),
296 SMART_DAT(0x03),
297 SMART_DAT(0x03),
298 SMART_CMD(0x03),
299 SMART_CMD(0x04),
300 SMART_DAT(0x01),
301 SMART_DAT(0x01),
302 SMART_CMD(0x03),
303 SMART_CMD(0x05),
304 SMART_DAT(0x00),
305 SMART_DAT(0x00),
306 SMART_CMD(0x04),
307 SMART_CMD(0x02),
308 SMART_DAT(0x00),
309 SMART_DAT(0x00),
310 SMART_CMD(0x04),
311 SMART_CMD(0x03),
312 SMART_DAT(0x01),
313 SMART_DAT(0x3F),
314 SMART_DELAY(0),
315
316 /* DISP RAM setting: 240*320 */
317 SMART_CMD(0x04), /* HADDR, START 0 */
318 SMART_CMD(0x06),
319 SMART_DAT(0x00),
320 SMART_DAT(0x00), /* x1,3 */
321 SMART_CMD(0x04), /* HADDR, END 4 */
322 SMART_CMD(0x07),
323 SMART_DAT(0x00),
324 SMART_DAT(0xEF), /* x2, 7 */
325 SMART_CMD(0x04), /* VADDR, START 8 */
326 SMART_CMD(0x08),
327 SMART_DAT(0x00), /* y1, 10 */
328 SMART_DAT(0x00), /* y1, 11 */
329 SMART_CMD(0x04), /* VADDR, END 12 */
330 SMART_CMD(0x09),
331 SMART_DAT(0x01), /* y2, 14 */
332 SMART_DAT(0x3F), /* y2, 15 */
333 SMART_CMD(0x02), /* RAM ADDR SETTING 16 */
334 SMART_CMD(0x00),
335 SMART_DAT(0x00),
336 SMART_DAT(0x00), /* x1, 19 */
337 SMART_CMD(0x02), /* RAM ADDR SETTING 20 */
338 SMART_CMD(0x01),
339 SMART_DAT(0x00), /* y1, 22 */
340 SMART_DAT(0x00), /* y1, 23 */
341};
342
343static uint16_t panel_on[] = {
344 /* Power-IC ON */
345 SMART_CMD(0x01),
346 SMART_CMD(0x02),
347 SMART_DAT(0x07),
348 SMART_DAT(0x7D),
349 SMART_CMD(0x01),
350 SMART_CMD(0x03),
351 SMART_DAT(0x00),
352 SMART_DAT(0x05),
353 SMART_CMD(0x01),
354 SMART_CMD(0x04),
355 SMART_DAT(0x00),
356 SMART_DAT(0x00),
357 SMART_CMD(0x01),
358 SMART_CMD(0x05),
359 SMART_DAT(0x00),
360 SMART_DAT(0x15),
361 SMART_CMD(0x01),
362 SMART_CMD(0x00),
363 SMART_DAT(0xC0),
364 SMART_DAT(0x10),
365 SMART_DELAY(30),
366
367 /* DISP ON */
368 SMART_CMD(0x01),
369 SMART_CMD(0x01),
370 SMART_DAT(0x00),
371 SMART_DAT(0x01),
372 SMART_CMD(0x01),
373 SMART_CMD(0x00),
374 SMART_DAT(0xFF),
375 SMART_DAT(0xFE),
376 SMART_DELAY(150),
377};
378
379static uint16_t panel_off[] = {
380 SMART_CMD(0x00),
381 SMART_CMD(0x1E),
382 SMART_DAT(0x00),
383 SMART_DAT(0x0A),
384 SMART_CMD(0x01),
385 SMART_CMD(0x00),
386 SMART_DAT(0xFF),
387 SMART_DAT(0xEE),
388 SMART_CMD(0x01),
389 SMART_CMD(0x00),
390 SMART_DAT(0xF8),
391 SMART_DAT(0x12),
392 SMART_CMD(0x01),
393 SMART_CMD(0x00),
394 SMART_DAT(0xE8),
395 SMART_DAT(0x11),
396 SMART_CMD(0x01),
397 SMART_CMD(0x00),
398 SMART_DAT(0xC0),
399 SMART_DAT(0x11),
400 SMART_CMD(0x01),
401 SMART_CMD(0x00),
402 SMART_DAT(0x40),
403 SMART_DAT(0x11),
404 SMART_CMD(0x01),
405 SMART_CMD(0x00),
406 SMART_DAT(0x00),
407 SMART_DAT(0x10),
408};
409
410static uint16_t update_framedata[] = {
411 /* write ram */
412 SMART_CMD(0x02),
413 SMART_CMD(0x02),
414
415 /* write frame data */
416 SMART_CMD_WRITE_FRAME,
417};
418
419static void ltm020d550_lcd_power(int on, struct fb_var_screeninfo *var)
420{
421 struct fb_info *info = container_of(var, struct fb_info, var);
422
423 if (on) {
424 pxafb_smart_queue(info, ARRAY_AND_SIZE(panel_init));
425 pxafb_smart_queue(info, ARRAY_AND_SIZE(panel_on));
426 } else {
427 pxafb_smart_queue(info, ARRAY_AND_SIZE(panel_off));
428 }
429
430 if (pxafb_smart_flush(info))
431 pr_err("%s: timed out\n", __func__);
432}
433
434static void ltm020d550_update(struct fb_info *info)
435{
436 pxafb_smart_queue(info, ARRAY_AND_SIZE(update_framedata));
437 pxafb_smart_flush(info);
438}
439
440static struct pxafb_mode_info toshiba_ltm020d550_modes[] = {
441 [0] = {
442 .xres = 240,
443 .yres = 320,
444 .bpp = 16,
445 .a0csrd_set_hld = 30,
446 .a0cswr_set_hld = 30,
447 .wr_pulse_width = 30,
448 .rd_pulse_width = 170,
449 .op_hold_time = 30,
450 .cmd_inh_time = 60,
451
452 /* L_LCLK_A0 and L_LCLK_RD active low */
453 .sync = FB_SYNC_HOR_HIGH_ACT |
454 FB_SYNC_VERT_HIGH_ACT,
455 },
456};
457
458static struct pxafb_mach_info tavorevb_lcd_info = {
459 .modes = toshiba_ltm020d550_modes,
460 .num_modes = 1,
461 .lcd_conn = LCD_SMART_PANEL_8BPP | LCD_PCLK_EDGE_FALL,
462 .pxafb_lcd_power = ltm020d550_lcd_power,
463 .smart_update = ltm020d550_update,
464};
465
466static void __init tavorevb_init_lcd(void)
467{
468 platform_device_register(&tavorevb_backlight_devices[0]);
469 platform_device_register(&tavorevb_backlight_devices[1]);
470 set_pxa_fb_info(&tavorevb_lcd_info);
471}
472#else
473static inline void tavorevb_init_lcd(void) {}
474#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
475
67static void __init tavorevb_init(void) 476static void __init tavorevb_init(void)
68{ 477{
69 /* initialize MFP configurations */ 478 /* initialize MFP configurations */
70 pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg)); 479 pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg));
71 480
72 platform_device_register(&smc91x_device); 481 platform_device_register(&smc91x_device);
482
483 tavorevb_init_lcd();
484 tavorevb_init_keypad();
73} 485}
74 486
75MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") 487MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index ef4ddf9d504..00162415851 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -24,7 +24,6 @@
24#include <asm/mach/time.h> 24#include <asm/mach/time.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/pxa-regs.h> 26#include <mach/pxa-regs.h>
27#include <asm/mach-types.h>
28 27
29/* 28/*
30 * This is PXA's sched_clock implementation. This has a resolution 29 * This is PXA's sched_clock implementation. This has a resolution
@@ -151,18 +150,11 @@ static struct irqaction pxa_ost0_irq = {
151 150
152static void __init pxa_timer_init(void) 151static void __init pxa_timer_init(void)
153{ 152{
154 unsigned long clock_tick_rate; 153 unsigned long clock_tick_rate = get_clock_tick_rate();
155 154
156 OIER = 0; 155 OIER = 0;
157 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3; 156 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
158 157
159 if (cpu_is_pxa25x())
160 clock_tick_rate = 3686400;
161 else if (machine_is_mainstone())
162 clock_tick_rate = 3249600;
163 else
164 clock_tick_rate = 3250000;
165
166 set_oscr2ns_scale(clock_tick_rate); 158 set_oscr2ns_scale(clock_tick_rate);
167 159
168 ckevt_pxa_osmr0.mult = 160 ckevt_pxa_osmr0.mult =
diff --git a/arch/arm/mach-sa1100/include/mach/hardware.h b/arch/arm/mach-sa1100/include/mach/hardware.h
index b70846c096a..60711822b12 100644
--- a/arch/arm/mach-sa1100/include/mach/hardware.h
+++ b/arch/arm/mach-sa1100/include/mach/hardware.h
@@ -59,6 +59,10 @@
59# define __REG(x) (*((volatile unsigned long *)io_p2v(x))) 59# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
60# define __PREG(x) (io_v2p((unsigned long)&(x))) 60# define __PREG(x) (io_v2p((unsigned long)&(x)))
61 61
62static inline unsigned long get_clock_tick_rate(void)
63{
64 return 3686400;
65}
62#else 66#else
63 67
64# define __REG(x) io_p2v(x) 68# define __REG(x) io_p2v(x)