diff options
Diffstat (limited to 'arch/arm/mach-ux500')
28 files changed, 206 insertions, 1209 deletions
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 18755f132267..5848206ee9b9 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
@@ -11,6 +11,7 @@ config UX500_SOC_COMMON | |||
11 | select CACHE_L2X0 | 11 | select CACHE_L2X0 |
12 | select PINCTRL | 12 | select PINCTRL |
13 | select PINCTRL_NOMADIK | 13 | select PINCTRL_NOMADIK |
14 | select COMMON_CLK | ||
14 | 15 | ||
15 | config UX500_SOC_DB8500 | 16 | config UX500_SOC_DB8500 |
16 | bool | 17 | bool |
@@ -28,6 +29,7 @@ config MACH_MOP500 | |||
28 | select I2C | 29 | select I2C |
29 | select I2C_NOMADIK | 30 | select I2C_NOMADIK |
30 | select SOC_BUS | 31 | select SOC_BUS |
32 | select REGULATOR_FIXED_VOLTAGE | ||
31 | help | 33 | help |
32 | Include support for the MOP500 development platform. | 34 | Include support for the MOP500 development platform. |
33 | 35 | ||
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index 026086ff9e6c..f24710dfc395 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel, U8500 machine. | 2 | # Makefile for the linux kernel, U8500 machine. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := clock.o cpu.o devices.o devices-common.o \ | 5 | obj-y := cpu.o devices.o devices-common.o \ |
6 | id.o usb.o timer.o | 6 | id.o usb.o timer.o |
7 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 7 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
8 | obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o | 8 | obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o |
@@ -12,6 +12,6 @@ obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \ | |||
12 | board-mop500-uib.o board-mop500-stuib.o \ | 12 | board-mop500-uib.o board-mop500-stuib.o \ |
13 | board-mop500-u8500uib.o \ | 13 | board-mop500-u8500uib.o \ |
14 | board-mop500-pins.o \ | 14 | board-mop500-pins.o \ |
15 | board-mop500-msp.o | 15 | board-mop500-audio.o |
16 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 16 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
17 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 17 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
diff --git a/arch/arm/mach-ux500/Makefile.boot b/arch/arm/mach-ux500/Makefile.boot index dd5cd00e2554..760a0efe7580 100644 --- a/arch/arm/mach-ux500/Makefile.boot +++ b/arch/arm/mach-ux500/Makefile.boot | |||
@@ -1,5 +1,3 @@ | |||
1 | zreladdr-y += 0x00008000 | 1 | zreladdr-y += 0x00008000 |
2 | params_phys-y := 0x00000100 | 2 | params_phys-y := 0x00000100 |
3 | initrd_phys-y := 0x00800000 | 3 | initrd_phys-y := 0x00800000 |
4 | |||
5 | dtb-$(CONFIG_MACH_SNOWBALL) += snowball.dtb | ||
diff --git a/arch/arm/mach-ux500/board-mop500-msp.c b/arch/arm/mach-ux500/board-mop500-audio.c index df15646036aa..070629a95625 100644 --- a/arch/arm/mach-ux500/board-mop500-msp.c +++ b/arch/arm/mach-ux500/board-mop500-audio.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/platform_device.h> | 7 | #include <linux/platform_device.h> |
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/gpio.h> | 9 | #include <linux/gpio.h> |
10 | #include <linux/pinctrl/consumer.h> | ||
11 | 10 | ||
12 | #include <plat/gpio-nomadik.h> | 11 | #include <plat/gpio-nomadik.h> |
13 | #include <plat/pincfg.h> | 12 | #include <plat/pincfg.h> |
@@ -23,53 +22,6 @@ | |||
23 | #include "devices-db8500.h" | 22 | #include "devices-db8500.h" |
24 | #include "pins-db8500.h" | 23 | #include "pins-db8500.h" |
25 | 24 | ||
26 | /* MSP1/3 Tx/Rx usage protection */ | ||
27 | static DEFINE_SPINLOCK(msp_rxtx_lock); | ||
28 | |||
29 | /* Reference Count */ | ||
30 | static int msp_rxtx_ref; | ||
31 | |||
32 | /* Pin modes */ | ||
33 | struct pinctrl *msp1_p; | ||
34 | struct pinctrl_state *msp1_def; | ||
35 | struct pinctrl_state *msp1_sleep; | ||
36 | |||
37 | int msp13_i2s_init(void) | ||
38 | { | ||
39 | int retval = 0; | ||
40 | unsigned long flags; | ||
41 | |||
42 | spin_lock_irqsave(&msp_rxtx_lock, flags); | ||
43 | if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_def))) { | ||
44 | retval = pinctrl_select_state(msp1_p, msp1_def); | ||
45 | if (retval) | ||
46 | pr_err("could not set MSP1 defstate\n"); | ||
47 | } | ||
48 | if (!retval) | ||
49 | msp_rxtx_ref++; | ||
50 | spin_unlock_irqrestore(&msp_rxtx_lock, flags); | ||
51 | |||
52 | return retval; | ||
53 | } | ||
54 | |||
55 | int msp13_i2s_exit(void) | ||
56 | { | ||
57 | int retval = 0; | ||
58 | unsigned long flags; | ||
59 | |||
60 | spin_lock_irqsave(&msp_rxtx_lock, flags); | ||
61 | WARN_ON(!msp_rxtx_ref); | ||
62 | msp_rxtx_ref--; | ||
63 | if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_sleep))) { | ||
64 | retval = pinctrl_select_state(msp1_p, msp1_sleep); | ||
65 | if (retval) | ||
66 | pr_err("could not set MSP1 sleepstate\n"); | ||
67 | } | ||
68 | spin_unlock_irqrestore(&msp_rxtx_lock, flags); | ||
69 | |||
70 | return retval; | ||
71 | } | ||
72 | |||
73 | static struct stedma40_chan_cfg msp0_dma_rx = { | 25 | static struct stedma40_chan_cfg msp0_dma_rx = { |
74 | .high_priority = true, | 26 | .high_priority = true, |
75 | .dir = STEDMA40_PERIPH_TO_MEM, | 27 | .dir = STEDMA40_PERIPH_TO_MEM, |
@@ -96,7 +48,7 @@ static struct stedma40_chan_cfg msp0_dma_tx = { | |||
96 | /* data_width is set during configuration */ | 48 | /* data_width is set during configuration */ |
97 | }; | 49 | }; |
98 | 50 | ||
99 | static struct msp_i2s_platform_data msp0_platform_data = { | 51 | struct msp_i2s_platform_data msp0_platform_data = { |
100 | .id = MSP_I2S_0, | 52 | .id = MSP_I2S_0, |
101 | .msp_i2s_dma_rx = &msp0_dma_rx, | 53 | .msp_i2s_dma_rx = &msp0_dma_rx, |
102 | .msp_i2s_dma_tx = &msp0_dma_tx, | 54 | .msp_i2s_dma_tx = &msp0_dma_tx, |
@@ -128,12 +80,10 @@ static struct stedma40_chan_cfg msp1_dma_tx = { | |||
128 | /* data_width is set during configuration */ | 80 | /* data_width is set during configuration */ |
129 | }; | 81 | }; |
130 | 82 | ||
131 | static struct msp_i2s_platform_data msp1_platform_data = { | 83 | struct msp_i2s_platform_data msp1_platform_data = { |
132 | .id = MSP_I2S_1, | 84 | .id = MSP_I2S_1, |
133 | .msp_i2s_dma_rx = NULL, | 85 | .msp_i2s_dma_rx = NULL, |
134 | .msp_i2s_dma_tx = &msp1_dma_tx, | 86 | .msp_i2s_dma_tx = &msp1_dma_tx, |
135 | .msp_i2s_init = msp13_i2s_init, | ||
136 | .msp_i2s_exit = msp13_i2s_exit, | ||
137 | }; | 87 | }; |
138 | 88 | ||
139 | static struct stedma40_chan_cfg msp2_dma_rx = { | 89 | static struct stedma40_chan_cfg msp2_dma_rx = { |
@@ -193,11 +143,11 @@ static struct platform_device *db8500_add_msp_i2s(struct device *parent, | |||
193 | 143 | ||
194 | /* Platform device for ASoC MOP500 machine */ | 144 | /* Platform device for ASoC MOP500 machine */ |
195 | static struct platform_device snd_soc_mop500 = { | 145 | static struct platform_device snd_soc_mop500 = { |
196 | .name = "snd-soc-mop500", | 146 | .name = "snd-soc-mop500", |
197 | .id = 0, | 147 | .id = 0, |
198 | .dev = { | 148 | .dev = { |
199 | .platform_data = NULL, | 149 | .platform_data = NULL, |
200 | }, | 150 | }, |
201 | }; | 151 | }; |
202 | 152 | ||
203 | /* Platform device for Ux500-PCM */ | 153 | /* Platform device for Ux500-PCM */ |
@@ -209,59 +159,37 @@ static struct platform_device ux500_pcm = { | |||
209 | }, | 159 | }, |
210 | }; | 160 | }; |
211 | 161 | ||
212 | static struct msp_i2s_platform_data msp2_platform_data = { | 162 | struct msp_i2s_platform_data msp2_platform_data = { |
213 | .id = MSP_I2S_2, | 163 | .id = MSP_I2S_2, |
214 | .msp_i2s_dma_rx = &msp2_dma_rx, | 164 | .msp_i2s_dma_rx = &msp2_dma_rx, |
215 | .msp_i2s_dma_tx = &msp2_dma_tx, | 165 | .msp_i2s_dma_tx = &msp2_dma_tx, |
216 | }; | 166 | }; |
217 | 167 | ||
218 | static struct msp_i2s_platform_data msp3_platform_data = { | 168 | struct msp_i2s_platform_data msp3_platform_data = { |
219 | .id = MSP_I2S_3, | 169 | .id = MSP_I2S_3, |
220 | .msp_i2s_dma_rx = &msp1_dma_rx, | 170 | .msp_i2s_dma_rx = &msp1_dma_rx, |
221 | .msp_i2s_dma_tx = NULL, | 171 | .msp_i2s_dma_tx = NULL, |
222 | .msp_i2s_init = msp13_i2s_init, | ||
223 | .msp_i2s_exit = msp13_i2s_exit, | ||
224 | }; | 172 | }; |
225 | 173 | ||
226 | int mop500_msp_init(struct device *parent) | 174 | void mop500_audio_init(struct device *parent) |
227 | { | 175 | { |
228 | struct platform_device *msp1; | ||
229 | |||
230 | pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__); | 176 | pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__); |
231 | platform_device_register(&snd_soc_mop500); | 177 | platform_device_register(&snd_soc_mop500); |
232 | 178 | ||
233 | pr_info("Initialize MSP I2S-devices.\n"); | 179 | pr_info("Initialize MSP I2S-devices.\n"); |
234 | db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, | 180 | db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, |
235 | &msp0_platform_data); | 181 | &msp0_platform_data); |
236 | msp1 = db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, | 182 | db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, |
237 | &msp1_platform_data); | 183 | &msp1_platform_data); |
238 | db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, | 184 | db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, |
239 | &msp2_platform_data); | 185 | &msp2_platform_data); |
240 | db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, | 186 | db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, |
241 | &msp3_platform_data); | 187 | &msp3_platform_data); |
188 | } | ||
242 | 189 | ||
243 | /* Get the pinctrl handle for MSP1 */ | 190 | /* Due for removal once the MSP driver has been fully DT:ed. */ |
244 | if (msp1) { | 191 | void mop500_of_audio_init(struct device *parent) |
245 | msp1_p = pinctrl_get(&msp1->dev); | 192 | { |
246 | if (IS_ERR(msp1_p)) | ||
247 | dev_err(&msp1->dev, "could not get MSP1 pinctrl\n"); | ||
248 | else { | ||
249 | msp1_def = pinctrl_lookup_state(msp1_p, | ||
250 | PINCTRL_STATE_DEFAULT); | ||
251 | if (IS_ERR(msp1_def)) { | ||
252 | dev_err(&msp1->dev, | ||
253 | "could not get MSP1 defstate\n"); | ||
254 | } | ||
255 | msp1_sleep = pinctrl_lookup_state(msp1_p, | ||
256 | PINCTRL_STATE_SLEEP); | ||
257 | if (IS_ERR(msp1_sleep)) | ||
258 | dev_err(&msp1->dev, | ||
259 | "could not get MSP1 idlestate\n"); | ||
260 | } | ||
261 | } | ||
262 | |||
263 | pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); | 193 | pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); |
264 | platform_device_register(&ux500_pcm); | 194 | platform_device_register(&ux500_pcm); |
265 | |||
266 | return 0; | ||
267 | } | 195 | } |
diff --git a/arch/arm/mach-ux500/board-mop500-msp.h b/arch/arm/mach-ux500/board-mop500-msp.h deleted file mode 100644 index 6fcfb5e2cc94..000000000000 --- a/arch/arm/mach-ux500/board-mop500-msp.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2012 | ||
3 | * | ||
4 | * Author: Ola Lilja <ola.o.lilja@stericsson.com>, | ||
5 | * for ST-Ericsson. | ||
6 | * | ||
7 | * License terms: | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | void mop500_msp_init(struct device *parent); | ||
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c index 32fd99204464..a267c6d30e37 100644 --- a/arch/arm/mach-ux500/board-mop500-pins.c +++ b/arch/arm/mach-ux500/board-mop500-pins.c | |||
@@ -30,16 +30,15 @@ static enum custom_pin_cfg_t pinsfor; | |||
30 | #define BIAS(a,b) static unsigned long a[] = { b } | 30 | #define BIAS(a,b) static unsigned long a[] = { b } |
31 | 31 | ||
32 | BIAS(pd, PIN_PULL_DOWN); | 32 | BIAS(pd, PIN_PULL_DOWN); |
33 | BIAS(slpm_gpio_nopull, PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL); | ||
34 | BIAS(in_nopull, PIN_INPUT_NOPULL); | 33 | BIAS(in_nopull, PIN_INPUT_NOPULL); |
35 | BIAS(in_nopull_sleep_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE); | 34 | BIAS(in_nopull_slpm_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE); |
36 | BIAS(in_pu, PIN_INPUT_PULLUP); | 35 | BIAS(in_pu, PIN_INPUT_PULLUP); |
37 | BIAS(in_pd, PIN_INPUT_PULLDOWN); | 36 | BIAS(in_pd, PIN_INPUT_PULLDOWN); |
38 | BIAS(in_pd_slpm_in_pu, PIN_INPUT_PULLDOWN|PIN_SLPM_INPUT_PULLUP); | 37 | BIAS(in_pd_slpm_in_pu, PIN_INPUT_PULLDOWN|PIN_SLPM_INPUT_PULLUP); |
39 | BIAS(in_pu_slpm_out_lo, PIN_INPUT_PULLUP|PIN_SLPM_OUTPUT_LOW); | 38 | BIAS(in_pu_slpm_out_lo, PIN_INPUT_PULLUP|PIN_SLPM_OUTPUT_LOW); |
40 | BIAS(out_hi, PIN_OUTPUT_HIGH); | 39 | BIAS(out_hi, PIN_OUTPUT_HIGH); |
41 | BIAS(out_lo, PIN_OUTPUT_LOW); | 40 | BIAS(out_lo, PIN_OUTPUT_LOW); |
42 | BIAS(out_lo_sleep_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE); | 41 | BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE); |
43 | /* These also force them into GPIO mode */ | 42 | /* These also force them into GPIO mode */ |
44 | BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED); | 43 | BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED); |
45 | BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED); | 44 | BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED); |
@@ -48,23 +47,32 @@ BIAS(gpio_in_pd_slpm_gpio_nopull, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED|PIN_SL | |||
48 | BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED); | 47 | BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED); |
49 | BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED); | 48 | BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED); |
50 | /* Sleep modes */ | 49 | /* Sleep modes */ |
51 | BIAS(sleep_in_wkup_pdis, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); | 50 | BIAS(slpm_in_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
52 | BIAS(sleep_in_nopull_wkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE); | 51 | BIAS(slpm_in_nopull_wkup, PIN_SLEEPMODE_ENABLED|PIN_SLPM_DIR_INPUT|PIN_SLPM_PULL_NONE|PIN_SLPM_WAKEUP_ENABLE); |
53 | BIAS(sleep_out_hi_wkup_pdis, PIN_SLPM_OUTPUT_HIGH|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); | 52 | BIAS(slpm_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
54 | BIAS(sleep_out_lo_wkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE); | 53 | BIAS(slpm_out_hi_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_HIGH|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
55 | BIAS(sleep_out_wkup_pdis, PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); | 54 | BIAS(slpm_out_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
55 | BIAS(slpm_out_lo_wkup, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE); | ||
56 | BIAS(slpm_out_lo_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); | ||
57 | BIAS(slpm_in_nopull_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); | ||
56 | 58 | ||
57 | /* We use these to define hog settings that are always done on boot */ | 59 | /* We use these to define hog settings that are always done on boot */ |
58 | #define DB8500_MUX_HOG(group,func) \ | 60 | #define DB8500_MUX_HOG(group,func) \ |
59 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func) | 61 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func) |
60 | #define DB8500_PIN_HOG(pin,conf) \ | 62 | #define DB8500_PIN_HOG(pin,conf) \ |
61 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf) | 63 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf) |
64 | #define DB8500_PIN_SLEEP(pin, conf, dev) \ | ||
65 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ | ||
66 | pin, conf) | ||
62 | 67 | ||
63 | /* These are default states associated with device and changed runtime */ | 68 | /* These are default states associated with device and changed runtime */ |
64 | #define DB8500_MUX(group,func,dev) \ | 69 | #define DB8500_MUX(group,func,dev) \ |
65 | PIN_MAP_MUX_GROUP_DEFAULT(dev, "pinctrl-db8500", group, func) | 70 | PIN_MAP_MUX_GROUP_DEFAULT(dev, "pinctrl-db8500", group, func) |
66 | #define DB8500_PIN(pin,conf,dev) \ | 71 | #define DB8500_PIN(pin,conf,dev) \ |
67 | PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf) | 72 | PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf) |
73 | #define DB8500_PIN_SLEEP(pin, conf, dev) \ | ||
74 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ | ||
75 | pin, conf) | ||
68 | 76 | ||
69 | #define DB8500_PIN_SLEEP(pin,conf,dev) \ | 77 | #define DB8500_PIN_SLEEP(pin,conf,dev) \ |
70 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ | 78 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ |
@@ -134,40 +142,47 @@ static struct pinctrl_map __initdata mop500_family_pinmap[] = { | |||
134 | DB8500_PIN("GPIO2_AH4", in_pu, "uart0"), /* RXD */ | 142 | DB8500_PIN("GPIO2_AH4", in_pu, "uart0"), /* RXD */ |
135 | DB8500_PIN("GPIO3_AH3", out_hi, "uart0"), /* TXD */ | 143 | DB8500_PIN("GPIO3_AH3", out_hi, "uart0"), /* TXD */ |
136 | /* UART0 sleep state */ | 144 | /* UART0 sleep state */ |
137 | DB8500_PIN_SLEEP("GPIO0_AJ5", sleep_in_wkup_pdis, "uart0"), | 145 | DB8500_PIN_SLEEP("GPIO0_AJ5", slpm_in_wkup_pdis, "uart0"), |
138 | DB8500_PIN_SLEEP("GPIO1_AJ3", sleep_out_hi_wkup_pdis, "uart0"), | 146 | DB8500_PIN_SLEEP("GPIO1_AJ3", slpm_out_hi_wkup_pdis, "uart0"), |
139 | DB8500_PIN_SLEEP("GPIO2_AH4", sleep_in_wkup_pdis, "uart0"), | 147 | DB8500_PIN_SLEEP("GPIO2_AH4", slpm_in_wkup_pdis, "uart0"), |
140 | DB8500_PIN_SLEEP("GPIO3_AH3", sleep_out_wkup_pdis, "uart0"), | 148 | DB8500_PIN_SLEEP("GPIO3_AH3", slpm_out_wkup_pdis, "uart0"), |
141 | /* MSP1 for ALSA codec */ | 149 | /* MSP1 for ALSA codec */ |
142 | DB8500_MUX("msp1txrx_a_1", "msp1", "ux500-msp-i2s.1"), | 150 | DB8500_MUX("msp1txrx_a_1", "msp1", "ux500-msp-i2s.1"), |
143 | DB8500_MUX("msp1_a_1", "msp1", "ux500-msp-i2s.1"), | 151 | DB8500_MUX("msp1_a_1", "msp1", "ux500-msp-i2s.1"), |
144 | DB8500_PIN("GPIO33_AF2", out_lo_sleep_nowkup, "ux500-msp-i2s.1"), | 152 | DB8500_PIN("GPIO33_AF2", out_lo_slpm_nowkup, "ux500-msp-i2s.1"), |
145 | DB8500_PIN("GPIO34_AE1", in_nopull_sleep_nowkup, "ux500-msp-i2s.1"), | 153 | DB8500_PIN("GPIO34_AE1", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"), |
146 | DB8500_PIN("GPIO35_AE2", in_nopull_sleep_nowkup, "ux500-msp-i2s.1"), | 154 | DB8500_PIN("GPIO35_AE2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"), |
147 | DB8500_PIN("GPIO36_AG2", in_nopull_sleep_nowkup, "ux500-msp-i2s.1"), | 155 | DB8500_PIN("GPIO36_AG2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"), |
148 | /* MSP1 sleep state */ | 156 | /* MSP1 sleep state */ |
149 | DB8500_PIN_SLEEP("GPIO33_AF2", sleep_out_lo_wkup, "ux500-msp-i2s.1"), | 157 | DB8500_PIN_SLEEP("GPIO33_AF2", slpm_out_lo_wkup, "ux500-msp-i2s.1"), |
150 | DB8500_PIN_SLEEP("GPIO34_AE1", sleep_in_nopull_wkup, "ux500-msp-i2s.1"), | 158 | DB8500_PIN_SLEEP("GPIO34_AE1", slpm_in_nopull_wkup, "ux500-msp-i2s.1"), |
151 | DB8500_PIN_SLEEP("GPIO35_AE2", sleep_in_nopull_wkup, "ux500-msp-i2s.1"), | 159 | DB8500_PIN_SLEEP("GPIO35_AE2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"), |
152 | DB8500_PIN_SLEEP("GPIO36_AG2", sleep_in_nopull_wkup, "ux500-msp-i2s.1"), | 160 | DB8500_PIN_SLEEP("GPIO36_AG2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"), |
153 | /* Mux in LCD data lines 8 thru 11 and LCDA CLK for MCDE TVOUT */ | 161 | /* Mux in LCD data lines 8 thru 11 and LCDA CLK for MCDE TVOUT */ |
154 | DB8500_MUX("lcd_d8_d11_a_1", "lcd", "mcde-tvout"), | 162 | DB8500_MUX("lcd_d8_d11_a_1", "lcd", "mcde-tvout"), |
155 | DB8500_MUX("lcdaclk_b_1", "lcda", "mcde-tvout"), | 163 | DB8500_MUX("lcdaclk_b_1", "lcda", "mcde-tvout"), |
156 | /* Mux in LCD VSI1 and pull it up for MCDE HDMI output */ | 164 | /* Mux in LCD VSI1 and pull it up for MCDE HDMI output */ |
157 | DB8500_MUX("lcdvsi1_a_1", "lcd", "av8100-hdmi"), | 165 | DB8500_MUX("lcdvsi1_a_1", "lcd", "av8100-hdmi"), |
158 | /* Mux in I2C blocks, put pins into GPIO in sleepmode no pull-up */ | 166 | /* Mux in i2c0 block, default state */ |
159 | DB8500_MUX("i2c0_a_1", "i2c0", "nmk-i2c.0"), | 167 | DB8500_MUX("i2c0_a_1", "i2c0", "nmk-i2c.0"), |
160 | DB8500_PIN("GPIO147_C15", slpm_gpio_nopull, "nmk-i2c.0"), | 168 | /* i2c0 sleep state */ |
161 | DB8500_PIN("GPIO148_B16", slpm_gpio_nopull, "nmk-i2c.0"), | 169 | DB8500_PIN_SLEEP("GPIO147_C15", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SDA */ |
170 | DB8500_PIN_SLEEP("GPIO148_B16", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SCL */ | ||
171 | /* Mux in i2c1 block, default state */ | ||
162 | DB8500_MUX("i2c1_b_2", "i2c1", "nmk-i2c.1"), | 172 | DB8500_MUX("i2c1_b_2", "i2c1", "nmk-i2c.1"), |
163 | DB8500_PIN("GPIO16_AD3", slpm_gpio_nopull, "nmk-i2c.1"), | 173 | /* i2c1 sleep state */ |
164 | DB8500_PIN("GPIO17_AD4", slpm_gpio_nopull, "nmk-i2c.1"), | 174 | DB8500_PIN_SLEEP("GPIO16_AD3", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SDA */ |
175 | DB8500_PIN_SLEEP("GPIO17_AD4", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SCL */ | ||
176 | /* Mux in i2c2 block, default state */ | ||
165 | DB8500_MUX("i2c2_b_2", "i2c2", "nmk-i2c.2"), | 177 | DB8500_MUX("i2c2_b_2", "i2c2", "nmk-i2c.2"), |
166 | DB8500_PIN("GPIO10_AF5", slpm_gpio_nopull, "nmk-i2c.2"), | 178 | /* i2c2 sleep state */ |
167 | DB8500_PIN("GPIO11_AG4", slpm_gpio_nopull, "nmk-i2c.2"), | 179 | DB8500_PIN_SLEEP("GPIO10_AF5", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SDA */ |
180 | DB8500_PIN_SLEEP("GPIO11_AG4", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SCL */ | ||
181 | /* Mux in i2c3 block, default state */ | ||
168 | DB8500_MUX("i2c3_c_2", "i2c3", "nmk-i2c.3"), | 182 | DB8500_MUX("i2c3_c_2", "i2c3", "nmk-i2c.3"), |
169 | DB8500_PIN("GPIO229_AG7", slpm_gpio_nopull, "nmk-i2c.3"), | 183 | /* i2c3 sleep state */ |
170 | DB8500_PIN("GPIO230_AF7", slpm_gpio_nopull, "nmk-i2c.3"), | 184 | DB8500_PIN_SLEEP("GPIO229_AG7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SDA */ |
185 | DB8500_PIN_SLEEP("GPIO230_AF7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SCL */ | ||
171 | /* Mux in SDI0 (here called MC0) used for removable MMC/SD/SDIO cards */ | 186 | /* Mux in SDI0 (here called MC0) used for removable MMC/SD/SDIO cards */ |
172 | DB8500_MUX("mc0_a_1", "mc0", "sdi0"), | 187 | DB8500_MUX("mc0_a_1", "mc0", "sdi0"), |
173 | DB8500_PIN("GPIO18_AC2", out_hi, "sdi0"), /* CMDDIR */ | 188 | DB8500_PIN("GPIO18_AC2", out_hi, "sdi0"), /* CMDDIR */ |
@@ -219,11 +234,15 @@ static struct pinctrl_map __initdata mop500_family_pinmap[] = { | |||
219 | DB8500_MUX("usb_a_1", "usb", "musb-ux500.0"), | 234 | DB8500_MUX("usb_a_1", "usb", "musb-ux500.0"), |
220 | DB8500_PIN("GPIO257_AE29", out_hi, "musb-ux500.0"), /* STP */ | 235 | DB8500_PIN("GPIO257_AE29", out_hi, "musb-ux500.0"), /* STP */ |
221 | /* Mux in SPI2 pins on the "other C1" altfunction */ | 236 | /* Mux in SPI2 pins on the "other C1" altfunction */ |
222 | DB8500_MUX("spi2_oc1_1", "spi2", "spi2"), | 237 | DB8500_MUX("spi2_oc1_2", "spi2", "spi2"), |
223 | DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */ | 238 | DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */ |
224 | DB8500_PIN("GPIO218_AH11", in_pd, "spi2"), /* RXD */ | 239 | DB8500_PIN("GPIO218_AH11", in_pd, "spi2"), /* RXD */ |
225 | DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */ | 240 | DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */ |
226 | DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */ | 241 | DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */ |
242 | /* SPI2 sleep state */ | ||
243 | DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */ | ||
244 | DB8500_PIN_SLEEP("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */ | ||
245 | DB8500_PIN_SLEEP("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */ | ||
227 | }; | 246 | }; |
228 | 247 | ||
229 | /* | 248 | /* |
@@ -410,7 +429,7 @@ static struct pinctrl_map __initdata u9500_pinmap[] = { | |||
410 | DB8500_PIN_HOG("GPIO144_B13", gpio_in_pu), | 429 | DB8500_PIN_HOG("GPIO144_B13", gpio_in_pu), |
411 | /* HSI */ | 430 | /* HSI */ |
412 | DB8500_MUX_HOG("hsir_a_1", "hsi"), | 431 | DB8500_MUX_HOG("hsir_a_1", "hsi"), |
413 | DB8500_MUX_HOG("hsit_a_1", "hsi"), | 432 | DB8500_MUX_HOG("hsit_a_2", "hsi"), |
414 | DB8500_PIN_HOG("GPIO219_AG10", in_pd), /* RX FLA0 */ | 433 | DB8500_PIN_HOG("GPIO219_AG10", in_pd), /* RX FLA0 */ |
415 | DB8500_PIN_HOG("GPIO220_AH10", in_pd), /* RX DAT0 */ | 434 | DB8500_PIN_HOG("GPIO220_AH10", in_pd), /* RX DAT0 */ |
416 | DB8500_PIN_HOG("GPIO221_AJ11", out_lo), /* RX RDY0 */ | 435 | DB8500_PIN_HOG("GPIO221_AJ11", out_lo), /* RX RDY0 */ |
@@ -418,7 +437,7 @@ static struct pinctrl_map __initdata u9500_pinmap[] = { | |||
418 | DB8500_PIN_HOG("GPIO223_AH9", out_lo), /* TX DAT0 */ | 437 | DB8500_PIN_HOG("GPIO223_AH9", out_lo), /* TX DAT0 */ |
419 | DB8500_PIN_HOG("GPIO224_AG9", in_pd), /* TX RDY0 */ | 438 | DB8500_PIN_HOG("GPIO224_AG9", in_pd), /* TX RDY0 */ |
420 | DB8500_PIN_HOG("GPIO225_AG8", in_pd), /* CAWAKE0 */ | 439 | DB8500_PIN_HOG("GPIO225_AG8", in_pd), /* CAWAKE0 */ |
421 | DB8500_PIN_HOG("GPIO226_AF8", out_hi), /* ACWAKE0 */ | 440 | DB8500_PIN_HOG("GPIO226_AF8", gpio_out_hi), /* ACWAKE0 */ |
422 | }; | 441 | }; |
423 | 442 | ||
424 | static struct pinctrl_map __initdata u8500_pinmap[] = { | 443 | static struct pinctrl_map __initdata u8500_pinmap[] = { |
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 52426a425787..2a17bc506cff 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c | |||
@@ -13,6 +13,21 @@ | |||
13 | #include <linux/regulator/ab8500.h> | 13 | #include <linux/regulator/ab8500.h> |
14 | #include "board-mop500-regulators.h" | 14 | #include "board-mop500-regulators.h" |
15 | 15 | ||
16 | static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { | ||
17 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
18 | }; | ||
19 | |||
20 | struct regulator_init_data gpio_en_3v3_regulator = { | ||
21 | .constraints = { | ||
22 | .name = "EN-3V3", | ||
23 | .min_uV = 3300000, | ||
24 | .max_uV = 3300000, | ||
25 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
26 | }, | ||
27 | .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers), | ||
28 | .consumer_supplies = gpio_en_3v3_consumers, | ||
29 | }; | ||
30 | |||
16 | /* | 31 | /* |
17 | * TPS61052 regulator | 32 | * TPS61052 regulator |
18 | */ | 33 | */ |
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h index 94992158d962..78a0642a2206 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.h +++ b/arch/arm/mach-ux500/board-mop500-regulators.h | |||
@@ -18,5 +18,6 @@ extern struct ab8500_regulator_reg_init | |||
18 | ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS]; | 18 | ab8500_regulator_reg_init[AB8500_NUM_REGULATOR_REGISTERS]; |
19 | extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS]; | 19 | extern struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS]; |
20 | extern struct regulator_init_data tps61052_regulator; | 20 | extern struct regulator_init_data tps61052_regulator; |
21 | extern struct regulator_init_data gpio_en_3v3_regulator; | ||
21 | 22 | ||
22 | #endif | 23 | #endif |
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 18ff781cfbe4..9c8e4a9e83ee 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c | |||
@@ -152,7 +152,7 @@ static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { | |||
152 | }; | 152 | }; |
153 | #endif | 153 | #endif |
154 | 154 | ||
155 | static struct mmci_platform_data mop500_sdi1_data = { | 155 | struct mmci_platform_data mop500_sdi1_data = { |
156 | .ocr_mask = MMC_VDD_29_30, | 156 | .ocr_mask = MMC_VDD_29_30, |
157 | .f_max = 50000000, | 157 | .f_max = 50000000, |
158 | .capabilities = MMC_CAP_4_BIT_DATA, | 158 | .capabilities = MMC_CAP_4_BIT_DATA, |
@@ -189,7 +189,7 @@ static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = { | |||
189 | }; | 189 | }; |
190 | #endif | 190 | #endif |
191 | 191 | ||
192 | static struct mmci_platform_data mop500_sdi2_data = { | 192 | struct mmci_platform_data mop500_sdi2_data = { |
193 | .ocr_mask = MMC_VDD_165_195, | 193 | .ocr_mask = MMC_VDD_165_195, |
194 | .f_max = 50000000, | 194 | .f_max = 50000000, |
195 | .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | | 195 | .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index a534d8880de1..416d436111f2 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
24 | #include <linux/mfd/abx500/ab8500.h> | 24 | #include <linux/mfd/abx500/ab8500.h> |
25 | #include <linux/regulator/ab8500.h> | 25 | #include <linux/regulator/ab8500.h> |
26 | #include <linux/regulator/fixed.h> | ||
26 | #include <linux/mfd/tc3589x.h> | 27 | #include <linux/mfd/tc3589x.h> |
27 | #include <linux/mfd/tps6105x.h> | 28 | #include <linux/mfd/tps6105x.h> |
28 | #include <linux/mfd/abx500/ab8500-gpio.h> | 29 | #include <linux/mfd/abx500/ab8500-gpio.h> |
@@ -48,13 +49,12 @@ | |||
48 | #include <mach/setup.h> | 49 | #include <mach/setup.h> |
49 | #include <mach/devices.h> | 50 | #include <mach/devices.h> |
50 | #include <mach/irqs.h> | 51 | #include <mach/irqs.h> |
51 | #include <mach/crypto-ux500.h> | 52 | #include <linux/platform_data/crypto-ux500.h> |
52 | 53 | ||
53 | #include "ste-dma40-db8500.h" | 54 | #include "ste-dma40-db8500.h" |
54 | #include "devices-db8500.h" | 55 | #include "devices-db8500.h" |
55 | #include "board-mop500.h" | 56 | #include "board-mop500.h" |
56 | #include "board-mop500-regulators.h" | 57 | #include "board-mop500-regulators.h" |
57 | #include "board-mop500-msp.h" | ||
58 | 58 | ||
59 | static struct gpio_led snowball_led_array[] = { | 59 | static struct gpio_led snowball_led_array[] = { |
60 | { | 60 | { |
@@ -76,6 +76,23 @@ static struct platform_device snowball_led_dev = { | |||
76 | }, | 76 | }, |
77 | }; | 77 | }; |
78 | 78 | ||
79 | static struct fixed_voltage_config snowball_gpio_en_3v3_data = { | ||
80 | .supply_name = "EN-3V3", | ||
81 | .gpio = SNOWBALL_EN_3V3_ETH_GPIO, | ||
82 | .microvolts = 3300000, | ||
83 | .enable_high = 1, | ||
84 | .init_data = &gpio_en_3v3_regulator, | ||
85 | .startup_delay = 5000, /* 1200us */ | ||
86 | }; | ||
87 | |||
88 | static struct platform_device snowball_gpio_en_3v3_regulator_dev = { | ||
89 | .name = "reg-fixed-voltage", | ||
90 | .id = 1, | ||
91 | .dev = { | ||
92 | .platform_data = &snowball_gpio_en_3v3_data, | ||
93 | }, | ||
94 | }; | ||
95 | |||
79 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { | 96 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { |
80 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), | 97 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), |
81 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, | 98 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, |
@@ -524,33 +541,12 @@ static struct stedma40_chan_cfg uart2_dma_cfg_tx = { | |||
524 | }; | 541 | }; |
525 | #endif | 542 | #endif |
526 | 543 | ||
527 | #define PRCC_K_SOFTRST_SET 0x18 | ||
528 | #define PRCC_K_SOFTRST_CLEAR 0x1C | ||
529 | static void ux500_uart0_reset(void) | ||
530 | { | ||
531 | void __iomem *prcc_rst_set, *prcc_rst_clr; | ||
532 | |||
533 | prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE + | ||
534 | PRCC_K_SOFTRST_SET); | ||
535 | prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE + | ||
536 | PRCC_K_SOFTRST_CLEAR); | ||
537 | |||
538 | /* Activate soft reset PRCC_K_SOFTRST_CLEAR */ | ||
539 | writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr); | ||
540 | udelay(1); | ||
541 | |||
542 | /* Release soft reset PRCC_K_SOFTRST_SET */ | ||
543 | writel((readl(prcc_rst_set) | 0x1), prcc_rst_set); | ||
544 | udelay(1); | ||
545 | } | ||
546 | |||
547 | static struct amba_pl011_data uart0_plat = { | 544 | static struct amba_pl011_data uart0_plat = { |
548 | #ifdef CONFIG_STE_DMA40 | 545 | #ifdef CONFIG_STE_DMA40 |
549 | .dma_filter = stedma40_filter, | 546 | .dma_filter = stedma40_filter, |
550 | .dma_rx_param = &uart0_dma_cfg_rx, | 547 | .dma_rx_param = &uart0_dma_cfg_rx, |
551 | .dma_tx_param = &uart0_dma_cfg_tx, | 548 | .dma_tx_param = &uart0_dma_cfg_tx, |
552 | #endif | 549 | #endif |
553 | .reset = ux500_uart0_reset, | ||
554 | }; | 550 | }; |
555 | 551 | ||
556 | static struct amba_pl011_data uart1_plat = { | 552 | static struct amba_pl011_data uart1_plat = { |
@@ -586,6 +582,7 @@ static struct platform_device *snowball_platform_devs[] __initdata = { | |||
586 | &snowball_led_dev, | 582 | &snowball_led_dev, |
587 | &snowball_key_dev, | 583 | &snowball_key_dev, |
588 | &snowball_sbnet_dev, | 584 | &snowball_sbnet_dev, |
585 | &snowball_gpio_en_3v3_regulator_dev, | ||
589 | }; | 586 | }; |
590 | 587 | ||
591 | static void __init mop500_init_machine(void) | 588 | static void __init mop500_init_machine(void) |
@@ -608,7 +605,7 @@ static void __init mop500_init_machine(void) | |||
608 | mop500_i2c_init(parent); | 605 | mop500_i2c_init(parent); |
609 | mop500_sdi_init(parent); | 606 | mop500_sdi_init(parent); |
610 | mop500_spi_init(parent); | 607 | mop500_spi_init(parent); |
611 | mop500_msp_init(parent); | 608 | mop500_audio_init(parent); |
612 | mop500_uart_init(parent); | 609 | mop500_uart_init(parent); |
613 | 610 | ||
614 | u8500_cryp1_hash1_init(parent); | 611 | u8500_cryp1_hash1_init(parent); |
@@ -642,7 +639,7 @@ static void __init snowball_init_machine(void) | |||
642 | mop500_i2c_init(parent); | 639 | mop500_i2c_init(parent); |
643 | snowball_sdi_init(parent); | 640 | snowball_sdi_init(parent); |
644 | mop500_spi_init(parent); | 641 | mop500_spi_init(parent); |
645 | mop500_msp_init(parent); | 642 | mop500_audio_init(parent); |
646 | mop500_uart_init(parent); | 643 | mop500_uart_init(parent); |
647 | 644 | ||
648 | /* This board has full regulator constraints */ | 645 | /* This board has full regulator constraints */ |
@@ -674,7 +671,7 @@ static void __init hrefv60_init_machine(void) | |||
674 | mop500_i2c_init(parent); | 671 | mop500_i2c_init(parent); |
675 | hrefv60_sdi_init(parent); | 672 | hrefv60_sdi_init(parent); |
676 | mop500_spi_init(parent); | 673 | mop500_spi_init(parent); |
677 | mop500_msp_init(parent); | 674 | mop500_audio_init(parent); |
678 | mop500_uart_init(parent); | 675 | mop500_uart_init(parent); |
679 | 676 | ||
680 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | 677 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
@@ -694,6 +691,7 @@ static void __init hrefv60_init_machine(void) | |||
694 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | 691 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") |
695 | /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */ | 692 | /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */ |
696 | .atag_offset = 0x100, | 693 | .atag_offset = 0x100, |
694 | .smp = smp_ops(ux500_smp_ops), | ||
697 | .map_io = u8500_map_io, | 695 | .map_io = u8500_map_io, |
698 | .init_irq = ux500_init_irq, | 696 | .init_irq = ux500_init_irq, |
699 | /* we re-use nomadik timer here */ | 697 | /* we re-use nomadik timer here */ |
@@ -705,6 +703,7 @@ MACHINE_END | |||
705 | 703 | ||
706 | MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") | 704 | MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") |
707 | .atag_offset = 0x100, | 705 | .atag_offset = 0x100, |
706 | .smp = smp_ops(ux500_smp_ops), | ||
708 | .map_io = u8500_map_io, | 707 | .map_io = u8500_map_io, |
709 | .init_irq = ux500_init_irq, | 708 | .init_irq = ux500_init_irq, |
710 | .timer = &ux500_timer, | 709 | .timer = &ux500_timer, |
@@ -715,6 +714,7 @@ MACHINE_END | |||
715 | 714 | ||
716 | MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") | 715 | MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") |
717 | .atag_offset = 0x100, | 716 | .atag_offset = 0x100, |
717 | .smp = smp_ops(ux500_smp_ops), | ||
718 | .map_io = u8500_map_io, | 718 | .map_io = u8500_map_io, |
719 | .init_irq = ux500_init_irq, | 719 | .init_irq = ux500_init_irq, |
720 | /* we re-use nomadik timer here */ | 720 | /* we re-use nomadik timer here */ |
@@ -726,12 +726,9 @@ MACHINE_END | |||
726 | 726 | ||
727 | #ifdef CONFIG_MACH_UX500_DT | 727 | #ifdef CONFIG_MACH_UX500_DT |
728 | 728 | ||
729 | static struct platform_device *snowball_of_platform_devs[] __initdata = { | ||
730 | &snowball_led_dev, | ||
731 | &snowball_key_dev, | ||
732 | }; | ||
733 | |||
734 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | 729 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { |
730 | /* Requires call-back bindings. */ | ||
731 | OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), | ||
735 | /* Requires DMA and call-back bindings. */ | 732 | /* Requires DMA and call-back bindings. */ |
736 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), | 733 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), |
737 | OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), | 734 | OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), |
@@ -739,6 +736,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | |||
739 | /* Requires DMA bindings. */ | 736 | /* Requires DMA bindings. */ |
740 | OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), | 737 | OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), |
741 | OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), | 738 | OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), |
739 | OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data), | ||
740 | OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data), | ||
742 | OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data), | 741 | OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data), |
743 | /* Requires clock name bindings. */ | 742 | /* Requires clock name bindings. */ |
744 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL), | 743 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL), |
@@ -757,6 +756,15 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { | |||
757 | OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), | 756 | OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), |
758 | /* Requires device name bindings. */ | 757 | /* Requires device name bindings. */ |
759 | OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), | 758 | OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), |
759 | /* Requires clock name and DMA bindings. */ | ||
760 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000, | ||
761 | "ux500-msp-i2s.0", &msp0_platform_data), | ||
762 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000, | ||
763 | "ux500-msp-i2s.1", &msp1_platform_data), | ||
764 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000, | ||
765 | "ux500-msp-i2s.2", &msp2_platform_data), | ||
766 | OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000, | ||
767 | "ux500-msp-i2s.3", &msp3_platform_data), | ||
760 | {}, | 768 | {}, |
761 | }; | 769 | }; |
762 | 770 | ||
@@ -797,7 +805,7 @@ static void __init u8500_init_machine(void) | |||
797 | ARRAY_SIZE(mop500_platform_devs)); | 805 | ARRAY_SIZE(mop500_platform_devs)); |
798 | 806 | ||
799 | mop500_sdi_init(parent); | 807 | mop500_sdi_init(parent); |
800 | mop500_msp_init(parent); | 808 | mop500_audio_init(parent); |
801 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | 809 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
802 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | 810 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
803 | i2c_register_board_info(2, mop500_i2c2_devices, | 811 | i2c_register_board_info(2, mop500_i2c2_devices, |
@@ -806,7 +814,7 @@ static void __init u8500_init_machine(void) | |||
806 | mop500_uib_init(); | 814 | mop500_uib_init(); |
807 | 815 | ||
808 | } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { | 816 | } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { |
809 | mop500_msp_init(parent); | 817 | mop500_of_audio_init(parent); |
810 | } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { | 818 | } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { |
811 | /* | 819 | /* |
812 | * The HREFv60 board removed a GPIO expander and routed | 820 | * The HREFv60 board removed a GPIO expander and routed |
@@ -817,16 +825,6 @@ static void __init u8500_init_machine(void) | |||
817 | platform_add_devices(mop500_platform_devs, | 825 | platform_add_devices(mop500_platform_devs, |
818 | ARRAY_SIZE(mop500_platform_devs)); | 826 | ARRAY_SIZE(mop500_platform_devs)); |
819 | 827 | ||
820 | hrefv60_sdi_init(parent); | ||
821 | mop500_msp_init(parent); | ||
822 | |||
823 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); | ||
824 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; | ||
825 | |||
826 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); | ||
827 | i2c_register_board_info(2, mop500_i2c2_devices, | ||
828 | ARRAY_SIZE(mop500_i2c2_devices)); | ||
829 | |||
830 | mop500_uib_init(); | 828 | mop500_uib_init(); |
831 | } | 829 | } |
832 | 830 | ||
@@ -844,6 +842,7 @@ static const char * u8500_dt_board_compat[] = { | |||
844 | 842 | ||
845 | 843 | ||
846 | DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") | 844 | DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") |
845 | .smp = smp_ops(ux500_smp_ops), | ||
847 | .map_io = u8500_map_io, | 846 | .map_io = u8500_map_io, |
848 | .init_irq = ux500_init_irq, | 847 | .init_irq = ux500_init_irq, |
849 | /* we re-use nomadik timer here */ | 848 | /* we re-use nomadik timer here */ |
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index b5bfc1a78b1a..aca39a68712a 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | /* For NOMADIK_NR_GPIO */ | 10 | /* For NOMADIK_NR_GPIO */ |
11 | #include <mach/irqs.h> | 11 | #include <mach/irqs.h> |
12 | #include <mach/msp.h> | ||
12 | #include <linux/amba/mmci.h> | 13 | #include <linux/amba/mmci.h> |
13 | 14 | ||
14 | /* Snowball specific GPIO assignments, this board has no GPIO expander */ | 15 | /* Snowball specific GPIO assignments, this board has no GPIO expander */ |
@@ -80,7 +81,14 @@ | |||
80 | struct device; | 81 | struct device; |
81 | struct i2c_board_info; | 82 | struct i2c_board_info; |
82 | extern struct mmci_platform_data mop500_sdi0_data; | 83 | extern struct mmci_platform_data mop500_sdi0_data; |
84 | extern struct mmci_platform_data mop500_sdi1_data; | ||
85 | extern struct mmci_platform_data mop500_sdi2_data; | ||
83 | extern struct mmci_platform_data mop500_sdi4_data; | 86 | extern struct mmci_platform_data mop500_sdi4_data; |
87 | extern struct msp_i2s_platform_data msp0_platform_data; | ||
88 | extern struct msp_i2s_platform_data msp1_platform_data; | ||
89 | extern struct msp_i2s_platform_data msp2_platform_data; | ||
90 | extern struct msp_i2s_platform_data msp3_platform_data; | ||
91 | extern struct arm_pmu_platdata db8500_pmu_platdata; | ||
84 | 92 | ||
85 | extern void mop500_sdi_init(struct device *parent); | 93 | extern void mop500_sdi_init(struct device *parent); |
86 | extern void snowball_sdi_init(struct device *parent); | 94 | extern void snowball_sdi_init(struct device *parent); |
@@ -91,6 +99,9 @@ void __init mop500_stuib_init(void); | |||
91 | void __init mop500_pinmaps_init(void); | 99 | void __init mop500_pinmaps_init(void); |
92 | void __init snowball_pinmaps_init(void); | 100 | void __init snowball_pinmaps_init(void); |
93 | void __init hrefv60_pinmaps_init(void); | 101 | void __init hrefv60_pinmaps_init(void); |
102 | void mop500_audio_init(struct device *parent); | ||
103 | /* Due for removal once the MSP driver has been fully DT:ed. */ | ||
104 | void mop500_of_audio_init(struct device *parent); | ||
94 | 105 | ||
95 | int __init mop500_uib_init(void); | 106 | int __init mop500_uib_init(void); |
96 | void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, | 107 | void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, |
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c index dc12394295d5..75d5b512a3d5 100644 --- a/arch/arm/mach-ux500/cache-l2x0.c +++ b/arch/arm/mach-ux500/cache-l2x0.c | |||
@@ -38,7 +38,7 @@ static int __init ux500_l2x0_init(void) | |||
38 | { | 38 | { |
39 | u32 aux_val = 0x3e000000; | 39 | u32 aux_val = 0x3e000000; |
40 | 40 | ||
41 | if (cpu_is_u8500_family()) | 41 | if (cpu_is_u8500_family() || cpu_is_ux540_family()) |
42 | l2x0_base = __io_address(U8500_L2CC_BASE); | 42 | l2x0_base = __io_address(U8500_L2CC_BASE); |
43 | else | 43 | else |
44 | ux500_unknown_soc(); | 44 | ux500_unknown_soc(); |
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c deleted file mode 100644 index 8d73b066a18d..000000000000 --- a/arch/arm/mach-ux500/clock.c +++ /dev/null | |||
@@ -1,715 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 ST-Ericsson | ||
3 | * Copyright (C) 2009 STMicroelectronics | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/list.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/clkdev.h> | ||
17 | #include <linux/cpufreq.h> | ||
18 | |||
19 | #include <plat/mtu.h> | ||
20 | #include <mach/hardware.h> | ||
21 | #include "clock.h" | ||
22 | |||
23 | #ifdef CONFIG_DEBUG_FS | ||
24 | #include <linux/debugfs.h> | ||
25 | #include <linux/uaccess.h> /* for copy_from_user */ | ||
26 | static LIST_HEAD(clk_list); | ||
27 | #endif | ||
28 | |||
29 | #define PRCC_PCKEN 0x00 | ||
30 | #define PRCC_PCKDIS 0x04 | ||
31 | #define PRCC_KCKEN 0x08 | ||
32 | #define PRCC_KCKDIS 0x0C | ||
33 | |||
34 | #define PRCM_YYCLKEN0_MGT_SET 0x510 | ||
35 | #define PRCM_YYCLKEN1_MGT_SET 0x514 | ||
36 | #define PRCM_YYCLKEN0_MGT_CLR 0x518 | ||
37 | #define PRCM_YYCLKEN1_MGT_CLR 0x51C | ||
38 | #define PRCM_YYCLKEN0_MGT_VAL 0x520 | ||
39 | #define PRCM_YYCLKEN1_MGT_VAL 0x524 | ||
40 | |||
41 | #define PRCM_SVAMMDSPCLK_MGT 0x008 | ||
42 | #define PRCM_SIAMMDSPCLK_MGT 0x00C | ||
43 | #define PRCM_SGACLK_MGT 0x014 | ||
44 | #define PRCM_UARTCLK_MGT 0x018 | ||
45 | #define PRCM_MSP02CLK_MGT 0x01C | ||
46 | #define PRCM_MSP1CLK_MGT 0x288 | ||
47 | #define PRCM_I2CCLK_MGT 0x020 | ||
48 | #define PRCM_SDMMCCLK_MGT 0x024 | ||
49 | #define PRCM_SLIMCLK_MGT 0x028 | ||
50 | #define PRCM_PER1CLK_MGT 0x02C | ||
51 | #define PRCM_PER2CLK_MGT 0x030 | ||
52 | #define PRCM_PER3CLK_MGT 0x034 | ||
53 | #define PRCM_PER5CLK_MGT 0x038 | ||
54 | #define PRCM_PER6CLK_MGT 0x03C | ||
55 | #define PRCM_PER7CLK_MGT 0x040 | ||
56 | #define PRCM_LCDCLK_MGT 0x044 | ||
57 | #define PRCM_BMLCLK_MGT 0x04C | ||
58 | #define PRCM_HSITXCLK_MGT 0x050 | ||
59 | #define PRCM_HSIRXCLK_MGT 0x054 | ||
60 | #define PRCM_HDMICLK_MGT 0x058 | ||
61 | #define PRCM_APEATCLK_MGT 0x05C | ||
62 | #define PRCM_APETRACECLK_MGT 0x060 | ||
63 | #define PRCM_MCDECLK_MGT 0x064 | ||
64 | #define PRCM_IPI2CCLK_MGT 0x068 | ||
65 | #define PRCM_DSIALTCLK_MGT 0x06C | ||
66 | #define PRCM_DMACLK_MGT 0x074 | ||
67 | #define PRCM_B2R2CLK_MGT 0x078 | ||
68 | #define PRCM_TVCLK_MGT 0x07C | ||
69 | #define PRCM_TCR 0x1C8 | ||
70 | #define PRCM_TCR_STOPPED (1 << 16) | ||
71 | #define PRCM_TCR_DOZE_MODE (1 << 17) | ||
72 | #define PRCM_UNIPROCLK_MGT 0x278 | ||
73 | #define PRCM_SSPCLK_MGT 0x280 | ||
74 | #define PRCM_RNGCLK_MGT 0x284 | ||
75 | #define PRCM_UICCCLK_MGT 0x27C | ||
76 | |||
77 | #define PRCM_MGT_ENABLE (1 << 8) | ||
78 | |||
79 | static DEFINE_SPINLOCK(clocks_lock); | ||
80 | |||
81 | static void __clk_enable(struct clk *clk) | ||
82 | { | ||
83 | if (clk->enabled++ == 0) { | ||
84 | if (clk->parent_cluster) | ||
85 | __clk_enable(clk->parent_cluster); | ||
86 | |||
87 | if (clk->parent_periph) | ||
88 | __clk_enable(clk->parent_periph); | ||
89 | |||
90 | if (clk->ops && clk->ops->enable) | ||
91 | clk->ops->enable(clk); | ||
92 | } | ||
93 | } | ||
94 | |||
95 | int clk_enable(struct clk *clk) | ||
96 | { | ||
97 | unsigned long flags; | ||
98 | |||
99 | spin_lock_irqsave(&clocks_lock, flags); | ||
100 | __clk_enable(clk); | ||
101 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | EXPORT_SYMBOL(clk_enable); | ||
106 | |||
107 | static void __clk_disable(struct clk *clk) | ||
108 | { | ||
109 | if (--clk->enabled == 0) { | ||
110 | if (clk->ops && clk->ops->disable) | ||
111 | clk->ops->disable(clk); | ||
112 | |||
113 | if (clk->parent_periph) | ||
114 | __clk_disable(clk->parent_periph); | ||
115 | |||
116 | if (clk->parent_cluster) | ||
117 | __clk_disable(clk->parent_cluster); | ||
118 | } | ||
119 | } | ||
120 | |||
121 | void clk_disable(struct clk *clk) | ||
122 | { | ||
123 | unsigned long flags; | ||
124 | |||
125 | WARN_ON(!clk->enabled); | ||
126 | |||
127 | spin_lock_irqsave(&clocks_lock, flags); | ||
128 | __clk_disable(clk); | ||
129 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
130 | } | ||
131 | EXPORT_SYMBOL(clk_disable); | ||
132 | |||
133 | /* | ||
134 | * The MTU has a separate, rather complex muxing setup | ||
135 | * with alternative parents (peripheral cluster or | ||
136 | * ULP or fixed 32768 Hz) depending on settings | ||
137 | */ | ||
138 | static unsigned long clk_mtu_get_rate(struct clk *clk) | ||
139 | { | ||
140 | void __iomem *addr; | ||
141 | u32 tcr; | ||
142 | int mtu = (int) clk->data; | ||
143 | /* | ||
144 | * One of these is selected eventually | ||
145 | * TODO: Replace the constant with a reference | ||
146 | * to the ULP source once this is modeled. | ||
147 | */ | ||
148 | unsigned long clk32k = 32768; | ||
149 | unsigned long mturate; | ||
150 | unsigned long retclk; | ||
151 | |||
152 | if (cpu_is_u8500_family()) | ||
153 | addr = __io_address(U8500_PRCMU_BASE); | ||
154 | else | ||
155 | ux500_unknown_soc(); | ||
156 | |||
157 | /* | ||
158 | * On a startup, always conifgure the TCR to the doze mode; | ||
159 | * bootloaders do it for us. Do this in the kernel too. | ||
160 | */ | ||
161 | writel(PRCM_TCR_DOZE_MODE, addr + PRCM_TCR); | ||
162 | |||
163 | tcr = readl(addr + PRCM_TCR); | ||
164 | |||
165 | /* Get the rate from the parent as a default */ | ||
166 | if (clk->parent_periph) | ||
167 | mturate = clk_get_rate(clk->parent_periph); | ||
168 | else if (clk->parent_cluster) | ||
169 | mturate = clk_get_rate(clk->parent_cluster); | ||
170 | else | ||
171 | /* We need to be connected SOMEWHERE */ | ||
172 | BUG(); | ||
173 | |||
174 | /* Return the clock selected for this MTU */ | ||
175 | if (tcr & (1 << mtu)) | ||
176 | retclk = clk32k; | ||
177 | else | ||
178 | retclk = mturate; | ||
179 | |||
180 | pr_info("MTU%d clock rate: %lu Hz\n", mtu, retclk); | ||
181 | return retclk; | ||
182 | } | ||
183 | |||
184 | unsigned long clk_get_rate(struct clk *clk) | ||
185 | { | ||
186 | unsigned long rate; | ||
187 | |||
188 | /* | ||
189 | * If there is a custom getrate callback for this clock, | ||
190 | * it will take precedence. | ||
191 | */ | ||
192 | if (clk->get_rate) | ||
193 | return clk->get_rate(clk); | ||
194 | |||
195 | if (clk->ops && clk->ops->get_rate) | ||
196 | return clk->ops->get_rate(clk); | ||
197 | |||
198 | rate = clk->rate; | ||
199 | if (!rate) { | ||
200 | if (clk->parent_periph) | ||
201 | rate = clk_get_rate(clk->parent_periph); | ||
202 | else if (clk->parent_cluster) | ||
203 | rate = clk_get_rate(clk->parent_cluster); | ||
204 | } | ||
205 | |||
206 | return rate; | ||
207 | } | ||
208 | EXPORT_SYMBOL(clk_get_rate); | ||
209 | |||
210 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
211 | { | ||
212 | /*TODO*/ | ||
213 | return rate; | ||
214 | } | ||
215 | EXPORT_SYMBOL(clk_round_rate); | ||
216 | |||
217 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
218 | { | ||
219 | clk->rate = rate; | ||
220 | return 0; | ||
221 | } | ||
222 | EXPORT_SYMBOL(clk_set_rate); | ||
223 | |||
224 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
225 | { | ||
226 | /*TODO*/ | ||
227 | return -ENOSYS; | ||
228 | } | ||
229 | EXPORT_SYMBOL(clk_set_parent); | ||
230 | |||
231 | static void clk_prcmu_enable(struct clk *clk) | ||
232 | { | ||
233 | void __iomem *cg_set_reg = __io_address(U8500_PRCMU_BASE) | ||
234 | + PRCM_YYCLKEN0_MGT_SET + clk->prcmu_cg_off; | ||
235 | |||
236 | writel(1 << clk->prcmu_cg_bit, cg_set_reg); | ||
237 | } | ||
238 | |||
239 | static void clk_prcmu_disable(struct clk *clk) | ||
240 | { | ||
241 | void __iomem *cg_clr_reg = __io_address(U8500_PRCMU_BASE) | ||
242 | + PRCM_YYCLKEN0_MGT_CLR + clk->prcmu_cg_off; | ||
243 | |||
244 | writel(1 << clk->prcmu_cg_bit, cg_clr_reg); | ||
245 | } | ||
246 | |||
247 | static struct clkops clk_prcmu_ops = { | ||
248 | .enable = clk_prcmu_enable, | ||
249 | .disable = clk_prcmu_disable, | ||
250 | }; | ||
251 | |||
252 | static unsigned int clkrst_base[] = { | ||
253 | [1] = U8500_CLKRST1_BASE, | ||
254 | [2] = U8500_CLKRST2_BASE, | ||
255 | [3] = U8500_CLKRST3_BASE, | ||
256 | [5] = U8500_CLKRST5_BASE, | ||
257 | [6] = U8500_CLKRST6_BASE, | ||
258 | }; | ||
259 | |||
260 | static void clk_prcc_enable(struct clk *clk) | ||
261 | { | ||
262 | void __iomem *addr = __io_address(clkrst_base[clk->cluster]); | ||
263 | |||
264 | if (clk->prcc_kernel != -1) | ||
265 | writel(1 << clk->prcc_kernel, addr + PRCC_KCKEN); | ||
266 | |||
267 | if (clk->prcc_bus != -1) | ||
268 | writel(1 << clk->prcc_bus, addr + PRCC_PCKEN); | ||
269 | } | ||
270 | |||
271 | static void clk_prcc_disable(struct clk *clk) | ||
272 | { | ||
273 | void __iomem *addr = __io_address(clkrst_base[clk->cluster]); | ||
274 | |||
275 | if (clk->prcc_bus != -1) | ||
276 | writel(1 << clk->prcc_bus, addr + PRCC_PCKDIS); | ||
277 | |||
278 | if (clk->prcc_kernel != -1) | ||
279 | writel(1 << clk->prcc_kernel, addr + PRCC_KCKDIS); | ||
280 | } | ||
281 | |||
282 | static struct clkops clk_prcc_ops = { | ||
283 | .enable = clk_prcc_enable, | ||
284 | .disable = clk_prcc_disable, | ||
285 | }; | ||
286 | |||
287 | static struct clk clk_32khz = { | ||
288 | .name = "clk_32khz", | ||
289 | .rate = 32000, | ||
290 | }; | ||
291 | |||
292 | /* | ||
293 | * PRCMU level clock gating | ||
294 | */ | ||
295 | |||
296 | /* Bank 0 */ | ||
297 | static DEFINE_PRCMU_CLK(svaclk, 0x0, 2, SVAMMDSPCLK); | ||
298 | static DEFINE_PRCMU_CLK(siaclk, 0x0, 3, SIAMMDSPCLK); | ||
299 | static DEFINE_PRCMU_CLK(sgaclk, 0x0, 4, SGACLK); | ||
300 | static DEFINE_PRCMU_CLK_RATE(uartclk, 0x0, 5, UARTCLK, 38400000); | ||
301 | static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK); | ||
302 | static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */ | ||
303 | static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000); | ||
304 | static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 100000000); | ||
305 | static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK); | ||
306 | static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK); | ||
307 | static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK); | ||
308 | static DEFINE_PRCMU_CLK(per3clk, 0x0, 13, PER3CLK); | ||
309 | static DEFINE_PRCMU_CLK(per5clk, 0x0, 14, PER5CLK); | ||
310 | static DEFINE_PRCMU_CLK_RATE(per6clk, 0x0, 15, PER6CLK, 133330000); | ||
311 | static DEFINE_PRCMU_CLK(lcdclk, 0x0, 17, LCDCLK); | ||
312 | static DEFINE_PRCMU_CLK(bmlclk, 0x0, 18, BMLCLK); | ||
313 | static DEFINE_PRCMU_CLK(hsitxclk, 0x0, 19, HSITXCLK); | ||
314 | static DEFINE_PRCMU_CLK(hsirxclk, 0x0, 20, HSIRXCLK); | ||
315 | static DEFINE_PRCMU_CLK(hdmiclk, 0x0, 21, HDMICLK); | ||
316 | static DEFINE_PRCMU_CLK(apeatclk, 0x0, 22, APEATCLK); | ||
317 | static DEFINE_PRCMU_CLK(apetraceclk, 0x0, 23, APETRACECLK); | ||
318 | static DEFINE_PRCMU_CLK(mcdeclk, 0x0, 24, MCDECLK); | ||
319 | static DEFINE_PRCMU_CLK(ipi2clk, 0x0, 25, IPI2CCLK); | ||
320 | static DEFINE_PRCMU_CLK(dsialtclk, 0x0, 26, DSIALTCLK); /* v1 */ | ||
321 | static DEFINE_PRCMU_CLK(dmaclk, 0x0, 27, DMACLK); | ||
322 | static DEFINE_PRCMU_CLK(b2r2clk, 0x0, 28, B2R2CLK); | ||
323 | static DEFINE_PRCMU_CLK(tvclk, 0x0, 29, TVCLK); | ||
324 | static DEFINE_PRCMU_CLK(uniproclk, 0x0, 30, UNIPROCLK); /* v1 */ | ||
325 | static DEFINE_PRCMU_CLK_RATE(sspclk, 0x0, 31, SSPCLK, 48000000); /* v1 */ | ||
326 | |||
327 | /* Bank 1 */ | ||
328 | static DEFINE_PRCMU_CLK(rngclk, 0x4, 0, RNGCLK); /* v1 */ | ||
329 | static DEFINE_PRCMU_CLK(uiccclk, 0x4, 1, UICCCLK); /* v1 */ | ||
330 | |||
331 | /* | ||
332 | * PRCC level clock gating | ||
333 | * Format: per#, clk, PCKEN bit, KCKEN bit, parent | ||
334 | */ | ||
335 | |||
336 | /* Peripheral Cluster #1 */ | ||
337 | static DEFINE_PRCC_CLK(1, msp3, 11, 10, &clk_msp1clk); | ||
338 | static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk); | ||
339 | static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL); | ||
340 | static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk); | ||
341 | static DEFINE_PRCC_CLK(1, spi3, 7, -1, NULL); | ||
342 | static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk); | ||
343 | static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk); | ||
344 | static DEFINE_PRCC_CLK(1, msp1, 4, 4, &clk_msp1clk); | ||
345 | static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk); | ||
346 | static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk); | ||
347 | static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk); | ||
348 | static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk); | ||
349 | |||
350 | /* Peripheral Cluster #2 */ | ||
351 | static DEFINE_PRCC_CLK(2, gpio1, 11, -1, NULL); | ||
352 | static DEFINE_PRCC_CLK(2, ssitx, 10, 7, NULL); | ||
353 | static DEFINE_PRCC_CLK(2, ssirx, 9, 6, NULL); | ||
354 | static DEFINE_PRCC_CLK(2, spi0, 8, -1, NULL); | ||
355 | static DEFINE_PRCC_CLK(2, sdi3, 7, 5, &clk_sdmmcclk); | ||
356 | static DEFINE_PRCC_CLK(2, sdi1, 6, 4, &clk_sdmmcclk); | ||
357 | static DEFINE_PRCC_CLK(2, msp2, 5, 3, &clk_msp02clk); | ||
358 | static DEFINE_PRCC_CLK(2, sdi4, 4, 2, &clk_sdmmcclk); | ||
359 | static DEFINE_PRCC_CLK(2, pwl, 3, 1, NULL); | ||
360 | static DEFINE_PRCC_CLK(2, spi1, 2, -1, NULL); | ||
361 | static DEFINE_PRCC_CLK(2, spi2, 1, -1, NULL); | ||
362 | static DEFINE_PRCC_CLK(2, i2c3, 0, 0, &clk_i2cclk); | ||
363 | |||
364 | /* Peripheral Cluster #3 */ | ||
365 | static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL); | ||
366 | static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk); | ||
367 | static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk); | ||
368 | static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz); | ||
369 | static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk); | ||
370 | static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk); | ||
371 | static DEFINE_PRCC_CLK(3, ssp1, 2, 2, &clk_sspclk); | ||
372 | static DEFINE_PRCC_CLK(3, ssp0, 1, 1, &clk_sspclk); | ||
373 | static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL); | ||
374 | |||
375 | /* Peripheral Cluster #4 is in the always on domain */ | ||
376 | |||
377 | /* Peripheral Cluster #5 */ | ||
378 | static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL); | ||
379 | static DEFINE_PRCC_CLK(5, usb, 0, 0, NULL); | ||
380 | |||
381 | /* Peripheral Cluster #6 */ | ||
382 | |||
383 | /* MTU ID in data */ | ||
384 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu1, 9, -1, NULL, clk_mtu_get_rate, 1); | ||
385 | static DEFINE_PRCC_CLK_CUSTOM(6, mtu0, 8, -1, NULL, clk_mtu_get_rate, 0); | ||
386 | static DEFINE_PRCC_CLK(6, cfgreg, 7, 7, NULL); | ||
387 | static DEFINE_PRCC_CLK(6, hash1, 6, -1, NULL); | ||
388 | static DEFINE_PRCC_CLK(6, unipro, 5, 1, &clk_uniproclk); | ||
389 | static DEFINE_PRCC_CLK(6, pka, 4, -1, NULL); | ||
390 | static DEFINE_PRCC_CLK(6, hash0, 3, -1, NULL); | ||
391 | static DEFINE_PRCC_CLK(6, cryp0, 2, -1, NULL); | ||
392 | static DEFINE_PRCC_CLK(6, cryp1, 1, -1, NULL); | ||
393 | static DEFINE_PRCC_CLK(6, rng, 0, 0, &clk_rngclk); | ||
394 | |||
395 | static struct clk clk_dummy_apb_pclk = { | ||
396 | .name = "apb_pclk", | ||
397 | }; | ||
398 | |||
399 | static struct clk_lookup u8500_clks[] = { | ||
400 | CLK(dummy_apb_pclk, NULL, "apb_pclk"), | ||
401 | |||
402 | /* Peripheral Cluster #1 */ | ||
403 | CLK(gpio0, "gpio.0", NULL), | ||
404 | CLK(gpio0, "gpio.1", NULL), | ||
405 | CLK(slimbus0, "slimbus0", NULL), | ||
406 | CLK(i2c2, "nmk-i2c.2", NULL), | ||
407 | CLK(sdi0, "sdi0", NULL), | ||
408 | CLK(msp0, "ux500-msp-i2s.0", NULL), | ||
409 | CLK(i2c1, "nmk-i2c.1", NULL), | ||
410 | CLK(uart1, "uart1", NULL), | ||
411 | CLK(uart0, "uart0", NULL), | ||
412 | |||
413 | /* Peripheral Cluster #3 */ | ||
414 | CLK(gpio2, "gpio.2", NULL), | ||
415 | CLK(gpio2, "gpio.3", NULL), | ||
416 | CLK(gpio2, "gpio.4", NULL), | ||
417 | CLK(gpio2, "gpio.5", NULL), | ||
418 | CLK(sdi5, "sdi5", NULL), | ||
419 | CLK(uart2, "uart2", NULL), | ||
420 | CLK(ske, "ske", NULL), | ||
421 | CLK(ske, "nmk-ske-keypad", NULL), | ||
422 | CLK(sdi2, "sdi2", NULL), | ||
423 | CLK(i2c0, "nmk-i2c.0", NULL), | ||
424 | CLK(fsmc, "fsmc", NULL), | ||
425 | |||
426 | /* Peripheral Cluster #5 */ | ||
427 | CLK(gpio3, "gpio.8", NULL), | ||
428 | |||
429 | /* Peripheral Cluster #6 */ | ||
430 | CLK(hash1, "hash1", NULL), | ||
431 | CLK(pka, "pka", NULL), | ||
432 | CLK(hash0, "hash0", NULL), | ||
433 | CLK(cryp0, "cryp0", NULL), | ||
434 | CLK(cryp1, "cryp1", NULL), | ||
435 | |||
436 | /* PRCMU level clock gating */ | ||
437 | |||
438 | /* Bank 0 */ | ||
439 | CLK(svaclk, "sva", NULL), | ||
440 | CLK(siaclk, "sia", NULL), | ||
441 | CLK(sgaclk, "sga", NULL), | ||
442 | CLK(slimclk, "slim", NULL), | ||
443 | CLK(lcdclk, "lcd", NULL), | ||
444 | CLK(bmlclk, "bml", NULL), | ||
445 | CLK(hsitxclk, "stm-hsi.0", NULL), | ||
446 | CLK(hsirxclk, "stm-hsi.1", NULL), | ||
447 | CLK(hdmiclk, "hdmi", NULL), | ||
448 | CLK(apeatclk, "apeat", NULL), | ||
449 | CLK(apetraceclk, "apetrace", NULL), | ||
450 | CLK(mcdeclk, "mcde", NULL), | ||
451 | CLK(ipi2clk, "ipi2", NULL), | ||
452 | CLK(dmaclk, "dma40.0", NULL), | ||
453 | CLK(b2r2clk, "b2r2", NULL), | ||
454 | CLK(tvclk, "tv", NULL), | ||
455 | |||
456 | /* Peripheral Cluster #1 */ | ||
457 | CLK(i2c4, "nmk-i2c.4", NULL), | ||
458 | CLK(spi3, "spi3", NULL), | ||
459 | CLK(msp1, "ux500-msp-i2s.1", NULL), | ||
460 | CLK(msp3, "ux500-msp-i2s.3", NULL), | ||
461 | |||
462 | /* Peripheral Cluster #2 */ | ||
463 | CLK(gpio1, "gpio.6", NULL), | ||
464 | CLK(gpio1, "gpio.7", NULL), | ||
465 | CLK(ssitx, "ssitx", NULL), | ||
466 | CLK(ssirx, "ssirx", NULL), | ||
467 | CLK(spi0, "spi0", NULL), | ||
468 | CLK(sdi3, "sdi3", NULL), | ||
469 | CLK(sdi1, "sdi1", NULL), | ||
470 | CLK(msp2, "ux500-msp-i2s.2", NULL), | ||
471 | CLK(sdi4, "sdi4", NULL), | ||
472 | CLK(pwl, "pwl", NULL), | ||
473 | CLK(spi1, "spi1", NULL), | ||
474 | CLK(spi2, "spi2", NULL), | ||
475 | CLK(i2c3, "nmk-i2c.3", NULL), | ||
476 | |||
477 | /* Peripheral Cluster #3 */ | ||
478 | CLK(ssp1, "ssp1", NULL), | ||
479 | CLK(ssp0, "ssp0", NULL), | ||
480 | |||
481 | /* Peripheral Cluster #5 */ | ||
482 | CLK(usb, "musb-ux500.0", "usb"), | ||
483 | |||
484 | /* Peripheral Cluster #6 */ | ||
485 | CLK(mtu1, "mtu1", NULL), | ||
486 | CLK(mtu0, "mtu0", NULL), | ||
487 | CLK(cfgreg, "cfgreg", NULL), | ||
488 | CLK(hash1, "hash1", NULL), | ||
489 | CLK(unipro, "unipro", NULL), | ||
490 | CLK(rng, "rng", NULL), | ||
491 | |||
492 | /* PRCMU level clock gating */ | ||
493 | |||
494 | /* Bank 0 */ | ||
495 | CLK(uniproclk, "uniproclk", NULL), | ||
496 | CLK(dsialtclk, "dsialt", NULL), | ||
497 | |||
498 | /* Bank 1 */ | ||
499 | CLK(rngclk, "rng", NULL), | ||
500 | CLK(uiccclk, "uicc", NULL), | ||
501 | }; | ||
502 | |||
503 | #ifdef CONFIG_DEBUG_FS | ||
504 | /* | ||
505 | * debugfs support to trace clock tree hierarchy and attributes with | ||
506 | * powerdebug | ||
507 | */ | ||
508 | static struct dentry *clk_debugfs_root; | ||
509 | |||
510 | void __init clk_debugfs_add_table(struct clk_lookup *cl, size_t num) | ||
511 | { | ||
512 | while (num--) { | ||
513 | /* Check that the clock has not been already registered */ | ||
514 | if (!(cl->clk->list.prev != cl->clk->list.next)) | ||
515 | list_add_tail(&cl->clk->list, &clk_list); | ||
516 | |||
517 | cl++; | ||
518 | } | ||
519 | } | ||
520 | |||
521 | static ssize_t usecount_dbg_read(struct file *file, char __user *buf, | ||
522 | size_t size, loff_t *off) | ||
523 | { | ||
524 | struct clk *clk = file->f_dentry->d_inode->i_private; | ||
525 | char cusecount[128]; | ||
526 | unsigned int len; | ||
527 | |||
528 | len = sprintf(cusecount, "%u\n", clk->enabled); | ||
529 | return simple_read_from_buffer(buf, size, off, cusecount, len); | ||
530 | } | ||
531 | |||
532 | static ssize_t rate_dbg_read(struct file *file, char __user *buf, | ||
533 | size_t size, loff_t *off) | ||
534 | { | ||
535 | struct clk *clk = file->f_dentry->d_inode->i_private; | ||
536 | char crate[128]; | ||
537 | unsigned int rate; | ||
538 | unsigned int len; | ||
539 | |||
540 | rate = clk_get_rate(clk); | ||
541 | len = sprintf(crate, "%u\n", rate); | ||
542 | return simple_read_from_buffer(buf, size, off, crate, len); | ||
543 | } | ||
544 | |||
545 | static const struct file_operations usecount_fops = { | ||
546 | .read = usecount_dbg_read, | ||
547 | }; | ||
548 | |||
549 | static const struct file_operations set_rate_fops = { | ||
550 | .read = rate_dbg_read, | ||
551 | }; | ||
552 | |||
553 | static struct dentry *clk_debugfs_register_dir(struct clk *c, | ||
554 | struct dentry *p_dentry) | ||
555 | { | ||
556 | struct dentry *d, *clk_d; | ||
557 | const char *p = c->name; | ||
558 | |||
559 | if (!p) | ||
560 | p = "BUG"; | ||
561 | |||
562 | clk_d = debugfs_create_dir(p, p_dentry); | ||
563 | if (!clk_d) | ||
564 | return NULL; | ||
565 | |||
566 | d = debugfs_create_file("usecount", S_IRUGO, | ||
567 | clk_d, c, &usecount_fops); | ||
568 | if (!d) | ||
569 | goto err_out; | ||
570 | d = debugfs_create_file("rate", S_IRUGO, | ||
571 | clk_d, c, &set_rate_fops); | ||
572 | if (!d) | ||
573 | goto err_out; | ||
574 | /* | ||
575 | * TODO : not currently available in ux500 | ||
576 | * d = debugfs_create_x32("flags", S_IRUGO, clk_d, (u32 *)&c->flags); | ||
577 | * if (!d) | ||
578 | * goto err_out; | ||
579 | */ | ||
580 | |||
581 | return clk_d; | ||
582 | |||
583 | err_out: | ||
584 | debugfs_remove_recursive(clk_d); | ||
585 | return NULL; | ||
586 | } | ||
587 | |||
588 | static int clk_debugfs_register_one(struct clk *c) | ||
589 | { | ||
590 | struct clk *pa = c->parent_periph; | ||
591 | struct clk *bpa = c->parent_cluster; | ||
592 | |||
593 | if (!(bpa && !pa)) { | ||
594 | c->dent = clk_debugfs_register_dir(c, | ||
595 | pa ? pa->dent : clk_debugfs_root); | ||
596 | if (!c->dent) | ||
597 | return -ENOMEM; | ||
598 | } | ||
599 | |||
600 | if (bpa) { | ||
601 | c->dent_bus = clk_debugfs_register_dir(c, | ||
602 | bpa->dent_bus ? bpa->dent_bus : bpa->dent); | ||
603 | if ((!c->dent_bus) && (c->dent)) { | ||
604 | debugfs_remove_recursive(c->dent); | ||
605 | c->dent = NULL; | ||
606 | return -ENOMEM; | ||
607 | } | ||
608 | } | ||
609 | return 0; | ||
610 | } | ||
611 | |||
612 | static int clk_debugfs_register(struct clk *c) | ||
613 | { | ||
614 | int err; | ||
615 | struct clk *pa = c->parent_periph; | ||
616 | struct clk *bpa = c->parent_cluster; | ||
617 | |||
618 | if (pa && (!pa->dent && !pa->dent_bus)) { | ||
619 | err = clk_debugfs_register(pa); | ||
620 | if (err) | ||
621 | return err; | ||
622 | } | ||
623 | |||
624 | if (bpa && (!bpa->dent && !bpa->dent_bus)) { | ||
625 | err = clk_debugfs_register(bpa); | ||
626 | if (err) | ||
627 | return err; | ||
628 | } | ||
629 | |||
630 | if ((!c->dent) && (!c->dent_bus)) { | ||
631 | err = clk_debugfs_register_one(c); | ||
632 | if (err) | ||
633 | return err; | ||
634 | } | ||
635 | return 0; | ||
636 | } | ||
637 | |||
638 | int __init clk_debugfs_init(void) | ||
639 | { | ||
640 | struct clk *c; | ||
641 | struct dentry *d; | ||
642 | int err; | ||
643 | |||
644 | d = debugfs_create_dir("clock", NULL); | ||
645 | if (!d) | ||
646 | return -ENOMEM; | ||
647 | clk_debugfs_root = d; | ||
648 | |||
649 | list_for_each_entry(c, &clk_list, list) { | ||
650 | err = clk_debugfs_register(c); | ||
651 | if (err) | ||
652 | goto err_out; | ||
653 | } | ||
654 | return 0; | ||
655 | err_out: | ||
656 | debugfs_remove_recursive(clk_debugfs_root); | ||
657 | return err; | ||
658 | } | ||
659 | |||
660 | #endif /* defined(CONFIG_DEBUG_FS) */ | ||
661 | |||
662 | unsigned long clk_smp_twd_rate = 500000000; | ||
663 | |||
664 | unsigned long clk_smp_twd_get_rate(struct clk *clk) | ||
665 | { | ||
666 | return clk_smp_twd_rate; | ||
667 | } | ||
668 | |||
669 | static struct clk clk_smp_twd = { | ||
670 | .get_rate = clk_smp_twd_get_rate, | ||
671 | .name = "smp_twd", | ||
672 | }; | ||
673 | |||
674 | static struct clk_lookup clk_smp_twd_lookup = { | ||
675 | .dev_id = "smp_twd", | ||
676 | .clk = &clk_smp_twd, | ||
677 | }; | ||
678 | |||
679 | #ifdef CONFIG_CPU_FREQ | ||
680 | |||
681 | static int clk_twd_cpufreq_transition(struct notifier_block *nb, | ||
682 | unsigned long state, void *data) | ||
683 | { | ||
684 | struct cpufreq_freqs *f = data; | ||
685 | |||
686 | if (state == CPUFREQ_PRECHANGE) { | ||
687 | /* Save frequency in simple Hz */ | ||
688 | clk_smp_twd_rate = (f->new * 1000) / 2; | ||
689 | } | ||
690 | |||
691 | return NOTIFY_OK; | ||
692 | } | ||
693 | |||
694 | static struct notifier_block clk_twd_cpufreq_nb = { | ||
695 | .notifier_call = clk_twd_cpufreq_transition, | ||
696 | }; | ||
697 | |||
698 | int clk_init_smp_twd_cpufreq(void) | ||
699 | { | ||
700 | return cpufreq_register_notifier(&clk_twd_cpufreq_nb, | ||
701 | CPUFREQ_TRANSITION_NOTIFIER); | ||
702 | } | ||
703 | |||
704 | #endif | ||
705 | |||
706 | int __init clk_init(void) | ||
707 | { | ||
708 | clkdev_add_table(u8500_clks, ARRAY_SIZE(u8500_clks)); | ||
709 | clkdev_add(&clk_smp_twd_lookup); | ||
710 | |||
711 | #ifdef CONFIG_DEBUG_FS | ||
712 | clk_debugfs_add_table(u8500_clks, ARRAY_SIZE(u8500_clks)); | ||
713 | #endif | ||
714 | return 0; | ||
715 | } | ||
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h deleted file mode 100644 index 65d27a13f46d..000000000000 --- a/arch/arm/mach-ux500/clock.h +++ /dev/null | |||
@@ -1,164 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 ST-Ericsson | ||
3 | * Copyright (C) 2009 STMicroelectronics | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | /** | ||
11 | * struct clkops - ux500 clock operations | ||
12 | * @enable: function to enable the clock | ||
13 | * @disable: function to disable the clock | ||
14 | * @get_rate: function to get the current clock rate | ||
15 | * | ||
16 | * This structure contains function pointers to functions that will be used to | ||
17 | * control the clock. All of these functions are optional. If get_rate is | ||
18 | * NULL, the rate in the struct clk will be used. | ||
19 | */ | ||
20 | struct clkops { | ||
21 | void (*enable) (struct clk *); | ||
22 | void (*disable) (struct clk *); | ||
23 | unsigned long (*get_rate) (struct clk *); | ||
24 | int (*set_parent)(struct clk *, struct clk *); | ||
25 | }; | ||
26 | |||
27 | /** | ||
28 | * struct clk - ux500 clock structure | ||
29 | * @ops: pointer to clkops struct used to control this clock | ||
30 | * @name: name, for debugging | ||
31 | * @enabled: refcount. positive if enabled, zero if disabled | ||
32 | * @get_rate: custom callback for getting the clock rate | ||
33 | * @data: custom per-clock data for example for the get_rate | ||
34 | * callback | ||
35 | * @rate: fixed rate for clocks which don't implement | ||
36 | * ops->getrate | ||
37 | * @prcmu_cg_off: address offset of the combined enable/disable register | ||
38 | * (used on u8500v1) | ||
39 | * @prcmu_cg_bit: bit in the combined enable/disable register (used on | ||
40 | * u8500v1) | ||
41 | * @prcmu_cg_mgt: address of the enable/disable register (used on | ||
42 | * u8500ed) | ||
43 | * @cluster: peripheral cluster number | ||
44 | * @prcc_bus: bit for the bus clock in the peripheral's CLKRST | ||
45 | * @prcc_kernel: bit for the kernel clock in the peripheral's CLKRST. | ||
46 | * -1 if no kernel clock exists. | ||
47 | * @parent_cluster: pointer to parent's cluster clk struct | ||
48 | * @parent_periph: pointer to parent's peripheral clk struct | ||
49 | * | ||
50 | * Peripherals are organised into clusters, and each cluster has an associated | ||
51 | * bus clock. Some peripherals also have a parent peripheral clock. | ||
52 | * | ||
53 | * In order to enable a clock for a peripheral, we need to enable: | ||
54 | * (1) the parent cluster (bus) clock at the PRCMU level | ||
55 | * (2) the parent peripheral clock (if any) at the PRCMU level | ||
56 | * (3) the peripheral's bus & kernel clock at the PRCC level | ||
57 | * | ||
58 | * (1) and (2) are handled by defining clk structs (DEFINE_PRCMU_CLK) for each | ||
59 | * of the cluster and peripheral clocks, and hooking these as the parents of | ||
60 | * the individual peripheral clocks. | ||
61 | * | ||
62 | * (3) is handled by specifying the bits in the PRCC control registers required | ||
63 | * to enable these clocks and modifying them in the ->enable and | ||
64 | * ->disable callbacks of the peripheral clocks (DEFINE_PRCC_CLK). | ||
65 | * | ||
66 | * This structure describes both the PRCMU-level clocks and PRCC-level clocks. | ||
67 | * The prcmu_* fields are only used for the PRCMU clocks, and the cluster, | ||
68 | * prcc, and parent pointers are only used for the PRCC-level clocks. | ||
69 | */ | ||
70 | struct clk { | ||
71 | const struct clkops *ops; | ||
72 | const char *name; | ||
73 | unsigned int enabled; | ||
74 | unsigned long (*get_rate)(struct clk *); | ||
75 | void *data; | ||
76 | |||
77 | unsigned long rate; | ||
78 | struct list_head list; | ||
79 | |||
80 | /* These three are only for PRCMU clks */ | ||
81 | |||
82 | unsigned int prcmu_cg_off; | ||
83 | unsigned int prcmu_cg_bit; | ||
84 | unsigned int prcmu_cg_mgt; | ||
85 | |||
86 | /* The rest are only for PRCC clks */ | ||
87 | |||
88 | int cluster; | ||
89 | unsigned int prcc_bus; | ||
90 | unsigned int prcc_kernel; | ||
91 | |||
92 | struct clk *parent_cluster; | ||
93 | struct clk *parent_periph; | ||
94 | #if defined(CONFIG_DEBUG_FS) | ||
95 | struct dentry *dent; /* For visible tree hierarchy */ | ||
96 | struct dentry *dent_bus; /* For visible tree hierarchy */ | ||
97 | #endif | ||
98 | }; | ||
99 | |||
100 | #define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \ | ||
101 | struct clk clk_##_name = { \ | ||
102 | .name = #_name, \ | ||
103 | .ops = &clk_prcmu_ops, \ | ||
104 | .prcmu_cg_off = _cg_off, \ | ||
105 | .prcmu_cg_bit = _cg_bit, \ | ||
106 | .prcmu_cg_mgt = PRCM_##_reg##_MGT \ | ||
107 | } | ||
108 | |||
109 | #define DEFINE_PRCMU_CLK_RATE(_name, _cg_off, _cg_bit, _reg, _rate) \ | ||
110 | struct clk clk_##_name = { \ | ||
111 | .name = #_name, \ | ||
112 | .ops = &clk_prcmu_ops, \ | ||
113 | .prcmu_cg_off = _cg_off, \ | ||
114 | .prcmu_cg_bit = _cg_bit, \ | ||
115 | .rate = _rate, \ | ||
116 | .prcmu_cg_mgt = PRCM_##_reg##_MGT \ | ||
117 | } | ||
118 | |||
119 | #define DEFINE_PRCC_CLK(_pclust, _name, _bus_en, _kernel_en, _kernclk) \ | ||
120 | struct clk clk_##_name = { \ | ||
121 | .name = #_name, \ | ||
122 | .ops = &clk_prcc_ops, \ | ||
123 | .cluster = _pclust, \ | ||
124 | .prcc_bus = _bus_en, \ | ||
125 | .prcc_kernel = _kernel_en, \ | ||
126 | .parent_cluster = &clk_per##_pclust##clk, \ | ||
127 | .parent_periph = _kernclk \ | ||
128 | } | ||
129 | |||
130 | #define DEFINE_PRCC_CLK_CUSTOM(_pclust, _name, _bus_en, _kernel_en, _kernclk, _callback, _data) \ | ||
131 | struct clk clk_##_name = { \ | ||
132 | .name = #_name, \ | ||
133 | .ops = &clk_prcc_ops, \ | ||
134 | .cluster = _pclust, \ | ||
135 | .prcc_bus = _bus_en, \ | ||
136 | .prcc_kernel = _kernel_en, \ | ||
137 | .parent_cluster = &clk_per##_pclust##clk, \ | ||
138 | .parent_periph = _kernclk, \ | ||
139 | .get_rate = _callback, \ | ||
140 | .data = (void *) _data \ | ||
141 | } | ||
142 | |||
143 | |||
144 | #define CLK(_clk, _devname, _conname) \ | ||
145 | { \ | ||
146 | .clk = &clk_##_clk, \ | ||
147 | .dev_id = _devname, \ | ||
148 | .con_id = _conname, \ | ||
149 | } | ||
150 | |||
151 | int __init clk_db8500_ed_fixup(void); | ||
152 | int __init clk_init(void); | ||
153 | |||
154 | #ifdef CONFIG_DEBUG_FS | ||
155 | int clk_debugfs_init(void); | ||
156 | #else | ||
157 | static inline int clk_debugfs_init(void) { return 0; } | ||
158 | #endif | ||
159 | |||
160 | #ifdef CONFIG_CPU_FREQ | ||
161 | int clk_init_smp_twd_cpufreq(void); | ||
162 | #else | ||
163 | static inline int clk_init_smp_twd_cpufreq(void) { return 0; } | ||
164 | #endif | ||
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index db3c52d56ca4..bcdfe6b1d453 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -18,13 +18,13 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/mfd/abx500/ab8500.h> | 19 | #include <linux/mfd/abx500/ab8500.h> |
20 | 20 | ||
21 | #include <asm/mach/map.h> | ||
22 | #include <asm/pmu.h> | 21 | #include <asm/pmu.h> |
22 | #include <asm/mach/map.h> | ||
23 | #include <plat/gpio-nomadik.h> | 23 | #include <plat/gpio-nomadik.h> |
24 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
25 | #include <mach/setup.h> | 25 | #include <mach/setup.h> |
26 | #include <mach/devices.h> | 26 | #include <mach/devices.h> |
27 | #include <mach/usb.h> | 27 | #include <linux/platform_data/usb-musb-ux500.h> |
28 | #include <mach/db8500-regs.h> | 28 | #include <mach/db8500-regs.h> |
29 | 29 | ||
30 | #include "devices-db8500.h" | 30 | #include "devices-db8500.h" |
@@ -80,7 +80,7 @@ void __init u8500_map_io(void) | |||
80 | 80 | ||
81 | iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc)); | 81 | iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc)); |
82 | 82 | ||
83 | if (cpu_is_u9540()) | 83 | if (cpu_is_ux540_family()) |
84 | iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); | 84 | iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); |
85 | else | 85 | else |
86 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); | 86 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); |
@@ -122,7 +122,7 @@ struct arm_pmu_platdata db8500_pmu_platdata = { | |||
122 | 122 | ||
123 | static struct platform_device db8500_pmu_device = { | 123 | static struct platform_device db8500_pmu_device = { |
124 | .name = "arm-pmu", | 124 | .name = "arm-pmu", |
125 | .id = ARM_PMU_DEVICE_CPU, | 125 | .id = -1, |
126 | .num_resources = ARRAY_SIZE(db8500_pmu_resources), | 126 | .num_resources = ARRAY_SIZE(db8500_pmu_resources), |
127 | .resource = db8500_pmu_resources, | 127 | .resource = db8500_pmu_resources, |
128 | .dev.platform_data = &db8500_pmu_platdata, | 128 | .dev.platform_data = &db8500_pmu_platdata, |
@@ -138,10 +138,6 @@ static struct platform_device *platform_devs[] __initdata = { | |||
138 | &db8500_prcmu_device, | 138 | &db8500_prcmu_device, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static struct platform_device *of_platform_devs[] __initdata = { | ||
142 | &u8500_dma40_device, | ||
143 | }; | ||
144 | |||
145 | static resource_size_t __initdata db8500_gpio_base[] = { | 141 | static resource_size_t __initdata db8500_gpio_base[] = { |
146 | U8500_GPIOBANK0_BASE, | 142 | U8500_GPIOBANK0_BASE, |
147 | U8500_GPIOBANK1_BASE, | 143 | U8500_GPIOBANK1_BASE, |
@@ -235,7 +231,6 @@ struct device * __init u8500_init_devices(struct ab8500_platform_data *ab8500) | |||
235 | struct device * __init u8500_of_init_devices(void) | 231 | struct device * __init u8500_of_init_devices(void) |
236 | { | 232 | { |
237 | struct device *parent; | 233 | struct device *parent; |
238 | int i; | ||
239 | 234 | ||
240 | parent = db8500_soc_device_init(); | 235 | parent = db8500_soc_device_init(); |
241 | 236 | ||
@@ -244,8 +239,7 @@ struct device * __init u8500_of_init_devices(void) | |||
244 | platform_device_register_data(parent, | 239 | platform_device_register_data(parent, |
245 | "cpufreq-u8500", -1, NULL, 0); | 240 | "cpufreq-u8500", -1, NULL, 0); |
246 | 241 | ||
247 | for (i = 0; i < ARRAY_SIZE(of_platform_devs); i++) | 242 | u8500_dma40_device.dev.parent = parent; |
248 | of_platform_devs[i]->dev.parent = parent; | ||
249 | 243 | ||
250 | /* | 244 | /* |
251 | * Devices to be DT:ed: | 245 | * Devices to be DT:ed: |
@@ -253,7 +247,7 @@ struct device * __init u8500_of_init_devices(void) | |||
253 | * db8500_pmu_device = done | 247 | * db8500_pmu_device = done |
254 | * db8500_prcmu_device = done | 248 | * db8500_prcmu_device = done |
255 | */ | 249 | */ |
256 | platform_add_devices(of_platform_devs, ARRAY_SIZE(of_platform_devs)); | 250 | platform_device_register(&u8500_dma40_device); |
257 | 251 | ||
258 | return parent; | 252 | return parent; |
259 | } | 253 | } |
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index e2360e7c770d..2236cbd03cd7 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c | |||
@@ -8,7 +8,6 @@ | |||
8 | 8 | ||
9 | #include <linux/platform_device.h> | 9 | #include <linux/platform_device.h> |
10 | #include <linux/io.h> | 10 | #include <linux/io.h> |
11 | #include <linux/clk.h> | ||
12 | #include <linux/mfd/db8500-prcmu.h> | 11 | #include <linux/mfd/db8500-prcmu.h> |
13 | #include <linux/clksrc-dbx500-prcmu.h> | 12 | #include <linux/clksrc-dbx500-prcmu.h> |
14 | #include <linux/sys_soc.h> | 13 | #include <linux/sys_soc.h> |
@@ -17,6 +16,7 @@ | |||
17 | #include <linux/stat.h> | 16 | #include <linux/stat.h> |
18 | #include <linux/of.h> | 17 | #include <linux/of.h> |
19 | #include <linux/of_irq.h> | 18 | #include <linux/of_irq.h> |
19 | #include <linux/platform_data/clk-ux500.h> | ||
20 | 20 | ||
21 | #include <asm/hardware/gic.h> | 21 | #include <asm/hardware/gic.h> |
22 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
@@ -25,8 +25,6 @@ | |||
25 | #include <mach/setup.h> | 25 | #include <mach/setup.h> |
26 | #include <mach/devices.h> | 26 | #include <mach/devices.h> |
27 | 27 | ||
28 | #include "clock.h" | ||
29 | |||
30 | void __iomem *_PRCMU_BASE; | 28 | void __iomem *_PRCMU_BASE; |
31 | 29 | ||
32 | /* | 30 | /* |
@@ -51,7 +49,9 @@ void __init ux500_init_irq(void) | |||
51 | void __iomem *dist_base; | 49 | void __iomem *dist_base; |
52 | void __iomem *cpu_base; | 50 | void __iomem *cpu_base; |
53 | 51 | ||
54 | if (cpu_is_u8500_family()) { | 52 | gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND; |
53 | |||
54 | if (cpu_is_u8500_family() || cpu_is_ux540_family()) { | ||
55 | dist_base = __io_address(U8500_GIC_DIST_BASE); | 55 | dist_base = __io_address(U8500_GIC_DIST_BASE); |
56 | cpu_base = __io_address(U8500_GIC_CPU_BASE); | 56 | cpu_base = __io_address(U8500_GIC_CPU_BASE); |
57 | } else | 57 | } else |
@@ -70,13 +70,17 @@ void __init ux500_init_irq(void) | |||
70 | */ | 70 | */ |
71 | if (cpu_is_u8500_family()) | 71 | if (cpu_is_u8500_family()) |
72 | db8500_prcmu_early_init(); | 72 | db8500_prcmu_early_init(); |
73 | clk_init(); | 73 | |
74 | if (cpu_is_u8500_family()) | ||
75 | u8500_clk_init(); | ||
76 | else if (cpu_is_u9540()) | ||
77 | u9540_clk_init(); | ||
78 | else if (cpu_is_u8540()) | ||
79 | u8540_clk_init(); | ||
74 | } | 80 | } |
75 | 81 | ||
76 | void __init ux500_init_late(void) | 82 | void __init ux500_init_late(void) |
77 | { | 83 | { |
78 | clk_debugfs_init(); | ||
79 | clk_init_smp_twd_cpufreq(); | ||
80 | } | 84 | } |
81 | 85 | ||
82 | static const char * __init ux500_get_machine(void) | 86 | static const char * __init ux500_get_machine(void) |
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h index ecdd8386cffb..7fbf0ba336e1 100644 --- a/arch/arm/mach-ux500/devices-common.h +++ b/arch/arm/mach-ux500/devices-common.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/sys_soc.h> | 13 | #include <linux/sys_soc.h> |
14 | #include <linux/amba/bus.h> | 14 | #include <linux/amba/bus.h> |
15 | #include <linux/platform_data/i2c-nomadik.h> | 15 | #include <linux/platform_data/i2c-nomadik.h> |
16 | #include <mach/crypto-ux500.h> | 16 | #include <linux/platform_data/crypto-ux500.h> |
17 | 17 | ||
18 | struct spi_master_cntlr; | 18 | struct spi_master_cntlr; |
19 | 19 | ||
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c index c76f0f456f04..2f6af259015d 100644 --- a/arch/arm/mach-ux500/hotplug.c +++ b/arch/arm/mach-ux500/hotplug.c | |||
@@ -15,13 +15,18 @@ | |||
15 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
16 | #include <asm/smp_plat.h> | 16 | #include <asm/smp_plat.h> |
17 | 17 | ||
18 | extern volatile int pen_release; | 18 | #include <mach/setup.h> |
19 | 19 | ||
20 | static inline void platform_do_lowpower(unsigned int cpu) | 20 | /* |
21 | * platform-specific code to shutdown a CPU | ||
22 | * | ||
23 | * Called with IRQs disabled | ||
24 | */ | ||
25 | void __ref ux500_cpu_die(unsigned int cpu) | ||
21 | { | 26 | { |
22 | flush_cache_all(); | 27 | flush_cache_all(); |
23 | 28 | ||
24 | /* we put the platform to just WFI */ | 29 | /* directly enter low power state, skipping secure registers */ |
25 | for (;;) { | 30 | for (;;) { |
26 | __asm__ __volatile__("dsb\n\t" "wfi\n\t" | 31 | __asm__ __volatile__("dsb\n\t" "wfi\n\t" |
27 | : : : "memory"); | 32 | : : : "memory"); |
@@ -33,28 +38,3 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
33 | } | 38 | } |
34 | } | 39 | } |
35 | } | 40 | } |
36 | |||
37 | int platform_cpu_kill(unsigned int cpu) | ||
38 | { | ||
39 | return 1; | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * platform-specific code to shutdown a CPU | ||
44 | * | ||
45 | * Called with IRQs disabled | ||
46 | */ | ||
47 | void platform_cpu_die(unsigned int cpu) | ||
48 | { | ||
49 | /* directly enter low power state, skipping secure registers */ | ||
50 | platform_do_lowpower(cpu); | ||
51 | } | ||
52 | |||
53 | int platform_cpu_disable(unsigned int cpu) | ||
54 | { | ||
55 | /* | ||
56 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
57 | * e.g. clock tick interrupts) | ||
58 | */ | ||
59 | return cpu == 0 ? -EPERM : 0; | ||
60 | } | ||
diff --git a/arch/arm/mach-ux500/include/mach/crypto-ux500.h b/arch/arm/mach-ux500/include/mach/crypto-ux500.h deleted file mode 100644 index 5b2d0817e26a..000000000000 --- a/arch/arm/mach-ux500/include/mach/crypto-ux500.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2011 | ||
3 | * | ||
4 | * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | #ifndef _CRYPTO_UX500_H | ||
8 | #define _CRYPTO_UX500_H | ||
9 | #include <linux/dmaengine.h> | ||
10 | #include <plat/ste_dma40.h> | ||
11 | |||
12 | struct hash_platform_data { | ||
13 | void *mem_to_engine; | ||
14 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
15 | }; | ||
16 | |||
17 | struct cryp_platform_data { | ||
18 | struct stedma40_chan_cfg mem_to_engine; | ||
19 | struct stedma40_chan_cfg engine_to_mem; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h deleted file mode 100644 index c01ef66537f3..000000000000 --- a/arch/arm/mach-ux500/include/mach/gpio.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | #ifndef __ASM_ARCH_GPIO_H | ||
2 | #define __ASM_ARCH_GPIO_H | ||
3 | |||
4 | |||
5 | #endif /* __ASM_ARCH_GPIO_H */ | ||
diff --git a/arch/arm/mach-ux500/include/mach/id.h b/arch/arm/mach-ux500/include/mach/id.h index c6e2db9e9e51..9c42642ab168 100644 --- a/arch/arm/mach-ux500/include/mach/id.h +++ b/arch/arm/mach-ux500/include/mach/id.h | |||
@@ -41,43 +41,29 @@ static inline bool __attribute_const__ cpu_is_u8500(void) | |||
41 | return dbx500_partnumber() == 0x8500; | 41 | return dbx500_partnumber() == 0x8500; |
42 | } | 42 | } |
43 | 43 | ||
44 | static inline bool __attribute_const__ cpu_is_u9540(void) | 44 | static inline bool __attribute_const__ cpu_is_u8520(void) |
45 | { | 45 | { |
46 | return dbx500_partnumber() == 0x9540; | 46 | return dbx500_partnumber() == 0x8520; |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline bool cpu_is_u8500_family(void) | 49 | static inline bool cpu_is_u8500_family(void) |
50 | { | 50 | { |
51 | return cpu_is_u8500() || cpu_is_u9540(); | 51 | return cpu_is_u8500() || cpu_is_u8520(); |
52 | } | ||
53 | |||
54 | static inline bool __attribute_const__ cpu_is_u5500(void) | ||
55 | { | ||
56 | return dbx500_partnumber() == 0x5500; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * 5500 revisions | ||
61 | */ | ||
62 | |||
63 | static inline bool __attribute_const__ cpu_is_u5500v1(void) | ||
64 | { | ||
65 | return cpu_is_u5500() && (dbx500_revision() & 0xf0) == 0xA0; | ||
66 | } | 52 | } |
67 | 53 | ||
68 | static inline bool __attribute_const__ cpu_is_u5500v2(void) | 54 | static inline bool __attribute_const__ cpu_is_u9540(void) |
69 | { | 55 | { |
70 | return (dbx500_id.revision & 0xf0) == 0xB0; | 56 | return dbx500_partnumber() == 0x9540; |
71 | } | 57 | } |
72 | 58 | ||
73 | static inline bool __attribute_const__ cpu_is_u5500v20(void) | 59 | static inline bool __attribute_const__ cpu_is_u8540(void) |
74 | { | 60 | { |
75 | return cpu_is_u5500() && ((dbx500_revision() & 0xf0) == 0xB0); | 61 | return dbx500_partnumber() == 0x8540; |
76 | } | 62 | } |
77 | 63 | ||
78 | static inline bool __attribute_const__ cpu_is_u5500v21(void) | 64 | static inline bool cpu_is_ux540_family(void) |
79 | { | 65 | { |
80 | return cpu_is_u5500() && (dbx500_revision() == 0xB1); | 66 | return cpu_is_u9540() || cpu_is_u8540(); |
81 | } | 67 | } |
82 | 68 | ||
83 | /* | 69 | /* |
@@ -119,14 +105,14 @@ static inline bool cpu_is_u8500v21(void) | |||
119 | return cpu_is_u8500() && (dbx500_revision() == 0xB1); | 105 | return cpu_is_u8500() && (dbx500_revision() == 0xB1); |
120 | } | 106 | } |
121 | 107 | ||
108 | static inline bool cpu_is_u8500v22(void) | ||
109 | { | ||
110 | return cpu_is_u8500() && (dbx500_revision() == 0xB2); | ||
111 | } | ||
112 | |||
122 | static inline bool cpu_is_u8500v20_or_later(void) | 113 | static inline bool cpu_is_u8500v20_or_later(void) |
123 | { | 114 | { |
124 | /* | 115 | return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11()); |
125 | * U9540 has so much in common with U8500 that is is considered a | ||
126 | * U8500 variant. | ||
127 | */ | ||
128 | return cpu_is_u9540() || | ||
129 | (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11()); | ||
130 | } | 116 | } |
131 | 117 | ||
132 | static inline bool ux500_is_svp(void) | 118 | static inline bool ux500_is_svp(void) |
diff --git a/arch/arm/mach-ux500/include/mach/msp.h b/arch/arm/mach-ux500/include/mach/msp.h index 798be19129ef..3cc7142eee02 100644 --- a/arch/arm/mach-ux500/include/mach/msp.h +++ b/arch/arm/mach-ux500/include/mach/msp.h | |||
@@ -22,8 +22,6 @@ struct msp_i2s_platform_data { | |||
22 | enum msp_i2s_id id; | 22 | enum msp_i2s_id id; |
23 | struct stedma40_chan_cfg *msp_i2s_dma_rx; | 23 | struct stedma40_chan_cfg *msp_i2s_dma_rx; |
24 | struct stedma40_chan_cfg *msp_i2s_dma_tx; | 24 | struct stedma40_chan_cfg *msp_i2s_dma_tx; |
25 | int (*msp_i2s_init) (void); | ||
26 | int (*msp_i2s_exit) (void); | ||
27 | }; | 25 | }; |
28 | 26 | ||
29 | #endif | 27 | #endif |
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h index 7914e5eaa9c7..6be4c4d2ab88 100644 --- a/arch/arm/mach-ux500/include/mach/setup.h +++ b/arch/arm/mach-ux500/include/mach/setup.h | |||
@@ -45,4 +45,7 @@ extern struct sys_timer ux500_timer; | |||
45 | .type = MT_MEMORY, \ | 45 | .type = MT_MEMORY, \ |
46 | } | 46 | } |
47 | 47 | ||
48 | extern struct smp_operations ux500_smp_ops; | ||
49 | extern void ux500_cpu_die(unsigned int cpu); | ||
50 | |||
48 | #endif /* __ASM_ARCH_SETUP_H */ | 51 | #endif /* __ASM_ARCH_SETUP_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h index 34775baadaea..d60ecd1753f0 100644 --- a/arch/arm/mach-ux500/include/mach/uncompress.h +++ b/arch/arm/mach-ux500/include/mach/uncompress.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/amba/serial.h> | 24 | #include <linux/amba/serial.h> |
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | 26 | ||
27 | u32 ux500_uart_base; | 27 | void __iomem *ux500_uart_base; |
28 | 28 | ||
29 | static void putc(const char c) | 29 | static void putc(const char c) |
30 | { | 30 | { |
@@ -51,7 +51,7 @@ static void flush(void) | |||
51 | static inline void arch_decomp_setup(void) | 51 | static inline void arch_decomp_setup(void) |
52 | { | 52 | { |
53 | /* Use machine_is_foo() macro if you need to switch base someday */ | 53 | /* Use machine_is_foo() macro if you need to switch base someday */ |
54 | ux500_uart_base = U8500_UART2_BASE; | 54 | ux500_uart_base = (void __iomem *)U8500_UART2_BASE; |
55 | } | 55 | } |
56 | 56 | ||
57 | #define arch_decomp_wdog() /* nothing to do here */ | 57 | #define arch_decomp_wdog() /* nothing to do here */ |
diff --git a/arch/arm/mach-ux500/include/mach/usb.h b/arch/arm/mach-ux500/include/mach/usb.h deleted file mode 100644 index 4c1cc50a595a..000000000000 --- a/arch/arm/mach-ux500/include/mach/usb.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2011 | ||
3 | * | ||
4 | * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | #ifndef __ASM_ARCH_USB_H | ||
8 | #define __ASM_ARCH_USB_H | ||
9 | |||
10 | #include <linux/dmaengine.h> | ||
11 | |||
12 | #define UX500_MUSB_DMA_NUM_RX_CHANNELS 8 | ||
13 | #define UX500_MUSB_DMA_NUM_TX_CHANNELS 8 | ||
14 | |||
15 | struct ux500_musb_board_data { | ||
16 | void **dma_rx_param_array; | ||
17 | void **dma_tx_param_array; | ||
18 | u32 num_rx_channels; | ||
19 | u32 num_tx_channels; | ||
20 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
21 | }; | ||
22 | |||
23 | void ux500_add_usb(struct device *parent, resource_size_t base, | ||
24 | int irq, int *dma_rx_cfg, int *dma_tx_cfg); | ||
25 | #endif | ||
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index da1d5ad5bd45..3db7782f3afb 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c | |||
@@ -28,12 +28,6 @@ | |||
28 | extern void u8500_secondary_startup(void); | 28 | extern void u8500_secondary_startup(void); |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * control for which core is the next to come out of the secondary | ||
32 | * boot "holding pen" | ||
33 | */ | ||
34 | volatile int pen_release = -1; | ||
35 | |||
36 | /* | ||
37 | * Write pen_release in a way that is guaranteed to be visible to all | 31 | * Write pen_release in a way that is guaranteed to be visible to all |
38 | * observers, irrespective of whether they're taking part in coherency | 32 | * observers, irrespective of whether they're taking part in coherency |
39 | * or not. This is necessary for the hotplug code to work reliably. | 33 | * or not. This is necessary for the hotplug code to work reliably. |
@@ -48,7 +42,7 @@ static void write_pen_release(int val) | |||
48 | 42 | ||
49 | static void __iomem *scu_base_addr(void) | 43 | static void __iomem *scu_base_addr(void) |
50 | { | 44 | { |
51 | if (cpu_is_u8500_family()) | 45 | if (cpu_is_u8500_family() || cpu_is_ux540_family()) |
52 | return __io_address(U8500_SCU_BASE); | 46 | return __io_address(U8500_SCU_BASE); |
53 | else | 47 | else |
54 | ux500_unknown_soc(); | 48 | ux500_unknown_soc(); |
@@ -58,7 +52,7 @@ static void __iomem *scu_base_addr(void) | |||
58 | 52 | ||
59 | static DEFINE_SPINLOCK(boot_lock); | 53 | static DEFINE_SPINLOCK(boot_lock); |
60 | 54 | ||
61 | void __cpuinit platform_secondary_init(unsigned int cpu) | 55 | static void __cpuinit ux500_secondary_init(unsigned int cpu) |
62 | { | 56 | { |
63 | /* | 57 | /* |
64 | * if any interrupts are already enabled for the primary | 58 | * if any interrupts are already enabled for the primary |
@@ -80,7 +74,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
80 | spin_unlock(&boot_lock); | 74 | spin_unlock(&boot_lock); |
81 | } | 75 | } |
82 | 76 | ||
83 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 77 | static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *idle) |
84 | { | 78 | { |
85 | unsigned long timeout; | 79 | unsigned long timeout; |
86 | 80 | ||
@@ -118,7 +112,7 @@ static void __init wakeup_secondary(void) | |||
118 | { | 112 | { |
119 | void __iomem *backupram; | 113 | void __iomem *backupram; |
120 | 114 | ||
121 | if (cpu_is_u8500_family()) | 115 | if (cpu_is_u8500_family() || cpu_is_ux540_family()) |
122 | backupram = __io_address(U8500_BACKUPRAM0_BASE); | 116 | backupram = __io_address(U8500_BACKUPRAM0_BASE); |
123 | else | 117 | else |
124 | ux500_unknown_soc(); | 118 | ux500_unknown_soc(); |
@@ -145,7 +139,7 @@ static void __init wakeup_secondary(void) | |||
145 | * Initialise the CPU possible map early - this describes the CPUs | 139 | * Initialise the CPU possible map early - this describes the CPUs |
146 | * which may be present or become present in the system. | 140 | * which may be present or become present in the system. |
147 | */ | 141 | */ |
148 | void __init smp_init_cpus(void) | 142 | static void __init ux500_smp_init_cpus(void) |
149 | { | 143 | { |
150 | void __iomem *scu_base = scu_base_addr(); | 144 | void __iomem *scu_base = scu_base_addr(); |
151 | unsigned int i, ncores; | 145 | unsigned int i, ncores; |
@@ -165,9 +159,19 @@ void __init smp_init_cpus(void) | |||
165 | set_smp_cross_call(gic_raise_softirq); | 159 | set_smp_cross_call(gic_raise_softirq); |
166 | } | 160 | } |
167 | 161 | ||
168 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) | 162 | static void __init ux500_smp_prepare_cpus(unsigned int max_cpus) |
169 | { | 163 | { |
170 | 164 | ||
171 | scu_enable(scu_base_addr()); | 165 | scu_enable(scu_base_addr()); |
172 | wakeup_secondary(); | 166 | wakeup_secondary(); |
173 | } | 167 | } |
168 | |||
169 | struct smp_operations ux500_smp_ops __initdata = { | ||
170 | .smp_init_cpus = ux500_smp_init_cpus, | ||
171 | .smp_prepare_cpus = ux500_smp_prepare_cpus, | ||
172 | .smp_secondary_init = ux500_secondary_init, | ||
173 | .smp_boot_secondary = ux500_boot_secondary, | ||
174 | #ifdef CONFIG_HOTPLUG_CPU | ||
175 | .cpu_die = ux500_cpu_die, | ||
176 | #endif | ||
177 | }; | ||
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index 66e7f00884ab..6f39731951b0 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c | |||
@@ -54,7 +54,7 @@ static void __init ux500_timer_init(void) | |||
54 | void __iomem *tmp_base; | 54 | void __iomem *tmp_base; |
55 | struct device_node *np; | 55 | struct device_node *np; |
56 | 56 | ||
57 | if (cpu_is_u8500_family()) { | 57 | if (cpu_is_u8500_family() || cpu_is_ux540_family()) { |
58 | mtu_timer_base = __io_address(U8500_MTU0_BASE); | 58 | mtu_timer_base = __io_address(U8500_MTU0_BASE); |
59 | prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); | 59 | prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); |
60 | } else { | 60 | } else { |
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index a74af389bc63..145482e74418 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <plat/ste_dma40.h> | 11 | #include <plat/ste_dma40.h> |
12 | #include <mach/hardware.h> | 12 | #include <mach/hardware.h> |
13 | #include <mach/usb.h> | 13 | #include <linux/platform_data/usb-musb-ux500.h> |
14 | 14 | ||
15 | #define MUSB_DMA40_RX_CH { \ | 15 | #define MUSB_DMA40_RX_CH { \ |
16 | .mode = STEDMA40_MODE_LOGICAL, \ | 16 | .mode = STEDMA40_MODE_LOGICAL, \ |