aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig9
-rw-r--r--arch/arm/mach-s3c64xx/Makefile1
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c152
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c40
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq5.c36
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq7.c28
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c2
8 files changed, 208 insertions, 62 deletions
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index f5a59727949f..f5c77e5d3d88 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -88,6 +88,15 @@ config MACH_ANW6410
88 help 88 help
89 Machine support for the A&W6410 89 Machine support for the A&W6410
90 90
91config MACH_REAL6410
92 bool "REAL6410"
93 select CPU_S3C6410
94 select S3C_DEV_HSMMC
95 select S3C_DEV_HSMMC1
96 select S3C64XX_SETUP_SDHCI
97 help
98 Machine support for the CoreWind REAL6410
99
91config MACH_SMDK6410 100config MACH_SMDK6410
92 bool "SMDK6410" 101 bool "SMDK6410"
93 select CPU_S3C6410 102 select CPU_S3C6410
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 9d1006938f5c..6be3e5b23009 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -50,6 +50,7 @@ obj-$(CONFIG_PM) += irq-pm.o
50obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o 50obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
51obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o 51obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
52obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 52obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
53obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o
53obj-$(CONFIG_MACH_NCP) += mach-ncp.o 54obj-$(CONFIG_MACH_NCP) += mach-ncp.o
54obj-$(CONFIG_MACH_HMT) += mach-hmt.o 55obj-$(CONFIG_MACH_HMT) += mach-hmt.o
55obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o 56obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o
diff --git a/arch/arm/mach-s3c64xx/include/mach/memory.h b/arch/arm/mach-s3c64xx/include/mach/memory.h
index a3ac84a65480..42cc54e2ee30 100644
--- a/arch/arm/mach-s3c64xx/include/mach/memory.h
+++ b/arch/arm/mach-s3c64xx/include/mach/memory.h
@@ -15,4 +15,6 @@
15 15
16#define PHYS_OFFSET UL(0x50000000) 16#define PHYS_OFFSET UL(0x50000000)
17 17
18#define CONSISTENT_DMA_SIZE SZ_8M
19
18#endif 20#endif
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
new file mode 100644
index 000000000000..5c07d013b23d
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -0,0 +1,152 @@
1/* linux/arch/arm/mach-s3c64xx/mach-real6410.c
2 *
3 * Copyright 2010 Darius Augulis <augulis.darius@gmail.com>
4 * Copyright 2008 Openmoko, Inc.
5 * Copyright 2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/list.h>
19#include <linux/init.h>
20#include <linux/dm9000.h>
21#include <linux/serial_core.h>
22#include <linux/platform_device.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26#include <mach/map.h>
27#include <mach/s3c6410.h>
28#include <mach/regs-srom.h>
29#include <plat/cpu.h>
30#include <plat/devs.h>
31#include <plat/regs-serial.h>
32
33#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
34#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
35#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
36
37static struct s3c2410_uartcfg real6410_uartcfgs[] __initdata = {
38 [0] = {
39 .hwport = 0,
40 .flags = 0,
41 .ucon = UCON,
42 .ulcon = ULCON,
43 .ufcon = UFCON,
44 },
45 [1] = {
46 .hwport = 1,
47 .flags = 0,
48 .ucon = UCON,
49 .ulcon = ULCON,
50 .ufcon = UFCON,
51 },
52 [2] = {
53 .hwport = 2,
54 .flags = 0,
55 .ucon = UCON,
56 .ulcon = ULCON,
57 .ufcon = UFCON,
58 },
59 [3] = {
60 .hwport = 3,
61 .flags = 0,
62 .ucon = UCON,
63 .ulcon = ULCON,
64 .ufcon = UFCON,
65 },
66};
67
68/* DM9000AEP 10/100 ethernet controller */
69
70static struct resource real6410_dm9k_resource[] = {
71 [0] = {
72 .start = S3C64XX_PA_XM0CSN1,
73 .end = S3C64XX_PA_XM0CSN1 + 1,
74 .flags = IORESOURCE_MEM
75 },
76 [1] = {
77 .start = S3C64XX_PA_XM0CSN1 + 4,
78 .end = S3C64XX_PA_XM0CSN1 + 5,
79 .flags = IORESOURCE_MEM
80 },
81 [2] = {
82 .start = S3C_EINT(7),
83 .end = S3C_EINT(7),
84 .flags = IORESOURCE_IRQ,
85 }
86};
87
88static struct dm9000_plat_data real6410_dm9k_pdata = {
89 .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
90};
91
92static struct platform_device real6410_device_eth = {
93 .name = "dm9000",
94 .id = -1,
95 .num_resources = ARRAY_SIZE(real6410_dm9k_resource),
96 .resource = real6410_dm9k_resource,
97 .dev = {
98 .platform_data = &real6410_dm9k_pdata,
99 },
100};
101
102static struct platform_device *real6410_devices[] __initdata = {
103 &real6410_device_eth,
104 &s3c_device_hsmmc0,
105 &s3c_device_hsmmc1,
106};
107
108static void __init real6410_map_io(void)
109{
110 s3c64xx_init_io(NULL, 0);
111 s3c24xx_init_clocks(12000000);
112 s3c24xx_init_uarts(real6410_uartcfgs, ARRAY_SIZE(real6410_uartcfgs));
113}
114
115static void __init real6410_machine_init(void)
116{
117 u32 cs1;
118
119 /* configure nCS1 width to 16 bits */
120
121 cs1 = __raw_readl(S3C64XX_SROM_BW) &
122 ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT);
123 cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) |
124 (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) |
125 (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) <<
126 S3C64XX_SROM_BW__NCS1__SHIFT;
127 __raw_writel(cs1, S3C64XX_SROM_BW);
128
129 /* set timing for nCS1 suitable for ethernet chip */
130
131 __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) |
132 (6 << S3C64XX_SROM_BCX__TACP__SHIFT) |
133 (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) |
134 (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) |
135 (13 << S3C64XX_SROM_BCX__TACC__SHIFT) |
136 (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) |
137 (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1);
138
139 platform_add_devices(real6410_devices, ARRAY_SIZE(real6410_devices));
140}
141
142MACHINE_START(REAL6410, "REAL6410")
143 /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
144 .phys_io = S3C_PA_UART & 0xfff00000,
145 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
146 .boot_params = S3C64XX_PA_SDRAM + 0x100,
147
148 .init_irq = s3c6410_init_irq,
149 .map_io = real6410_map_io,
150 .init_machine = real6410_machine_init,
151 .timer = &s3c24xx_timer,
152MACHINE_END
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index 028d080dcd35..3a9639bc3d9b 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/pwm_backlight.h> 17#include <linux/pwm_backlight.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/spi/spi_gpio.h>
19#include <linux/usb/gpio_vbus.h> 20#include <linux/usb/gpio_vbus.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
@@ -166,7 +167,7 @@ static struct s3c2410_ts_mach_info smartq_touchscreen_pdata __initdata = {
166 167
167static struct s3c_sdhci_platdata smartq_internal_hsmmc_pdata = { 168static struct s3c_sdhci_platdata smartq_internal_hsmmc_pdata = {
168 .max_width = 4, 169 .max_width = 4,
169 /*.broken_card_detection = true,*/ 170 .cd_type = S3C_SDHCI_CD_PERMANENT,
170}; 171};
171 172
172static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = { 173static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
@@ -184,6 +185,33 @@ static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = {
184 }, 185 },
185}; 186};
186 187
188static int __init smartq_lcd_setup_gpio(void)
189{
190 int ret;
191
192 ret = gpio_request(S3C64XX_GPM(3), "LCD power");
193 if (ret < 0)
194 return ret;
195
196 /* turn power off */
197 gpio_direction_output(S3C64XX_GPM(3), 0);
198
199 return 0;
200}
201
202/* GPM0 -> CS */
203static struct spi_gpio_platform_data smartq_lcd_control = {
204 .sck = S3C64XX_GPM(1),
205 .mosi = S3C64XX_GPM(2),
206 .miso = S3C64XX_GPM(2),
207};
208
209static struct platform_device smartq_lcd_control_device = {
210 .name = "spi-gpio",
211 .id = 1,
212 .dev.platform_data = &smartq_lcd_control,
213};
214
187static void smartq_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) 215static void smartq_lcd_power_set(struct plat_lcd_data *pd, unsigned int power)
188{ 216{
189 gpio_direction_output(S3C64XX_GPM(3), power); 217 gpio_direction_output(S3C64XX_GPM(3), power);
@@ -199,6 +227,9 @@ static struct platform_device smartq_lcd_power_device = {
199 .dev.platform_data = &smartq_lcd_power_data, 227 .dev.platform_data = &smartq_lcd_power_data,
200}; 228};
201 229
230static struct i2c_board_info smartq_i2c_devs[] __initdata = {
231 { I2C_BOARD_INFO("wm8987", 0x1a), },
232};
202 233
203static struct platform_device *smartq_devices[] __initdata = { 234static struct platform_device *smartq_devices[] __initdata = {
204 &s3c_device_hsmmc1, /* Init iNAND first, ... */ 235 &s3c_device_hsmmc1, /* Init iNAND first, ... */
@@ -213,7 +244,9 @@ static struct platform_device *smartq_devices[] __initdata = {
213 &s3c_device_timer[1], 244 &s3c_device_timer[1],
214 &s3c_device_ts, 245 &s3c_device_ts,
215 &s3c_device_usb_hsotg, 246 &s3c_device_usb_hsotg,
247 &s3c64xx_device_iis0,
216 &smartq_backlight_device, 248 &smartq_backlight_device,
249 &smartq_lcd_control_device,
217 &smartq_lcd_power_device, 250 &smartq_lcd_power_device,
218 &smartq_usb_otg_vbus_dev, 251 &smartq_usb_otg_vbus_dev,
219}; 252};
@@ -252,7 +285,6 @@ static int __init smartq_power_off_init(void)
252 /* leave power on */ 285 /* leave power on */
253 gpio_direction_output(S3C64XX_GPK(15), 0); 286 gpio_direction_output(S3C64XX_GPK(15), 0);
254 287
255
256 pm_power_off = smartq_power_off; 288 pm_power_off = smartq_power_off;
257 289
258 return ret; 290 return ret;
@@ -354,6 +386,10 @@ void __init smartq_machine_init(void)
354 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata); 386 s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
355 s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata); 387 s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata);
356 388
389 i2c_register_board_info(0, smartq_i2c_devs,
390 ARRAY_SIZE(smartq_i2c_devs));
391
392 WARN_ON(smartq_lcd_setup_gpio());
357 WARN_ON(smartq_power_off_init()); 393 WARN_ON(smartq_power_off_init());
358 WARN_ON(smartq_usb_host_init()); 394 WARN_ON(smartq_usb_host_init());
359 WARN_ON(smartq_usb_otg_init()); 395 WARN_ON(smartq_usb_otg_init());
diff --git a/arch/arm/mach-s3c64xx/mach-smartq5.c b/arch/arm/mach-s3c64xx/mach-smartq5.c
index 1d0326ead90f..70bcbcac4f0f 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq5.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq5.c
@@ -12,7 +12,6 @@
12#include <linux/fb.h> 12#include <linux/fb.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/gpio_keys.h> 14#include <linux/gpio_keys.h>
15#include <linux/i2c-gpio.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/input.h> 16#include <linux/input.h>
18#include <linux/leds.h> 17#include <linux/leds.h>
@@ -33,31 +32,6 @@
33 32
34#include "mach-smartq.h" 33#include "mach-smartq.h"
35 34
36static void __init smartq5_lcd_setup_gpio(void)
37{
38 gpio_request(S3C64XX_GPM(0), "LCD SCEN pin");
39 gpio_request(S3C64XX_GPM(1), "LCD SCL pin");
40 gpio_request(S3C64XX_GPM(2), "LCD SDA pin");
41 gpio_request(S3C64XX_GPM(3), "LCD power");
42
43 /* turn power off */
44 gpio_direction_output(S3C64XX_GPM(0), 1);
45 gpio_direction_input(S3C64XX_GPM(1));
46 gpio_direction_input(S3C64XX_GPM(2));
47 gpio_direction_output(S3C64XX_GPM(3), 0);
48}
49
50static struct i2c_gpio_platform_data smartq5_lcd_control = {
51 .sda_pin = S3C64XX_GPM(2),
52 .scl_pin = S3C64XX_GPM(1),
53};
54
55static struct platform_device smartq5_lcd_control_device = {
56 .name = "i2c-gpio",
57 .id = 1,
58 .dev.platform_data = &smartq5_lcd_control,
59};
60
61static struct gpio_led smartq5_leds[] __initdata = { 35static struct gpio_led smartq5_leds[] __initdata = {
62 { 36 {
63 .name = "smartq5:green", 37 .name = "smartq5:green",
@@ -136,10 +110,10 @@ static struct s3c_fb_pd_win smartq5_fb_win0 = {
136 .win_mode = { 110 .win_mode = {
137 .pixclock = 1000000000000ULL / 111 .pixclock = 1000000000000ULL /
138 ((40+1+216+800)*(10+1+35+480)*80), 112 ((40+1+216+800)*(10+1+35+480)*80),
139 .left_margin = 40, 113 .left_margin = 216,
140 .right_margin = 216, 114 .right_margin = 40,
141 .upper_margin = 10, 115 .upper_margin = 35,
142 .lower_margin = 35, 116 .lower_margin = 10,
143 .hsync_len = 1, 117 .hsync_len = 1,
144 .vsync_len = 1, 118 .vsync_len = 1,
145 .xres = 800, 119 .xres = 800,
@@ -160,7 +134,6 @@ static struct s3c_fb_platdata smartq5_lcd_pdata __initdata = {
160static struct platform_device *smartq5_devices[] __initdata = { 134static struct platform_device *smartq5_devices[] __initdata = {
161 &smartq5_leds_device, 135 &smartq5_leds_device,
162 &smartq5_buttons_device, 136 &smartq5_buttons_device,
163 &smartq5_lcd_control_device,
164}; 137};
165 138
166static void __init smartq5_machine_init(void) 139static void __init smartq5_machine_init(void)
@@ -168,7 +141,6 @@ static void __init smartq5_machine_init(void)
168 s3c_fb_set_platdata(&smartq5_lcd_pdata); 141 s3c_fb_set_platdata(&smartq5_lcd_pdata);
169 142
170 smartq_machine_init(); 143 smartq_machine_init();
171 smartq5_lcd_setup_gpio();
172 144
173 platform_add_devices(smartq5_devices, ARRAY_SIZE(smartq5_devices)); 145 platform_add_devices(smartq5_devices, ARRAY_SIZE(smartq5_devices));
174} 146}
diff --git a/arch/arm/mach-s3c64xx/mach-smartq7.c b/arch/arm/mach-s3c64xx/mach-smartq7.c
index e0bc78ecb156..c4868dbd2fe2 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq7.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq7.c
@@ -12,7 +12,6 @@
12#include <linux/fb.h> 12#include <linux/fb.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/gpio_keys.h> 14#include <linux/gpio_keys.h>
15#include <linux/i2c-gpio.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/input.h> 16#include <linux/input.h>
18#include <linux/leds.h> 17#include <linux/leds.h>
@@ -33,31 +32,6 @@
33 32
34#include "mach-smartq.h" 33#include "mach-smartq.h"
35 34
36static void __init smartq7_lcd_setup_gpio(void)
37{
38 gpio_request(S3C64XX_GPM(0), "LCD CSB pin");
39 gpio_request(S3C64XX_GPM(3), "LCD power");
40 gpio_request(S3C64XX_GPM(4), "LCD power status");
41
42 /* turn power off */
43 gpio_direction_output(S3C64XX_GPM(0), 1);
44 gpio_direction_output(S3C64XX_GPM(3), 0);
45 gpio_direction_input(S3C64XX_GPM(4));
46}
47
48static struct i2c_gpio_platform_data smartq7_lcd_control = {
49 .sda_pin = S3C64XX_GPM(2),
50 .scl_pin = S3C64XX_GPM(1),
51 .sda_is_open_drain = 1,
52 .scl_is_open_drain = 1,
53};
54
55static struct platform_device smartq7_lcd_control_device = {
56 .name = "i2c-gpio",
57 .id = 1,
58 .dev.platform_data = &smartq7_lcd_control,
59};
60
61static struct gpio_led smartq7_leds[] __initdata = { 35static struct gpio_led smartq7_leds[] __initdata = {
62 { 36 {
63 .name = "smartq7:red", 37 .name = "smartq7:red",
@@ -176,7 +150,6 @@ static struct s3c_fb_platdata smartq7_lcd_pdata __initdata = {
176static struct platform_device *smartq7_devices[] __initdata = { 150static struct platform_device *smartq7_devices[] __initdata = {
177 &smartq7_leds_device, 151 &smartq7_leds_device,
178 &smartq7_buttons_device, 152 &smartq7_buttons_device,
179 &smartq7_lcd_control_device,
180}; 153};
181 154
182static void __init smartq7_machine_init(void) 155static void __init smartq7_machine_init(void)
@@ -184,7 +157,6 @@ static void __init smartq7_machine_init(void)
184 s3c_fb_set_platdata(&smartq7_lcd_pdata); 157 s3c_fb_set_platdata(&smartq7_lcd_pdata);
185 158
186 smartq_machine_init(); 159 smartq_machine_init();
187 smartq7_lcd_setup_gpio();
188 160
189 platform_add_devices(smartq7_devices, ARRAY_SIZE(smartq7_devices)); 161 platform_add_devices(smartq7_devices, ARRAY_SIZE(smartq7_devices));
190} 162}
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index d9a03555f88b..ed9296f678ae 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -153,6 +153,8 @@ static struct s3c_fb_pd_win smdk6410_fb_win0 = {
153 }, 153 },
154 .max_bpp = 32, 154 .max_bpp = 32,
155 .default_bpp = 16, 155 .default_bpp = 16,
156 .virtual_y = 480 * 2,
157 .virtual_x = 800,
156}; 158};
157 159
158/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */ 160/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */