1 /* linux/arch/arm/mach-s5p64x0/mach-smdk6450.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/interrupt.h>
14 #include <linux/list.h>
15 #include <linux/timer.h>
16 #include <linux/delay.h>
17 #include <linux/init.h>
18 #include <linux/i2c.h>
19 #include <linux/serial_core.h>
20 #include <linux/serial_s3c.h>
21 #include <linux/platform_device.h>
23 #include <linux/module.h>
24 #include <linux/clk.h>
25 #include <linux/gpio.h>
26 #include <linux/pwm_backlight.h>
28 #include <linux/mmc/host.h>
30 #include <video/platform_lcd.h>
31 #include <video/samsung_fimd.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
36 #include <asm/mach-types.h>
38 #include <mach/hardware.h>
40 #include <mach/regs-clock.h>
41 #include <mach/regs-gpio.h>
43 #include <plat/gpio-cfg.h>
44 #include <plat/clock.h>
45 #include <plat/devs.h>
47 #include <linux/platform_data/i2c-s3c2410.h>
50 #include <linux/platform_data/touchscreen-s3c2410.h>
51 #include <plat/samsung-time.h>
52 #include <plat/backlight.h>
54 #include <plat/sdhci.h>
59 #define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
60 S3C2410_UCON_RXILEVEL | \
61 S3C2410_UCON_TXIRQMODE | \
62 S3C2410_UCON_RXIRQMODE | \
63 S3C2410_UCON_RXFIFO_TOI | \
64 S3C2443_UCON_RXERR_IRQEN)
66 #define SMDK6450_ULCON_DEFAULT S3C2410_LCON_CS8
68 #define SMDK6450_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
69 S3C2440_UFCON_TXTRIG16 | \
70 S3C2410_UFCON_RXTRIG8)
72 static struct s3c2410_uartcfg smdk6450_uartcfgs
[] __initdata
= {
76 .ucon
= SMDK6450_UCON_DEFAULT
,
77 .ulcon
= SMDK6450_ULCON_DEFAULT
,
78 .ufcon
= SMDK6450_UFCON_DEFAULT
,
83 .ucon
= SMDK6450_UCON_DEFAULT
,
84 .ulcon
= SMDK6450_ULCON_DEFAULT
,
85 .ufcon
= SMDK6450_UFCON_DEFAULT
,
90 .ucon
= SMDK6450_UCON_DEFAULT
,
91 .ulcon
= SMDK6450_ULCON_DEFAULT
,
92 .ufcon
= SMDK6450_UFCON_DEFAULT
,
97 .ucon
= SMDK6450_UCON_DEFAULT
,
98 .ulcon
= SMDK6450_ULCON_DEFAULT
,
99 .ufcon
= SMDK6450_UFCON_DEFAULT
,
101 #if CONFIG_SERIAL_SAMSUNG_UARTS > 4
105 .ucon
= SMDK6450_UCON_DEFAULT
,
106 .ulcon
= SMDK6450_ULCON_DEFAULT
,
107 .ufcon
= SMDK6450_UFCON_DEFAULT
,
110 #if CONFIG_SERIAL_SAMSUNG_UARTS > 5
114 .ucon
= SMDK6450_UCON_DEFAULT
,
115 .ulcon
= SMDK6450_ULCON_DEFAULT
,
116 .ufcon
= SMDK6450_UFCON_DEFAULT
,
122 static struct s3c_fb_pd_win smdk6450_fb_win0
= {
129 static struct fb_videomode smdk6450_lcd_timing
= {
140 static struct s3c_fb_platdata smdk6450_lcd_pdata __initdata
= {
141 .win
[0] = &smdk6450_fb_win0
,
142 .vtiming
= &smdk6450_lcd_timing
,
143 .vidcon0
= VIDCON0_VIDOUT_RGB
| VIDCON0_PNRMODE_RGB
,
144 .vidcon1
= VIDCON1_INV_HSYNC
| VIDCON1_INV_VSYNC
,
145 .setup_gpio
= s5p64x0_fb_gpio_setup_24bpp
,
148 /* LCD power controller */
149 static void smdk6450_lte480_reset_power(struct plat_lcd_data
*pd
,
155 err
= gpio_request(S5P6450_GPN(5), "GPN");
157 printk(KERN_ERR
"failed to request GPN for lcd reset\n");
161 gpio_direction_output(S5P6450_GPN(5), 1);
162 gpio_set_value(S5P6450_GPN(5), 0);
163 gpio_set_value(S5P6450_GPN(5), 1);
164 gpio_free(S5P6450_GPN(5));
168 static struct plat_lcd_data smdk6450_lcd_power_data
= {
169 .set_power
= smdk6450_lte480_reset_power
,
172 static struct platform_device smdk6450_lcd_lte480wv
= {
173 .name
= "platform-lcd",
174 .dev
.parent
= &s3c_device_fb
.dev
,
175 .dev
.platform_data
= &smdk6450_lcd_power_data
,
178 static struct platform_device
*smdk6450_devices
[] __initdata
= {
186 &s5p6450_device_iis0
,
188 &smdk6450_lcd_lte480wv
,
192 /* s5p6450_device_spi0 will be added */
195 static struct s3c_sdhci_platdata smdk6450_hsmmc0_pdata __initdata
= {
196 .cd_type
= S3C_SDHCI_CD_NONE
,
199 static struct s3c_sdhci_platdata smdk6450_hsmmc1_pdata __initdata
= {
200 .cd_type
= S3C_SDHCI_CD_NONE
,
201 #if defined(CONFIG_S5P64X0_SD_CH1_8BIT)
203 .host_caps
= MMC_CAP_8_BIT_DATA
,
207 static struct s3c_sdhci_platdata smdk6450_hsmmc2_pdata __initdata
= {
208 .cd_type
= S3C_SDHCI_CD_NONE
,
211 static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata
= {
214 .frequency
= 100*1000,
216 .cfg_gpio
= s5p6450_i2c0_cfg_gpio
,
219 static struct s3c2410_platform_i2c s5p6450_i2c1_data __initdata
= {
223 .frequency
= 100*1000,
225 .cfg_gpio
= s5p6450_i2c1_cfg_gpio
,
228 static struct i2c_board_info smdk6450_i2c_devs0
[] __initdata
= {
229 { I2C_BOARD_INFO("wm8580", 0x1b), },
230 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung KS24C080C EEPROM */
233 static struct i2c_board_info smdk6450_i2c_devs1
[] __initdata
= {
234 { I2C_BOARD_INFO("24c128", 0x57), },/* Samsung S524AD0XD1 EEPROM */
237 /* LCD Backlight data */
238 static struct samsung_bl_gpio_info smdk6450_bl_gpio_info
= {
239 .no
= S5P6450_GPF(15),
240 .func
= S3C_GPIO_SFN(2),
243 static struct platform_pwm_backlight_data smdk6450_bl_data
= {
248 static void __init
smdk6450_map_io(void)
250 s5p64x0_init_io(NULL
, 0);
251 s3c24xx_init_clocks(19200000);
252 s3c24xx_init_uarts(smdk6450_uartcfgs
, ARRAY_SIZE(smdk6450_uartcfgs
));
253 samsung_set_timer_source(SAMSUNG_PWM3
, SAMSUNG_PWM4
);
256 static void s5p6450_set_lcd_interface(void)
260 /* select TFT LCD type (RGB I/F) */
261 cfg
= __raw_readl(S5P64X0_SPCON0
);
262 cfg
&= ~S5P64X0_SPCON0_LCD_SEL_MASK
;
263 cfg
|= S5P64X0_SPCON0_LCD_SEL_RGB
;
264 __raw_writel(cfg
, S5P64X0_SPCON0
);
267 static void __init
smdk6450_machine_init(void)
269 s3c24xx_ts_set_platdata(NULL
);
271 s3c_i2c0_set_platdata(&s5p6450_i2c0_data
);
272 s3c_i2c1_set_platdata(&s5p6450_i2c1_data
);
273 i2c_register_board_info(0, smdk6450_i2c_devs0
,
274 ARRAY_SIZE(smdk6450_i2c_devs0
));
275 i2c_register_board_info(1, smdk6450_i2c_devs1
,
276 ARRAY_SIZE(smdk6450_i2c_devs1
));
278 s5p6450_set_lcd_interface();
279 s3c_fb_set_platdata(&smdk6450_lcd_pdata
);
281 s3c_sdhci0_set_platdata(&smdk6450_hsmmc0_pdata
);
282 s3c_sdhci1_set_platdata(&smdk6450_hsmmc1_pdata
);
283 s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata
);
285 platform_add_devices(smdk6450_devices
, ARRAY_SIZE(smdk6450_devices
));
287 samsung_bl_set(&smdk6450_bl_gpio_info
, &smdk6450_bl_data
);
290 MACHINE_START(SMDK6450
, "SMDK6450")
291 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
292 .atag_offset
= 0x100,
294 .init_irq
= s5p6450_init_irq
,
295 .map_io
= smdk6450_map_io
,
296 .init_machine
= smdk6450_machine_init
,
297 .init_time
= samsung_timer_init
,
298 .restart
= s5p64x0_restart
,