24 Apr, 2018

1 commit

  • commit 73ce2ce129783813e1ebc37d2c757fe5e0fab1ef upstream.

    Fix the pointer to struct scp_subdomian not being moved forward
    when each sub-domain is expected to be iteratively added through
    pm_genpd_add_subdomain call.

    Cc: stable@vger.kernel.org
    Fixes: 53fddb1a66dd ("soc: mediatek: reduce code duplication of scpsys_probe across all SoCs")
    Reported-by: Weiyi Lu
    Signed-off-by: Sean Wang
    Signed-off-by: Matthias Brugger
    Signed-off-by: Greg Kroah-Hartman

    Sean Wang
     

20 Dec, 2017

1 commit

  • [ Upstream commit fb2c1934f30577756e55e24e8870b45c78da3bc2 ]

    When compiling using sparse, we got the following error:
    drivers/soc/mediatek/mtk-pmic-wrap.c:686:25: error: dubious one-bit signed bitfield

    Changing the data type to unsigned fixes this.

    Signed-off-by: Matthias Brugger
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Matthias Brugger
     

19 Aug, 2017

1 commit

  • Pull "arm: mediatek: soc updates for v4.14" from Matthias Brugger:

    - add mt7623a smp support
    - scpsys: reduce code duplication
    - scpsys: add mt7622 support
    - pmic wrapper: make of_device_ids constant

    * tag 'v4.13-next-soc' of https://github.com/mbgg/linux-mediatek:
    soc: mediatek: add SCPSYS power domain driver for MediaTek MT7622 SoC
    soc: mediatek: add header files required for MT7622 SCPSYS dt-binding
    soc: mediatek: reduce code duplication of scpsys_probe across all SoCs
    dt-bindings: soc: update the binding document for SCPSYS on MediaTek MT7622 SoC
    soc: mtk-pmic-wrap: make of_device_ids const.
    ARM: mediatek: add MT7623a smp bringup code

    Arnd Bergmann
     

17 Aug, 2017

1 commit

  • Now that we have a custom printf format specifier, convert users of
    full_name to use %pOF instead. This is preparation to remove storing
    of the full path string for each node.

    Signed-off-by: Rob Herring
    Acked-by: Krzysztof Kozlowski
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Matthias Brugger
    Acked-by: Simon Horman
    Cc: Scott Wood
    Cc: Qiang Zhao
    Cc: Magnus Damm
    Cc: Kukjin Kim
    Cc: Javier Martinez Canillas
    Signed-off-by: Arnd Bergmann

    Rob Herring
     

14 Aug, 2017

2 commits

  • Add SCPSYS power domain driver for MT7622 SoC having four power domains
    which are respectively ETHSYS for Ethernet including embedded switch,
    WBSYS for WIFI and Bluetooth, HIF0SYS for PCI-E and SATA, and HIF1SYS for
    USB. Those functions could be selectively powered gated when the
    corresponding function is no longer to use in order to reach more minimal
    power dissipation.

    Signed-off-by: Chen Zhong
    Signed-off-by: Sean Wang
    Reviewed-by: Ulf Hansson
    Signed-off-by: Matthias Brugger

    Sean Wang
     
  • Reduce code duplication of scpsys_probe_mtXXXX across all SoCs using
    the more generic scpsys_probe all covering all cases to avoid starting
    to bloat the driver when more MediaTek SoCs supported are added.

    Suggested-by: Matthias Brugger
    Signed-off-by: Sean Wang
    Reviewed-by: Ulf Hansson
    Signed-off-by: Matthias Brugger

    Sean Wang
     

02 Aug, 2017

1 commit


15 May, 2017

5 commits


31 Oct, 2016

2 commits


23 Aug, 2016

1 commit


19 May, 2016

2 commits

  • On ARM64, the mtk-pmic-wrap driver causes a harmless warning:

    mtk-pmic-wrap.c:1062:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    mtk-pmic-wrap.c:1074:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    mtk-pmic-wrap.c:1086:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    .int_en_all = ~(BIT(31) | BIT(1)),

    The problem is that the result of the BIT() macro is an 'unsigned long',
    so taking the bitwise NOT operation of that results in an integer
    with the upper 32 bits all set and that cannot be assigned to a
    'u32' variable without loss of information.

    This is harmless because we were never interested in the upper bits
    here anyway, so we can shut up the warning by adding a simple cast
    to 'u32'.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • Pull ARM SoC driver updates from Arnd Bergmann:
    "Driver updates for ARM SoCs, these contain various things that touch
    the drivers/ directory but got merged through arm-soc for practical
    reasons.

    For the most part, this is now related to power management
    controllers, which have not yet been abstracted into a separate
    subsystem, and typically require some code in drivers/soc or arch/arm
    to control the power domains.

    Another large chunk here is a rework of the NVIDIA Tegra USB3.0
    support, which was surprisingly tricky and took a long time to get
    done.

    Finally, reset controller handling as always gets merged through here
    as well"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
    arm-ccn: Enable building as module
    soc/tegra: pmc: Add generic PM domain support
    usb: xhci: tegra: Add Tegra210 support
    usb: xhci: Add NVIDIA Tegra XUSB controller driver
    dt-bindings: usb: xhci-tegra: Add Tegra210 XUSB controller support
    dt-bindings: usb: Add NVIDIA Tegra XUSB controller binding
    PCI: tegra: Support per-lane PHYs
    dt-bindings: pci: tegra: Update for per-lane PHYs
    phy: tegra: Add Tegra210 support
    phy: Add Tegra XUSB pad controller support
    dt-bindings: phy: tegra-xusb-padctl: Add Tegra210 support
    dt-bindings: phy: Add NVIDIA Tegra XUSB pad controller binding
    phy: core: Allow children node to be overridden
    clk: tegra: Add interface to enable hardware control of SATA/XUSB PLLs
    drivers: firmware: psci: make two helper functions inline
    soc: renesas: rcar-sysc: Add support for R-Car H3 power areas
    soc: renesas: rcar-sysc: Add support for R-Car E2 power areas
    soc: renesas: rcar-sysc: Add support for R-Car M2-N power areas
    soc: renesas: rcar-sysc: Add support for R-Car M2-W power areas
    soc: renesas: rcar-sysc: Add support for R-Car H2 power areas
    ...

    Linus Torvalds
     

20 Apr, 2016

10 commits


13 Apr, 2016

1 commit

  • This reverts commit cc8ed76938b5cf6a54ab3d60edabaf808dc960d1
    ("soc: mediatek: SCPSYS: Fix double enabling of regulators") [1].

    This patch fixes mt8173-evb failing boot issue. With commit [1],
    genpd state will not sync to real power domain state. So some
    resources such as clocks and regulators may stay in a wrong state.

    There is no regulator double enabling issue on mainline kernel, so
    we can refert commit [1] safely.

    Signed-off-by: James Liao
    Signed-off-by: Matthias Brugger

    James Liao
     

01 Feb, 2016

1 commit

  • With CONFIG_PM enabled do not call genpd->power_on manually as this
    will cause the regulators being turned on once in SCPSYS probe and
    then again when the genpd core turns on the domains. Instead, call
    genpd->power_on only with CONFIG_PM disabled and tell the genpd core
    that the domains are disabled when registered.

    Signed-off-by: Sascha Hauer
    Tested-by: Daniel Kurtz
    Reviewed-by: Daniel Kurtz
    Signed-off-by: Matthias Brugger

    Sascha Hauer
     

26 Jan, 2016

3 commits

  • SCPSYS can't be built as module. Use builtin_platform_driver instead.
    For this probe must not be __init and the data accessed can't be
    __initconst. Remove this macros. To make the impact as small as possible,
    fold scp_domain_data into scp_domain via a pointer.

    Cc: Sascha Hauer
    Cc: Arnd Bergmann
    Reported-by: Daniel Kurtz
    Signed-off-by: Matthias Brugger
    Reviewed-by: Daniel Kurtz
    Tested-by: Daniel Kurtz
    Acked-by: Arnd Bergmann

    Matthias Brugger
     
  • Since STAUPD interrupts aren't handled on mt8173, disable watchdog timeout
    monitor of STAUPD to avoid WDT_INT triggered by STAUPD.

    Signed-off-by: Henry Chen
    Reviewed-by: Daniel Kurtz
    Signed-off-by: Matthias Brugger

    Henry Chen
     
  • Sometimes PMIC is too busy to send data in time to cause pmic wrap timeout,
    because pmic wrap is waiting for FSM_VLDCLR after finishing WACS2_CMD. It
    just return error when issue happened, so the state machine will stay on
    FSM_VLDCLR state when data send back later by PMIC and timeout again in next
    time because pmic wrap waiting for FSM_IDLE state at the beginning of the
    read/write function.

    Clear the vldclr when timeout if state machine stay on FSM_VLDCLR.

    Signed-off-by: Henry Chen
    Tested-by: Ricky Liang
    Signed-off-by: Matthias Brugger

    Henry Chen
     

23 Dec, 2015

1 commit


18 Dec, 2015

2 commits

  • The Kconfig currently controlling compilation of this code is:

    drivers/soc/mediatek/Kconfig:config MTK_SCPSYS
    drivers/soc/mediatek/Kconfig: bool "MediaTek SCPSYS Support"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple traces of modularity so that when reading the
    driver there is no doubt it is builtin-only.

    Since module_platform_driver() uses the same init level priority as
    builtin_platform_driver() the init ordering remains unchanged with
    this commit.

    Cc: Matthias Brugger
    Cc: Sascha Hauer
    Cc: Daniel Kurtz
    Cc: Paul Gortmaker
    Cc: Olof Johansson
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-mediatek@lists.infradead.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Matthias Brugger

    Paul Gortmaker
     
  • The power domains are supplied by regulators. Add support for them so
    that the regulators are properly turned on before a domain is powered up
    and turned off when a domain is powered down.

    Signed-off-by: Sascha Hauer
    Signed-off-by: Matthias Brugger

    Sascha Hauer
     

25 Nov, 2015

1 commit


14 Oct, 2015

1 commit

  • In kernel late init, it turns off all unused clocks, which
    needs to access subsystem registers such as VENC and VENC_LT.

    Accessing MT8173 VENC registers needs two top clocks, mm_sel and
    venc_sel. Accessing VENC_LT registers needs mm_sel and venclt_sel.
    So we need to keep these clocks on before accessing their registers.

    This patch keeps venc_sel / venclt_sel clock on when
    VENC / VENC_LT's power is on, to prevent system hang up while
    accessing its registeres.

    Signed-off-by: James Liao
    Signed-off-by: Matthias Brugger

    James Liao
     

27 Sep, 2015

2 commits


05 Aug, 2015

1 commit