aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6440.c')
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c117
1 files changed, 107 insertions, 10 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 346f8dfa6f35..a40e325d62c8 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.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/s5p6440.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 SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 60#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
52 S3C2410_UCON_RXILEVEL | \ 61 S3C2410_UCON_RXILEVEL | \
@@ -92,6 +101,59 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
92 }, 101 },
93}; 102};
94 103
104/* Frame Buffer */
105static struct s3c_fb_pd_win smdk6440_fb_win0 = {
106 .win_mode = {
107 .left_margin = 8,
108 .right_margin = 13,
109 .upper_margin = 7,
110 .lower_margin = 5,
111 .hsync_len = 3,
112 .vsync_len = 1,
113 .xres = 800,
114 .yres = 480,
115 },
116 .max_bpp = 32,
117 .default_bpp = 24,
118};
119
120static struct s3c_fb_platdata smdk6440_lcd_pdata __initdata = {
121 .win[0] = &smdk6440_fb_win0,
122 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
123 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
124 .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
125};
126
127/* LCD power controller */
128static void smdk6440_lte480_reset_power(struct plat_lcd_data *pd,
129 unsigned int power)
130{
131 int err;
132
133 if (power) {
134 err = gpio_request(S5P6440_GPN(5), "GPN");
135 if (err) {
136 printk(KERN_ERR "failed to request GPN for lcd reset\n");
137 return;
138 }
139
140 gpio_direction_output(S5P6440_GPN(5), 1);
141 gpio_set_value(S5P6440_GPN(5), 0);
142 gpio_set_value(S5P6440_GPN(5), 1);
143 gpio_free(S5P6440_GPN(5));
144 }
145}
146
147static struct plat_lcd_data smdk6440_lcd_power_data = {
148 .set_power = smdk6440_lte480_reset_power,
149};
150
151static struct platform_device smdk6440_lcd_lte480wv = {
152 .name = "platform-lcd",
153 .dev.parent = &s3c_device_fb.dev,
154 .dev.platform_data = &smdk6440_lcd_power_data,
155};
156
95static struct platform_device *smdk6440_devices[] __initdata = { 157static struct platform_device *smdk6440_devices[] __initdata = {
96 &s3c_device_adc, 158 &s3c_device_adc,
97 &s3c_device_rtc, 159 &s3c_device_rtc,
@@ -101,6 +163,27 @@ static struct platform_device *smdk6440_devices[] __initdata = {
101 &s3c_device_wdt, 163 &s3c_device_wdt,
102 &samsung_asoc_dma, 164 &samsung_asoc_dma,
103 &s5p6440_device_iis, 165 &s5p6440_device_iis,
166 &s3c_device_fb,
167 &smdk6440_lcd_lte480wv,
168 &s3c_device_hsmmc0,
169 &s3c_device_hsmmc1,
170 &s3c_device_hsmmc2,
171};
172
173static struct s3c_sdhci_platdata smdk6440_hsmmc0_pdata __initdata = {
174 .cd_type = S3C_SDHCI_CD_NONE,
175};
176
177static struct s3c_sdhci_platdata smdk6440_hsmmc1_pdata __initdata = {
178 .cd_type = S3C_SDHCI_CD_INTERNAL,
179#if defined(CONFIG_S5P64X0_SD_CH1_8BIT)
180 .max_width = 8,
181 .host_caps = MMC_CAP_8_BIT_DATA,
182#endif
183};
184
185static struct s3c_sdhci_platdata smdk6440_hsmmc2_pdata __initdata = {
186 .cd_type = S3C_SDHCI_CD_NONE,
104}; 187};
105 188
106static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { 189static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -129,12 +212,6 @@ static struct i2c_board_info smdk6440_i2c_devs1[] __initdata = {
129 /* To be populated */ 212 /* To be populated */
130}; 213};
131 214
132static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
133 .delay = 10000,
134 .presc = 49,
135 .oversampling_shift = 2,
136};
137
138/* LCD Backlight data */ 215/* LCD Backlight data */
139static struct samsung_bl_gpio_info smdk6440_bl_gpio_info = { 216static struct samsung_bl_gpio_info smdk6440_bl_gpio_info = {
140 .no = S5P6440_GPF(15), 217 .no = S5P6440_GPF(15),
@@ -147,15 +224,26 @@ static struct platform_pwm_backlight_data smdk6440_bl_data = {
147 224
148static void __init smdk6440_map_io(void) 225static void __init smdk6440_map_io(void)
149{ 226{
150 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 227 s5p64x0_init_io(NULL, 0);
151 s3c24xx_init_clocks(12000000); 228 s3c24xx_init_clocks(12000000);
152 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs)); 229 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
153 s5p_set_timer_source(S5P_PWM3, S5P_PWM4); 230 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
154} 231}
155 232
233static void s5p6440_set_lcd_interface(void)
234{
235 unsigned int cfg;
236
237 /* select TFT LCD type (RGB I/F) */
238 cfg = __raw_readl(S5P64X0_SPCON0);
239 cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
240 cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
241 __raw_writel(cfg, S5P64X0_SPCON0);
242}
243
156static void __init smdk6440_machine_init(void) 244static void __init smdk6440_machine_init(void)
157{ 245{
158 s3c24xx_ts_set_platdata(&s3c_ts_platform); 246 s3c24xx_ts_set_platdata(NULL);
159 247
160 s3c_i2c0_set_platdata(&s5p6440_i2c0_data); 248 s3c_i2c0_set_platdata(&s5p6440_i2c0_data);
161 s3c_i2c1_set_platdata(&s5p6440_i2c1_data); 249 s3c_i2c1_set_platdata(&s5p6440_i2c1_data);
@@ -166,15 +254,24 @@ static void __init smdk6440_machine_init(void)
166 254
167 samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data); 255 samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
168 256
257 s5p6440_set_lcd_interface();
258 s3c_fb_set_platdata(&smdk6440_lcd_pdata);
259
260 s3c_sdhci0_set_platdata(&smdk6440_hsmmc0_pdata);
261 s3c_sdhci1_set_platdata(&smdk6440_hsmmc1_pdata);
262 s3c_sdhci2_set_platdata(&smdk6440_hsmmc2_pdata);
263
169 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); 264 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
170} 265}
171 266
172MACHINE_START(SMDK6440, "SMDK6440") 267MACHINE_START(SMDK6440, "SMDK6440")
173 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 268 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
174 .boot_params = S5P64X0_PA_SDRAM + 0x100, 269 .atag_offset = 0x100,
175 270
176 .init_irq = s5p6440_init_irq, 271 .init_irq = s5p6440_init_irq,
272 .handle_irq = vic_handle_irq,
177 .map_io = smdk6440_map_io, 273 .map_io = smdk6440_map_io,
178 .init_machine = smdk6440_machine_init, 274 .init_machine = smdk6440_machine_init,
179 .timer = &s5p_timer, 275 .timer = &s5p_timer,
276 .restart = s5p64x0_restart,
180MACHINE_END 277MACHINE_END