diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-19 20:13:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-19 20:13:56 -0400 |
commit | 8362fd64f07eaef7155c94fca8dee91c4f99a666 (patch) | |
tree | 2d16af7d7b8cbb5765727493f796d453580fc107 /arch/arm | |
parent | 24e44913aa746098349370a0f279733c0cadcba7 (diff) | |
parent | 8c0993621c3e5fa52e5425ef2a0f67a0cde07092 (diff) |
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC-related driver updates from Olof Johansson:
"Various driver updates for platforms and a couple of the small driver
subsystems we merge through our tree:
- A driver for SCU (system control) on NXP i.MX8QXP
- Qualcomm Always-on Subsystem messaging driver (AOSS QMP)
- Qualcomm PM support for MSM8998
- Support for a newer version of DRAM PHY driver for Broadcom (DPFE)
- Reset controller support for Bitmain BM1880
- TI SCI (System Control Interface) support for CPU control on AM654
processors
- More TI sysc refactoring and rework"
* tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (84 commits)
reset: remove redundant null check on pointer dev
soc: rockchip: work around clang warning
dt-bindings: reset: imx7: Fix the spelling of 'indices'
soc: imx: Add i.MX8MN SoC driver support
soc: aspeed: lpc-ctrl: Fix probe error handling
soc: qcom: geni: Add support for ACPI
firmware: ti_sci: Fix gcc unused-but-set-variable warning
firmware: ti_sci: Use the correct style for SPDX License Identifier
soc: imx8: Use existing of_root directly
soc: imx8: Fix potential kernel dump in error path
firmware/psci: psci_checker: Park kthreads before stopping them
memory: move jedec_ddr.h from include/memory to drivers/memory/
memory: move jedec_ddr_data.c from lib/ to drivers/memory/
MAINTAINERS: Remove myself as qcom maintainer
soc: aspeed: lpc-ctrl: make parameter optional
soc: qcom: apr: Don't use reg for domain id
soc: qcom: fix QCOM_AOSS_QMP dependency and build errors
memory: tegra: Fix -Wunused-const-variable
firmware: tegra: Early resume BPMP
soc/tegra: Select pinctrl for Tegra194
...
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pdata-quirks.c | 60 |
2 files changed, 65 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e0350476feaa..203664c40d3d 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -3442,6 +3442,7 @@ static int omap_hwmod_check_module(struct device *dev, | |||
3442 | * @dev: struct device | 3442 | * @dev: struct device |
3443 | * @oh: module | 3443 | * @oh: module |
3444 | * @sysc_fields: sysc register bits | 3444 | * @sysc_fields: sysc register bits |
3445 | * @clockdomain: clockdomain | ||
3445 | * @rev_offs: revision register offset | 3446 | * @rev_offs: revision register offset |
3446 | * @sysc_offs: sysconfig register offset | 3447 | * @sysc_offs: sysconfig register offset |
3447 | * @syss_offs: sysstatus register offset | 3448 | * @syss_offs: sysstatus register offset |
@@ -3453,6 +3454,7 @@ static int omap_hwmod_check_module(struct device *dev, | |||
3453 | static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, | 3454 | static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, |
3454 | const struct ti_sysc_module_data *data, | 3455 | const struct ti_sysc_module_data *data, |
3455 | struct sysc_regbits *sysc_fields, | 3456 | struct sysc_regbits *sysc_fields, |
3457 | struct clockdomain *clkdm, | ||
3456 | s32 rev_offs, s32 sysc_offs, | 3458 | s32 rev_offs, s32 sysc_offs, |
3457 | s32 syss_offs, u32 sysc_flags, | 3459 | s32 syss_offs, u32 sysc_flags, |
3458 | u32 idlemodes) | 3460 | u32 idlemodes) |
@@ -3460,8 +3462,6 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, | |||
3460 | struct omap_hwmod_class_sysconfig *sysc; | 3462 | struct omap_hwmod_class_sysconfig *sysc; |
3461 | struct omap_hwmod_class *class = NULL; | 3463 | struct omap_hwmod_class *class = NULL; |
3462 | struct omap_hwmod_ocp_if *oi = NULL; | 3464 | struct omap_hwmod_ocp_if *oi = NULL; |
3463 | struct clockdomain *clkdm = NULL; | ||
3464 | struct clk *clk = NULL; | ||
3465 | void __iomem *regs = NULL; | 3465 | void __iomem *regs = NULL; |
3466 | unsigned long flags; | 3466 | unsigned long flags; |
3467 | 3467 | ||
@@ -3508,36 +3508,6 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, | |||
3508 | oi->user = OCP_USER_MPU | OCP_USER_SDMA; | 3508 | oi->user = OCP_USER_MPU | OCP_USER_SDMA; |
3509 | } | 3509 | } |
3510 | 3510 | ||
3511 | if (!oh->_clk) { | ||
3512 | struct clk_hw_omap *hwclk; | ||
3513 | |||
3514 | clk = of_clk_get_by_name(dev->of_node, "fck"); | ||
3515 | if (!IS_ERR(clk)) | ||
3516 | clk_prepare(clk); | ||
3517 | else | ||
3518 | clk = NULL; | ||
3519 | |||
3520 | /* | ||
3521 | * Populate clockdomain based on dts clock. It is needed for | ||
3522 | * clkdm_deny_idle() and clkdm_allow_idle() until we have have | ||
3523 | * interconnect driver and reset driver capable of blocking | ||
3524 | * clockdomain idle during reset, enable and idle. | ||
3525 | */ | ||
3526 | if (clk) { | ||
3527 | hwclk = to_clk_hw_omap(__clk_get_hw(clk)); | ||
3528 | if (hwclk && hwclk->clkdm_name) | ||
3529 | clkdm = clkdm_lookup(hwclk->clkdm_name); | ||
3530 | } | ||
3531 | |||
3532 | /* | ||
3533 | * Note that we assume interconnect driver manages the clocks | ||
3534 | * and do not need to populate oh->_clk for dynamically | ||
3535 | * allocated modules. | ||
3536 | */ | ||
3537 | clk_unprepare(clk); | ||
3538 | clk_put(clk); | ||
3539 | } | ||
3540 | |||
3541 | spin_lock_irqsave(&oh->_lock, flags); | 3511 | spin_lock_irqsave(&oh->_lock, flags); |
3542 | if (regs) | 3512 | if (regs) |
3543 | oh->_mpu_rt_va = regs; | 3513 | oh->_mpu_rt_va = regs; |
@@ -3623,7 +3593,7 @@ int omap_hwmod_init_module(struct device *dev, | |||
3623 | u32 sysc_flags, idlemodes; | 3593 | u32 sysc_flags, idlemodes; |
3624 | int error; | 3594 | int error; |
3625 | 3595 | ||
3626 | if (!dev || !data) | 3596 | if (!dev || !data || !data->name || !cookie) |
3627 | return -EINVAL; | 3597 | return -EINVAL; |
3628 | 3598 | ||
3629 | oh = _lookup(data->name); | 3599 | oh = _lookup(data->name); |
@@ -3694,7 +3664,8 @@ int omap_hwmod_init_module(struct device *dev, | |||
3694 | return error; | 3664 | return error; |
3695 | 3665 | ||
3696 | return omap_hwmod_allocate_module(dev, oh, data, sysc_fields, | 3666 | return omap_hwmod_allocate_module(dev, oh, data, sysc_fields, |
3697 | rev_offs, sysc_offs, syss_offs, | 3667 | cookie->clkdm, rev_offs, |
3668 | sysc_offs, syss_offs, | ||
3698 | sysc_flags, idlemodes); | 3669 | sysc_flags, idlemodes); |
3699 | } | 3670 | } |
3700 | 3671 | ||
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index b0f8c9a70c68..6c6f8fce854e 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/platform_data/wkup_m3.h> | 26 | #include <linux/platform_data/wkup_m3.h> |
27 | #include <linux/platform_data/asoc-ti-mcbsp.h> | 27 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
28 | 28 | ||
29 | #include "clockdomain.h" | ||
29 | #include "common.h" | 30 | #include "common.h" |
30 | #include "common-board-devices.h" | 31 | #include "common-board-devices.h" |
31 | #include "control.h" | 32 | #include "control.h" |
@@ -460,6 +461,62 @@ static void __init dra7x_evm_mmc_quirk(void) | |||
460 | } | 461 | } |
461 | #endif | 462 | #endif |
462 | 463 | ||
464 | static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk) | ||
465 | { | ||
466 | struct clockdomain *clkdm = NULL; | ||
467 | struct clk_hw_omap *hwclk; | ||
468 | |||
469 | hwclk = to_clk_hw_omap(__clk_get_hw(clk)); | ||
470 | if (hwclk && hwclk->clkdm_name) | ||
471 | clkdm = clkdm_lookup(hwclk->clkdm_name); | ||
472 | |||
473 | return clkdm; | ||
474 | } | ||
475 | |||
476 | /** | ||
477 | * ti_sysc_clkdm_init - find clockdomain based on clock | ||
478 | * @fck: device functional clock | ||
479 | * @ick: device interface clock | ||
480 | * @dev: struct device | ||
481 | * | ||
482 | * Populate clockdomain based on clock. It is needed for | ||
483 | * clkdm_deny_idle() and clkdm_allow_idle() for blocking clockdomain | ||
484 | * clockdomain idle during reset, enable and idle. | ||
485 | * | ||
486 | * Note that we assume interconnect driver manages the clocks | ||
487 | * and do not need to populate oh->_clk for dynamically | ||
488 | * allocated modules. | ||
489 | */ | ||
490 | static int ti_sysc_clkdm_init(struct device *dev, | ||
491 | struct clk *fck, struct clk *ick, | ||
492 | struct ti_sysc_cookie *cookie) | ||
493 | { | ||
494 | if (fck) | ||
495 | cookie->clkdm = ti_sysc_find_one_clockdomain(fck); | ||
496 | if (cookie->clkdm) | ||
497 | return 0; | ||
498 | if (ick) | ||
499 | cookie->clkdm = ti_sysc_find_one_clockdomain(ick); | ||
500 | if (cookie->clkdm) | ||
501 | return 0; | ||
502 | |||
503 | return -ENODEV; | ||
504 | } | ||
505 | |||
506 | static void ti_sysc_clkdm_deny_idle(struct device *dev, | ||
507 | const struct ti_sysc_cookie *cookie) | ||
508 | { | ||
509 | if (cookie->clkdm) | ||
510 | clkdm_deny_idle(cookie->clkdm); | ||
511 | } | ||
512 | |||
513 | static void ti_sysc_clkdm_allow_idle(struct device *dev, | ||
514 | const struct ti_sysc_cookie *cookie) | ||
515 | { | ||
516 | if (cookie->clkdm) | ||
517 | clkdm_allow_idle(cookie->clkdm); | ||
518 | } | ||
519 | |||
463 | static int ti_sysc_enable_module(struct device *dev, | 520 | static int ti_sysc_enable_module(struct device *dev, |
464 | const struct ti_sysc_cookie *cookie) | 521 | const struct ti_sysc_cookie *cookie) |
465 | { | 522 | { |
@@ -491,6 +548,9 @@ static struct of_dev_auxdata omap_auxdata_lookup[]; | |||
491 | 548 | ||
492 | static struct ti_sysc_platform_data ti_sysc_pdata = { | 549 | static struct ti_sysc_platform_data ti_sysc_pdata = { |
493 | .auxdata = omap_auxdata_lookup, | 550 | .auxdata = omap_auxdata_lookup, |
551 | .init_clockdomain = ti_sysc_clkdm_init, | ||
552 | .clkdm_deny_idle = ti_sysc_clkdm_deny_idle, | ||
553 | .clkdm_allow_idle = ti_sysc_clkdm_allow_idle, | ||
494 | .init_module = omap_hwmod_init_module, | 554 | .init_module = omap_hwmod_init_module, |
495 | .enable_module = ti_sysc_enable_module, | 555 | .enable_module = ti_sysc_enable_module, |
496 | .idle_module = ti_sysc_idle_module, | 556 | .idle_module = ti_sysc_idle_module, |