Ben Dooks | 431107e | 2010-01-26 10:11:04 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/mach-s3c64xx/mach-smdk6410.c |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 2 | * |
| 3 | * Copyright 2008 Openmoko, Inc. |
| 4 | * Copyright 2008 Simtec Electronics |
| 5 | * Ben Dooks <ben@simtec.co.uk> |
| 6 | * http://armlinux.simtec.co.uk/ |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/types.h> |
| 16 | #include <linux/interrupt.h> |
| 17 | #include <linux/list.h> |
| 18 | #include <linux/timer.h> |
| 19 | #include <linux/init.h> |
Naveen Krishna Ch | 290d098 | 2010-06-22 07:39:18 +0900 | [diff] [blame] | 20 | #include <linux/input.h> |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 21 | #include <linux/serial_core.h> |
Tushar Behera | 334a1c7 | 2014-02-14 10:32:45 +0900 | [diff] [blame] | 22 | #include <linux/serial_s3c.h> |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/io.h> |
Ben Dooks | 096941e | 2008-10-31 16:14:59 +0000 | [diff] [blame] | 25 | #include <linux/i2c.h> |
Mark Brown | a7a81d0 | 2010-02-17 18:19:31 +0000 | [diff] [blame] | 26 | #include <linux/leds.h> |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 27 | #include <linux/fb.h> |
| 28 | #include <linux/gpio.h> |
| 29 | #include <linux/delay.h> |
Mark Brown | 3056ea0 | 2009-01-27 16:18:01 +0000 | [diff] [blame] | 30 | #include <linux/smsc911x.h> |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 31 | #include <linux/regulator/fixed.h> |
Mark Brown | 628e7eb | 2011-03-04 07:59:20 +0900 | [diff] [blame] | 32 | #include <linux/regulator/machine.h> |
Thierry Reding | bf0ff1c | 2015-10-13 05:04:22 +0900 | [diff] [blame] | 33 | #include <linux/pwm.h> |
Banajit Goswami | 075d108 | 2011-02-28 17:42:35 +0530 | [diff] [blame] | 34 | #include <linux/pwm_backlight.h> |
Lukasz Majewski | 126625e | 2012-05-09 13:16:53 +0200 | [diff] [blame] | 35 | #include <linux/platform_data/s3c-hsotg.h> |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 36 | |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 37 | #ifdef CONFIG_SMDK6410_WM1190_EV1 |
| 38 | #include <linux/mfd/wm8350/core.h> |
| 39 | #include <linux/mfd/wm8350/pmic.h> |
| 40 | #endif |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 41 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 42 | #ifdef CONFIG_SMDK6410_WM1192_EV1 |
Mark Brown | a7a81d0 | 2010-02-17 18:19:31 +0000 | [diff] [blame] | 43 | #include <linux/mfd/wm831x/core.h> |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 44 | #include <linux/mfd/wm831x/pdata.h> |
| 45 | #endif |
| 46 | |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 47 | #include <video/platform_lcd.h> |
Leela Krishna Amudala | 5a213a5 | 2012-08-08 09:44:49 +0900 | [diff] [blame] | 48 | #include <video/samsung_fimd.h> |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 49 | |
| 50 | #include <asm/mach/arch.h> |
| 51 | #include <asm/mach/map.h> |
| 52 | #include <asm/mach/irq.h> |
| 53 | |
| 54 | #include <mach/hardware.h> |
Arnd Bergmann | ba27904 | 2015-02-27 22:06:58 +0100 | [diff] [blame] | 55 | #include <mach/irqs.h> |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 56 | #include <mach/map.h> |
| 57 | |
| 58 | #include <asm/irq.h> |
| 59 | #include <asm/mach-types.h> |
| 60 | |
Ben Dooks | 3501c9a | 2010-01-26 10:45:40 +0900 | [diff] [blame] | 61 | #include <mach/regs-gpio.h> |
Linus Walleij | b0161ca | 2014-01-14 14:24:24 +0100 | [diff] [blame] | 62 | #include <mach/gpio-samsung.h> |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 63 | #include <linux/platform_data/ata-samsung_cf.h> |
| 64 | #include <linux/platform_data/i2c-s3c2410.h> |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 65 | #include <plat/fb.h> |
Mark Brown | 3056ea0 | 2009-01-27 16:18:01 +0000 | [diff] [blame] | 66 | #include <plat/gpio-cfg.h> |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 67 | |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 68 | #include <plat/devs.h> |
| 69 | #include <plat/cpu.h> |
Naveen Krishna Ch | 85b14a3 | 2010-05-20 11:39:52 +0900 | [diff] [blame] | 70 | #include <plat/adc.h> |
Arnd Bergmann | 436d42c | 2012-08-24 15:22:12 +0200 | [diff] [blame] | 71 | #include <linux/platform_data/touchscreen-s3c2410.h> |
Naveen Krishna Ch | 290d098 | 2010-06-22 07:39:18 +0900 | [diff] [blame] | 72 | #include <plat/keypad.h> |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 73 | #include <plat/samsung-time.h> |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 74 | |
Kukjin Kim | 4a7bf56 | 2015-07-30 02:00:36 +0900 | [diff] [blame] | 75 | #include "backlight.h" |
Kukjin Kim | b024043b | 2011-12-22 23:27:42 +0100 | [diff] [blame] | 76 | #include "common.h" |
Kukjin Kim | a81c197 | 2013-01-02 13:24:12 -0800 | [diff] [blame] | 77 | #include "regs-modem.h" |
Kukjin Kim | 8eba8ea | 2013-01-02 13:26:25 -0800 | [diff] [blame] | 78 | #include "regs-srom.h" |
Kukjin Kim | f2bfd17 | 2013-01-02 13:31:15 -0800 | [diff] [blame] | 79 | #include "regs-sys.h" |
Kukjin Kim | b024043b | 2011-12-22 23:27:42 +0100 | [diff] [blame] | 80 | |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 81 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK |
| 82 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB |
| 83 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE |
| 84 | |
| 85 | static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = { |
| 86 | [0] = { |
| 87 | .hwport = 0, |
| 88 | .flags = 0, |
Matt Hsu | bd258e5 | 2009-06-29 19:03:41 +0800 | [diff] [blame] | 89 | .ucon = UCON, |
| 90 | .ulcon = ULCON, |
| 91 | .ufcon = UFCON, |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 92 | }, |
| 93 | [1] = { |
| 94 | .hwport = 1, |
| 95 | .flags = 0, |
Matt Hsu | bd258e5 | 2009-06-29 19:03:41 +0800 | [diff] [blame] | 96 | .ucon = UCON, |
| 97 | .ulcon = ULCON, |
| 98 | .ufcon = UFCON, |
| 99 | }, |
| 100 | [2] = { |
| 101 | .hwport = 2, |
| 102 | .flags = 0, |
| 103 | .ucon = UCON, |
| 104 | .ulcon = ULCON, |
| 105 | .ufcon = UFCON, |
| 106 | }, |
| 107 | [3] = { |
| 108 | .hwport = 3, |
| 109 | .flags = 0, |
| 110 | .ucon = UCON, |
| 111 | .ulcon = ULCON, |
| 112 | .ufcon = UFCON, |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 113 | }, |
| 114 | }; |
| 115 | |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 116 | /* framebuffer and LCD setup. */ |
| 117 | |
| 118 | /* GPF15 = LCD backlight control |
| 119 | * GPF13 => Panel power |
| 120 | * GPN5 = LCD nRESET signal |
| 121 | * PWM_TOUT1 => backlight brightness |
| 122 | */ |
| 123 | |
| 124 | static void smdk6410_lcd_power_set(struct plat_lcd_data *pd, |
| 125 | unsigned int power) |
| 126 | { |
| 127 | if (power) { |
| 128 | gpio_direction_output(S3C64XX_GPF(13), 1); |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 129 | |
| 130 | /* fire nRESET on power up */ |
| 131 | gpio_direction_output(S3C64XX_GPN(5), 0); |
| 132 | msleep(10); |
| 133 | gpio_direction_output(S3C64XX_GPN(5), 1); |
| 134 | msleep(1); |
| 135 | } else { |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 136 | gpio_direction_output(S3C64XX_GPF(13), 0); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | static struct plat_lcd_data smdk6410_lcd_power_data = { |
| 141 | .set_power = smdk6410_lcd_power_set, |
| 142 | }; |
| 143 | |
| 144 | static struct platform_device smdk6410_lcd_powerdev = { |
| 145 | .name = "platform-lcd", |
| 146 | .dev.parent = &s3c_device_fb.dev, |
| 147 | .dev.platform_data = &smdk6410_lcd_power_data, |
| 148 | }; |
| 149 | |
| 150 | static struct s3c_fb_pd_win smdk6410_fb_win0 = { |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 151 | .max_bpp = 32, |
| 152 | .default_bpp = 16, |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 153 | .xres = 800, |
| 154 | .yres = 480, |
Ben Dooks | 001ca74 | 2010-07-26 10:56:40 +0100 | [diff] [blame] | 155 | .virtual_y = 480 * 2, |
| 156 | .virtual_x = 800, |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 157 | }; |
| 158 | |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 159 | static struct fb_videomode smdk6410_lcd_timing = { |
| 160 | .left_margin = 8, |
| 161 | .right_margin = 13, |
| 162 | .upper_margin = 7, |
| 163 | .lower_margin = 5, |
| 164 | .hsync_len = 3, |
| 165 | .vsync_len = 1, |
| 166 | .xres = 800, |
| 167 | .yres = 480, |
| 168 | }; |
| 169 | |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 170 | /* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */ |
| 171 | static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = { |
| 172 | .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, |
Thomas Abraham | 79d3c41 | 2012-03-24 21:58:48 +0530 | [diff] [blame] | 173 | .vtiming = &smdk6410_lcd_timing, |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 174 | .win[0] = &smdk6410_fb_win0, |
| 175 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, |
| 176 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, |
| 177 | }; |
| 178 | |
Andy Green | a4e9469 | 2009-12-29 14:40:43 +0000 | [diff] [blame] | 179 | /* |
| 180 | * Configuring Ethernet on SMDK6410 |
| 181 | * |
| 182 | * Both CS8900A and LAN9115 chips share one chip select mediated by CFG6. |
| 183 | * The constant address below corresponds to nCS1 |
| 184 | * |
| 185 | * 1) Set CFGB2 p3 ON others off, no other CFGB selects "ethernet" |
| 186 | * 2) CFG6 needs to be switched to "LAN9115" side |
| 187 | */ |
| 188 | |
Mark Brown | 3056ea0 | 2009-01-27 16:18:01 +0000 | [diff] [blame] | 189 | static struct resource smdk6410_smsc911x_resources[] = { |
Tushar Behera | c858fd5 | 2012-05-12 16:12:30 +0900 | [diff] [blame] | 190 | [0] = DEFINE_RES_MEM(S3C64XX_PA_XM0CSN1, SZ_64K), |
| 191 | [1] = DEFINE_RES_NAMED(S3C_EINT(10), 1, NULL, IORESOURCE_IRQ \ |
| 192 | | IRQ_TYPE_LEVEL_LOW), |
Mark Brown | 3056ea0 | 2009-01-27 16:18:01 +0000 | [diff] [blame] | 193 | }; |
| 194 | |
| 195 | static struct smsc911x_platform_config smdk6410_smsc911x_pdata = { |
| 196 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 197 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
| 198 | .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY, |
| 199 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 200 | }; |
| 201 | |
| 202 | |
| 203 | static struct platform_device smdk6410_smsc911x = { |
| 204 | .name = "smsc911x", |
| 205 | .id = -1, |
| 206 | .num_resources = ARRAY_SIZE(smdk6410_smsc911x_resources), |
| 207 | .resource = &smdk6410_smsc911x_resources[0], |
| 208 | .dev = { |
| 209 | .platform_data = &smdk6410_smsc911x_pdata, |
| 210 | }, |
| 211 | }; |
| 212 | |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 213 | #ifdef CONFIG_REGULATOR |
Arnd Bergmann | 19c69da | 2015-02-27 05:50:22 +0900 | [diff] [blame] | 214 | static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = { |
Mark Brown | b5930b8 | 2011-05-24 08:27:59 +0800 | [diff] [blame] | 215 | REGULATOR_SUPPLY("PVDD", "0-001b"), |
| 216 | REGULATOR_SUPPLY("AVDD", "0-001b"), |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 217 | }; |
| 218 | |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 219 | static struct regulator_init_data __maybe_unused smdk6410_b_pwr_5v_data = { |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 220 | .constraints = { |
| 221 | .always_on = 1, |
| 222 | }, |
| 223 | .num_consumer_supplies = ARRAY_SIZE(smdk6410_b_pwr_5v_consumers), |
| 224 | .consumer_supplies = smdk6410_b_pwr_5v_consumers, |
| 225 | }; |
| 226 | |
| 227 | static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = { |
| 228 | .supply_name = "B_PWR_5V", |
| 229 | .microvolts = 5000000, |
| 230 | .init_data = &smdk6410_b_pwr_5v_data, |
Mark Brown | d3cf448 | 2010-01-13 13:57:04 +0000 | [diff] [blame] | 231 | .gpio = -EINVAL, |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 232 | }; |
| 233 | |
| 234 | static struct platform_device smdk6410_b_pwr_5v = { |
| 235 | .name = "reg-fixed-voltage", |
| 236 | .id = -1, |
| 237 | .dev = { |
| 238 | .platform_data = &smdk6410_b_pwr_5v_pdata, |
| 239 | }, |
| 240 | }; |
| 241 | #endif |
| 242 | |
Abhilash Kesavan | 0ab0b6d | 2010-06-08 16:55:45 +0900 | [diff] [blame] | 243 | static struct s3c_ide_platdata smdk6410_ide_pdata __initdata = { |
| 244 | .setup_gpio = s3c64xx_ide_setup_gpio, |
| 245 | }; |
| 246 | |
Naveen Krishna Ch | 290d098 | 2010-06-22 07:39:18 +0900 | [diff] [blame] | 247 | static uint32_t smdk6410_keymap[] __initdata = { |
| 248 | /* KEY(row, col, keycode) */ |
| 249 | KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3), |
| 250 | KEY(0, 6, KEY_4), KEY(0, 7, KEY_5), |
| 251 | KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C), |
| 252 | KEY(1, 6, KEY_D), KEY(1, 7, KEY_E) |
| 253 | }; |
| 254 | |
| 255 | static struct matrix_keymap_data smdk6410_keymap_data __initdata = { |
| 256 | .keymap = smdk6410_keymap, |
| 257 | .keymap_size = ARRAY_SIZE(smdk6410_keymap), |
| 258 | }; |
| 259 | |
| 260 | static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = { |
| 261 | .keymap_data = &smdk6410_keymap_data, |
| 262 | .rows = 2, |
| 263 | .cols = 8, |
| 264 | }; |
| 265 | |
Mark Brown | 027191a | 2009-01-23 16:29:43 +0000 | [diff] [blame] | 266 | static struct map_desc smdk6410_iodesc[] = {}; |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 267 | |
| 268 | static struct platform_device *smdk6410_devices[] __initdata = { |
Ben Dooks | b24636c | 2008-11-03 20:14:53 +0000 | [diff] [blame] | 269 | #ifdef CONFIG_SMDK6410_SD_CH0 |
Ben Dooks | 39057f2 | 2008-10-31 16:14:29 +0000 | [diff] [blame] | 270 | &s3c_device_hsmmc0, |
Ben Dooks | b24636c | 2008-11-03 20:14:53 +0000 | [diff] [blame] | 271 | #endif |
| 272 | #ifdef CONFIG_SMDK6410_SD_CH1 |
| 273 | &s3c_device_hsmmc1, |
| 274 | #endif |
Ben Dooks | d85fa24 | 2008-10-31 16:14:52 +0000 | [diff] [blame] | 275 | &s3c_device_i2c0, |
Ben Dooks | d7ea374 | 2008-10-31 16:14:57 +0000 | [diff] [blame] | 276 | &s3c_device_i2c1, |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 277 | &s3c_device_fb, |
Ben Dooks | b813248 | 2009-11-23 00:13:39 +0000 | [diff] [blame] | 278 | &s3c_device_ohci, |
Tomasz Figa | 7fa33bd | 2013-03-09 15:37:53 +0100 | [diff] [blame] | 279 | &samsung_device_pwm, |
Ben Dooks | 06fa1d3 | 2009-05-16 22:11:20 +0100 | [diff] [blame] | 280 | &s3c_device_usb_hsotg, |
Mark Brown | 1f10086 | 2010-02-17 19:03:20 +0000 | [diff] [blame] | 281 | &s3c64xx_device_iisv4, |
Naveen Krishna Ch | 290d098 | 2010-06-22 07:39:18 +0900 | [diff] [blame] | 282 | &samsung_device_keypad, |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 283 | |
| 284 | #ifdef CONFIG_REGULATOR |
| 285 | &smdk6410_b_pwr_5v, |
| 286 | #endif |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 287 | &smdk6410_lcd_powerdev, |
Mark Brown | 3056ea0 | 2009-01-27 16:18:01 +0000 | [diff] [blame] | 288 | |
| 289 | &smdk6410_smsc911x, |
Naveen Krishna Ch | 85b14a3 | 2010-05-20 11:39:52 +0900 | [diff] [blame] | 290 | &s3c_device_adc, |
Abhilash Kesavan | 0ab0b6d | 2010-06-08 16:55:45 +0900 | [diff] [blame] | 291 | &s3c_device_cfcon, |
Atul Dahiya | 9bbf4a6 | 2010-07-20 16:31:32 +0530 | [diff] [blame] | 292 | &s3c_device_rtc, |
Banajit Goswami | b351c4a | 2010-05-20 16:21:30 +0900 | [diff] [blame] | 293 | &s3c_device_wdt, |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 294 | }; |
| 295 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 296 | #ifdef CONFIG_REGULATOR |
| 297 | /* ARM core */ |
| 298 | static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = { |
Mark Brown | b5930b8 | 2011-05-24 08:27:59 +0800 | [diff] [blame] | 299 | REGULATOR_SUPPLY("vddarm", NULL), |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 300 | }; |
| 301 | |
| 302 | /* VDDARM, BUCK1 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 303 | static struct regulator_init_data __maybe_unused smdk6410_vddarm = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 304 | .constraints = { |
| 305 | .name = "PVDD_ARM", |
| 306 | .min_uV = 1000000, |
| 307 | .max_uV = 1300000, |
| 308 | .always_on = 1, |
| 309 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, |
| 310 | }, |
| 311 | .num_consumer_supplies = ARRAY_SIZE(smdk6410_vddarm_consumers), |
| 312 | .consumer_supplies = smdk6410_vddarm_consumers, |
| 313 | }; |
| 314 | |
| 315 | /* VDD_INT, BUCK2 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 316 | static struct regulator_init_data __maybe_unused smdk6410_vddint = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 317 | .constraints = { |
| 318 | .name = "PVDD_INT", |
| 319 | .min_uV = 1000000, |
| 320 | .max_uV = 1200000, |
| 321 | .always_on = 1, |
| 322 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, |
| 323 | }, |
| 324 | }; |
| 325 | |
| 326 | /* VDD_HI, LDO3 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 327 | static struct regulator_init_data __maybe_unused smdk6410_vddhi = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 328 | .constraints = { |
| 329 | .name = "PVDD_HI", |
| 330 | .always_on = 1, |
| 331 | }, |
| 332 | }; |
| 333 | |
| 334 | /* VDD_PLL, LDO2 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 335 | static struct regulator_init_data __maybe_unused smdk6410_vddpll = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 336 | .constraints = { |
| 337 | .name = "PVDD_PLL", |
| 338 | .always_on = 1, |
| 339 | }, |
| 340 | }; |
| 341 | |
| 342 | /* VDD_UH_MMC, LDO5 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 343 | static struct regulator_init_data __maybe_unused smdk6410_vdduh_mmc = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 344 | .constraints = { |
Mark Brown | 18b52ca | 2011-03-04 08:24:15 +0900 | [diff] [blame] | 345 | .name = "PVDD_UH+PVDD_MMC", |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 346 | .always_on = 1, |
| 347 | }, |
| 348 | }; |
| 349 | |
| 350 | /* VCCM3BT, LDO8 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 351 | static struct regulator_init_data __maybe_unused smdk6410_vccmc3bt = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 352 | .constraints = { |
| 353 | .name = "PVCCM3BT", |
| 354 | .always_on = 1, |
| 355 | }, |
| 356 | }; |
| 357 | |
| 358 | /* VCCM2MTV, LDO11 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 359 | static struct regulator_init_data __maybe_unused smdk6410_vccm2mtv = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 360 | .constraints = { |
| 361 | .name = "PVCCM2MTV", |
| 362 | .always_on = 1, |
| 363 | }, |
| 364 | }; |
| 365 | |
| 366 | /* VDD_LCD, LDO12 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 367 | static struct regulator_init_data __maybe_unused smdk6410_vddlcd = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 368 | .constraints = { |
| 369 | .name = "PVDD_LCD", |
| 370 | .always_on = 1, |
| 371 | }, |
| 372 | }; |
| 373 | |
| 374 | /* VDD_OTGI, LDO9 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 375 | static struct regulator_init_data __maybe_unused smdk6410_vddotgi = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 376 | .constraints = { |
| 377 | .name = "PVDD_OTGI", |
| 378 | .always_on = 1, |
| 379 | }, |
| 380 | }; |
| 381 | |
| 382 | /* VDD_OTG, LDO14 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 383 | static struct regulator_init_data __maybe_unused smdk6410_vddotg = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 384 | .constraints = { |
| 385 | .name = "PVDD_OTG", |
| 386 | .always_on = 1, |
| 387 | }, |
| 388 | }; |
| 389 | |
| 390 | /* VDD_ALIVE, LDO15 on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 391 | static struct regulator_init_data __maybe_unused smdk6410_vddalive = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 392 | .constraints = { |
| 393 | .name = "PVDD_ALIVE", |
| 394 | .always_on = 1, |
| 395 | }, |
| 396 | }; |
| 397 | |
| 398 | /* VDD_AUDIO, VLDO_AUDIO on J5 */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 399 | static struct regulator_init_data __maybe_unused smdk6410_vddaudio = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 400 | .constraints = { |
| 401 | .name = "PVDD_AUDIO", |
| 402 | .always_on = 1, |
| 403 | }, |
| 404 | }; |
| 405 | #endif |
| 406 | |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 407 | #ifdef CONFIG_SMDK6410_WM1190_EV1 |
| 408 | /* S3C64xx internal logic & PLL */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 409 | static struct regulator_init_data __maybe_unused wm8350_dcdc1_data = { |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 410 | .constraints = { |
Mark Brown | 18b52ca | 2011-03-04 08:24:15 +0900 | [diff] [blame] | 411 | .name = "PVDD_INT+PVDD_PLL", |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 412 | .min_uV = 1200000, |
| 413 | .max_uV = 1200000, |
| 414 | .always_on = 1, |
| 415 | .apply_uV = 1, |
| 416 | }, |
| 417 | }; |
| 418 | |
| 419 | /* Memory */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 420 | static struct regulator_init_data __maybe_unused wm8350_dcdc3_data = { |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 421 | .constraints = { |
| 422 | .name = "PVDD_MEM", |
| 423 | .min_uV = 1800000, |
| 424 | .max_uV = 1800000, |
| 425 | .always_on = 1, |
| 426 | .state_mem = { |
| 427 | .uV = 1800000, |
| 428 | .mode = REGULATOR_MODE_NORMAL, |
| 429 | .enabled = 1, |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 430 | }, |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 431 | .initial_state = PM_SUSPEND_MEM, |
| 432 | }, |
| 433 | }; |
| 434 | |
| 435 | /* USB, EXT, PCM, ADC/DAC, USB, MMC */ |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 436 | static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = { |
Mark Brown | b5930b8 | 2011-05-24 08:27:59 +0800 | [diff] [blame] | 437 | REGULATOR_SUPPLY("DVDD", "0-001b"), |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 438 | }; |
| 439 | |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 440 | static struct regulator_init_data __maybe_unused wm8350_dcdc4_data = { |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 441 | .constraints = { |
Mark Brown | 18b52ca | 2011-03-04 08:24:15 +0900 | [diff] [blame] | 442 | .name = "PVDD_HI+PVDD_EXT+PVDD_SYS+PVCCM2MTV", |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 443 | .min_uV = 3000000, |
| 444 | .max_uV = 3000000, |
| 445 | .always_on = 1, |
| 446 | }, |
Mark Brown | 42015c1 | 2009-11-03 14:42:06 +0000 | [diff] [blame] | 447 | .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers), |
| 448 | .consumer_supplies = wm8350_dcdc4_consumers, |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 449 | }; |
| 450 | |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 451 | /* OTGi/1190-EV1 HPVDD & AVDD */ |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 452 | static struct regulator_init_data __maybe_unused wm8350_ldo4_data = { |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 453 | .constraints = { |
Mark Brown | 18b52ca | 2011-03-04 08:24:15 +0900 | [diff] [blame] | 454 | .name = "PVDD_OTGI+HPVDD+AVDD", |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 455 | .min_uV = 1200000, |
| 456 | .max_uV = 1200000, |
| 457 | .apply_uV = 1, |
Mark Brown | f53aee2 | 2009-04-09 16:30:40 +0100 | [diff] [blame] | 458 | .always_on = 1, |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 459 | }, |
| 460 | }; |
| 461 | |
| 462 | static struct { |
| 463 | int regulator; |
| 464 | struct regulator_init_data *initdata; |
| 465 | } wm1190_regulators[] = { |
| 466 | { WM8350_DCDC_1, &wm8350_dcdc1_data }, |
| 467 | { WM8350_DCDC_3, &wm8350_dcdc3_data }, |
| 468 | { WM8350_DCDC_4, &wm8350_dcdc4_data }, |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 469 | { WM8350_DCDC_6, &smdk6410_vddarm }, |
| 470 | { WM8350_LDO_1, &smdk6410_vddalive }, |
| 471 | { WM8350_LDO_2, &smdk6410_vddotg }, |
| 472 | { WM8350_LDO_3, &smdk6410_vddlcd }, |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 473 | { WM8350_LDO_4, &wm8350_ldo4_data }, |
| 474 | }; |
| 475 | |
| 476 | static int __init smdk6410_wm8350_init(struct wm8350 *wm8350) |
| 477 | { |
| 478 | int i; |
| 479 | |
Mark Brown | a3323b7 | 2009-11-03 14:42:04 +0000 | [diff] [blame] | 480 | /* Configure the IRQ line */ |
| 481 | s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP); |
| 482 | |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 483 | /* Instantiate the regulators */ |
| 484 | for (i = 0; i < ARRAY_SIZE(wm1190_regulators); i++) |
| 485 | wm8350_register_regulator(wm8350, |
| 486 | wm1190_regulators[i].regulator, |
| 487 | wm1190_regulators[i].initdata); |
| 488 | |
| 489 | return 0; |
| 490 | } |
| 491 | |
| 492 | static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = { |
| 493 | .init = smdk6410_wm8350_init, |
Mark Brown | db9256f | 2009-04-09 19:00:19 +0100 | [diff] [blame] | 494 | .irq_high = 1, |
Mark Brown | 9fca878 | 2010-01-19 15:26:56 +0000 | [diff] [blame] | 495 | .irq_base = IRQ_BOARD_START, |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 496 | }; |
| 497 | #endif |
| 498 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 499 | #ifdef CONFIG_SMDK6410_WM1192_EV1 |
Mark Brown | a7a81d0 | 2010-02-17 18:19:31 +0000 | [diff] [blame] | 500 | static struct gpio_led wm1192_pmic_leds[] = { |
| 501 | { |
| 502 | .name = "PMIC:red:power", |
| 503 | .gpio = GPIO_BOARD_START + 3, |
| 504 | .default_state = LEDS_GPIO_DEFSTATE_ON, |
| 505 | }, |
| 506 | }; |
| 507 | |
| 508 | static struct gpio_led_platform_data wm1192_pmic_led = { |
| 509 | .num_leds = ARRAY_SIZE(wm1192_pmic_leds), |
| 510 | .leds = wm1192_pmic_leds, |
| 511 | }; |
| 512 | |
| 513 | static struct platform_device wm1192_pmic_led_dev = { |
| 514 | .name = "leds-gpio", |
| 515 | .id = -1, |
| 516 | .dev = { |
| 517 | .platform_data = &wm1192_pmic_led, |
| 518 | }, |
| 519 | }; |
| 520 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 521 | static int wm1192_pre_init(struct wm831x *wm831x) |
| 522 | { |
Mark Brown | a7a81d0 | 2010-02-17 18:19:31 +0000 | [diff] [blame] | 523 | int ret; |
| 524 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 525 | /* Configure the IRQ line */ |
| 526 | s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP); |
| 527 | |
Mark Brown | a7a81d0 | 2010-02-17 18:19:31 +0000 | [diff] [blame] | 528 | ret = platform_device_register(&wm1192_pmic_led_dev); |
| 529 | if (ret != 0) |
| 530 | dev_err(wm831x->dev, "Failed to add PMIC LED: %d\n", ret); |
| 531 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 532 | return 0; |
| 533 | } |
| 534 | |
| 535 | static struct wm831x_backlight_pdata wm1192_backlight_pdata = { |
| 536 | .isink = 1, |
| 537 | .max_uA = 27554, |
| 538 | }; |
| 539 | |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 540 | static struct regulator_init_data __maybe_unused wm1192_dcdc3 = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 541 | .constraints = { |
Mark Brown | 18b52ca | 2011-03-04 08:24:15 +0900 | [diff] [blame] | 542 | .name = "PVDD_MEM+PVDD_GPS", |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 543 | .always_on = 1, |
| 544 | }, |
| 545 | }; |
| 546 | |
| 547 | static struct regulator_consumer_supply wm1192_ldo1_consumers[] = { |
Mark Brown | b5930b8 | 2011-05-24 08:27:59 +0800 | [diff] [blame] | 548 | REGULATOR_SUPPLY("DVDD", "0-001b"), /* WM8580 */ |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 549 | }; |
| 550 | |
Arnd Bergmann | a113b05 | 2016-01-29 15:50:37 +0100 | [diff] [blame] | 551 | static struct regulator_init_data __maybe_unused wm1192_ldo1 = { |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 552 | .constraints = { |
Mark Brown | 18b52ca | 2011-03-04 08:24:15 +0900 | [diff] [blame] | 553 | .name = "PVDD_LCD+PVDD_EXT", |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 554 | .always_on = 1, |
| 555 | }, |
| 556 | .consumer_supplies = wm1192_ldo1_consumers, |
| 557 | .num_consumer_supplies = ARRAY_SIZE(wm1192_ldo1_consumers), |
| 558 | }; |
| 559 | |
| 560 | static struct wm831x_status_pdata wm1192_led7_pdata = { |
| 561 | .name = "LED7:green:", |
| 562 | }; |
| 563 | |
| 564 | static struct wm831x_status_pdata wm1192_led8_pdata = { |
| 565 | .name = "LED8:green:", |
| 566 | }; |
| 567 | |
| 568 | static struct wm831x_pdata smdk6410_wm1192_pdata = { |
| 569 | .pre_init = wm1192_pre_init, |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 570 | |
| 571 | .backlight = &wm1192_backlight_pdata, |
| 572 | .dcdc = { |
| 573 | &smdk6410_vddarm, /* DCDC1 */ |
| 574 | &smdk6410_vddint, /* DCDC2 */ |
| 575 | &wm1192_dcdc3, |
| 576 | }, |
Mark Brown | a7a81d0 | 2010-02-17 18:19:31 +0000 | [diff] [blame] | 577 | .gpio_base = GPIO_BOARD_START, |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 578 | .ldo = { |
| 579 | &wm1192_ldo1, /* LDO1 */ |
| 580 | &smdk6410_vdduh_mmc, /* LDO2 */ |
| 581 | NULL, /* LDO3 NC */ |
| 582 | &smdk6410_vddotgi, /* LDO4 */ |
| 583 | &smdk6410_vddotg, /* LDO5 */ |
| 584 | &smdk6410_vddhi, /* LDO6 */ |
| 585 | &smdk6410_vddaudio, /* LDO7 */ |
| 586 | &smdk6410_vccm2mtv, /* LDO8 */ |
| 587 | &smdk6410_vddpll, /* LDO9 */ |
| 588 | &smdk6410_vccmc3bt, /* LDO10 */ |
| 589 | &smdk6410_vddalive, /* LDO11 */ |
| 590 | }, |
| 591 | .status = { |
| 592 | &wm1192_led7_pdata, |
| 593 | &wm1192_led8_pdata, |
| 594 | }, |
| 595 | }; |
| 596 | #endif |
| 597 | |
Ben Dooks | 096941e | 2008-10-31 16:14:59 +0000 | [diff] [blame] | 598 | static struct i2c_board_info i2c_devs0[] __initdata = { |
| 599 | { I2C_BOARD_INFO("24c08", 0x50), }, |
Mark Brown | 7789747 | 2009-01-23 16:29:41 +0000 | [diff] [blame] | 600 | { I2C_BOARD_INFO("wm8580", 0x1b), }, |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 601 | |
Mark Brown | 60f9101 | 2010-02-17 18:19:29 +0000 | [diff] [blame] | 602 | #ifdef CONFIG_SMDK6410_WM1192_EV1 |
| 603 | { I2C_BOARD_INFO("wm8312", 0x34), |
| 604 | .platform_data = &smdk6410_wm1192_pdata, |
| 605 | .irq = S3C_EINT(12), |
| 606 | }, |
| 607 | #endif |
| 608 | |
Mark Brown | ecc558a | 2009-02-17 15:59:38 +0000 | [diff] [blame] | 609 | #ifdef CONFIG_SMDK6410_WM1190_EV1 |
| 610 | { I2C_BOARD_INFO("wm8350", 0x1a), |
| 611 | .platform_data = &smdk6410_wm8350_pdata, |
| 612 | .irq = S3C_EINT(12), |
| 613 | }, |
| 614 | #endif |
Ben Dooks | 096941e | 2008-10-31 16:14:59 +0000 | [diff] [blame] | 615 | }; |
| 616 | |
| 617 | static struct i2c_board_info i2c_devs1[] __initdata = { |
| 618 | { I2C_BOARD_INFO("24c128", 0x57), }, /* Samsung S524AD0XD1 */ |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 619 | }; |
| 620 | |
Banajit Goswami | 96d7868 | 2011-07-20 23:45:22 +0900 | [diff] [blame] | 621 | /* LCD Backlight data */ |
| 622 | static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = { |
| 623 | .no = S3C64XX_GPF(15), |
| 624 | .func = S3C_GPIO_SFN(2), |
| 625 | }; |
| 626 | |
Thierry Reding | bf0ff1c | 2015-10-13 05:04:22 +0900 | [diff] [blame] | 627 | static struct pwm_lookup smdk6410_pwm_lookup[] = { |
| 628 | PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL, 78770, |
| 629 | PWM_POLARITY_NORMAL), |
| 630 | }; |
| 631 | |
Banajit Goswami | 96d7868 | 2011-07-20 23:45:22 +0900 | [diff] [blame] | 632 | static struct platform_pwm_backlight_data smdk6410_bl_data = { |
Thierry Reding | a63652f | 2013-08-30 12:19:52 +0200 | [diff] [blame] | 633 | .enable_gpio = -1, |
Banajit Goswami | 96d7868 | 2011-07-20 23:45:22 +0900 | [diff] [blame] | 634 | }; |
| 635 | |
Felipe Balbi | 1f91b4c | 2015-08-06 18:11:54 -0500 | [diff] [blame] | 636 | static struct dwc2_hsotg_plat smdk6410_hsotg_pdata; |
Joonyoung Shim | 99f6e1f | 2012-03-07 04:23:47 -0800 | [diff] [blame] | 637 | |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 638 | static void __init smdk6410_map_io(void) |
| 639 | { |
Ben Dooks | d6662c3 | 2008-12-12 00:24:40 +0000 | [diff] [blame] | 640 | u32 tmp; |
| 641 | |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 642 | s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc)); |
Tomasz Figa | b69f460 | 2013-08-26 02:00:38 +0900 | [diff] [blame] | 643 | s3c64xx_set_xtal_freq(12000000); |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 644 | s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs)); |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 645 | samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); |
Ben Dooks | d6662c3 | 2008-12-12 00:24:40 +0000 | [diff] [blame] | 646 | |
| 647 | /* set the LCD type */ |
| 648 | |
| 649 | tmp = __raw_readl(S3C64XX_SPCON); |
| 650 | tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK; |
| 651 | tmp |= S3C64XX_SPCON_LCD_SEL_RGB; |
| 652 | __raw_writel(tmp, S3C64XX_SPCON); |
| 653 | |
| 654 | /* remove the lcd bypass */ |
| 655 | tmp = __raw_readl(S3C64XX_MODEM_MIFPCON); |
| 656 | tmp &= ~MIFPCON_LCD_BYPASS; |
| 657 | __raw_writel(tmp, S3C64XX_MODEM_MIFPCON); |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 658 | } |
| 659 | |
| 660 | static void __init smdk6410_machine_init(void) |
| 661 | { |
Andy Green | f01fdac | 2009-12-29 14:40:36 +0000 | [diff] [blame] | 662 | u32 cs1; |
| 663 | |
Ben Dooks | d85fa24 | 2008-10-31 16:14:52 +0000 | [diff] [blame] | 664 | s3c_i2c0_set_platdata(NULL); |
Ben Dooks | d7ea374 | 2008-10-31 16:14:57 +0000 | [diff] [blame] | 665 | s3c_i2c1_set_platdata(NULL); |
Ben Dooks | 438a5d4 | 2008-11-19 15:41:34 +0000 | [diff] [blame] | 666 | s3c_fb_set_platdata(&smdk6410_lcd_pdata); |
Felipe Balbi | 1f91b4c | 2015-08-06 18:11:54 -0500 | [diff] [blame] | 667 | dwc2_hsotg_set_platdata(&smdk6410_hsotg_pdata); |
Ben Dooks | 096941e | 2008-10-31 16:14:59 +0000 | [diff] [blame] | 668 | |
Naveen Krishna Ch | 290d098 | 2010-06-22 07:39:18 +0900 | [diff] [blame] | 669 | samsung_keypad_set_platdata(&smdk6410_keypad_data); |
| 670 | |
Arnd Bergmann | a829ae5 | 2015-03-02 09:47:23 +0100 | [diff] [blame] | 671 | s3c64xx_ts_set_platdata(NULL); |
Naveen Krishna Ch | 85b14a3 | 2010-05-20 11:39:52 +0900 | [diff] [blame] | 672 | |
Andy Green | f01fdac | 2009-12-29 14:40:36 +0000 | [diff] [blame] | 673 | /* configure nCS1 width to 16 bits */ |
| 674 | |
| 675 | cs1 = __raw_readl(S3C64XX_SROM_BW) & |
| 676 | ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT); |
| 677 | cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) | |
| 678 | (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) | |
| 679 | (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) << |
| 680 | S3C64XX_SROM_BW__NCS1__SHIFT; |
| 681 | __raw_writel(cs1, S3C64XX_SROM_BW); |
| 682 | |
| 683 | /* set timing for nCS1 suitable for ethernet chip */ |
| 684 | |
| 685 | __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) | |
| 686 | (6 << S3C64XX_SROM_BCX__TACP__SHIFT) | |
| 687 | (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) | |
| 688 | (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) | |
| 689 | (0xe << S3C64XX_SROM_BCX__TACC__SHIFT) | |
| 690 | (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) | |
| 691 | (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1); |
| 692 | |
Mark Brown | b7f9a94 | 2009-04-08 16:12:35 +0100 | [diff] [blame] | 693 | gpio_request(S3C64XX_GPN(5), "LCD power"); |
| 694 | gpio_request(S3C64XX_GPF(13), "LCD power"); |
Mark Brown | b7f9a94 | 2009-04-08 16:12:35 +0100 | [diff] [blame] | 695 | |
Ben Dooks | 096941e | 2008-10-31 16:14:59 +0000 | [diff] [blame] | 696 | i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); |
| 697 | i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); |
| 698 | |
Abhilash Kesavan | 0ab0b6d | 2010-06-08 16:55:45 +0900 | [diff] [blame] | 699 | s3c_ide_set_platdata(&smdk6410_ide_pdata); |
| 700 | |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 701 | platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); |
Tomasz Figa | 7fa33bd | 2013-03-09 15:37:53 +0100 | [diff] [blame] | 702 | |
Thierry Reding | bf0ff1c | 2015-10-13 05:04:22 +0900 | [diff] [blame] | 703 | pwm_add_table(smdk6410_pwm_lookup, ARRAY_SIZE(smdk6410_pwm_lookup)); |
Tomasz Figa | 7fa33bd | 2013-03-09 15:37:53 +0100 | [diff] [blame] | 704 | samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data); |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 705 | } |
| 706 | |
| 707 | MACHINE_START(SMDK6410, "SMDK6410") |
Ben Dooks | afdd225 | 2010-05-07 09:24:05 +0900 | [diff] [blame] | 708 | /* Maintainer: Ben Dooks <ben-linux@fluff.org> */ |
Nicolas Pitre | 170a590 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 709 | .atag_offset = 0x100, |
Arnd Bergmann | ba27904 | 2015-02-27 22:06:58 +0100 | [diff] [blame] | 710 | .nr_irqs = S3C64XX_NR_IRQS, |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 711 | .init_irq = s3c6410_init_irq, |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 712 | .map_io = smdk6410_map_io, |
| 713 | .init_machine = smdk6410_machine_init, |
Romain Naour | 04a49b7 | 2013-01-09 18:47:04 -0800 | [diff] [blame] | 714 | .init_time = samsung_timer_init, |
Kukjin Kim | ff84ded | 2012-01-03 14:03:30 +0100 | [diff] [blame] | 715 | .restart = s3c64xx_restart, |
Ben Dooks | 5718df9 | 2008-10-21 14:07:09 +0100 | [diff] [blame] | 716 | MACHINE_END |