linux-2.6-microblaze.git
3 years agoMerge tag 'memory-controller-drv-tegra-5.13' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Thu, 8 Apr 2021 15:47:49 +0000 (17:47 +0200)]
Merge tag 'memory-controller-drv-tegra-5.13' of git://git./linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers

Memory controller drivers for v5.13 - Tegra SoC

1. Few cleanups.
2. Add debug statistics to Tegra20 memory controller.
3. Update bindings and convert to dtschema.  This update is not
   backwards compatible (ABI break) however the broken part was added
   recently (v5.11) and there are no users of it yet.

* tag 'memory-controller-drv-tegra-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  dt-bindings: memory: tegra20: mc: Convert to schema
  dt-bindings: memory: tegra124: emc: Replace core regulator with power domain
  dt-bindings: memory: tegra30: emc: Replace core regulator with power domain
  dt-bindings: memory: tegra20: emc: Replace core regulator with power domain
  memory: tegra: Print out info-level once per driver probe
  memory: tegra20: Protect debug code with a lock
  memory: tegra20: Correct comment to MC_STAT registers writes
  memory: tegra20: Add debug statistics
  memory: tegra: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

Link: https://lore.kernel.org/r/20210407161333.73013-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'memory-controller-drv-5.13' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 8 Apr 2021 15:46:21 +0000 (17:46 +0200)]
Merge tag 'memory-controller-drv-5.13' of git://git./linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers

Memory controller drivers for v5.13

1. OMAP: fix unlikely but possible out of bounds read.
2. PL353: fix mask used in setting ECC page_size in config register.
3. Minor cleanup: Freescale Corenet.

* tag 'memory-controller-drv-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: pl353: fix mask of ECC page_size config register
  memory: fsl-corenet-cf: Remove redundant dev_err call in ccf_probe()
  memory: gpmc: fix out of bounds read and dereference on gpmc_cs[]

Link: https://lore.kernel.org/r/20210407161333.73013-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'v5.12-next-soc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthia...
Arnd Bergmann [Thu, 8 Apr 2021 15:45:28 +0000 (17:45 +0200)]
Merge tag 'v5.12-next-soc.2' of git://git./linux/kernel/git/matthias.bgg/linux into arm/drivers

MT8167:
- add support for mmsys subsystem

* tag 'v5.12-next-soc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux:
  soc: mediatek: mmsys: Add support for MT8167 SoC
  dt-bindings: mediatek: mmsys: add mt8167 binding

Link: https://lore.kernel.org/r/14104322-3a6c-e8eb-cd21-a5343a81aa0f@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'socfpga_update_for_v5.13_part2' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Thu, 8 Apr 2021 15:44:14 +0000 (17:44 +0200)]
Merge tag 'socfpga_update_for_v5.13_part2' of git://git./linux/kernel/git/dinguyen/linux into arm/drivers

SoCFPGA updates for v5.13, part 2
- Only build Stratix10 Service Layer and RSU drivers on ARM64

* tag 'socfpga_update_for_v5.13_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  firmware: stratix10-svc: build only on 64-bit ARM

Link: https://lore.kernel.org/r/20210405155026.86309-1-dinguyen@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'qcom-drivers-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Thu, 8 Apr 2021 15:41:52 +0000 (17:41 +0200)]
Merge tag 'qcom-drivers-for-5.13' of git://git./linux/kernel/git/qcom/linux into arm/drivers

Qualcomm driver updates for 5.13

This introduces SC7280 and SM8350 support in the RPMH power-domain
driver, SC7280 support to the LLCC driver, SC7280 support tot he AOSS
QMP driver, cleanups to the RPMH driver and a few smaller fixes to the
SMEM, QMI and EBI2 drivers.

* tag 'qcom-drivers-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  bus: qcom: Put child node before return
  dt-bindings: firmware: scm: Add sc7280 support
  soc: qcom: rpmh-rsc: Fold WARN_ON() into if condition
  soc: qcom: rpmh-rsc: Loop over fewer bits in irq handler
  soc: qcom: rpmh-rsc: Remove tcs_is_free() API
  soc: qcom: smem: Update max processor count
  soc: qcom: aoss: Add AOSS QMP support for SC7280
  dt-bindings: soc: qcom: aoss: Add SC7280 compatible
  soc: qcom: llcc: Add configuration data for SC7280
  dt-bindings: arm: msm: Add LLCC for SC7280
  soc: qcom: Fix typos in the file qmi_encdec.c
  soc: qcom: rpmhpd: Add sc7280 powerdomains
  dt-bindings: power: rpmpd: Add sc7280 to rpmpd binding
  soc: qcom: rpmhpd: Add SM8350 power domains
  dt-bindings: power: Add rpm power domain bindings for SM8350

Link: https://lore.kernel.org/r/20210404164951.713045-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'scmi-updates-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep...
Arnd Bergmann [Thu, 8 Apr 2021 15:38:20 +0000 (17:38 +0200)]
Merge tag 'scmi-updates-5.13' of git://git./linux/kernel/git/sudeep.holla/linux into arm/drivers

ARM SCMI updates for v5.13

The major and big addition this time is to support modularisation of
individual SCMI protocols thus enabling to add support for vendors'
custom SCMI protocol. This changes the interface provided by the SCMI
driver to all the users of SCMI and hence involved changes in various
other subsystem SCMI drivers. The change has been split with a bit of
transient code to preserve bisectability and avoiding one big patch bomb
changing all the users.

This also includes SCMI IIO driver(pulled from IIO tree) and support for
per-cpu DVFS.

* tag 'scmi-updates-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (41 commits)
  firmware: arm_scmi: Add dynamic scmi devices creation
  firmware: arm_scmi: Add protocol modularization support
  firmware: arm_scmi: Rename non devres notify_ops
  firmware: arm_scmi: Make notify_priv really private
  firmware: arm_scmi: Cleanup events registration transient code
  firmware: arm_scmi: Cleanup unused core transfer helper wrappers
  firmware: arm_scmi: Cleanup legacy protocol init code
  firmware: arm_scmi: Make references to handle const
  firmware: arm_scmi: Remove legacy scmi_voltage_ops protocol interface
  regulator: scmi: Port driver to the new scmi_voltage_proto_ops interface
  firmware: arm_scmi: Port voltage protocol to new protocols interface
  firmware: arm_scmi: Port systempower protocol to new protocols interface
  firmware: arm_scmi: Remove legacy scmi_sensor_ops protocol interface
  iio/scmi: Port driver to the new scmi_sensor_proto_ops interface
  hwmon: (scmi) port driver to the new scmi_sensor_proto_ops interface
  firmware: arm_scmi: Port sensor protocol to new protocols interface
  firmware: arm_scmi: Remove legacy scmi_reset_ops protocol interface
  reset: reset-scmi: Port driver to the new scmi_reset_proto_ops interface
  firmware: arm_scmi: Port reset protocol to new protocols interface
  firmware: arm_scmi: Remove legacy scmi_clk_ops protocol interface
  ...

Link: https://lore.kernel.org/r/20210331100657.ilu63i4swnr3zp4e@bogus
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agosoc: mediatek: mmsys: Add support for MT8167 SoC
Fabien Parent [Mon, 5 Apr 2021 20:03:53 +0000 (22:03 +0200)]
soc: mediatek: mmsys: Add support for MT8167 SoC

Add routing table for DSI on MT8167 SoC. The registers are mostly
incompatible with the current defines, so new one for MT8167 are added.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Link: https://lore.kernel.org/r/20210405200354.2194930-2-fparent@baylibre.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agodt-bindings: mediatek: mmsys: add mt8167 binding
Fabien Parent [Mon, 5 Apr 2021 20:03:52 +0000 (22:03 +0200)]
dt-bindings: mediatek: mmsys: add mt8167 binding

Add binding documentation for MT8167 SoC.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210405200354.2194930-1-fparent@baylibre.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agomemory: pl353: fix mask of ECC page_size config register
gexueyuan [Wed, 31 Mar 2021 03:10:56 +0000 (11:10 +0800)]
memory: pl353: fix mask of ECC page_size config register

The mask for page size of ECC Configuration Register should be 0x3,
according to  the datasheet of PL353 smc.

Fixes: fee10bd22678 ("memory: pl353: Add driver for arm pl353 static memory controller")
Signed-off-by: gexueyuan <gexueyuan@gmail.com>
Link: https://lore.kernel.org/r/20210331031056.5326-1-gexueyuan@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agofirmware: stratix10-svc: build only on 64-bit ARM
Krzysztof Kozlowski [Sun, 21 Mar 2021 18:46:50 +0000 (19:46 +0100)]
firmware: stratix10-svc: build only on 64-bit ARM

The Stratix10 service layer and RCU drivers are useful only on
Stratix10, so on ARMv8.  Compile testing the RCU driver on 32-bit ARM
fails:

  drivers/firmware/stratix10-rsu.c: In function 'rsu_status_callback':
  include/linux/compiler_types.h:320:38: error: call to '__compiletime_assert_179'
    declared with attribute error: FIELD_GET: type of reg too small for mask
    _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
  ...
  drivers/firmware/stratix10-rsu.c:96:26: note: in expansion of macro 'FIELD_GET'
    priv->status.version = FIELD_GET(RSU_VERSION_MASK,

Fixes: 4483397b0353 ("ARM: socfpga: drop ARCH_SOCFPGA")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Richard Gong <richard.gong@linux.intel.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
v2: add Fixes tag

3 years agoMerge tag 'socfpga_update_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 1 Apr 2021 20:20:08 +0000 (22:20 +0200)]
Merge tag 'socfpga_update_for_v5.13' of git://git./linux/kernel/git/dinguyen/linux into arm/drivers

SoCFPGA updates for v5.13
- Patches from Krzysztof Kozlowski the cleans up and consolidate support for
  SoCFPGA platforms
- Rename ARCH_SOCFPGA into ARCH_INTEL_SOCFPGA
- Consolidate ARCH_STRATIX10 into ARCH_INTEL_SOCFPGA
- Consolidate ARCH_AGILEX into ARCH_INTEL_SOCFPGA
- Consolidate ARCH_N5X into ARCH_INTEL_SOCFPGA

* tag 'socfpga_update_for_v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  ARM: socfpga: drop ARCH_SOCFPGA
  reset: socfpga: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs
  i2c: altera: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs
  fpga: altera: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs
  dmaengine: socfpga: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs
  clk: socfpga: use ARCH_INTEL_SOCFPGA also for 32-bit ARM SoCs (and compile test)
  clk: socfpga: allow compile testing of Stratix 10 / Agilex clocks
  arm64: socfpga: merge Agilex and N5X into ARCH_INTEL_SOCFPGA
  EDAC: altera: merge ARCH_SOCFPGA and ARCH_STRATIX10
  clk: socfpga: merge ARCH_SOCFPGA and ARCH_STRATIX10
  clk: socfpga: build together Stratix 10, Agilex and N5X clock drivers
  net: stmmac: merge ARCH_SOCFPGA and ARCH_STRATIX10
  mfd: altera: merge ARCH_SOCFPGA and ARCH_STRATIX10
  ARM: socfpga: introduce common ARCH_INTEL_SOCFPGA
  clk: socfpga: allow building N5X clocks with ARCH_N5X

Link: https://lore.kernel.org/r/20210330110430.558182-1-dinguyen@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'v5.12-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias...
Arnd Bergmann [Thu, 1 Apr 2021 20:17:12 +0000 (22:17 +0200)]
Merge tag 'v5.12-next-soc' of git://git./linux/kernel/git/matthias.bgg/linux into arm/drivers

- add MT8183 support to mutex driver

MMSYS:
- use per SoC array to describe the possible routing
- add support for MT8183

Power management domains:
- fix the case of a domain fails to get added
- add names for each power domain to make debugging easier

PMIC wrapper:
- add support for PMIC wrapper with integrated arbiter
- add support for MT8192/MT6873

* tag 'v5.12-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux:
  soc: mediatek: pm-domains: Add a power domain names for mt8167
  soc: mediatek: pm-domains: Add a power domain names for mt8192
  soc: mediatek: pm-domains: Add a power domain names for mt8183
  soc: mediatek: pm-domains: Add a meaningful power domain name
  soc: mediatek: Make symbol 'mtk_mutex_driver' static
  soc: mediatek: mmsys: Add mt8183 mmsys routing table
  soc: mediatek: pwrap: add pwrap driver for MT6873/8192 SoCs
  dt-bindings: mediatek: add compatible for MT6873/8192 pwrap
  soc: mediatek: pwrap: add arbiter capability
  soc: mediatek: pwrap: use BIT() macro
  soc: mediatek: pm-domains: Fix missing error code in scpsys_add_subdomain()
  soc: mediatek: mmsys: Use an array for setting the routing registers
  soc: mediatek: mmsys: Create struct mtk_mmsys to store context data
  soc: mediatek: add mtk mutex support for MT8183

Link: https://lore.kernel.org/r/c47d4bdd-9e05-c0de-bacb-3a262fed936d@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'tegra-for-5.13-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
Arnd Bergmann [Thu, 1 Apr 2021 19:20:14 +0000 (21:20 +0200)]
Merge tag 'tegra-for-5.13-soc' of git://git./linux/kernel/git/tegra/linux into arm/drivers

soc/tegra: Changes for v5.13-rc1

Contains a couple of fixes to the PMC power domain implementation and
exports a regmap from PMC needed to implement USB sleepwalk support.

* tag 'tegra-for-5.13-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  soc/tegra: pmc: Print out domain name when reset fails to acquire
  soc/tegra: pmc: Ensure that clock rates aren't too high
  soc/tegra: pmc: Fix completion of power-gate toggling
  soc/tegra: pmc: Fix imbalanced clock disabling in error code path
  soc/tegra: regulators: Fix locking up when voltage-spread is out of range
  soc/tegra: pmc: Provide USB sleepwalk register map

Link: https://lore.kernel.org/r/20210401172622.3352990-3-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'tegra-for-5.13-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
Arnd Bergmann [Thu, 1 Apr 2021 19:14:01 +0000 (21:14 +0200)]
Merge tag 'tegra-for-5.13-clk' of git://git./linux/kernel/git/tegra/linux into arm/drivers

clk: tegra: Changes for v5.13-rc1

This adds PLLE HW sequencer support which is necessary for USB sleepwalk
functionality.

* tag 'tegra-for-5.13-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  clk: tegra: Don't enable PLLE HW sequencer at init
  clk: tegra: Add PLLE HW power sequencer control

Link: https://lore.kernel.org/r/20210401172622.3352990-2-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'imx-drivers-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/shawngu...
Arnd Bergmann [Thu, 1 Apr 2021 19:08:43 +0000 (21:08 +0200)]
Merge tag 'imx-drivers-5.13' of git://git./linux/kernel/git/shawnguo/linux into arm/drivers

i.MX drivers change for 5.13:

- Update SCU power domain driver to keep console domain power on.
- Add missing ADC1 power domain to SCU power domain driver.
- Update comments for single global power domain in SCU power domain
  driver.
- Add i.MX51/i.MX53 unique id support to i.MX SoC driver.

* tag 'imx-drivers-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  firmware: imx: scu-pd: add missed ADC1 pd
  firmware: imx: scu-pd: Update comments for single global power domain
  firmware: imx: scu-pd: do not power off console domain
  soc: imx: add i.MX51/i.MX53 unique id support

Link: https://lore.kernel.org/r/20210331041019.31345-1-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'arm-soc/for-5.13/drivers' of https://github.com/Broadcom/stblinux into...
Arnd Bergmann [Thu, 1 Apr 2021 19:07:46 +0000 (21:07 +0200)]
Merge tag 'arm-soc/for-5.13/drivers' of https://github.com/Broadcom/stblinux into arm/drivers

This pull request contains Broadcom ARM/ARM64/MIPS based SoCs drivers
changes for 5.13, please pull the following:

- Rafal updates the Broadcom PMB binding to support BCM63138 and updates
  the code to support resetting the 63138 SATA controller

* tag 'arm-soc/for-5.13/drivers' of https://github.com/Broadcom/stblinux:
  soc: bcm: bcm-pmb: add BCM63138 SATA support
  dt-bindings: power: bcm-pmb: add BCM63138 binding

Link: https://lore.kernel.org/r/20210330184006.1451315-3-f.fainelli@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'optee-memref-size-for-v5.13' of git://git.linaro.org/people/jens.wiklander...
Arnd Bergmann [Thu, 1 Apr 2021 19:01:18 +0000 (21:01 +0200)]
Merge tag 'optee-memref-size-for-v5.13' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers

OP-TEE skip check of returned memref size

* tag 'optee-memref-size-for-v5.13' of git://git.linaro.org/people/jens.wiklander/linux-tee:
  tee: optee: do not check memref size on return from Secure World

Link: https://lore.kernel.org/r/20210330110037.GA1166563@jade
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'omap-for-v5.13/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kerne...
Arnd Bergmann [Thu, 1 Apr 2021 18:59:59 +0000 (20:59 +0200)]
Merge tag 'omap-for-v5.13/ti-sysc-signed' of git://git./linux/kernel/git/tmlind/linux-omap into arm/drivers

Driver changes for omaps for genpd support for v5.13

In order to move omap4/5 and dra7 to probe with devicetree data and genpd,
we need to patch the related drivers to prepare.

These are mostly ti-sysc interconnect target module driver changes and soc
init changes. However, there are minor changes to other drivers too. There
are changes for pci-dra7xx probe, omap-prm idle configuration, and a omap5
clock change:

- ti-sysc needs iorange check improved when the interconnect target module
  has no control registers listed

- ti-sysc needs to probe l4_wkup and l4_cfg interconnects first to avoid
  issues with missing resources and unnecessary deferred probe

- ti-sysc debug option can now detect more devices

- ti-sysc now warns if an old incomplete devicetree data is found as we
  now rely on it being complete for am3 and 4

- soc init code needs to check for prcm and prm nodes for omap4/5 and
  dra7

- omap-prm driver needs to enable autoidle retention support for omap4

- omap5 clocks are missing gpmc and ocmc clock registers

- pci-dra7xx now needs to use builtin_platform_driver instead of using
  builtin_platform_driver_probe for deferred probe to work

There are also few minor non-urgent fixes:

- soc init code pdata_quirks_init_clocks should be static

- ti-sysc has few unneeded semiconon typos

- ti-sysc can use kzalloc instead of kcalloc for a single element

* tag 'omap-for-v5.13/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  bus: ti-sysc: Use kzalloc for allocating only one thing
  bus: ti-sysc: remove unneeded semicolon
  ARM: OMAP2+: Make symbol 'pdata_quirks_init_clocks' static
  PCI: pci-dra7xx: Prepare for deferred probe with module_platform_driver
  clk: ti: omap5: Add missing gpmc and ocmc clkctrl
  soc: ti: omap-prm: Allow hardware supported retention when idle
  ARM: OMAP2+: Init both prm and prcm nodes early for clocks
  bus: ti-sysc: Check for old incomplete dtb
  bus: ti-sysc: Detect more modules for debugging
  bus: ti-sysc: Probe for l4_wkup and l4_cfg interconnect devices first
  bus: ti-sysc: Fix initializing module_pa for modules without sysc register
  ARM: dts: Fix moving mmc devices with aliases for omap4 & 5
  ARM: dts: Drop duplicate sha2md5_fck to fix clk_disable race
  soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva
  bus: ti-sysc: Fix warning on unbind if reset is not deasserted
  ARM: OMAP2+: Fix smartreflex init regression after dropping legacy data
  soc: ti: omap-prm: Fix reboot issue with invalid pcie reset map for dra7
  ARM: dts: am33xx: add aliases for mmc interfaces
  bus: omap_l3_noc: mark l3 irqs as IRQF_NO_THREAD

Link: https://lore.kernel.org/r/pull-1617004205-537424@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'rpi-poe-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/nsaenz...
Arnd Bergmann [Thu, 1 Apr 2021 18:56:49 +0000 (20:56 +0200)]
Merge tag 'rpi-poe-v5.13' of git://git./linux/kernel/git/nsaenz/linux-rpi into arm/drivers

Raspberry Pi driver updates for v5.13:
  - Fix-up all RPi firmware drivers so as for unbind to happen in an
    orderly fashion
  - Support for RPi's PoE hat PWM bus

* tag 'rpi-poe-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi:
  pwm: Add Raspberry Pi Firmware based PWM bus
  dt-bindings: pwm: Add binding for RPi firmware PWM bus
  input: raspberrypi-ts: Release firmware handle when not needed
  staging: vchiq: Release firmware handle on unbind
  soc: bcm: raspberrypi-power: Release firmware handle on unbind
  reset: raspberrypi: Release firmware handle on unbind
  gpio: raspberrypi-exp: Release firmware handle on unbind
  clk: bcm: rpi: Release firmware handle on unbind
  firmware: raspberrypi: Introduce devm_rpi_firmware_get()
  firmware: raspberrypi: Keep count of all consumers

Link: https://lore.kernel.org/r/20210322174232.29549-1-nsaenz@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agodt-bindings: memory: tegra20: mc: Convert to schema
Dmitry Osipenko [Tue, 30 Mar 2021 23:04:43 +0000 (02:04 +0300)]
dt-bindings: memory: tegra20: mc: Convert to schema

Convert Tegra20 Memory Controller binding to schema.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210330230445.26619-5-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agodt-bindings: memory: tegra124: emc: Replace core regulator with power domain
Dmitry Osipenko [Tue, 30 Mar 2021 23:04:42 +0000 (02:04 +0300)]
dt-bindings: memory: tegra124: emc: Replace core regulator with power domain

Power domain fits much better than a voltage regulator in regards to
a proper hardware description and from a software perspective as well.
Hence replace the core regulator with the power domain. Note that this
doesn't affect any existing DTBs because we haven't started to use the
regulator yet, and thus, it's okay to change it.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210330230445.26619-4-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agodt-bindings: memory: tegra30: emc: Replace core regulator with power domain
Dmitry Osipenko [Tue, 30 Mar 2021 23:04:41 +0000 (02:04 +0300)]
dt-bindings: memory: tegra30: emc: Replace core regulator with power domain

Power domain fits much better than a voltage regulator in regards to
a proper hardware description and from a software perspective as well.
Hence replace the core regulator with the power domain. Note that this
doesn't affect any existing DTBs because we haven't started to use the
regulator yet, and thus, it's okay to change it.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210330230445.26619-3-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agodt-bindings: memory: tegra20: emc: Replace core regulator with power domain
Dmitry Osipenko [Tue, 30 Mar 2021 23:04:40 +0000 (02:04 +0300)]
dt-bindings: memory: tegra20: emc: Replace core regulator with power domain

Power domain fits much better than a voltage regulator in regards to
a proper hardware description and from a software perspective as well.
Hence replace the core regulator with the power domain. Note that this
doesn't affect any existing DTBs because we haven't started to use the
regulator yet, and thus, it's okay to change it.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210330230445.26619-2-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agomemory: tegra: Print out info-level once per driver probe
Dmitry Osipenko [Tue, 30 Mar 2021 23:04:45 +0000 (02:04 +0300)]
memory: tegra: Print out info-level once per driver probe

Probing of EMC drivers may be deferred and in this case we get duplicated
info messages during kernel boot. Use dev_info_once() helper to silence
the duplicated messages.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210330230445.26619-7-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agomemory: tegra20: Protect debug code with a lock
Dmitry Osipenko [Tue, 23 Mar 2021 21:04:46 +0000 (00:04 +0300)]
memory: tegra20: Protect debug code with a lock

Simultaneous accesses to MC_STAT h/w shouldn't be allowed since one
collection process stomps on another. There is no good reason for
polling stats in parallel in practice, nevertheless let's add a
protection lock, just for consistency.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210323210446.24867-2-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agomemory: tegra20: Correct comment to MC_STAT registers writes
Dmitry Osipenko [Tue, 23 Mar 2021 21:04:45 +0000 (00:04 +0300)]
memory: tegra20: Correct comment to MC_STAT registers writes

The code was changed multiple times and the comment to MC_STAT
registers writes became slightly outdated. The MC_STAT programming
now isn't hardcoded to the "bandwidth" mode, let's clarify this in
the comment.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210323210446.24867-1-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agomemory: tegra20: Add debug statistics
Dmitry Osipenko [Fri, 19 Mar 2021 13:09:33 +0000 (16:09 +0300)]
memory: tegra20: Add debug statistics

Add debug statistics collection support. The statistics is available
via debugfs in '/sys/kernel/debug/mc/stats', it shows percent of memory
controller utilization for each memory client. This information is
intended to help with debugging of memory performance issues, it already
was proven to be useful by helping to improve memory bandwidth management
of the display driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210319130933.23261-1-digetx@gmail.com
3 years agomemory: tegra: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE
Yang Li [Thu, 25 Feb 2021 09:05:58 +0000 (17:05 +0800)]
memory: tegra: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

Fix the following coccicheck warning:

  drivers/memory/tegra/tegra124-emc.c:1207:0-23: WARNING:
    tegra_emc_debug_min_rate_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1614243958-55847-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
3 years agomemory: fsl-corenet-cf: Remove redundant dev_err call in ccf_probe()
Qiheng Lin [Wed, 31 Mar 2021 09:32:44 +0000 (17:32 +0800)]
memory: fsl-corenet-cf: Remove redundant dev_err call in ccf_probe()

There is a error message within devm_ioremap_resource already, so remove
the dev_err call to avoid redundant error message.

Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Link: https://lore.kernel.org/r/20210331093244.3238-1-linqiheng@huawei.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
3 years agoMerge tag 'optee-tracepoints-fix-for-v5.13' of git://git.linaro.org/people/jens.wikla...
Arnd Bergmann [Thu, 1 Apr 2021 09:51:40 +0000 (11:51 +0200)]
Merge tag 'optee-tracepoints-fix-for-v5.13' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes

Fixes build error for recently added OP-TEE tracepoints

* tag 'optee-tracepoints-fix-for-v5.13' of git://git.linaro.org/people/jens.wiklander/linux-tee:
  tee: optee: fix build error caused by recent optee tracepoints feature

Link: https://lore.kernel.org/r/20210330082208.GA965793@jade
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agosoc: mediatek: pm-domains: Add a power domain names for mt8167
Enric Balletbo i Serra [Thu, 25 Feb 2021 17:50:00 +0000 (18:50 +0100)]
soc: mediatek: pm-domains: Add a power domain names for mt8167

Add the power domains names for the mt8167 SoC.

Fixes: 207f13b419a6 ("soc: mediatek: pm-domains: Add support for mt8167")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Link: https://lore.kernel.org/r/20210225175000.824661-4-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: pm-domains: Add a power domain names for mt8192
Enric Balletbo i Serra [Thu, 25 Feb 2021 17:49:59 +0000 (18:49 +0100)]
soc: mediatek: pm-domains: Add a power domain names for mt8192

Add the power domains names for the mt8192 SoC.

Fixes: a49d5e7a89d6 ("soc: mediatek: pm-domains: Add support for mt8192")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Link: https://lore.kernel.org/r/20210225175000.824661-3-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: pm-domains: Add a power domain names for mt8183
Enric Balletbo i Serra [Thu, 25 Feb 2021 17:49:58 +0000 (18:49 +0100)]
soc: mediatek: pm-domains: Add a power domain names for mt8183

Add the power domains names for the mt8183 SoC. This removes the debugfs
errors like the following:

  debugfs: Directory 'power-domain' with parent 'pm_genpd' already present!

Fixes: eb9fa767fbe1 ("soc: mediatek: pm-domains: Add support for mt8183")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Link: https://lore.kernel.org/r/20210225175000.824661-2-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: pm-domains: Add a meaningful power domain name
Enric Balletbo i Serra [Thu, 25 Feb 2021 17:49:57 +0000 (18:49 +0100)]
soc: mediatek: pm-domains: Add a meaningful power domain name

Add the power domains names to the power domain struct so we
have meaningful name for every power domain. This also removes the
following debugfs error message.

  [    2.242068] debugfs: Directory 'power-domain' with parent 'pm_genpd' already present!
  [    2.249949] debugfs: Directory 'power-domain' with parent 'pm_genpd' already present!
  [    2.257784] debugfs: Directory 'power-domain' with parent 'pm_genpd' already present!
  ...

Fixes: 59b644b01cf4 ("soc: mediatek: Add MediaTek SCPSYS power domains")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Link: https://lore.kernel.org/r/20210225175000.824661-1-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: Make symbol 'mtk_mutex_driver' static
Wei Yongjun [Wed, 10 Feb 2021 07:56:56 +0000 (07:56 +0000)]
soc: mediatek: Make symbol 'mtk_mutex_driver' static

The sparse tool complains as follows:

drivers/soc/mediatek/mtk-mutex.c:464:24: warning:
 symbol 'mtk_mutex_driver' was not declared. Should it be static?

This symbol is not used outside of mtk-mutex.c, so this
commit marks it static.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://lore.kernel.org/r/20210210075656.1096251-1-weiyongjun1@huawei.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: mmsys: Add mt8183 mmsys routing table
Hsin-Yi Wang [Tue, 30 Mar 2021 11:04:23 +0000 (19:04 +0800)]
soc: mediatek: mmsys: Add mt8183 mmsys routing table

mt8183 has different routing registers than mt8173.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210330110423.3542163-1-hsinyi@chromium.org
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agofirmware: arm_scmi: Add dynamic scmi devices creation
Cristian Marussi [Tue, 16 Mar 2021 12:49:03 +0000 (12:49 +0000)]
firmware: arm_scmi: Add dynamic scmi devices creation

Having added the support for SCMI protocols as modules in order to let
vendors extend the SCMI core with their own additions it seems odd to
then force SCMI drivers built on top to use a static device table to
declare their devices since this way any new SCMI drivers addition
would need the core SCMI device table to be updated too.

Remove the static core device table and let SCMI drivers to simply declare
which device/protocol pair they need at initialization time: the core will
then take care to generate such devices dynamically during platform
initialization or at module loading time, as long as the requested
underlying protocol is defined in the devicetree.

Link: https://lore.kernel.org/r/20210316124903.35011-39-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Add protocol modularization support
Cristian Marussi [Tue, 16 Mar 2021 12:49:02 +0000 (12:49 +0000)]
firmware: arm_scmi: Add protocol modularization support

Extend SCMI protocols accounting mechanism to address possible module
usage and add the support to possibly define new protocols as loadable
modules.

Keep the standard protocols built into the SCMI core.

Link: https://lore.kernel.org/r/20210316124903.35011-38-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Rename non devres notify_ops
Cristian Marussi [Tue, 16 Mar 2021 12:49:01 +0000 (12:49 +0000)]
firmware: arm_scmi: Rename non devres notify_ops

Rename non devres managed notify_ops to use a naming pattern which exposes
the performed action verb as last token.

No functional change.

Link: https://lore.kernel.org/r/20210316124903.35011-37-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Make notify_priv really private
Cristian Marussi [Tue, 16 Mar 2021 12:49:00 +0000 (12:49 +0000)]
firmware: arm_scmi: Make notify_priv really private

Notification private data is currently accessible via handle->notify_priv,
this data was indeed meant to be private to the notification core support
and not to be accessible by SCMI drivers. Make it private hiding it
inside instance descriptor struct scmi_info and accessible only via
dedicated helpers.

Link: https://lore.kernel.org/r/20210316124903.35011-36-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Cleanup events registration transient code
Cristian Marussi [Tue, 16 Mar 2021 12:48:59 +0000 (12:48 +0000)]
firmware: arm_scmi: Cleanup events registration transient code

Remove all the events registration code used to ease the transition to the
new interface based on protocol handles.

Link: https://lore.kernel.org/r/20210316124903.35011-35-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Cleanup unused core transfer helper wrappers
Cristian Marussi [Tue, 16 Mar 2021 12:48:58 +0000 (12:48 +0000)]
firmware: arm_scmi: Cleanup unused core transfer helper wrappers

Remove unused core scmi_xfer wrappers now that we have migrated all
protocols to the new interface based on protocol handles.

Link: https://lore.kernel.org/r/20210316124903.35011-34-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Cleanup legacy protocol init code
Cristian Marussi [Tue, 16 Mar 2021 12:48:57 +0000 (12:48 +0000)]
firmware: arm_scmi: Cleanup legacy protocol init code

Now that all protocols and drivers have been ported to the new interface
based on protocol handles and get/put operations, remove all the legacy
transient initialization code.

Link: https://lore.kernel.org/r/20210316124903.35011-33-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Make references to handle const
Cristian Marussi [Tue, 16 Mar 2021 12:48:56 +0000 (12:48 +0000)]
firmware: arm_scmi: Make references to handle const

Now that all the protocol private variable data have been moved out of
struct scmi_handle, mark all of its references as const.

Link: https://lore.kernel.org/r/20210316124903.35011-32-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Remove legacy scmi_voltage_ops protocol interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:55 +0000 (12:48 +0000)]
firmware: arm_scmi: Remove legacy scmi_voltage_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-31-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agoregulator: scmi: Port driver to the new scmi_voltage_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:54 +0000 (12:48 +0000)]
regulator: scmi: Port driver to the new scmi_voltage_proto_ops interface

Port the scmi regulator driver to the new SCMI voltage interface based
on protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-30-cristian.marussi@arm.com
Cc: Mark Brown <broonie@kernel.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port voltage protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:53 +0000 (12:48 +0000)]
firmware: arm_scmi: Port voltage protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->voltage_ops still
around to ease transition.

Remove handle->voltage_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-29-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port systempower protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:52 +0000 (12:48 +0000)]
firmware: arm_scmi: Port systempower protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations.

Remove handle->system_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-28-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Remove legacy scmi_sensor_ops protocol interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:51 +0000 (12:48 +0000)]
firmware: arm_scmi: Remove legacy scmi_sensor_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-27-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agoiio/scmi: Port driver to the new scmi_sensor_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:50 +0000 (12:48 +0000)]
iio/scmi: Port driver to the new scmi_sensor_proto_ops interface

Port the scmi iio driver to the new SCMI sensor interface based on
protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-26-cristian.marussi@arm.com
Link: https://lore.kernel.org/r/20210330134711.1962-1-cristian.marussi@arm.com
Acked-by: Jyoti Bhayana <jbhayana@google.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agohwmon: (scmi) port driver to the new scmi_sensor_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:49 +0000 (12:48 +0000)]
hwmon: (scmi) port driver to the new scmi_sensor_proto_ops interface

Port the scmi hwmon driver to the new SCMI sensor interface based on
protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-25-cristian.marussi@arm.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port sensor protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:48 +0000 (12:48 +0000)]
firmware: arm_scmi: Port sensor protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->sensor_ops still
around to ease transition.

Remove handle->sensor_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-24-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Remove legacy scmi_reset_ops protocol interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:47 +0000 (12:48 +0000)]
firmware: arm_scmi: Remove legacy scmi_reset_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-23-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agoreset: reset-scmi: Port driver to the new scmi_reset_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:46 +0000 (12:48 +0000)]
reset: reset-scmi: Port driver to the new scmi_reset_proto_ops interface

Port the scmi reset driver to the new SCMI reset interface based on
protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-22-cristian.marussi@arm.com
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port reset protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:45 +0000 (12:48 +0000)]
firmware: arm_scmi: Port reset protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->reset_ops still
around to ease transition.

Remove handle->reset_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-21-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Remove legacy scmi_clk_ops protocol interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:44 +0000 (12:48 +0000)]
firmware: arm_scmi: Remove legacy scmi_clk_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-20-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agoclk: scmi: Port driver to the new scmi_clk_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:43 +0000 (12:48 +0000)]
clk: scmi: Port driver to the new scmi_clk_proto_ops interface

Port the scmi clock driver to the new SCMI clock interface based on
protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-19-cristian.marussi@arm.com
Link: https://lore.kernel.org/r/20210326132844.33360-1-cristian.marussi@arm.com
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agosoc: mediatek: pwrap: add pwrap driver for MT6873/8192 SoCs
Hsin-Hsiung Wang [Fri, 12 Mar 2021 15:34:45 +0000 (23:34 +0800)]
soc: mediatek: pwrap: add pwrap driver for MT6873/8192 SoCs

MT6873/8192 are highly integrated SoCs and use PMIC_MT6359 for
power management. This patch adds pwrap master driver to
access PMIC_MT6359.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Link: https://lore.kernel.org/r/1615563286-22126-5-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agodt-bindings: mediatek: add compatible for MT6873/8192 pwrap
Hsin-Hsiung Wang [Fri, 12 Mar 2021 15:34:44 +0000 (23:34 +0800)]
dt-bindings: mediatek: add compatible for MT6873/8192 pwrap

This adds dt-binding documentation of pwrap for Mediatek MT6873/8192
SoCs Platform.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1615563286-22126-4-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: pwrap: add arbiter capability
Hsin-Hsiung Wang [Fri, 12 Mar 2021 15:34:43 +0000 (23:34 +0800)]
soc: mediatek: pwrap: add arbiter capability

Add arbiter capability for pwrap driver.
The arbiter capability uses new design to judge the priority and latency
for multi-channel.
The design with arbiter support cannot change the watchdog timer.
This patch is preparing for adding mt6873/8192 pwrap support.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Link: https://lore.kernel.org/r/1615563286-22126-3-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: pwrap: use BIT() macro
Hsin-Hsiung Wang [Fri, 12 Mar 2021 15:34:42 +0000 (23:34 +0800)]
soc: mediatek: pwrap: use BIT() macro

Use a better BIT() marco for the bit definition.
No functional changes, cleanup only.

Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Link: https://lore.kernel.org/r/1615563286-22126-2-git-send-email-hsin-hsiung.wang@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: pm-domains: Fix missing error code in scpsys_add_subdomain()
Enric Balletbo i Serra [Wed, 3 Mar 2021 09:10:54 +0000 (10:10 +0100)]
soc: mediatek: pm-domains: Fix missing error code in scpsys_add_subdomain()

Adding one power domain in scpsys_add_subdomain is missing to assign an
error code when it fails. Fix that assigning an error code to 'ret',
this also fixes the follwowing smatch warning.

  drivers/soc/mediatek/mtk-pm-domains.c:492 scpsys_add_subdomain() warn: missing error code 'ret'

Fixes: dd65030295e2 ("soc: mediatek: pm-domains: Don't print an error if child domain is deferred")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210303091054.796975-1-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: mmsys: Use an array for setting the routing registers
CK Hu [Wed, 17 Mar 2021 18:17:10 +0000 (19:17 +0100)]
soc: mediatek: mmsys: Use an array for setting the routing registers

Actually, setting the registers for routing, use multiple 'if-else' for different
routes, but this code would be more and more complicated while we
support more and more SoCs. Change that and use a table per SoC so the
code will be more portable and clear.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210317181711.795245-3-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agosoc: mediatek: mmsys: Create struct mtk_mmsys to store context data
CK Hu [Wed, 17 Mar 2021 18:17:09 +0000 (19:17 +0100)]
soc: mediatek: mmsys: Create struct mtk_mmsys to store context data

Apart from the driver data, in order to extend the driver to support more
and more SoCs, we will need to store other configuration data. So, create
a mtk_mmsys struct to encapsulate all that information.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://lore.kernel.org/r/20210317181711.795245-2-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
3 years agotee: optee: do not check memref size on return from Secure World
Jerome Forissier [Mon, 22 Mar 2021 10:40:37 +0000 (11:40 +0100)]
tee: optee: do not check memref size on return from Secure World

When Secure World returns, it may have changed the size attribute of the
memory references passed as [in/out] parameters. The GlobalPlatform TEE
Internal Core API specification does not restrict the values that this
size can take. In particular, Secure World may increase the value to be
larger than the size of the input buffer to indicate that it needs more.

Therefore, the size check in optee_from_msg_param() is incorrect and
needs to be removed. This fixes a number of failed test cases in the
GlobalPlatform TEE Initial Configuratiom Test Suite v2_0_0_0-2017_06_09
when OP-TEE is compiled without dynamic shared memory support
(CFG_CORE_DYN_SHM=n).

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Suggested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
3 years agotee: optee: fix build error caused by recent optee tracepoints feature
Jisheng Zhang [Thu, 25 Mar 2021 04:06:01 +0000 (12:06 +0800)]
tee: optee: fix build error caused by recent optee tracepoints feature

If build kernel without "O=dir", below error will be seen:

In file included from drivers/tee/optee/optee_trace.h:67,
                 from drivers/tee/optee/call.c:18:
./include/trace/define_trace.h:95:42: fatal error: ./optee_trace.h: No such file or directory
   95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
      |                                          ^
compilation terminated.

Fix it by adding below line to Makefile:
CFLAGS_call.o := -I$(src)

Tested with and without "O=dir", both can build successfully.

Fixes: 0101947dbcc3 ("tee: optee: add invoke_fn tracepoints")
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
3 years agobus: qcom: Put child node before return
Pan Bian [Thu, 21 Jan 2021 11:49:07 +0000 (03:49 -0800)]
bus: qcom: Put child node before return

Put child node before return to fix potential reference count leak.
Generally, the reference count of child is incremented and decremented
automatically in the macro for_each_available_child_of_node() and should
be decremented manually if the loop is broken in loop body.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210121114907.109267-1-bianpan2016@163.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agofirmware: arm_scmi: Port clock protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:42 +0000 (12:48 +0000)]
firmware: arm_scmi: Port clock protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->clk_ops still
around to ease transition.

Remove handle->clock_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-18-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Remove legacy scmi_power_ops protocol interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:41 +0000 (12:48 +0000)]
firmware: arm_scmi: Remove legacy scmi_power_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-17-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port genpd driver to the new scmi_power_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:40 +0000 (12:48 +0000)]
firmware: arm_scmi: Port genpd driver to the new scmi_power_proto_ops interface

Port the scmi genpd driver to the new SCMI power interface based on
protocol handles and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-16-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port power protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:39 +0000 (12:48 +0000)]
firmware: arm_scmi: Port power protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->power_ops still
around to ease transition.

Remove handle->power_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-15-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Remove legacy scmi_perf_ops protocol interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:38 +0000 (12:48 +0000)]
firmware: arm_scmi: Remove legacy scmi_perf_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-14-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agocpufreq: scmi: Port driver to the new scmi_perf_proto_ops interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:37 +0000 (12:48 +0000)]
cpufreq: scmi: Port driver to the new scmi_perf_proto_ops interface

Port driver to the new SCMI perf interface based on protocol handles
and common devm_get_ops().

Link: https://lore.kernel.org/r/20210316124903.35011-13-cristian.marussi@arm.com
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port perf protocol to new protocols interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:36 +0000 (12:48 +0000)]
firmware: arm_scmi: Port perf protocol to new protocols interface

Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations, while keeping the old handle->perf_ops still
around to ease transition.

Remove handle->perf_priv now unused.

Link: https://lore.kernel.org/r/20210316124903.35011-12-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Port base protocol to new interface
Cristian Marussi [Tue, 16 Mar 2021 12:48:35 +0000 (12:48 +0000)]
firmware: arm_scmi: Port base protocol to new interface

Port the SCMI base protocol to new protocol handles based interface.

Link: https://lore.kernel.org/r/20210316124903.35011-11-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Add helper to access protocol revision/version
Cristian Marussi [Tue, 16 Mar 2021 12:48:34 +0000 (12:48 +0000)]
firmware: arm_scmi: Add helper to access protocol revision/version

Add an helper to access from a protocol handle, the SCMI version data
which is exposed on sysfs. Such helper will be needed by SCMI base
protocol initialization once it will be moved to new protocol handles
scheme.

Link: https://lore.kernel.org/r/20210316124903.35011-10-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Add new protocol handle core transfer ops
Cristian Marussi [Tue, 16 Mar 2021 12:48:33 +0000 (12:48 +0000)]
firmware: arm_scmi: Add new protocol handle core transfer ops

Add new core SCMI transfer operations based on protocol handles to
enable protocols to builds and send their own protocol specific messages.

Keep old original scmi_xfer_ operations interface as wrappers around the
new interface in order to let coexist old and new interfaces to ease
protocol by protocol migration.

In order to support such migration the above wrappers and some
additional transient code is also introduced in this commit. It will be
later removed as a whole once the full migration of protocols and SCMI
drivers will have been completed.

Link: https://lore.kernel.org/r/20210316124903.35011-9-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Convert events registration to protocol handles
Cristian Marussi [Tue, 16 Mar 2021 12:48:32 +0000 (12:48 +0000)]
firmware: arm_scmi: Convert events registration to protocol handles

Convert all refactored events registration routines to use protocol
handles.

In order to maintain bisectability and to allow protocols and drivers
to be later ported to the new protocol handle interface one by one,
introduce here also some transient code that will be removed later
in order to ease such transition.

Link: https://lore.kernel.org/r/20210316124903.35011-8-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Refactor events registration
Cristian Marussi [Tue, 16 Mar 2021 12:48:31 +0000 (12:48 +0000)]
firmware: arm_scmi: Refactor events registration

Add a new refactored protocol events registration helper and invoke it
from the centralized initialization process triggered by get_ops() and
friends.

Also add a `get_num_sources` as a new optional callback amongst protocol
events operations. Finally remove events registration call-sites from
within the legacy protocol init routines.

Link: https://lore.kernel.org/r/20210316124903.35011-7-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Introduce new devres notification ops
Cristian Marussi [Tue, 16 Mar 2021 12:48:30 +0000 (12:48 +0000)]
firmware: arm_scmi: Introduce new devres notification ops

Expose to the SCMI drivers a new alternative devres managed notifications
API based on protocol handles.

All drivers still keep using the old API, no functional change.

Link: https://lore.kernel.org/r/20210316124903.35011-6-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Make notifications aware of protocols users
Cristian Marussi [Tue, 16 Mar 2021 12:48:29 +0000 (12:48 +0000)]
firmware: arm_scmi: Make notifications aware of protocols users

Account for any active registered notifier against the proper related
protocol, do not consider pending event handlers, only active handlers
will concur to protocol usage accounting.

Link: https://lore.kernel.org/r/20210316124903.35011-5-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Introduce devres get/put protocols operations
Cristian Marussi [Tue, 16 Mar 2021 12:48:28 +0000 (12:48 +0000)]
firmware: arm_scmi: Introduce devres get/put protocols operations

Expose to the SCMI drivers a new devres managed common protocols API
based on generic get/put methods and protocol handles.

All drivers still keep using the old API, no functional change.

Link: https://lore.kernel.org/r/20210316124903.35011-4-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Introduce protocol handle definitions
Cristian Marussi [Tue, 16 Mar 2021 12:48:27 +0000 (12:48 +0000)]
firmware: arm_scmi: Introduce protocol handle definitions

Add basic protocol handles definitions and private data helpers.

A protocol handle identifies a protocol instance initialized against a
specific handle, it embeds all the references to the core SCMI transfer
methods that will be needed by a protocol implementation to build and
send its own protocol specific messages using common core methods.

As such, in the interface, a protocol handle will be passed down from
the core to the protocol specific initialization callback at init time.

Anyways, at this point only definitions are introduced, all protocols
initialization code and SCMI drivers probing is still based on the old
interface, so no functional change.

Link: https://lore.kernel.org/r/20210316124903.35011-3-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: arm_scmi: Extend protocol registration interfaces
Cristian Marussi [Tue, 16 Mar 2021 12:48:26 +0000 (12:48 +0000)]
firmware: arm_scmi: Extend protocol registration interfaces

Extend common protocol registration routines and provide some new generic
protocols get/put helpers that can track protocols usage and automatically
perform the proper initialization and de-initialization on demand when
required.

Convert all standard protocols to use this new registration scheme while
keeping them all still using the usual initialization logic bound to SCMI
devices probing.

Link: https://lore.kernel.org/r/20210316124903.35011-2-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
3 years agofirmware: imx: scu-pd: add missed ADC1 pd
Frank Li [Fri, 19 Mar 2021 21:23:52 +0000 (16:23 -0500)]
firmware: imx: scu-pd: add missed ADC1 pd

ADC1 is not defined in pd driver on 8QM.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
3 years agofirmware: imx: scu-pd: Update comments for single global power domain
Ulf Hansson [Wed, 17 Mar 2021 09:31:17 +0000 (10:31 +0100)]
firmware: imx: scu-pd: Update comments for single global power domain

Since the introduction of the PM domain support for the scu-pd, the genpd
framework has been continuously improved. More preciously, using a single
global power domain can quite easily be deployed for imx platforms.

To avoid confusions, let's therefore make an update to the comments about
the missing pieces.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
3 years agosoc/tegra: pmc: Print out domain name when reset fails to acquire
Dmitry Osipenko [Tue, 2 Mar 2021 12:25:01 +0000 (15:25 +0300)]
soc/tegra: pmc: Print out domain name when reset fails to acquire

Print out domain name when reset fails to acquire for debugging purposes
and to make formatting of GENPD errors consistent in the driver.

Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20 and TK1 T124
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agosoc/tegra: pmc: Ensure that clock rates aren't too high
Dmitry Osipenko [Tue, 2 Mar 2021 12:25:00 +0000 (15:25 +0300)]
soc/tegra: pmc: Ensure that clock rates aren't too high

Switch all clocks of a power domain to a safe rate which is suitable
for all possible voltages in order to ensure that hardware constraints
aren't violated when power domain state toggles.

Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20 and TK1 T124
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agosoc/tegra: pmc: Fix completion of power-gate toggling
Dmitry Osipenko [Tue, 2 Mar 2021 12:24:59 +0000 (15:24 +0300)]
soc/tegra: pmc: Fix completion of power-gate toggling

The SW-initiated power gate toggling is dropped by PMC if there is
contention with a HW-initiated toggling, i.e. when one of CPU cores is
gated by cpuidle driver. Software should retry the toggling after 10
microseconds on Tegra20/30 SoCs, hence add the retrying. On Tegra114+ the
toggling method was changed in hardware, the TOGGLE_START bit indicates
whether PMC is busy or could accept the command to toggle, hence handle
that bit properly.

The problem pops up after enabling dynamic power gating of 3D hardware,
where 3D power domain fails to turn on/off "randomly".

The programming sequence and quirks are documented in TRMs, but PMC
driver obliviously re-used the Tegra20 logic for Tegra30+, which strikes
back now. The 10 microseconds and other timeouts aren't documented in TRM,
they are taken from downstream kernel.

Link: https://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=commit;h=311dd1c318b70e93bcefec15456a10ff2b9eb0ff
Link: https://nv-tegra.nvidia.com/gitweb/?p=linux-3.10.git;a=commit;h=7f36693c47cb23730a6b2822e0975be65fb0c51d
Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20 and TK1 T124
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agosoc/tegra: pmc: Fix imbalanced clock disabling in error code path
Dmitry Osipenko [Tue, 2 Mar 2021 12:24:58 +0000 (15:24 +0300)]
soc/tegra: pmc: Fix imbalanced clock disabling in error code path

The tegra_powergate_power_up() has a typo in the error code path where it
will try to disable clocks twice, fix it. In practice that error never
happens, so this is a minor correction.

Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20 and TK1 T124
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agosoc/tegra: regulators: Fix locking up when voltage-spread is out of range
Dmitry Osipenko [Tue, 2 Mar 2021 13:18:00 +0000 (16:18 +0300)]
soc/tegra: regulators: Fix locking up when voltage-spread is out of range

Fix voltage coupler lockup which happens when voltage-spread is out
of range due to a bug in the code. The max-spread requirement shall be
accounted when CPU regulator doesn't have consumers. This problem is
observed on Tegra30 Ouya game console once system-wide DVFS is enabled
in a device-tree.

Fixes: 783807436f36 ("soc/tegra: regulators: Add regulators coupler for Tegra30")
Cc: stable@vger.kernel.org
Reported-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agosoc/tegra: pmc: Provide USB sleepwalk register map
JC Kuo [Wed, 20 Jan 2021 07:34:07 +0000 (15:34 +0800)]
soc/tegra: pmc: Provide USB sleepwalk register map

This commit implements a register map which grants USB (UTMI and HSIC)
sleepwalk registers access to USB PHY drivers. The USB sleepwalk logic
is in PMC hardware block but USB PHY drivers have the best knowledge
of proper programming sequence.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agosoc: bcm: bcm-pmb: add BCM63138 SATA support
Rafał Miłecki [Thu, 14 Jan 2021 17:53:39 +0000 (18:53 +0100)]
soc: bcm: bcm-pmb: add BCM63138 SATA support

BCM63138 has SATA controller that needs to be powered up using PMB.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
3 years agodt-bindings: power: bcm-pmb: add BCM63138 binding
Rafał Miłecki [Thu, 14 Jan 2021 17:53:38 +0000 (18:53 +0100)]
dt-bindings: power: bcm-pmb: add BCM63138 binding

PMB can be also found on bcm63xx chipsets. It uses difference device
addresses so a new binding is required.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
3 years agoclk: tegra: Don't enable PLLE HW sequencer at init
JC Kuo [Wed, 20 Jan 2021 07:34:02 +0000 (15:34 +0800)]
clk: tegra: Don't enable PLLE HW sequencer at init

PLLE hardware power sequencer references PEX/SATA UPHY PLL hardware
power sequencers' output to enable/disable PLLE. PLLE hardware power
sequencer has to be enabled only after PEX/SATA UPHY PLL's sequencers
are enabled.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agoclk: tegra: Add PLLE HW power sequencer control
JC Kuo [Wed, 20 Jan 2021 07:34:01 +0000 (15:34 +0800)]
clk: tegra: Add PLLE HW power sequencer control

PLLE has a hardware power sequencer logic which is a state machine
that can power on/off PLLE without any software intervention. The
sequencer has two inputs, one from XUSB UPHY PLL and the other from
SATA UPHY PLL. PLLE provides reference clock to XUSB and SATA UPHY
PLLs. When both of the downstream PLLs are powered-off, PLLE hardware
power sequencer will automatically power off PLLE for power saving.

XUSB and SATA UPHY PLLs also have their own hardware power sequencer
logic. XUSB UPHY PLL is shared between XUSB SuperSpeed ports and PCIE
controllers. The XUSB UPHY PLL hardware power sequencer has inputs
from XUSB and PCIE. When all of the XUSB SuperSpeed ports and PCIE
controllers are in low power state, XUSB UPHY PLL hardware power
sequencer automatically power off PLL and flags idle to PLLE hardware
power sequencer. Similar applies to SATA UPHY PLL.

PLLE hardware power sequencer has to be enabled after both downstream
sequencers are enabled.

This commit adds two helper functions:
1. tegra210_plle_hw_sequence_start() for XUSB PADCTL driver to enable
   PLLE hardware sequencer at proper time.

2. tegra210_plle_hw_sequence_is_enabled() for XUSB PADCTL driver to
   check whether PLLE hardware sequencer has been enabled or not.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
3 years agobus: ti-sysc: Use kzalloc for allocating only one thing
Zheng Yongjun [Tue, 29 Dec 2020 13:51:47 +0000 (21:51 +0800)]
bus: ti-sysc: Use kzalloc for allocating only one thing

Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
3 years agobus: ti-sysc: remove unneeded semicolon
Yang Li [Tue, 2 Feb 2021 07:00:05 +0000 (15:00 +0800)]
bus: ti-sysc: remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/bus/ti-sysc.c:1595:2-3: Unneeded semicolon
./drivers/bus/ti-sysc.c:2833:3-4: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
3 years agoARM: OMAP2+: Make symbol 'pdata_quirks_init_clocks' static
Wei Yongjun [Thu, 18 Mar 2021 13:56:49 +0000 (13:56 +0000)]
ARM: OMAP2+: Make symbol 'pdata_quirks_init_clocks' static

The sparse tool complains as follows:

arch/arm/mach-omap2/pdata-quirks.c:578:1: warning:
 symbol 'pdata_quirks_init_clocks' was not declared. Should it be static?

This symbol is not used outside of pdata-quirks.c, so this
commit marks it static.

Fixes: a15de032a72d ("ARM: OMAP2+: Init both prm and prcm nodes early for clocks")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
3 years agoMerge tag 'renesas-drivers-for-v5.13-tag1' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Tue, 23 Mar 2021 17:16:40 +0000 (18:16 +0100)]
Merge tag 'renesas-drivers-for-v5.13-tag1' of git://git./linux/kernel/git/geert/renesas-devel into arm/drivers

Renesas driver updates for v5.13

  - Prepare rmobile-sysc for fw_devlink=on,
  - A minor cleanup.

* tag 'renesas-drivers-for-v5.13-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
  soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
  soc: renesas: rmobile-sysc: Remove unneeded platform includes

Link: https://lore.kernel.org/r/20210319085146.2709844-4-geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>