Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-exynos4/mach-smdkv310.c |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 2 | * |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 5 | * |
| 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. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/serial_core.h> |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 12 | #include <linux/delay.h> |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 13 | #include <linux/gpio.h> |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 14 | #include <linux/lcd.h> |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 15 | #include <linux/mmc/host.h> |
| 16 | #include <linux/platform_device.h> |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 17 | #include <linux/smsc911x.h> |
| 18 | #include <linux/io.h> |
Jassi Brar | 6f5c11c | 2010-12-21 09:59:05 +0900 | [diff] [blame] | 19 | #include <linux/i2c.h> |
Naveen Krishna Ch | be4c33b | 2011-02-22 17:16:58 +0900 | [diff] [blame] | 20 | #include <linux/input.h> |
Sachin Kamat | fae9659 | 2012-09-13 15:54:18 +0900 | [diff] [blame] | 21 | #include <linux/pwm.h> |
Banajit Goswami | 8689de7 | 2011-07-20 23:45:21 +0900 | [diff] [blame] | 22 | #include <linux/pwm_backlight.h> |
Jingoo Han | f034d85 | 2012-11-07 08:11:30 +0900 | [diff] [blame] | 23 | #include <linux/platform_data/i2c-s3c2410.h> |
Sachin Kamat | fb395c3 | 2012-05-20 07:46:44 +0900 | [diff] [blame] | 24 | #include <linux/platform_data/s3c-hsotg.h> |
Jingoo Han | f034d85 | 2012-11-07 08:11:30 +0900 | [diff] [blame] | 25 | #include <linux/platform_data/usb-ehci-s5p.h> |
| 26 | #include <linux/platform_data/usb-exynos.h> |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 27 | |
| 28 | #include <asm/mach/arch.h> |
| 29 | #include <asm/mach-types.h> |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 30 | |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 31 | #include <video/platform_lcd.h> |
Leela Krishna Amudala | 5a213a5 | 2012-08-08 09:44:49 +0900 | [diff] [blame] | 32 | #include <video/samsung_fimd.h> |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 33 | #include <plat/regs-serial.h> |
Kukjin Kim | 8cf460a | 2010-11-15 09:18:57 +0900 | [diff] [blame] | 34 | #include <plat/regs-srom.h> |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 35 | #include <plat/cpu.h> |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 36 | #include <plat/devs.h> |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 37 | #include <plat/fb.h> |
Naveen Krishna Ch | be4c33b | 2011-02-22 17:16:58 +0900 | [diff] [blame] | 38 | #include <plat/keypad.h> |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 39 | #include <plat/sdhci.h> |
Banajit Goswami | 8689de7 | 2011-07-20 23:45:21 +0900 | [diff] [blame] | 40 | #include <plat/gpio-cfg.h> |
| 41 | #include <plat/backlight.h> |
Sachin Kamat | 95727e1 | 2011-08-12 18:21:27 +0900 | [diff] [blame] | 42 | #include <plat/mfc.h> |
Jingoo Han | 9830f6a | 2011-09-28 10:33:25 +0900 | [diff] [blame] | 43 | #include <plat/clock.h> |
Sachin Kamat | cceb840 | 2012-08-08 13:12:19 +0900 | [diff] [blame] | 44 | #include <plat/hdmi.h> |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 45 | |
| 46 | #include <mach/map.h> |
| 47 | |
Sachin Kamat | ab25a8d | 2012-05-12 16:34:06 +0900 | [diff] [blame] | 48 | #include <drm/exynos_drm.h> |
Kukjin Kim | cc511b8 | 2011-12-27 08:18:36 +0100 | [diff] [blame] | 49 | #include "common.h" |
| 50 | |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 51 | /* Following are default values for UCON, ULCON and UFCON UART registers */ |
| 52 | #define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
| 53 | S3C2410_UCON_RXILEVEL | \ |
| 54 | S3C2410_UCON_TXIRQMODE | \ |
| 55 | S3C2410_UCON_RXIRQMODE | \ |
| 56 | S3C2410_UCON_RXFIFO_TOI | \ |
| 57 | S3C2443_UCON_RXERR_IRQEN) |
| 58 | |
| 59 | #define SMDKV310_ULCON_DEFAULT S3C2410_LCON_CS8 |
| 60 | |
| 61 | #define SMDKV310_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ |
| 62 | S5PV210_UFCON_TXTRIG4 | \ |
| 63 | S5PV210_UFCON_RXTRIG4) |
| 64 | |
| 65 | static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = { |
| 66 | [0] = { |
| 67 | .hwport = 0, |
| 68 | .flags = 0, |
| 69 | .ucon = SMDKV310_UCON_DEFAULT, |
| 70 | .ulcon = SMDKV310_ULCON_DEFAULT, |
| 71 | .ufcon = SMDKV310_UFCON_DEFAULT, |
| 72 | }, |
| 73 | [1] = { |
| 74 | .hwport = 1, |
| 75 | .flags = 0, |
| 76 | .ucon = SMDKV310_UCON_DEFAULT, |
| 77 | .ulcon = SMDKV310_ULCON_DEFAULT, |
| 78 | .ufcon = SMDKV310_UFCON_DEFAULT, |
| 79 | }, |
| 80 | [2] = { |
| 81 | .hwport = 2, |
| 82 | .flags = 0, |
| 83 | .ucon = SMDKV310_UCON_DEFAULT, |
| 84 | .ulcon = SMDKV310_ULCON_DEFAULT, |
| 85 | .ufcon = SMDKV310_UFCON_DEFAULT, |
| 86 | }, |
| 87 | [3] = { |
| 88 | .hwport = 3, |
| 89 | .flags = 0, |
| 90 | .ucon = SMDKV310_UCON_DEFAULT, |
| 91 | .ulcon = SMDKV310_ULCON_DEFAULT, |
| 92 | .ufcon = SMDKV310_UFCON_DEFAULT, |
| 93 | }, |
| 94 | }; |
| 95 | |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 96 | static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = { |
Thomas Abraham | a0d8efe | 2011-06-16 16:12:35 +0900 | [diff] [blame] | 97 | .cd_type = S3C_SDHCI_CD_INTERNAL, |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 98 | #ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 99 | .max_width = 8, |
| 100 | .host_caps = MMC_CAP_8_BIT_DATA, |
| 101 | #endif |
| 102 | }; |
| 103 | |
| 104 | static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = { |
| 105 | .cd_type = S3C_SDHCI_CD_GPIO, |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 106 | .ext_cd_gpio = EXYNOS4_GPK0(2), |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 107 | .ext_cd_gpio_invert = 1, |
| 108 | }; |
| 109 | |
| 110 | static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = { |
Thomas Abraham | a0d8efe | 2011-06-16 16:12:35 +0900 | [diff] [blame] | 111 | .cd_type = S3C_SDHCI_CD_INTERNAL, |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 112 | #ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 113 | .max_width = 8, |
| 114 | .host_caps = MMC_CAP_8_BIT_DATA, |
| 115 | #endif |
| 116 | }; |
| 117 | |
| 118 | static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = { |
| 119 | .cd_type = S3C_SDHCI_CD_GPIO, |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 120 | .ext_cd_gpio = EXYNOS4_GPK2(2), |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 121 | .ext_cd_gpio_invert = 1, |
| 122 | }; |
| 123 | |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 124 | static void lcd_lte480wv_set_power(struct plat_lcd_data *pd, |
| 125 | unsigned int power) |
| 126 | { |
| 127 | if (power) { |
| 128 | #if !defined(CONFIG_BACKLIGHT_PWM) |
| 129 | gpio_request_one(EXYNOS4_GPD0(1), GPIOF_OUT_INIT_HIGH, "GPD0"); |
| 130 | gpio_free(EXYNOS4_GPD0(1)); |
| 131 | #endif |
| 132 | /* fire nRESET on power up */ |
Jingoo Han | 321655e | 2011-12-24 11:58:32 +0900 | [diff] [blame] | 133 | gpio_request_one(EXYNOS4_GPX0(6), GPIOF_OUT_INIT_HIGH, "GPX0"); |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 134 | mdelay(100); |
| 135 | |
| 136 | gpio_set_value(EXYNOS4_GPX0(6), 0); |
| 137 | mdelay(10); |
| 138 | |
| 139 | gpio_set_value(EXYNOS4_GPX0(6), 1); |
| 140 | mdelay(10); |
| 141 | |
| 142 | gpio_free(EXYNOS4_GPX0(6)); |
| 143 | } else { |
| 144 | #if !defined(CONFIG_BACKLIGHT_PWM) |
| 145 | gpio_request_one(EXYNOS4_GPD0(1), GPIOF_OUT_INIT_LOW, "GPD0"); |
| 146 | gpio_free(EXYNOS4_GPD0(1)); |
| 147 | #endif |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | static struct plat_lcd_data smdkv310_lcd_lte480wv_data = { |
| 152 | .set_power = lcd_lte480wv_set_power, |
| 153 | }; |
| 154 | |
| 155 | static struct platform_device smdkv310_lcd_lte480wv = { |
| 156 | .name = "platform-lcd", |
| 157 | .dev.parent = &s5p_device_fimd0.dev, |
| 158 | .dev.platform_data = &smdkv310_lcd_lte480wv_data, |
| 159 | }; |
| 160 | |
Sachin Kamat | 873673d | 2012-12-18 08:55:20 -0800 | [diff] [blame] | 161 | #ifdef CONFIG_DRM_EXYNOS_FIMD |
Sachin Kamat | ab25a8d | 2012-05-12 16:34:06 +0900 | [diff] [blame] | 162 | static struct exynos_drm_fimd_pdata drm_fimd_pdata = { |
| 163 | .panel = { |
| 164 | .timing = { |
| 165 | .left_margin = 13, |
| 166 | .right_margin = 8, |
| 167 | .upper_margin = 7, |
| 168 | .lower_margin = 5, |
| 169 | .hsync_len = 3, |
| 170 | .vsync_len = 1, |
| 171 | .xres = 800, |
| 172 | .yres = 480, |
| 173 | }, |
| 174 | }, |
| 175 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, |
| 176 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, |
| 177 | .default_win = 0, |
| 178 | .bpp = 32, |
| 179 | }; |
| 180 | #else |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 181 | static struct s3c_fb_pd_win smdkv310_fb_win0 = { |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 182 | .max_bpp = 32, |
| 183 | .default_bpp = 24, |
| 184 | .xres = 800, |
| 185 | .yres = 480, |
| 186 | }; |
| 187 | |
| 188 | static struct fb_videomode smdkv310_lcd_timing = { |
| 189 | .left_margin = 13, |
| 190 | .right_margin = 8, |
| 191 | .upper_margin = 7, |
| 192 | .lower_margin = 5, |
| 193 | .hsync_len = 3, |
| 194 | .vsync_len = 1, |
| 195 | .xres = 800, |
| 196 | .yres = 480, |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 197 | }; |
| 198 | |
| 199 | static struct s3c_fb_platdata smdkv310_lcd0_pdata __initdata = { |
| 200 | .win[0] = &smdkv310_fb_win0, |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 201 | .vtiming = &smdkv310_lcd_timing, |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 202 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, |
| 203 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, |
| 204 | .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, |
| 205 | }; |
Sachin Kamat | ab25a8d | 2012-05-12 16:34:06 +0900 | [diff] [blame] | 206 | #endif |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 207 | |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 208 | static struct resource smdkv310_smsc911x_resources[] = { |
Tushar Behera | f7f145e | 2012-05-12 16:12:20 +0900 | [diff] [blame] | 209 | [0] = DEFINE_RES_MEM(EXYNOS4_PA_SROM_BANK(1), SZ_64K), |
| 210 | [1] = DEFINE_RES_NAMED(IRQ_EINT(5), 1, NULL, IORESOURCE_IRQ \ |
| 211 | | IRQF_TRIGGER_LOW), |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 212 | }; |
| 213 | |
| 214 | static struct smsc911x_platform_config smsc9215_config = { |
Jeongtae Park | cd0527c | 2011-03-25 15:48:15 +0900 | [diff] [blame] | 215 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 216 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 217 | .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY, |
| 218 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 219 | .mac = {0x00, 0x80, 0x00, 0x23, 0x45, 0x67}, |
| 220 | }; |
| 221 | |
| 222 | static struct platform_device smdkv310_smsc911x = { |
| 223 | .name = "smsc911x", |
| 224 | .id = -1, |
| 225 | .num_resources = ARRAY_SIZE(smdkv310_smsc911x_resources), |
| 226 | .resource = smdkv310_smsc911x_resources, |
| 227 | .dev = { |
| 228 | .platform_data = &smsc9215_config, |
| 229 | }, |
| 230 | }; |
| 231 | |
Naveen Krishna Ch | be4c33b | 2011-02-22 17:16:58 +0900 | [diff] [blame] | 232 | static uint32_t smdkv310_keymap[] __initdata = { |
| 233 | /* KEY(row, col, keycode) */ |
| 234 | KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3), |
| 235 | KEY(0, 6, KEY_4), KEY(0, 7, KEY_5), |
| 236 | KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C), |
| 237 | KEY(1, 6, KEY_D), KEY(1, 7, KEY_E) |
| 238 | }; |
| 239 | |
| 240 | static struct matrix_keymap_data smdkv310_keymap_data __initdata = { |
| 241 | .keymap = smdkv310_keymap, |
| 242 | .keymap_size = ARRAY_SIZE(smdkv310_keymap), |
| 243 | }; |
| 244 | |
| 245 | static struct samsung_keypad_platdata smdkv310_keypad_data __initdata = { |
| 246 | .keymap_data = &smdkv310_keymap_data, |
| 247 | .rows = 2, |
| 248 | .cols = 8, |
| 249 | }; |
| 250 | |
Jassi Brar | 6f5c11c | 2010-12-21 09:59:05 +0900 | [diff] [blame] | 251 | static struct i2c_board_info i2c_devs1[] __initdata = { |
| 252 | {I2C_BOARD_INFO("wm8994", 0x1a),}, |
| 253 | }; |
| 254 | |
Jingoo Han | 9830f6a | 2011-09-28 10:33:25 +0900 | [diff] [blame] | 255 | /* USB EHCI */ |
| 256 | static struct s5p_ehci_platdata smdkv310_ehci_pdata; |
| 257 | |
| 258 | static void __init smdkv310_ehci_init(void) |
| 259 | { |
| 260 | struct s5p_ehci_platdata *pdata = &smdkv310_ehci_pdata; |
| 261 | |
| 262 | s5p_ehci_set_platdata(pdata); |
| 263 | } |
| 264 | |
Jingoo Han | 744f20f | 2011-12-23 11:20:50 +0900 | [diff] [blame] | 265 | /* USB OHCI */ |
| 266 | static struct exynos4_ohci_platdata smdkv310_ohci_pdata; |
| 267 | |
| 268 | static void __init smdkv310_ohci_init(void) |
| 269 | { |
| 270 | struct exynos4_ohci_platdata *pdata = &smdkv310_ohci_pdata; |
| 271 | |
| 272 | exynos4_ohci_set_platdata(pdata); |
| 273 | } |
| 274 | |
Sachin Kamat | fb395c3 | 2012-05-20 07:46:44 +0900 | [diff] [blame] | 275 | /* USB OTG */ |
| 276 | static struct s3c_hsotg_plat smdkv310_hsotg_pdata; |
| 277 | |
Sachin Kamat | 1b1ce35 | 2012-07-12 17:48:49 +0900 | [diff] [blame] | 278 | /* Audio device */ |
| 279 | static struct platform_device smdkv310_device_audio = { |
| 280 | .name = "smdk-audio", |
| 281 | .id = -1, |
| 282 | }; |
| 283 | |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 284 | static struct platform_device *smdkv310_devices[] __initdata = { |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 285 | &s3c_device_hsmmc0, |
| 286 | &s3c_device_hsmmc1, |
| 287 | &s3c_device_hsmmc2, |
| 288 | &s3c_device_hsmmc3, |
Kukjin Kim | 285dee7 | 2010-12-31 10:52:05 +0900 | [diff] [blame] | 289 | &s3c_device_i2c1, |
Hatim Ali | c0735c8 | 2011-09-27 07:37:18 +0900 | [diff] [blame] | 290 | &s5p_device_i2c_hdmiphy, |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 291 | &s3c_device_rtc, |
Sachin Kamat | fb395c3 | 2012-05-20 07:46:44 +0900 | [diff] [blame] | 292 | &s3c_device_usb_hsotg, |
Jemings Ko | 8d75c91 | 2010-09-20 15:33:04 +0900 | [diff] [blame] | 293 | &s3c_device_wdt, |
Jingoo Han | 9830f6a | 2011-09-28 10:33:25 +0900 | [diff] [blame] | 294 | &s5p_device_ehci, |
Sachin Kamat | 568f0e2 | 2011-09-28 11:13:30 +0900 | [diff] [blame] | 295 | &s5p_device_fimc0, |
| 296 | &s5p_device_fimc1, |
| 297 | &s5p_device_fimc2, |
| 298 | &s5p_device_fimc3, |
Sachin Kamat | e0d49c7 | 2012-01-31 13:28:52 +0900 | [diff] [blame] | 299 | &s5p_device_fimc_md, |
Sachin Kamat | b3421f9 | 2012-03-09 06:51:45 -0800 | [diff] [blame] | 300 | &s5p_device_g2d, |
Sachin Kamat | 9fbe8c7 | 2012-03-09 08:19:21 -0800 | [diff] [blame] | 301 | &s5p_device_jpeg, |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 302 | &exynos4_device_ac97, |
| 303 | &exynos4_device_i2s0, |
Jingoo Han | 744f20f | 2011-12-23 11:20:50 +0900 | [diff] [blame] | 304 | &exynos4_device_ohci, |
Naveen Krishna Ch | be4c33b | 2011-02-22 17:16:58 +0900 | [diff] [blame] | 305 | &samsung_device_keypad, |
Sachin Kamat | 95727e1 | 2011-08-12 18:21:27 +0900 | [diff] [blame] | 306 | &s5p_device_mfc, |
| 307 | &s5p_device_mfc_l, |
| 308 | &s5p_device_mfc_r, |
Naveen Krishna Chatradhi | 2ba707a | 2011-07-18 15:14:01 +0900 | [diff] [blame] | 309 | &exynos4_device_spdif, |
Sangbeom Kim | 2839cc1 | 2011-07-21 14:12:19 +0900 | [diff] [blame] | 310 | &samsung_asoc_idma, |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 311 | &s5p_device_fimd0, |
Sachin Kamat | 1b1ce35 | 2012-07-12 17:48:49 +0900 | [diff] [blame] | 312 | &smdkv310_device_audio, |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 313 | &smdkv310_lcd_lte480wv, |
Jassi Brar | fbcb44d | 2011-01-18 14:41:43 +0900 | [diff] [blame] | 314 | &smdkv310_smsc911x, |
Inderpal Singh | 0d855f4 | 2011-07-04 19:19:36 +0900 | [diff] [blame] | 315 | &exynos4_device_ahci, |
Hatim Ali | c0735c8 | 2011-09-27 07:37:18 +0900 | [diff] [blame] | 316 | &s5p_device_hdmi, |
| 317 | &s5p_device_mixer, |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 318 | }; |
| 319 | |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 320 | static void __init smdkv310_smsc911x_init(void) |
| 321 | { |
| 322 | u32 cs1; |
| 323 | |
| 324 | /* configure nCS1 width to 16 bits */ |
Kukjin Kim | 8cf460a | 2010-11-15 09:18:57 +0900 | [diff] [blame] | 325 | cs1 = __raw_readl(S5P_SROM_BW) & |
| 326 | ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT); |
| 327 | cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) | |
| 328 | (1 << S5P_SROM_BW__WAITENABLE__SHIFT) | |
| 329 | (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) << |
| 330 | S5P_SROM_BW__NCS1__SHIFT; |
| 331 | __raw_writel(cs1, S5P_SROM_BW); |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 332 | |
| 333 | /* set timing for nCS1 suitable for ethernet chip */ |
Kukjin Kim | 8cf460a | 2010-11-15 09:18:57 +0900 | [diff] [blame] | 334 | __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) | |
| 335 | (0x9 << S5P_SROM_BCX__TACP__SHIFT) | |
| 336 | (0xc << S5P_SROM_BCX__TCAH__SHIFT) | |
| 337 | (0x1 << S5P_SROM_BCX__TCOH__SHIFT) | |
| 338 | (0x6 << S5P_SROM_BCX__TACC__SHIFT) | |
| 339 | (0x1 << S5P_SROM_BCX__TCOS__SHIFT) | |
| 340 | (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1); |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 341 | } |
| 342 | |
Banajit Goswami | 8689de7 | 2011-07-20 23:45:21 +0900 | [diff] [blame] | 343 | /* LCD Backlight data */ |
| 344 | static struct samsung_bl_gpio_info smdkv310_bl_gpio_info = { |
| 345 | .no = EXYNOS4_GPD0(1), |
| 346 | .func = S3C_GPIO_SFN(2), |
| 347 | }; |
| 348 | |
| 349 | static struct platform_pwm_backlight_data smdkv310_bl_data = { |
| 350 | .pwm_id = 1, |
| 351 | .pwm_period_ns = 1000, |
| 352 | }; |
| 353 | |
Sachin Kamat | cceb840 | 2012-08-08 13:12:19 +0900 | [diff] [blame] | 354 | /* I2C module and id for HDMIPHY */ |
| 355 | static struct i2c_board_info hdmiphy_info = { |
| 356 | I2C_BOARD_INFO("hdmiphy-exynos4210", 0x38), |
| 357 | }; |
| 358 | |
Sachin Kamat | fae9659 | 2012-09-13 15:54:18 +0900 | [diff] [blame] | 359 | static struct pwm_lookup smdkv310_pwm_lookup[] = { |
| 360 | PWM_LOOKUP("s3c24xx-pwm.1", 0, "pwm-backlight.0", NULL), |
| 361 | }; |
| 362 | |
Hatim Ali | c0735c8 | 2011-09-27 07:37:18 +0900 | [diff] [blame] | 363 | static void s5p_tv_setup(void) |
| 364 | { |
| 365 | /* direct HPD to HDMI chip */ |
| 366 | WARN_ON(gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug")); |
| 367 | s3c_gpio_cfgpin(EXYNOS4_GPX3(7), S3C_GPIO_SFN(0x3)); |
| 368 | s3c_gpio_setpull(EXYNOS4_GPX3(7), S3C_GPIO_PULL_NONE); |
Hatim Ali | c0735c8 | 2011-09-27 07:37:18 +0900 | [diff] [blame] | 369 | } |
| 370 | |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 371 | static void __init smdkv310_map_io(void) |
| 372 | { |
Kukjin Kim | cc511b8 | 2011-12-27 08:18:36 +0100 | [diff] [blame] | 373 | exynos_init_io(NULL, 0); |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 374 | s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs)); |
| 375 | } |
| 376 | |
Sachin Kamat | 95727e1 | 2011-08-12 18:21:27 +0900 | [diff] [blame] | 377 | static void __init smdkv310_reserve(void) |
| 378 | { |
| 379 | s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20); |
| 380 | } |
| 381 | |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 382 | static void __init smdkv310_machine_init(void) |
| 383 | { |
Jassi Brar | 6f5c11c | 2010-12-21 09:59:05 +0900 | [diff] [blame] | 384 | s3c_i2c1_set_platdata(NULL); |
| 385 | i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); |
| 386 | |
Daein Moon | cbff3eb | 2010-10-26 12:51:17 +0900 | [diff] [blame] | 387 | smdkv310_smsc911x_init(); |
| 388 | |
Hyuk Lee | 2b11148 | 2010-10-06 14:50:20 +0900 | [diff] [blame] | 389 | s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata); |
| 390 | s3c_sdhci1_set_platdata(&smdkv310_hsmmc1_pdata); |
| 391 | s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata); |
| 392 | s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata); |
| 393 | |
Hatim Ali | c0735c8 | 2011-09-27 07:37:18 +0900 | [diff] [blame] | 394 | s5p_tv_setup(); |
| 395 | s5p_i2c_hdmiphy_set_platdata(NULL); |
Sachin Kamat | cceb840 | 2012-08-08 13:12:19 +0900 | [diff] [blame] | 396 | s5p_hdmi_set_platdata(&hdmiphy_info, NULL, 0); |
Hatim Ali | c0735c8 | 2011-09-27 07:37:18 +0900 | [diff] [blame] | 397 | |
Naveen Krishna Ch | be4c33b | 2011-02-22 17:16:58 +0900 | [diff] [blame] | 398 | samsung_keypad_set_platdata(&smdkv310_keypad_data); |
| 399 | |
Banajit Goswami | 8689de7 | 2011-07-20 23:45:21 +0900 | [diff] [blame] | 400 | samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data); |
Sachin Kamat | fae9659 | 2012-09-13 15:54:18 +0900 | [diff] [blame] | 401 | pwm_add_table(smdkv310_pwm_lookup, ARRAY_SIZE(smdkv310_pwm_lookup)); |
| 402 | |
Sachin Kamat | 873673d | 2012-12-18 08:55:20 -0800 | [diff] [blame] | 403 | #ifdef CONFIG_DRM_EXYNOS_FIMD |
Sachin Kamat | ab25a8d | 2012-05-12 16:34:06 +0900 | [diff] [blame] | 404 | s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata; |
| 405 | exynos4_fimd0_gpio_setup_24bpp(); |
| 406 | #else |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 407 | s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata); |
Sachin Kamat | ab25a8d | 2012-05-12 16:34:06 +0900 | [diff] [blame] | 408 | #endif |
Banajit Goswami | 8689de7 | 2011-07-20 23:45:21 +0900 | [diff] [blame] | 409 | |
Jingoo Han | 9830f6a | 2011-09-28 10:33:25 +0900 | [diff] [blame] | 410 | smdkv310_ehci_init(); |
Jingoo Han | 744f20f | 2011-12-23 11:20:50 +0900 | [diff] [blame] | 411 | smdkv310_ohci_init(); |
Sachin Kamat | fb395c3 | 2012-05-20 07:46:44 +0900 | [diff] [blame] | 412 | s3c_hsotg_set_platdata(&smdkv310_hsotg_pdata); |
Jingoo Han | 9830f6a | 2011-09-28 10:33:25 +0900 | [diff] [blame] | 413 | |
Changhwan Youn | cdff6e6 | 2010-09-20 15:25:51 +0900 | [diff] [blame] | 414 | platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices)); |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 415 | } |
| 416 | |
| 417 | MACHINE_START(SMDKV310, "SMDKV310") |
| 418 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
| 419 | /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ |
Tushar Behera | 1abd328 | 2011-09-19 20:09:01 +0900 | [diff] [blame] | 420 | .atag_offset = 0x100, |
Marc Zyngier | 06853ae | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 421 | .smp = smp_ops(exynos_smp_ops), |
Kukjin Kim | d11135c | 2011-02-14 14:59:52 +0900 | [diff] [blame] | 422 | .init_irq = exynos4_init_irq, |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 423 | .map_io = smdkv310_map_io, |
| 424 | .init_machine = smdkv310_machine_init, |
Thomas Abraham | 6923ae4 | 2013-03-09 17:03:29 +0900 | [diff] [blame^] | 425 | .init_time = exynos_init_time, |
Sachin Kamat | 95727e1 | 2011-08-12 18:21:27 +0900 | [diff] [blame] | 426 | .reserve = &smdkv310_reserve, |
Russell King | 9eb4859 | 2012-01-03 11:56:53 +0100 | [diff] [blame] | 427 | .restart = exynos4_restart, |
Changhwan Youn | b1d69cc | 2010-07-16 12:18:36 +0900 | [diff] [blame] | 428 | MACHINE_END |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 429 | |
| 430 | MACHINE_START(SMDKC210, "SMDKC210") |
| 431 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ |
Tushar Behera | 1abd328 | 2011-09-19 20:09:01 +0900 | [diff] [blame] | 432 | .atag_offset = 0x100, |
Marc Zyngier | 06853ae | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 433 | .smp = smp_ops(exynos_smp_ops), |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 434 | .init_irq = exynos4_init_irq, |
| 435 | .map_io = smdkv310_map_io, |
| 436 | .init_machine = smdkv310_machine_init, |
Shawn Guo | bb13fab | 2012-04-26 10:35:40 +0800 | [diff] [blame] | 437 | .init_late = exynos_init_late, |
Thomas Abraham | 6923ae4 | 2013-03-09 17:03:29 +0900 | [diff] [blame^] | 438 | .init_time = exynos_init_time, |
Sachin Kamat | 1034b9f | 2012-07-19 14:43:24 +0900 | [diff] [blame] | 439 | .reserve = &smdkv310_reserve, |
Russell King | 9eb4859 | 2012-01-03 11:56:53 +0100 | [diff] [blame] | 440 | .restart = exynos4_restart, |
Kukjin Kim | 42c0d26 | 2011-08-18 21:14:28 +0900 | [diff] [blame] | 441 | MACHINE_END |