aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6450.c')
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c117
1 files changed, 107 insertions, 10 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 33f2adf8f3fe..efb69e2f2afe 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -23,7 +23,12 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
26#include <linux/fb.h>
27#include <linux/mmc/host.h>
26 28
29#include <video/platform_lcd.h>
30
31#include <asm/hardware/vic.h>
27#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 33#include <asm/mach/map.h>
29#include <asm/irq.h> 34#include <asm/irq.h>
@@ -37,7 +42,6 @@
37 42
38#include <plat/regs-serial.h> 43#include <plat/regs-serial.h>
39#include <plat/gpio-cfg.h> 44#include <plat/gpio-cfg.h>
40#include <plat/s5p6450.h>
41#include <plat/clock.h> 45#include <plat/clock.h>
42#include <plat/devs.h> 46#include <plat/devs.h>
43#include <plat/cpu.h> 47#include <plat/cpu.h>
@@ -47,6 +51,11 @@
47#include <plat/ts.h> 51#include <plat/ts.h>
48#include <plat/s5p-time.h> 52#include <plat/s5p-time.h>
49#include <plat/backlight.h> 53#include <plat/backlight.h>
54#include <plat/fb.h>
55#include <plat/regs-fb.h>
56#include <plat/sdhci.h>
57
58#include "common.h"
50 59
51#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 60#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 61 S3C2410_UCON_RXILEVEL | \
@@ -110,6 +119,59 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
110#endif 119#endif
111}; 120};
112 121
122/* Frame Buffer */
123static struct s3c_fb_pd_win smdk6450_fb_win0 = {
124 .win_mode = {
125 .left_margin = 8,
126 .right_margin = 13,
127 .upper_margin = 7,
128 .lower_margin = 5,
129 .hsync_len = 3,
130 .vsync_len = 1,
131 .xres = 800,
132 .yres = 480,
133 },
134 .max_bpp = 32,
135 .default_bpp = 24,
136};
137
138static struct s3c_fb_platdata smdk6450_lcd_pdata __initdata = {
139 .win[0] = &smdk6450_fb_win0,
140 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
141 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
142 .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
143};
144
145/* LCD power controller */
146static void smdk6450_lte480_reset_power(struct plat_lcd_data *pd,
147 unsigned int power)
148{
149 int err;
150
151 if (power) {
152 err = gpio_request(S5P6450_GPN(5), "GPN");
153 if (err) {
154 printk(KERN_ERR "failed to request GPN for lcd reset\n");
155 return;
156 }
157
158 gpio_direction_output(S5P6450_GPN(5), 1);
159 gpio_set_value(S5P6450_GPN(5), 0);
160 gpio_set_value(S5P6450_GPN(5), 1);
161 gpio_free(S5P6450_GPN(5));
162 }
163}
164
165static struct plat_lcd_data smdk6450_lcd_power_data = {
166 .set_power = smdk6450_lte480_reset_power,
167};
168
169static struct platform_device smdk6450_lcd_lte480wv = {
170 .name = "platform-lcd",
171 .dev.parent = &s3c_device_fb.dev,
172 .dev.platform_data = &smdk6450_lcd_power_data,
173};
174
113static struct platform_device *smdk6450_devices[] __initdata = { 175static struct platform_device *smdk6450_devices[] __initdata = {
114 &s3c_device_adc, 176 &s3c_device_adc,
115 &s3c_device_rtc, 177 &s3c_device_rtc,
@@ -119,9 +181,30 @@ static struct platform_device *smdk6450_devices[] __initdata = {
119 &s3c_device_wdt, 181 &s3c_device_wdt,
120 &samsung_asoc_dma, 182 &samsung_asoc_dma,
121 &s5p6450_device_iis0, 183 &s5p6450_device_iis0,
184 &s3c_device_fb,
185 &smdk6450_lcd_lte480wv,
186 &s3c_device_hsmmc0,
187 &s3c_device_hsmmc1,
188 &s3c_device_hsmmc2,
122 /* s5p6450_device_spi0 will be added */ 189 /* s5p6450_device_spi0 will be added */
123}; 190};
124 191
192static struct s3c_sdhci_platdata smdk6450_hsmmc0_pdata __initdata = {
193 .cd_type = S3C_SDHCI_CD_NONE,
194};
195
196static struct s3c_sdhci_platdata smdk6450_hsmmc1_pdata __initdata = {
197 .cd_type = S3C_SDHCI_CD_NONE,
198#if defined(CONFIG_S5P64X0_SD_CH1_8BIT)
199 .max_width = 8,
200 .host_caps = MMC_CAP_8_BIT_DATA,
201#endif
202};
203
204static struct s3c_sdhci_platdata smdk6450_hsmmc2_pdata __initdata = {
205 .cd_type = S3C_SDHCI_CD_NONE,
206};
207
125static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata = { 208static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata = {
126 .flags = 0, 209 .flags = 0,
127 .slave_addr = 0x10, 210 .slave_addr = 0x10,
@@ -148,12 +231,6 @@ static struct i2c_board_info smdk6450_i2c_devs1[] __initdata = {
148 { I2C_BOARD_INFO("24c128", 0x57), },/* Samsung S524AD0XD1 EEPROM */ 231 { I2C_BOARD_INFO("24c128", 0x57), },/* Samsung S524AD0XD1 EEPROM */
149}; 232};
150 233
151static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
152 .delay = 10000,
153 .presc = 49,
154 .oversampling_shift = 2,
155};
156
157/* LCD Backlight data */ 234/* LCD Backlight data */
158static struct samsung_bl_gpio_info smdk6450_bl_gpio_info = { 235static struct samsung_bl_gpio_info smdk6450_bl_gpio_info = {
159 .no = S5P6450_GPF(15), 236 .no = S5P6450_GPF(15),
@@ -166,15 +243,26 @@ static struct platform_pwm_backlight_data smdk6450_bl_data = {
166 243
167static void __init smdk6450_map_io(void) 244static void __init smdk6450_map_io(void)
168{ 245{
169 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 246 s5p64x0_init_io(NULL, 0);
170 s3c24xx_init_clocks(19200000); 247 s3c24xx_init_clocks(19200000);
171 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs)); 248 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs));
172 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 249 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
173} 250}
174 251
252static void s5p6450_set_lcd_interface(void)
253{
254 unsigned int cfg;
255
256 /* select TFT LCD type (RGB I/F) */
257 cfg = __raw_readl(S5P64X0_SPCON0);
258 cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
259 cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
260 __raw_writel(cfg, S5P64X0_SPCON0);
261}
262
175static void __init smdk6450_machine_init(void) 263static void __init smdk6450_machine_init(void)
176{ 264{
177 s3c24xx_ts_set_platdata(&s3c_ts_platform); 265 s3c24xx_ts_set_platdata(NULL);
178 266
179 s3c_i2c0_set_platdata(&s5p6450_i2c0_data); 267 s3c_i2c0_set_platdata(&s5p6450_i2c0_data);
180 s3c_i2c1_set_platdata(&s5p6450_i2c1_data); 268 s3c_i2c1_set_platdata(&s5p6450_i2c1_data);
@@ -185,15 +273,24 @@ static void __init smdk6450_machine_init(void)
185 273
186 samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data); 274 samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
187 275
276 s5p6450_set_lcd_interface();
277 s3c_fb_set_platdata(&smdk6450_lcd_pdata);
278
279 s3c_sdhci0_set_platdata(&smdk6450_hsmmc0_pdata);
280 s3c_sdhci1_set_platdata(&smdk6450_hsmmc1_pdata);
281 s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata);
282
188 platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); 283 platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
189} 284}
190 285
191MACHINE_START(SMDK6450, "SMDK6450") 286MACHINE_START(SMDK6450, "SMDK6450")
192 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 287 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
193 .boot_params = S5P64X0_PA_SDRAM + 0x100, 288 .atag_offset = 0x100,
194 289
195 .init_irq = s5p6450_init_irq, 290 .init_irq = s5p6450_init_irq,
291 .handle_irq = vic_handle_irq,
196 .map_io = smdk6450_map_io, 292 .map_io = smdk6450_map_io,
197 .init_machine = smdk6450_machine_init, 293 .init_machine = smdk6450_machine_init,
198 .timer = &s5p_timer, 294 .timer = &s5p_timer,
295 .restart = s5p64x0_restart,
199MACHINE_END 296MACHINE_END