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