diff options
author | Olof Johansson <olof@lixom.net> | 2017-06-18 23:46:30 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2017-06-18 23:46:30 -0400 |
commit | 2b1ee3061f09bd90a5c659b9cb45fcbf49c5fd4c (patch) | |
tree | 37fc6c42bc227468e0c60869fd60e59685726135 /arch/arm/mach-omap2/cm_common.c | |
parent | 6198c74939c085fbd31fab3ba6f1eb2ce2820b39 (diff) | |
parent | 1df5eaa6bced2d8a9de305d4a5f587adf57ddf35 (diff) |
Merge tag 'omap-for-v4.13/soc-v4-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
SoC changes for omap variants for v4.13 merge window:
- PM clean-up in preparation of adding am335x/am437x PM support
- Fixes for issues found by Coccinelle
- Legacy code removal now that everything boots in device
tree only mode
- Interconnect changes in preparation of moving clkctrl clocks
to be managed by clkctrl clock driver
- Interconnect changes to add omap4 crypto acceclerator
support
* tag 'omap-for-v4.13/soc-v4-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (27 commits)
ARM: OMAP4: hwmod_data: add SHAM crypto accelerator
ARM: OMAP4: hwmod data: add des
ARM: OMAP4: hwmod data: add aes2
ARM: OMAP4: hwmod data: add aes1
ARM: OMAP2+: Remove unused legacy code for n8x0
ARM: OMAP2+: Remove unused legacy code for watchdog
ARM: OMAP2+: Remove unused legacy code for interconnects
ARM: OMAP2+: Remove unused legacy code for PRM
ARM: OMAP2+: Remove unused legacy code for io.c
ARM: OMAP2+: Remove unused legacy code for McBSP
ARM: OMAP2+: SmartReflex: Delete an error message for a failed memory allocation in two functions
ARM: OMAP2+: Use kcalloc() in sr_set_nvalues()
ARM: OMAP2+: Improve a size determination in sr_dev_init()
ARM: OMAP2+: Delete an error message for a failed memory allocation in two functions
ARM: OMAP2+: Remove unused legacy code for device init
ARM: OMAP2+: Remove unused legacy code for PMU
ARM: OMAP2+: Remove unused legacy code for opp
ARM: OMAP2+: hwmod: populate clkctrl clocks for hwmods if available
ARM: OMAP4: cminst: add support for clkdm_xlate_address
ARM: omap2+: clockdomain: add clkdm_xlate_address
...
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-omap2/cm_common.c')
-rw-r--r-- | arch/arm/mach-omap2/cm_common.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c index bbe41f4c9dc8..d555791cf349 100644 --- a/arch/arm/mach-omap2/cm_common.c +++ b/arch/arm/mach-omap2/cm_common.c | |||
@@ -32,10 +32,10 @@ static struct cm_ll_data null_cm_ll_data; | |||
32 | static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; | 32 | static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; |
33 | 33 | ||
34 | /* cm_base: base virtual address of the CM IP block */ | 34 | /* cm_base: base virtual address of the CM IP block */ |
35 | void __iomem *cm_base; | 35 | struct omap_domain_base cm_base; |
36 | 36 | ||
37 | /* cm2_base: base virtual address of the CM2 IP block (OMAP44xx only) */ | 37 | /* cm2_base: base virtual address of the CM2 IP block (OMAP44xx only) */ |
38 | void __iomem *cm2_base; | 38 | struct omap_domain_base cm2_base; |
39 | 39 | ||
40 | #define CM_NO_CLOCKS 0x1 | 40 | #define CM_NO_CLOCKS 0x1 |
41 | #define CM_SINGLE_INSTANCE 0x2 | 41 | #define CM_SINGLE_INSTANCE 0x2 |
@@ -49,8 +49,8 @@ void __iomem *cm2_base; | |||
49 | */ | 49 | */ |
50 | void __init omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2) | 50 | void __init omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2) |
51 | { | 51 | { |
52 | cm_base = cm; | 52 | cm_base.va = cm; |
53 | cm2_base = cm2; | 53 | cm2_base.va = cm2; |
54 | } | 54 | } |
55 | 55 | ||
56 | /** | 56 | /** |
@@ -315,27 +315,34 @@ int __init omap2_cm_base_init(void) | |||
315 | struct device_node *np; | 315 | struct device_node *np; |
316 | const struct of_device_id *match; | 316 | const struct of_device_id *match; |
317 | struct omap_prcm_init_data *data; | 317 | struct omap_prcm_init_data *data; |
318 | void __iomem *mem; | 318 | struct resource res; |
319 | int ret; | ||
320 | struct omap_domain_base *mem = NULL; | ||
319 | 321 | ||
320 | for_each_matching_node_and_match(np, omap_cm_dt_match_table, &match) { | 322 | for_each_matching_node_and_match(np, omap_cm_dt_match_table, &match) { |
321 | data = (struct omap_prcm_init_data *)match->data; | 323 | data = (struct omap_prcm_init_data *)match->data; |
322 | 324 | ||
323 | mem = of_iomap(np, 0); | 325 | ret = of_address_to_resource(np, 0, &res); |
324 | if (!mem) | 326 | if (ret) |
325 | return -ENOMEM; | 327 | return ret; |
326 | 328 | ||
327 | if (data->index == TI_CLKM_CM) | 329 | if (data->index == TI_CLKM_CM) |
328 | cm_base = mem + data->offset; | 330 | mem = &cm_base; |
329 | 331 | ||
330 | if (data->index == TI_CLKM_CM2) | 332 | if (data->index == TI_CLKM_CM2) |
331 | cm2_base = mem + data->offset; | 333 | mem = &cm2_base; |
334 | |||
335 | data->mem = ioremap(res.start, resource_size(&res)); | ||
332 | 336 | ||
333 | data->mem = mem; | 337 | if (mem) { |
338 | mem->pa = res.start + data->offset; | ||
339 | mem->va = data->mem + data->offset; | ||
340 | } | ||
334 | 341 | ||
335 | data->np = np; | 342 | data->np = np; |
336 | 343 | ||
337 | if (data->init && (data->flags & CM_SINGLE_INSTANCE || | 344 | if (data->init && (data->flags & CM_SINGLE_INSTANCE || |
338 | (cm_base && cm2_base))) | 345 | (cm_base.va && cm2_base.va))) |
339 | data->init(data); | 346 | data->init(data); |
340 | } | 347 | } |
341 | 348 | ||