linux-2.6-microblaze.git
3 years agoMerge tag 'memory-controller-drv-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 19 Apr 2021 14:32:34 +0000 (16:32 +0200)]
Merge tag 'memory-controller-drv-5.13-2' of git://git./linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers

Memory controller drivers for v5.13, part two

1. Renesas RPC: fix possible NULL pointer.
2. Exynos5422 DMC: add proper error checking for clk_prepare.
3. Mediatek SMI: use device-links instead of explicit PM runtime calls.

* tag 'memory-controller-drv-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: mtk-smi: Add device-link between smi-larb and smi-common
  memory: samsung: exynos5422-dmc: handle clk_set_parent() failure
  memory: renesas-rpc-if: fix possible NULL pointer dereference of resource

Link: https://lore.kernel.org/r/20210415065514.7385-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agomemory: mtk-smi: Add device-link between smi-larb and smi-common
Yong Wu [Sat, 10 Apr 2021 09:11:16 +0000 (17:11 +0800)]
memory: mtk-smi: Add device-link between smi-larb and smi-common

Normally, If the smi-larb HW need work, we should enable the smi-common
HW power and clock firstly.
This patch adds device-link between the smi-larb dev and the smi-common
dev. then If pm_runtime_get_sync(smi-larb-dev), the pm_runtime_get_sync
(smi-common-dev) will be called automatically.

Also, Add DL_FLAG_STATELESS to avoid the smi-common clocks be gated when
probe.

CC: Matthias Brugger <matthias.bgg@gmail.com>
Suggested-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210410091128.31823-5-yong.wu@mediatek.com
3 years agomemory: samsung: exynos5422-dmc: handle clk_set_parent() failure
Krzysztof Kozlowski [Wed, 7 Apr 2021 15:45:35 +0000 (17:45 +0200)]
memory: samsung: exynos5422-dmc: handle clk_set_parent() failure

clk_set_parent() can fail and ignoring such case could lead to invalid
clock setup for given frequency.

Addresses-Coverity: Unchecked return value
Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://lore.kernel.org/r/20210407154535.70756-1-krzysztof.kozlowski@canonical.com
3 years agomemory: renesas-rpc-if: fix possible NULL pointer dereference of resource
Krzysztof Kozlowski [Wed, 7 Apr 2021 15:43:57 +0000 (17:43 +0200)]
memory: renesas-rpc-if: fix possible NULL pointer dereference of resource

The platform_get_resource_byname() can return NULL which would be
immediately dereferenced by resource_size().  Instead dereference it
after validating the resource.

Addresses-Coverity: Dereference null return value
Fixes: ca7d8b980b67 ("memory: add Renesas RPC-IF driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210407154357.70200-1-krzysztof.kozlowski@canonical.com
3 years agoMerge tag 'soc-fsl-next-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/leo...
Arnd Bergmann [Tue, 13 Apr 2021 09:06:03 +0000 (11:06 +0200)]
Merge tag 'soc-fsl-next-v5.13' of git://git./linux/kernel/git/leo/linux into arm/drivers

NXP/FSL SoC driver updates for v5.13

- Add ACPI support for RCPM driver
- Use generic io{read,write} for QE drivers after performance optimized
  for PowerPC
- Fix QBMAN probe to cleanup HW states correctly for kexec
- Various cleanup and style fix for QBMAN/QE/GUTS drivers

* tag 'soc-fsl-next-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: enable acpi support in RCPM driver
  Revert "soc: fsl: qe: introduce qe_io{read,write}* wrappers"
  tty: serial: ucc_uart: replace qe_io{read,write}* wrappers by generic io{read,write}*
  soc: fsl: qe: replace qe_io{read,write}* wrappers by generic io{read,write}*
  soc: fsl: guts: fix comment syntax in file
  soc: fsl: guts: remove unneeded semicolon
  soc: fsl: qe: Use DEFINE_SPINLOCK() for spinlock
  soc: fsl: qbman: Delete useless kfree code
  soc: fsl: qbman: Ensure device cleanup is run for kexec

Link: https://lore.kernel.org/r/20210409205719.27927-1-leoyang.li@nxp.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'zynqmp-soc-for-v5.13' of https://github.com/Xilinx/linux-xlnx into arm...
Arnd Bergmann [Tue, 13 Apr 2021 08:59:45 +0000 (10:59 +0200)]
Merge tag 'zynqmp-soc-for-v5.13' of https://github.com/Xilinx/linux-xlnx into arm/drivers

arm64: soc: ZynqMP SoC changes for v5.13

- Fix firmware removal path
- Cleanup eemi doc and *ops()

* tag 'zynqmp-soc-for-v5.13' of https://github.com/Xilinx/linux-xlnx:
  firmware: xilinx: Remove zynqmp_pm_get_eemi_ops() in IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
  firmware: xilinx: Fix dereferencing freed memory

Link: https://lore.kernel.org/r/a44f8e9f-cea7-57ef-c3bc-10f5f5e064fc@monstr.eu
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'qcom-drivers-for-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Fri, 9 Apr 2021 19:46:14 +0000 (21:46 +0200)]
Merge tag 'qcom-drivers-for-5.13-2' of git://git./linux/kernel/git/qcom/linux into arm/drivers

More Qualcomm driver updates for 5.13

This improves the Qualcomm SCM driver logic related to detecting the
calling convention, in particular on SC7180, and fixes a few small
issues in the same.

It introduces additonal sanity checks of the size of loaded segments in
the MDT loader and adds a missing error in the return path of
pdr_register_listener().

It makes it possible to specify the OEM specific firmware path in the
wcn36xx control (and WiFi) driver.

Lastly it adds a missing path specifier in the MAINTAINERS' entry and
fixes a bunch of kerneldoc issues in various drivers.

* tag 'qcom-drivers-for-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  soc: qcom: mdt_loader: Detect truncated read of segments
  soc: qcom: mdt_loader: Validate that p_filesz < p_memsz
  soc: qcom: pdr: Fix error return code in pdr_register_listener
  firmware: qcom_scm: Fix kernel-doc function names to match
  firmware: qcom_scm: Suppress sysfs bind attributes
  firmware: qcom_scm: Workaround lack of "is available" call on SC7180
  firmware: qcom_scm: Reduce locking section for __get_convention()
  firmware: qcom_scm: Make __qcom_scm_is_call_available() return bool
  soc: qcom: wcnss_ctrl: Allow reading firmware-name from DT
  soc: qcom: wcnss_ctrl: Introduce local variable "dev"
  dt-bindings: soc: qcom: wcnss: Add firmware-name property
  soc: qcom: address kernel-doc warnings
  MAINTAINERS: add another entry for ARM/QUALCOMM SUPPORT

Link: https://lore.kernel.org/r/20210409162001.775851-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoclk: socfpga: fix iomem pointer cast on 64-bit
Krzysztof Kozlowski [Sun, 14 Mar 2021 11:07:09 +0000 (12:07 +0100)]
clk: socfpga: fix iomem pointer cast on 64-bit

Pointers should be cast with uintptr_t instead of integer.  This fixes
warning when compile testing on ARM64:

  drivers/clk/socfpga/clk-gate.c: In function ‘socfpga_clk_recalc_rate’:
  drivers/clk/socfpga/clk-gate.c:102:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Fixes: b7cec13f082f ("clk: socfpga: Look for the GPIO_DB_CLK by its offset")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMerge tag 'aspeed-5.13-lpc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel...
Arnd Bergmann [Fri, 9 Apr 2021 07:00:58 +0000 (09:00 +0200)]
Merge tag 'aspeed-5.13-lpc' of git://git./linux/kernel/git/joel/bmc into arm/drivers

ASPEED LPC updates for 5.13

These patches fix the ASPEED LPC bindings and LPC-related device drivers
so in the future the KCS driver can properly use the hardware.

* tag 'aspeed-5.13-lpc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc:
  soc: aspeed: Adapt to new LPC device tree layout
  pinctrl: aspeed-g5: Adapt to new LPC device tree layout
  ipmi: kcs: aspeed: Adapt to new LPC DTS layout
  ARM: dts: Remove LPC BMC and Host partitions
  dt-bindings: aspeed-lpc: Remove LPC partitioning

Link: https://lore.kernel.org/r/CACPK8Xcb12LsVr7CUaXXjQskKbVjb7x+jgueG1Hik-kBPWtDSg@mail.gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agosoc: aspeed: Adapt to new LPC device tree layout
Chia-Wei, Wang [Fri, 19 Mar 2021 06:27:36 +0000 (16:57 +1030)]
soc: aspeed: Adapt to new LPC device tree layout

Add check against LPC device v2 compatible string to
ensure that the fixed device tree layout is adopted.
The LPC register offsets are also fixed accordingly.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20210319062752.145730-5-andrew@aj.id.au
Signed-off-by: Joel Stanley <joel@jms.id.au>
3 years agopinctrl: aspeed-g5: Adapt to new LPC device tree layout
Chia-Wei, Wang [Fri, 19 Mar 2021 06:27:35 +0000 (16:57 +1030)]
pinctrl: aspeed-g5: Adapt to new LPC device tree layout

Add check against LPC device v2 compatible string to
ensure that the fixed device tree layout is adopted.
The LPC register offsets are also fixed accordingly.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20210319062752.145730-4-andrew@aj.id.au
Signed-off-by: Joel Stanley <joel@jms.id.au>
3 years agoipmi: kcs: aspeed: Adapt to new LPC DTS layout
Chia-Wei, Wang [Fri, 19 Mar 2021 06:27:34 +0000 (16:57 +1030)]
ipmi: kcs: aspeed: Adapt to new LPC DTS layout

Add check against LPC device v2 compatible string to
ensure that the fixed device tree layout is adopted.
The LPC register offsets are also fixed accordingly.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Acked-by: Haiyue Wang <haiyue.wang@linux.intel.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20210319062752.145730-3-andrew@aj.id.au
Signed-off-by: Joel Stanley <joel@jms.id.au>
3 years agoARM: dts: Remove LPC BMC and Host partitions
Chia-Wei, Wang [Fri, 19 Mar 2021 06:27:33 +0000 (16:57 +1030)]
ARM: dts: Remove LPC BMC and Host partitions

The LPC controller has no concept of the BMC and the Host partitions.

A concrete instance is that the HICRB[5:4] are for the I/O port address
configurtaion of KCS channel 1/2. However, the KCS driver cannot access
HICRB for channel 1/2 initialization via syscon regmap interface due to
the parition boundary. (i.e. offset 80h)

In addition, for the HW design backward compatibility, a newly added HW
control bit could be located at any reserved one over the LPC addressing
space. Thereby, this patch removes the lpc-bmc and lpc-host child node
and thus the LPC partitioning.

Note that this change requires the synchronization between device tree
change and the driver change. To prevent the misuse of old devicetrees
with new drivers, or vice versa, the v2 compatible strings are adopted
for the LPC device as listed:

"aspeed,ast2400-lpc-v2"
"aspeed,ast2500-lpc-v2"
"aspeed,ast2600-lpc-v2"

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Link: https://lore.kernel.org/r/20210319062752.145730-2-andrew@aj.id.au
Signed-off-by: Joel Stanley <joel@jms.id.au>
3 years agodt-bindings: aspeed-lpc: Remove LPC partitioning
Chia-Wei, Wang [Fri, 19 Mar 2021 06:27:32 +0000 (16:57 +1030)]
dt-bindings: aspeed-lpc: Remove LPC partitioning

The LPC controller has no concept of the BMC and the Host partitions.
This patch fixes the documentation by removing the description on LPC
partitions. The register offsets illustrated in the DTS node examples
are also fixed to adapt to the LPC DTS change.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20210319062752.145730-1-andrew@aj.id.au
Signed-off-by: Joel Stanley <joel@jms.id.au>
3 years agosoc: fsl: enable acpi support in RCPM driver
Peng Ma [Thu, 8 Apr 2021 03:03:53 +0000 (11:03 +0800)]
soc: fsl: enable acpi support in RCPM driver

This patch enables ACPI support in RCPM driver.

Signed-off-by: Peng Ma <peng.ma@nxp.com>
Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
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: qcom: mdt_loader: Detect truncated read of segments
Bjorn Andersson [Thu, 7 Jan 2021 23:25:26 +0000 (15:25 -0800)]
soc: qcom: mdt_loader: Detect truncated read of segments

Given that no validation of how much data the firmware loader read in
for a given segment truncated segment files would best case result in a
hash verification failure, without any indication of what went wrong.

Improve this by validating that the firmware loader did return the
amount of data requested.

Fixes: 445c2410a449 ("soc: qcom: mdt_loader: Use request_firmware_into_buf()")
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Link: https://lore.kernel.org/r/20210107232526.716989-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agosoc: qcom: mdt_loader: Validate that p_filesz < p_memsz
Bjorn Andersson [Thu, 7 Jan 2021 23:31:19 +0000 (15:31 -0800)]
soc: qcom: mdt_loader: Validate that p_filesz < p_memsz

The code validates that segments of p_memsz bytes of a segment will fit
in the provided memory region, but does not validate that p_filesz bytes
will, which means that an incorrectly crafted ELF header might write
beyond the provided memory region.

Fixes: 051fb70fd4ea ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5")
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Link: https://lore.kernel.org/r/20210107233119.717173-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agosoc: qcom: pdr: Fix error return code in pdr_register_listener
Qinglang Miao [Wed, 25 Nov 2020 06:50:34 +0000 (14:50 +0800)]
soc: qcom: pdr: Fix error return code in pdr_register_listener

Fix to return the error code -EREMOTEIO from pdr_register_listener
rather than 0.

Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Link: https://lore.kernel.org/r/20201125065034.154217-1-miaoqinglang@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agofirmware: qcom_scm: Fix kernel-doc function names to match
Stephen Boyd [Tue, 23 Feb 2021 21:45:38 +0000 (13:45 -0800)]
firmware: qcom_scm: Fix kernel-doc function names to match

These functions were renamed but the kernel doc didn't follow along. Fix
it.

Cc: Elliot Berman <eberman@codeaurora.org>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210223214539.1336155-6-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agofirmware: qcom_scm: Suppress sysfs bind attributes
Stephen Boyd [Tue, 23 Feb 2021 21:45:37 +0000 (13:45 -0800)]
firmware: qcom_scm: Suppress sysfs bind attributes

We don't want userspace ejecting this driver at runtime. Various other
drivers call into this code because it provides the mechanism to
communicate with the secure world on qcom SoCs. It should probe once and
be present forever after that.

Cc: Elliot Berman <eberman@codeaurora.org>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210223214539.1336155-5-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agofirmware: qcom_scm: Workaround lack of "is available" call on SC7180
Stephen Boyd [Tue, 23 Feb 2021 21:45:36 +0000 (13:45 -0800)]
firmware: qcom_scm: Workaround lack of "is available" call on SC7180

Some SC7180 firmwares don't implement the QCOM_SCM_INFO_IS_CALL_AVAIL
API, so we can't probe the calling convention. We detect the legacy
calling convention on these firmwares, because the availability call
always fails and legacy is the fallback. This leads to problems where
the rmtfs driver fails to probe, because it tries to assign memory with
a bad calling convention, which then leads to modem failing to load and
all networking, even wifi, to fail. Ouch!

Let's force the calling convention to be what it always is on this SoC,
i.e. arm64. Of course, the calling convention is not the same thing as
implementing the QCOM_SCM_INFO_IS_CALL_AVAIL API. The absence of the "is
this call available" API from the firmware means that any call to
__qcom_scm_is_call_available() fails. This is OK for now though because
none of the calls that are checked for existence are implemented on
firmware running on sc7180. If such a call needs to be checked for
existence in the future, we presume that firmware will implement this
API and then things will "just work".

Cc: Elliot Berman <eberman@codeaurora.org>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210223214539.1336155-4-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agofirmware: qcom_scm: Reduce locking section for __get_convention()
Stephen Boyd [Tue, 23 Feb 2021 21:45:35 +0000 (13:45 -0800)]
firmware: qcom_scm: Reduce locking section for __get_convention()

We shouldn't need to hold this spinlock here around the entire SCM call
into the firmware and back. Instead, we should be able to query the
firmware, potentially in parallel with other CPUs making the same
convention detection firmware call, and then grab the lock to update the
calling convention detected. The convention doesn't change at runtime so
calling into firmware more than once is possibly wasteful but simpler.
Besides, this is the slow path, not the fast path where we've already
detected the convention used.

More importantly, this allows us to add more logic here to workaround
the case where the firmware call to check for availability isn't
implemented in the firmware at all. In that case we can check the
firmware node compatible string and force a calling convention.

Note that we remove the 'has_queried' logic that is repeated twice. That
could lead to the calling convention being printed multiple times to the
kernel logs if the bool is true but __query_convention() is running on
multiple CPUs. We also shorten the time where the lock is held, but we
keep the lock held around the printk because it doesn't seem hugely
important to drop it for that.

Cc: Elliot Berman <eberman@codeaurora.org>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210223214539.1336155-3-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agofirmware: qcom_scm: Make __qcom_scm_is_call_available() return bool
Stephen Boyd [Tue, 23 Feb 2021 21:45:34 +0000 (13:45 -0800)]
firmware: qcom_scm: Make __qcom_scm_is_call_available() return bool

Make __qcom_scm_is_call_available() return bool instead of int. The
function has "is" in the name, so it should return a bool to indicate
the truth of the call being available. Unfortunately, it can return a
number < 0 which also looks "true", but not all callers expect that and
thus they think a call is available when really the check to see if the
call is available failed to figure it out.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Elliot Berman <eberman@codeaurora.org>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Jeffrey Hugo <jhugo@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Fixes: 0f206514749b ("scsi: firmware: qcom_scm: Add support for programming inline crypto keys")
Fixes: 0434a4061471 ("firmware: qcom: scm: add support to restore secure config to qcm_scm-32")
Fixes: b0a1614fb1f5 ("firmware: qcom: scm: add OCMEM lock/unlock interface")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210223214539.1336155-2-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agoRevert "soc: fsl: qe: introduce qe_io{read,write}* wrappers"
Christophe Leroy [Sat, 6 Mar 2021 18:09:31 +0000 (18:09 +0000)]
Revert "soc: fsl: qe: introduce qe_io{read,write}* wrappers"

This reverts commit 6ac9b61786cc64ae5cbfb69413137656f72e8204.

This commit was required because at that time, ioread/iowrite
functions were sub-optimal on powerpc/32 compared to the
architecture specific in_/out_ IO accessors.

But there are now equivalent since
commit 894fa235eb4c ("powerpc: inline iomap accessors").

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agotty: serial: ucc_uart: replace qe_io{read,write}* wrappers by generic io{read,write}*
Christophe Leroy [Sat, 6 Mar 2021 18:09:30 +0000 (18:09 +0000)]
tty: serial: ucc_uart: replace qe_io{read,write}* wrappers by generic io{read,write}*

Commit 6ac9b61786cc ("soc: fsl: qe: introduce qe_io{read,write}*
wrappers") added specific I/O accessors for qe because at that
time ioread/iowrite functions were sub-optimal on powerpc/32
compared to the architecture specific in_/out_ IO accessors.

But as ioread/iowrite accessors are now equivalent since
commit 894fa235eb4c ("powerpc: inline iomap accessors"),
use them in order to allow removal of the qe specific ones.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agosoc: fsl: qe: replace qe_io{read,write}* wrappers by generic io{read,write}*
Christophe Leroy [Sat, 6 Mar 2021 18:09:29 +0000 (18:09 +0000)]
soc: fsl: qe: replace qe_io{read,write}* wrappers by generic io{read,write}*

Commit 6ac9b61786cc ("soc: fsl: qe: introduce qe_io{read,write}*
wrappers") added specific I/O accessors for qe because at that
time ioread/iowrite functions were sub-optimal on powerpc/32
compared to the architecture specific in_/out_ IO accessors.

But as ioread/iowrite accessors are now equivalent since
commit 894fa235eb4c ("powerpc: inline iomap accessors"),
use them in order to allow removal of the qe specific ones.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agosoc: fsl: guts: fix comment syntax in file
Aditya Srivastava [Sun, 14 Mar 2021 07:28:28 +0000 (12:58 +0530)]
soc: fsl: guts: fix comment syntax in file

The opening comment mark '/**' is used for kernel-doc comments.
There are certain comments in include/linux/fsl/guts.h which follows this
syntax, but the content inside does not comply with kernel-doc.

E.g., opening comment for "Freecale 85xx and 86xx Global Utilties
register set" follows kernel-doc syntax(i.e., '/**'), but the content
inside does not comply with any kernel-doc specification (function,
struct, etc).

This causes unwelcomed warning from kernel-doc:
"warning: expecting prototype for Freecale 85xx and 86xx Global Utilties register set(). Prototype was for __FSL_GUTS_H__() instead"

Replace all such comment occurrences with general comment format,
i.e. '/*' to pervent kernel-doc from parsing these.

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agosoc: fsl: guts: remove unneeded semicolon
Yang Li [Wed, 3 Feb 2021 01:51:03 +0000 (09:51 +0800)]
soc: fsl: guts: remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/soc/fsl/guts.c:120:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agosoc: fsl: qe: Use DEFINE_SPINLOCK() for spinlock
Zheng Yongjun [Wed, 23 Dec 2020 14:14:59 +0000 (22:14 +0800)]
soc: fsl: qe: Use DEFINE_SPINLOCK() for spinlock

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agosoc: fsl: qbman: Delete useless kfree code
Zheng Yongjun [Wed, 16 Dec 2020 13:08:13 +0000 (21:08 +0800)]
soc: fsl: qbman: Delete useless kfree code

The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
3 years agosoc: fsl: qbman: Ensure device cleanup is run for kexec
Roy Pledge [Tue, 3 Nov 2020 20:05:55 +0000 (15:05 -0500)]
soc: fsl: qbman: Ensure device cleanup is run for kexec

Make sure that the QBMan device cleanup routines are executed
when the device was previously initialized. This is needed for
kexec since the device will keep it's state from the previous
kernel that was executing.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
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 agosoc: qcom: wcnss_ctrl: Allow reading firmware-name from DT
Bjorn Andersson [Fri, 12 Mar 2021 00:33:17 +0000 (16:33 -0800)]
soc: qcom: wcnss_ctrl: Allow reading firmware-name from DT

The WLAN NV firmware blob differs between platforms, and possibly
devices, so add support in the wcnss_ctrl driver for reading the path of
this file from DT in order to allow these files to live in a generic
file system (or linux-firmware).

The new property is optional and the code falls back to the old filename
if the property isn't specified.

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Aníbal Limón <anibal.limon@linaro.org>
Link: https://lore.kernel.org/r/20210312003318.3273536-5-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agosoc: qcom: wcnss_ctrl: Introduce local variable "dev"
Bjorn Andersson [Fri, 12 Mar 2021 00:33:16 +0000 (16:33 -0800)]
soc: qcom: wcnss_ctrl: Introduce local variable "dev"

Introduce a local variable to carry the struct device *, to reduce the
line lengths in the next patch.

Tested-by: Aníbal Limón <anibal.limon@linaro.org>
Link: https://lore.kernel.org/r/20210312003318.3273536-4-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
3 years agodt-bindings: soc: qcom: wcnss: Add firmware-name property
Bjorn Andersson [Fri, 12 Mar 2021 00:33:14 +0000 (16:33 -0800)]
dt-bindings: soc: qcom: wcnss: Add firmware-name property

The WCNSS needs firmware which differs between platforms, and possibly
boards. Add a new property "firmware-name" to allow the DT to specify
the platform/board specific path to this firmware file.

Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Aníbal Limón <anibal.limon@linaro.org>
Link: https://lore.kernel.org/r/20210312003318.3273536-2-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
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>