diff options
| -rw-r--r-- | arch/arm/mach-s3c6400/include/mach/map.h | 4 | ||||
| -rw-r--r-- | arch/arm/mach-s3c6400/s3c6400.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-s3c6410/cpu.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-s3c6410/mach-smdk6410.c | 52 | ||||
| -rw-r--r-- | arch/arm/plat-s3c/dev-hsmmc2.c | 4 | ||||
| -rw-r--r-- | arch/arm/plat-s3c/include/plat/sdhci.h | 23 | ||||
| -rw-r--r-- | arch/arm/plat-s3c64xx/cpu.c | 5 | ||||
| -rw-r--r-- | arch/arm/plat-s3c64xx/cpufreq.c | 40 | ||||
| -rw-r--r-- | arch/arm/plat-s3c64xx/gpiolib.c | 12 | ||||
| -rw-r--r-- | arch/arm/plat-s3c64xx/irq-eint.c | 19 | ||||
| -rw-r--r-- | arch/arm/plat-s3c64xx/setup-sdhci-gpio.c | 20 |
11 files changed, 160 insertions, 21 deletions
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h index fc8b223bad4f..f3b48f841d84 100644 --- a/arch/arm/mach-s3c6400/include/mach/map.h +++ b/arch/arm/mach-s3c6400/include/mach/map.h | |||
| @@ -64,6 +64,9 @@ | |||
| 64 | 64 | ||
| 65 | #define S3C64XX_PA_USBHOST (0x74300000) | 65 | #define S3C64XX_PA_USBHOST (0x74300000) |
| 66 | 66 | ||
| 67 | #define S3C64XX_PA_USB_HSPHY (0x7C100000) | ||
| 68 | #define S3C64XX_VA_USB_HSPHY S3C_ADDR_CPU(0x00200000) | ||
| 69 | |||
| 67 | /* place VICs close together */ | 70 | /* place VICs close together */ |
| 68 | #define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) | 71 | #define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) |
| 69 | #define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) | 72 | #define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) |
| @@ -79,5 +82,6 @@ | |||
| 79 | #define S3C_PA_FB S3C64XX_PA_FB | 82 | #define S3C_PA_FB S3C64XX_PA_FB |
| 80 | #define S3C_PA_USBHOST S3C64XX_PA_USBHOST | 83 | #define S3C_PA_USBHOST S3C64XX_PA_USBHOST |
| 81 | #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG | 84 | #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG |
| 85 | #define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY | ||
| 82 | 86 | ||
| 83 | #endif /* __ASM_ARCH_6400_MAP_H */ | 87 | #endif /* __ASM_ARCH_6400_MAP_H */ |
diff --git a/arch/arm/mach-s3c6400/s3c6400.c b/arch/arm/mach-s3c6400/s3c6400.c index b42bdd0f2138..d876ee503671 100644 --- a/arch/arm/mach-s3c6400/s3c6400.c +++ b/arch/arm/mach-s3c6400/s3c6400.c | |||
| @@ -45,6 +45,7 @@ void __init s3c6400_map_io(void) | |||
| 45 | 45 | ||
| 46 | s3c6400_default_sdhci0(); | 46 | s3c6400_default_sdhci0(); |
| 47 | s3c6400_default_sdhci1(); | 47 | s3c6400_default_sdhci1(); |
| 48 | s3c6400_default_sdhci2(); | ||
| 48 | 49 | ||
| 49 | /* the i2c devices are directly compatible with s3c2440 */ | 50 | /* the i2c devices are directly compatible with s3c2440 */ |
| 50 | s3c_i2c0_setname("s3c2440-i2c"); | 51 | s3c_i2c0_setname("s3c2440-i2c"); |
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index 9b67c663d9d8..522c08691952 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c | |||
| @@ -58,6 +58,7 @@ void __init s3c6410_map_io(void) | |||
| 58 | /* initialise device information early */ | 58 | /* initialise device information early */ |
| 59 | s3c6410_default_sdhci0(); | 59 | s3c6410_default_sdhci0(); |
| 60 | s3c6410_default_sdhci1(); | 60 | s3c6410_default_sdhci1(); |
| 61 | s3c6410_default_sdhci2(); | ||
| 61 | 62 | ||
| 62 | /* the i2c devices are directly compatible with s3c2440 */ | 63 | /* the i2c devices are directly compatible with s3c2440 */ |
| 63 | s3c_i2c0_setname("s3c2440-i2c"); | 64 | s3c_i2c0_setname("s3c2440-i2c"); |
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 9f1a21462620..480d297c1de2 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
| 26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
| 27 | #include <linux/smsc911x.h> | 27 | #include <linux/smsc911x.h> |
| 28 | #include <linux/regulator/fixed.h> | ||
| 28 | 29 | ||
| 29 | #ifdef CONFIG_SMDK6410_WM1190_EV1 | 30 | #ifdef CONFIG_SMDK6410_WM1190_EV1 |
| 30 | #include <linux/mfd/wm8350/core.h> | 31 | #include <linux/mfd/wm8350/core.h> |
| @@ -184,6 +185,43 @@ static struct platform_device smdk6410_smsc911x = { | |||
| 184 | }, | 185 | }, |
| 185 | }; | 186 | }; |
| 186 | 187 | ||
| 188 | #ifdef CONFIG_REGULATOR | ||
| 189 | static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = { | ||
| 190 | { | ||
| 191 | /* WM8580 */ | ||
| 192 | .supply = "PVDD", | ||
| 193 | .dev_name = "0-001b", | ||
| 194 | }, | ||
| 195 | { | ||
| 196 | /* WM8580 */ | ||
| 197 | .supply = "AVDD", | ||
| 198 | .dev_name = "0-001b", | ||
| 199 | }, | ||
| 200 | }; | ||
| 201 | |||
| 202 | static struct regulator_init_data smdk6410_b_pwr_5v_data = { | ||
| 203 | .constraints = { | ||
| 204 | .always_on = 1, | ||
| 205 | }, | ||
| 206 | .num_consumer_supplies = ARRAY_SIZE(smdk6410_b_pwr_5v_consumers), | ||
| 207 | .consumer_supplies = smdk6410_b_pwr_5v_consumers, | ||
| 208 | }; | ||
| 209 | |||
| 210 | static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = { | ||
| 211 | .supply_name = "B_PWR_5V", | ||
| 212 | .microvolts = 5000000, | ||
| 213 | .init_data = &smdk6410_b_pwr_5v_data, | ||
| 214 | }; | ||
| 215 | |||
| 216 | static struct platform_device smdk6410_b_pwr_5v = { | ||
| 217 | .name = "reg-fixed-voltage", | ||
| 218 | .id = -1, | ||
| 219 | .dev = { | ||
| 220 | .platform_data = &smdk6410_b_pwr_5v_pdata, | ||
| 221 | }, | ||
| 222 | }; | ||
| 223 | #endif | ||
| 224 | |||
| 187 | static struct map_desc smdk6410_iodesc[] = {}; | 225 | static struct map_desc smdk6410_iodesc[] = {}; |
| 188 | 226 | ||
| 189 | static struct platform_device *smdk6410_devices[] __initdata = { | 227 | static struct platform_device *smdk6410_devices[] __initdata = { |
| @@ -198,6 +236,10 @@ static struct platform_device *smdk6410_devices[] __initdata = { | |||
| 198 | &s3c_device_fb, | 236 | &s3c_device_fb, |
| 199 | &s3c_device_usb, | 237 | &s3c_device_usb, |
| 200 | &s3c_device_usb_hsotg, | 238 | &s3c_device_usb_hsotg, |
| 239 | |||
| 240 | #ifdef CONFIG_REGULATOR | ||
| 241 | &smdk6410_b_pwr_5v, | ||
| 242 | #endif | ||
| 201 | &smdk6410_lcd_powerdev, | 243 | &smdk6410_lcd_powerdev, |
| 202 | 244 | ||
| 203 | &smdk6410_smsc911x, | 245 | &smdk6410_smsc911x, |
| @@ -232,6 +274,14 @@ static struct regulator_init_data wm8350_dcdc3_data = { | |||
| 232 | }; | 274 | }; |
| 233 | 275 | ||
| 234 | /* USB, EXT, PCM, ADC/DAC, USB, MMC */ | 276 | /* USB, EXT, PCM, ADC/DAC, USB, MMC */ |
| 277 | static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = { | ||
| 278 | { | ||
| 279 | /* WM8580 */ | ||
| 280 | .supply = "DVDD", | ||
| 281 | .dev_name = "0-001b", | ||
| 282 | }, | ||
| 283 | }; | ||
| 284 | |||
| 235 | static struct regulator_init_data wm8350_dcdc4_data = { | 285 | static struct regulator_init_data wm8350_dcdc4_data = { |
| 236 | .constraints = { | 286 | .constraints = { |
| 237 | .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", | 287 | .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", |
| @@ -239,6 +289,8 @@ static struct regulator_init_data wm8350_dcdc4_data = { | |||
| 239 | .max_uV = 3000000, | 289 | .max_uV = 3000000, |
| 240 | .always_on = 1, | 290 | .always_on = 1, |
| 241 | }, | 291 | }, |
| 292 | .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers), | ||
| 293 | .consumer_supplies = wm8350_dcdc4_consumers, | ||
| 242 | }; | 294 | }; |
| 243 | 295 | ||
| 244 | /* ARM core */ | 296 | /* ARM core */ |
diff --git a/arch/arm/plat-s3c/dev-hsmmc2.c b/arch/arm/plat-s3c/dev-hsmmc2.c index 082e55a78ad7..824580bc0e06 100644 --- a/arch/arm/plat-s3c/dev-hsmmc2.c +++ b/arch/arm/plat-s3c/dev-hsmmc2.c | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c/dev-hsmmc2.c | 1 | /* linux/arch/arm/plat-s3c/dev-hsmmc2.c |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2009 Samsung Electronics | 3 | * Copyright (c) 2009 Samsung Electronics |
| 4 | * Copyright (c) 2009 Maurus Cuelenaere | ||
| 5 | * | ||
| 6 | * Based on arch/arm/plat-s3c/dev-hsmmc1.c | ||
| 7 | * original file Copyright (c) 2008 Simtec Electronics | ||
| 4 | * | 8 | * |
| 5 | * S3C series device definition for hsmmc device 2 | 9 | * S3C series device definition for hsmmc device 2 |
| 6 | * | 10 | * |
diff --git a/arch/arm/plat-s3c/include/plat/sdhci.h b/arch/arm/plat-s3c/include/plat/sdhci.h index c71d07861840..53198673b6bd 100644 --- a/arch/arm/plat-s3c/include/plat/sdhci.h +++ b/arch/arm/plat-s3c/include/plat/sdhci.h | |||
| @@ -74,6 +74,7 @@ extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | |||
| 74 | extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); | 74 | extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); |
| 75 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | 75 | extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w); |
| 76 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | 76 | extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w); |
| 77 | extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w); | ||
| 77 | 78 | ||
| 78 | /* S3C6400 SDHCI setup */ | 79 | /* S3C6400 SDHCI setup */ |
| 79 | 80 | ||
| @@ -108,6 +109,17 @@ static inline void s3c6400_default_sdhci1(void) | |||
| 108 | static inline void s3c6400_default_sdhci1(void) { } | 109 | static inline void s3c6400_default_sdhci1(void) { } |
| 109 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | 110 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ |
| 110 | 111 | ||
| 112 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
| 113 | static inline void s3c6400_default_sdhci2(void) | ||
| 114 | { | ||
| 115 | s3c_hsmmc2_def_platdata.clocks = s3c6400_hsmmc_clksrcs; | ||
| 116 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; | ||
| 117 | s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; | ||
| 118 | } | ||
| 119 | #else | ||
| 120 | static inline void s3c6400_default_sdhci2(void) { } | ||
| 121 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
| 122 | |||
| 111 | #else | 123 | #else |
| 112 | static inline void s3c6400_default_sdhci0(void) { } | 124 | static inline void s3c6400_default_sdhci0(void) { } |
| 113 | static inline void s3c6400_default_sdhci1(void) { } | 125 | static inline void s3c6400_default_sdhci1(void) { } |
| @@ -145,6 +157,17 @@ static inline void s3c6410_default_sdhci1(void) | |||
| 145 | static inline void s3c6410_default_sdhci1(void) { } | 157 | static inline void s3c6410_default_sdhci1(void) { } |
| 146 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | 158 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ |
| 147 | 159 | ||
| 160 | #ifdef CONFIG_S3C_DEV_HSMMC2 | ||
| 161 | static inline void s3c6410_default_sdhci2(void) | ||
| 162 | { | ||
| 163 | s3c_hsmmc2_def_platdata.clocks = s3c6410_hsmmc_clksrcs; | ||
| 164 | s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; | ||
| 165 | s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; | ||
| 166 | } | ||
| 167 | #else | ||
| 168 | static inline void s3c6410_default_sdhci2(void) { } | ||
| 169 | #endif /* CONFIG_S3C_DEV_HSMMC2 */ | ||
| 170 | |||
| 148 | #else | 171 | #else |
| 149 | static inline void s3c6410_default_sdhci0(void) { } | 172 | static inline void s3c6410_default_sdhci0(void) { } |
| 150 | static inline void s3c6410_default_sdhci1(void) { } | 173 | static inline void s3c6410_default_sdhci1(void) { } |
diff --git a/arch/arm/plat-s3c64xx/cpu.c b/arch/arm/plat-s3c64xx/cpu.c index b1fdd83940a6..49796d2db86d 100644 --- a/arch/arm/plat-s3c64xx/cpu.c +++ b/arch/arm/plat-s3c64xx/cpu.c | |||
| @@ -107,6 +107,11 @@ static struct map_desc s3c_iodesc[] __initdata = { | |||
| 107 | .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG), | 107 | .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG), |
| 108 | .length = SZ_4K, | 108 | .length = SZ_4K, |
| 109 | .type = MT_DEVICE, | 109 | .type = MT_DEVICE, |
| 110 | }, { | ||
| 111 | .virtual = (unsigned long)S3C_VA_USB_HSPHY, | ||
| 112 | .pfn = __phys_to_pfn(S3C64XX_PA_USB_HSPHY), | ||
| 113 | .length = SZ_1K, | ||
| 114 | .type = MT_DEVICE, | ||
| 110 | }, | 115 | }, |
| 111 | }; | 116 | }; |
| 112 | 117 | ||
diff --git a/arch/arm/plat-s3c64xx/cpufreq.c b/arch/arm/plat-s3c64xx/cpufreq.c index e6e0843215df..74c0e8347de5 100644 --- a/arch/arm/plat-s3c64xx/cpufreq.c +++ b/arch/arm/plat-s3c64xx/cpufreq.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | static struct clk *armclk; | 20 | static struct clk *armclk; |
| 21 | static struct regulator *vddarm; | 21 | static struct regulator *vddarm; |
| 22 | static unsigned long regulator_latency; | ||
| 22 | 23 | ||
| 23 | #ifdef CONFIG_CPU_S3C6410 | 24 | #ifdef CONFIG_CPU_S3C6410 |
| 24 | struct s3c64xx_dvfs { | 25 | struct s3c64xx_dvfs { |
| @@ -27,11 +28,10 @@ struct s3c64xx_dvfs { | |||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = { | 30 | static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = { |
| 30 | [0] = { 1000000, 1000000 }, | 31 | [0] = { 1000000, 1150000 }, |
| 31 | [1] = { 1000000, 1050000 }, | 32 | [1] = { 1050000, 1150000 }, |
| 32 | [2] = { 1050000, 1100000 }, | 33 | [2] = { 1100000, 1150000 }, |
| 33 | [3] = { 1050000, 1150000 }, | 34 | [3] = { 1200000, 1350000 }, |
| 34 | [4] = { 1250000, 1350000 }, | ||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | static struct cpufreq_frequency_table s3c64xx_freq_table[] = { | 37 | static struct cpufreq_frequency_table s3c64xx_freq_table[] = { |
| @@ -41,9 +41,9 @@ static struct cpufreq_frequency_table s3c64xx_freq_table[] = { | |||
| 41 | { 1, 266000 }, | 41 | { 1, 266000 }, |
| 42 | { 2, 333000 }, | 42 | { 2, 333000 }, |
| 43 | { 2, 400000 }, | 43 | { 2, 400000 }, |
| 44 | { 3, 532000 }, | 44 | { 2, 532000 }, |
| 45 | { 3, 533000 }, | 45 | { 2, 533000 }, |
| 46 | { 4, 667000 }, | 46 | { 3, 667000 }, |
| 47 | { 0, CPUFREQ_TABLE_END }, | 47 | { 0, CPUFREQ_TABLE_END }, |
| 48 | }; | 48 | }; |
| 49 | #endif | 49 | #endif |
| @@ -141,7 +141,7 @@ err: | |||
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | #ifdef CONFIG_REGULATOR | 143 | #ifdef CONFIG_REGULATOR |
| 144 | static void __init s3c64xx_cpufreq_constrain_voltages(void) | 144 | static void __init s3c64xx_cpufreq_config_regulator(void) |
| 145 | { | 145 | { |
| 146 | int count, v, i, found; | 146 | int count, v, i, found; |
| 147 | struct cpufreq_frequency_table *freq; | 147 | struct cpufreq_frequency_table *freq; |
| @@ -150,11 +150,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void) | |||
| 150 | count = regulator_count_voltages(vddarm); | 150 | count = regulator_count_voltages(vddarm); |
| 151 | if (count < 0) { | 151 | if (count < 0) { |
| 152 | pr_err("cpufreq: Unable to check supported voltages\n"); | 152 | pr_err("cpufreq: Unable to check supported voltages\n"); |
| 153 | return; | ||
| 154 | } | 153 | } |
| 155 | 154 | ||
| 156 | freq = s3c64xx_freq_table; | 155 | freq = s3c64xx_freq_table; |
| 157 | while (freq->frequency != CPUFREQ_TABLE_END) { | 156 | while (count > 0 && freq->frequency != CPUFREQ_TABLE_END) { |
| 158 | if (freq->frequency == CPUFREQ_ENTRY_INVALID) | 157 | if (freq->frequency == CPUFREQ_ENTRY_INVALID) |
| 159 | continue; | 158 | continue; |
| 160 | 159 | ||
| @@ -175,6 +174,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void) | |||
| 175 | 174 | ||
| 176 | freq++; | 175 | freq++; |
| 177 | } | 176 | } |
| 177 | |||
| 178 | /* Guess based on having to do an I2C/SPI write; in future we | ||
| 179 | * will be able to query the regulator performance here. */ | ||
| 180 | regulator_latency = 1 * 1000 * 1000; | ||
| 178 | } | 181 | } |
| 179 | #endif | 182 | #endif |
| 180 | 183 | ||
| @@ -206,7 +209,7 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) | |||
| 206 | pr_err("cpufreq: Only frequency scaling available\n"); | 209 | pr_err("cpufreq: Only frequency scaling available\n"); |
| 207 | vddarm = NULL; | 210 | vddarm = NULL; |
| 208 | } else { | 211 | } else { |
| 209 | s3c64xx_cpufreq_constrain_voltages(); | 212 | s3c64xx_cpufreq_config_regulator(); |
| 210 | } | 213 | } |
| 211 | #endif | 214 | #endif |
| 212 | 215 | ||
| @@ -217,8 +220,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) | |||
| 217 | /* Check for frequencies we can generate */ | 220 | /* Check for frequencies we can generate */ |
| 218 | r = clk_round_rate(armclk, freq->frequency * 1000); | 221 | r = clk_round_rate(armclk, freq->frequency * 1000); |
| 219 | r /= 1000; | 222 | r /= 1000; |
| 220 | if (r != freq->frequency) | 223 | if (r != freq->frequency) { |
| 224 | pr_debug("cpufreq: %dkHz unsupported by clock\n", | ||
| 225 | freq->frequency); | ||
| 221 | freq->frequency = CPUFREQ_ENTRY_INVALID; | 226 | freq->frequency = CPUFREQ_ENTRY_INVALID; |
| 227 | } | ||
| 222 | 228 | ||
| 223 | /* If we have no regulator then assume startup | 229 | /* If we have no regulator then assume startup |
| 224 | * frequency is the maximum we can support. */ | 230 | * frequency is the maximum we can support. */ |
| @@ -230,9 +236,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) | |||
| 230 | 236 | ||
| 231 | policy->cur = clk_get_rate(armclk) / 1000; | 237 | policy->cur = clk_get_rate(armclk) / 1000; |
| 232 | 238 | ||
| 233 | /* Pick a conservative guess in ns: we'll need ~1 I2C/SPI | 239 | /* Datasheet says PLL stabalisation time (if we were to use |
| 234 | * write plus clock reprogramming. */ | 240 | * the PLLs, which we don't currently) is ~300us worst case, |
| 235 | policy->cpuinfo.transition_latency = 2 * 1000 * 1000; | 241 | * but add some fudge. |
| 242 | */ | ||
| 243 | policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency; | ||
| 236 | 244 | ||
| 237 | ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table); | 245 | ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table); |
| 238 | if (ret != 0) { | 246 | if (ret != 0) { |
diff --git a/arch/arm/plat-s3c64xx/gpiolib.c b/arch/arm/plat-s3c64xx/gpiolib.c index 92859290ea33..778560457277 100644 --- a/arch/arm/plat-s3c64xx/gpiolib.c +++ b/arch/arm/plat-s3c64xx/gpiolib.c | |||
| @@ -213,6 +213,11 @@ static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = { | |||
| 213 | .get_pull = s3c_gpio_getpull_updown, | 213 | .get_pull = s3c_gpio_getpull_updown, |
| 214 | }; | 214 | }; |
| 215 | 215 | ||
| 216 | int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin) | ||
| 217 | { | ||
| 218 | return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO; | ||
| 219 | } | ||
| 220 | |||
| 216 | static struct s3c_gpio_chip gpio_4bit[] = { | 221 | static struct s3c_gpio_chip gpio_4bit[] = { |
| 217 | { | 222 | { |
| 218 | .base = S3C64XX_GPA_BASE, | 223 | .base = S3C64XX_GPA_BASE, |
| @@ -269,10 +274,16 @@ static struct s3c_gpio_chip gpio_4bit[] = { | |||
| 269 | .base = S3C64XX_GPM(0), | 274 | .base = S3C64XX_GPM(0), |
| 270 | .ngpio = S3C64XX_GPIO_M_NR, | 275 | .ngpio = S3C64XX_GPIO_M_NR, |
| 271 | .label = "GPM", | 276 | .label = "GPM", |
| 277 | .to_irq = s3c64xx_gpio2int_gpm, | ||
| 272 | }, | 278 | }, |
| 273 | }, | 279 | }, |
| 274 | }; | 280 | }; |
| 275 | 281 | ||
| 282 | int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin) | ||
| 283 | { | ||
| 284 | return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO; | ||
| 285 | } | ||
| 286 | |||
| 276 | static struct s3c_gpio_chip gpio_4bit2[] = { | 287 | static struct s3c_gpio_chip gpio_4bit2[] = { |
| 277 | { | 288 | { |
| 278 | .base = S3C64XX_GPH_BASE + 0x4, | 289 | .base = S3C64XX_GPH_BASE + 0x4, |
| @@ -297,6 +308,7 @@ static struct s3c_gpio_chip gpio_4bit2[] = { | |||
| 297 | .base = S3C64XX_GPL(0), | 308 | .base = S3C64XX_GPL(0), |
| 298 | .ngpio = S3C64XX_GPIO_L_NR, | 309 | .ngpio = S3C64XX_GPIO_L_NR, |
| 299 | .label = "GPL", | 310 | .label = "GPL", |
| 311 | .to_irq = s3c64xx_gpio2int_gpl, | ||
| 300 | }, | 312 | }, |
| 301 | }, | 313 | }, |
| 302 | }; | 314 | }; |
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c index f81b7b818ba0..ebdf183a0911 100644 --- a/arch/arm/plat-s3c64xx/irq-eint.c +++ b/arch/arm/plat-s3c64xx/irq-eint.c | |||
| @@ -65,7 +65,7 @@ static void s3c_irq_eint_maskack(unsigned int irq) | |||
| 65 | static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) | 65 | static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) |
| 66 | { | 66 | { |
| 67 | int offs = eint_offset(irq); | 67 | int offs = eint_offset(irq); |
| 68 | int pin; | 68 | int pin, pin_val; |
| 69 | int shift; | 69 | int shift; |
| 70 | u32 ctrl, mask; | 70 | u32 ctrl, mask; |
| 71 | u32 newvalue = 0; | 71 | u32 newvalue = 0; |
| @@ -109,7 +109,10 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) | |||
| 109 | return -1; | 109 | return -1; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | shift = (offs / 2) * 4; | 112 | if (offs <= 15) |
| 113 | shift = (offs / 2) * 4; | ||
| 114 | else | ||
| 115 | shift = ((offs - 16) / 2) * 4; | ||
| 113 | mask = 0x7 << shift; | 116 | mask = 0x7 << shift; |
| 114 | 117 | ||
| 115 | ctrl = __raw_readl(reg); | 118 | ctrl = __raw_readl(reg); |
| @@ -119,12 +122,18 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) | |||
| 119 | 122 | ||
| 120 | /* set the GPIO pin appropriately */ | 123 | /* set the GPIO pin appropriately */ |
| 121 | 124 | ||
| 122 | if (offs < 23) | 125 | if (offs < 16) { |
| 123 | pin = S3C64XX_GPN(offs); | 126 | pin = S3C64XX_GPN(offs); |
| 124 | else | 127 | pin_val = S3C_GPIO_SFN(2); |
| 128 | } else if (offs < 23) { | ||
| 129 | pin = S3C64XX_GPL(offs + 8 - 16); | ||
| 130 | pin_val = S3C_GPIO_SFN(3); | ||
| 131 | } else { | ||
| 125 | pin = S3C64XX_GPM(offs - 23); | 132 | pin = S3C64XX_GPM(offs - 23); |
| 133 | pin_val = S3C_GPIO_SFN(3); | ||
| 134 | } | ||
| 126 | 135 | ||
| 127 | s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(2)); | 136 | s3c_gpio_cfgpin(pin, pin_val); |
| 128 | 137 | ||
| 129 | return 0; | 138 | return 0; |
| 130 | } | 139 | } |
diff --git a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c index 5417123b0ac1..a58c0cc7ba5e 100644 --- a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c +++ b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c | |||
| @@ -53,3 +53,23 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | |||
| 53 | s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); | 53 | s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); |
| 54 | s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3)); | 54 | s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3)); |
| 55 | } | 55 | } |
| 56 | |||
| 57 | void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | ||
| 58 | { | ||
| 59 | unsigned int gpio; | ||
| 60 | unsigned int end; | ||
| 61 | |||
| 62 | end = S3C64XX_GPH(6 + width); | ||
| 63 | |||
| 64 | /* Set all the necessary GPH pins to special-function 1 */ | ||
| 65 | for (gpio = S3C64XX_GPH(6); gpio < end; gpio++) { | ||
| 66 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | ||
| 67 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
| 68 | } | ||
| 69 | |||
| 70 | /* Set all the necessary GPC pins to special-function 1 */ | ||
| 71 | for (gpio = S3C64XX_GPC(4); gpio < S3C64XX_GPC(6); gpio++) { | ||
| 72 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | ||
| 73 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
| 74 | } | ||
| 75 | } | ||
