]> www.infradead.org Git - users/willy/xarray.git/log
users/willy/xarray.git
10 months agoMerge tag 'memory-controller-drv-6.12-2' of https://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Wed, 11 Sep 2024 09:46:31 +0000 (09:46 +0000)]
Merge tag 'memory-controller-drv-6.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers

Memory controller drivers for v6.12, part two

1. Renesas RPC-IF: adjust default setting for pins to accommodate
   different flash devices, which should fix 4-bit flash writes with
   Renesas AT25QL128A flash.

2. Simplify a bit probe() in PL172 and PL353-SMC.

* tag 'memory-controller-drv-6.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: pl353-smc: simplify with scoped for each OF child loop
  memory: pl172: simplify releasing AMBA regions with devm
  memory: renesas-rpc-if: Use Hi-Z state as the default setting for IOVF pins

Link: https://lore.kernel.org/r/20240906140859.71712-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'arm-soc/for-6.12/drivers' of https://github.com/Broadcom/stblinux into...
Arnd Bergmann [Wed, 11 Sep 2024 09:01:03 +0000 (09:01 +0000)]
Merge tag 'arm-soc/for-6.12/drivers' of https://github.com/Broadcom/stblinux into soc/drivers

This pull request contains Broadcom SoC driver updates for 6.12, please
pull the following:

- Stefan improves the timeout warning within the Raspberry Pi firmware
  driver

* tag 'arm-soc/for-6.12/drivers' of https://github.com/Broadcom/stblinux:
  firmware: raspberrypi: Improve timeout warning

Link: https://lore.kernel.org/r/20240906180643.2275460-3-florian.fainelli@broadcom.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'v6.12-rockchip-drivers-2' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Wed, 11 Sep 2024 08:56:50 +0000 (08:56 +0000)]
Merge tag 'v6.12-rockchip-drivers-2' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/drivers

One new pmu compatible for rk3576

* tag 'v6.12-rockchip-drivers-2' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  dt-bindings: arm: rockchip: Add rk3576 compatible string to pmu.yaml

Link: https://lore.kernel.org/r/3004026.A7TYtsqqnE@diego
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'v6.11-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/mediate...
Arnd Bergmann [Wed, 11 Sep 2024 08:55:51 +0000 (08:55 +0000)]
Merge tag 'v6.11-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into soc/drivers

pmic warpper:
- reduce size by constifying data structures
- use devm_clk_bulk_det_all_enable

mutex:
- reduce size by changing variable bit size

* tag 'v6.11-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux:
  soc: mediatek: mtk-mutex: Reduce type size for mtk_mutex_data members
  soc: mediatek: pwrap: Use devm_clk_bulk_get_all_enable()
  soc: mediatek: pwrap: Constify some struct int[]
  soc: mediatek: pwrap: Constify struct pmic_wrapper_type

Link: https://lore.kernel.org/r/bfa9ab87-9de8-41fc-bfd1-de5ec324cfe0@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: imx: remove duplicate scmi_imx_misc_ctrl_get()
Arnd Bergmann [Mon, 9 Sep 2024 20:30:18 +0000 (20:30 +0000)]
firmware: imx: remove duplicate scmi_imx_misc_ctrl_get()

These two functions have a stub definition when CONFIG_IMX_SCMI_MISC_EXT
is not set, which conflict with the global definition:

In file included from drivers/firmware/imx/sm-misc.c:6:
include/linux/firmware/imx/sm.h:30:1: error: expected identifier or '(' before '{' token
   30 | {
      | ^
drivers/firmware/imx/sm-misc.c:26:5: error: redefinition of 'scmi_imx_misc_ctrl_get'
   26 | int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
      |     ^~~~~~~~~~~~~~~~~~~~~~
include/linux/firmware/imx/sm.h:24:19: note: previous definition of 'scmi_imx_misc_ctrl_get' with type 'int(u32,  u32 *, u32 *)' {aka 'int(unsigned int,  unsigned int *, unsigned int *)'}
   24 | static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
      |                   ^~~~~~~~~~~~~~~~~~~~~~

There is no real need for the #ifdef, and removing this avoids
the build failure.

Fixes: 0b4f8a68b292 ("firmware: imx: Add i.MX95 MISC driver")
Link: https://lore.kernel.org/r/20240909203023.1275232-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'sunxi-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 5 Sep 2024 19:54:11 +0000 (19:54 +0000)]
Merge tag 'sunxi-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/drivers

Allwinner SoC driver changes for 6.12

- Simplify sunxi-rsb driver probe function using dev_err_probe()

* tag 'sunxi-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  bus: sunxi-rsb: Simplify code with dev_err_probe()

Link: https://lore.kernel.org/r/ZtnYUswjHdLRYq8Y@wens.tw
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoplatform: cznic: turris-omnia-mcu: Fix error check in omnia_mcu_register_trng()
Dan Carpenter [Thu, 5 Sep 2024 13:16:53 +0000 (16:16 +0300)]
platform: cznic: turris-omnia-mcu: Fix error check in omnia_mcu_register_trng()

The gpiod_to_irq() function never returns zero.  It returns negative
error codes or a positive IRQ number.  Update the checking to check
for negatives.

Fixes: 41bb142a4028 ("platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agobus: sunxi-rsb: Simplify code with dev_err_probe()
Zhang Zekun [Thu, 5 Sep 2024 11:41:34 +0000 (19:41 +0800)]
bus: sunxi-rsb: Simplify code with dev_err_probe()

Use dev_err_probe() directly in the driver probe phase. This can
simplify the code a bit.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Link: https://lore.kernel.org/r/20240905114134.80310-1-zhangzekun11@huawei.com
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
10 months agoMerge tag 'amlogic-drivers-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 5 Sep 2024 14:39:15 +0000 (14:39 +0000)]
Merge tag 'amlogic-drivers-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/drivers

Amlogic drivers changes for v6.12:
- Support new Amlogic SoCs in meson-gx-ao-secure & meson-gx-socinfo

* tag 'amlogic-drivers-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  soc: amlogic: meson-gx-socinfo: add new SoCs id
  dt-bindings: arm: amlogic: meson-gx-ao-secure: support more SoCs

Link: https://lore.kernel.org/r/577ad7fe-19b1-468a-b994-573855493fd7@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'qcom-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 5 Sep 2024 14:13:39 +0000 (14:13 +0000)]
Merge tag 'qcom-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers

Qualcomm driver updates for v6.12

Support is added for making SCM driver configure the system either for a
full or minimal ramdump following a system crash. The ramdump mode is
changed from being enable-only to enable/disable as requested.

The QSEECOM uefisecapp interface is allow-listed on Surface Laptop 7 and
Lenovo Thinkpad T14s, providing EFI variable access.

The change to match the SMD RPM driver based on the SMD channel name is
reverted, in favor of stepping back to OF-based matching, as a means to
get module autoloading to work properly.

AOSS, APR, ICE, OCMEM, PBS and SMP2P drivers has error handling cleaned
up using scoped resources.

Trace events are added to the BWMON and SMP2P drivers, for better
insights into their operations.

The X1E LLCC configuration data is updated based on recommended values.

A number of platforms are added to the in-kernel PD-mapper.

SocInfo driver is extended with IDs from SM7325, QCS8275 and QCS8300
families.

* tag 'qcom-drivers-for-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (33 commits)
  firmware: qcom: scm: Allow QSEECOM on Surface Laptop 7 models
  dt-bindings: soc: qcom: qcom,pmic-glink: Document SM7325 compatible
  soc: qcom: pd_mapper: Add SM7325 compatible
  soc: qcom: socinfo: Add Soc IDs for SM7325 family
  dt-bindings: arm: qcom,ids: Add IDs for SM7325 family
  soc: qcom: socinfo: add QCS8275/QCS8300 SoC ID
  dt-bindings: arm: qcom,ids: add SoC ID for QCS8275/QCS8300
  soc: qcom: smp2p: use scoped device node handling to simplify error paths
  soc: qcom: pbs: use scoped device node handling to simplify error paths
  soc: qcom: ocmem: use scoped device node handling to simplify error paths
  soc: qcom: ice: use scoped device node handling to simplify error paths
  soc: qcom: aoss: simplify with scoped for each OF child loop
  soc: qcom: apr: simplify with scoped for each OF child loop
  soc: qcom: smd-rpm: add qcom,smd-rpm compatible
  dt-bindings: soc: qcom: smd-rpm: add generic compatibles
  Revert "soc: qcom: smd-rpm: Match rpmsg channel instead of compatible"
  firmware: qcom: scm: Add multiple download mode support
  firmware: qcom: scm: Refactor code to support multiple dload mode
  soc: qcom: pd_mapper: Add more older platforms without domains
  soc: qcom: pd_mapper: Add X1E80100
  ...

Link: https://lore.kernel.org/r/20240904193042.15118-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'at91-soc-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/at91...
Arnd Bergmann [Thu, 5 Sep 2024 14:13:14 +0000 (14:13 +0000)]
Merge tag 'at91-soc-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/drivers

Microchip AT91 SoC updates for v6.12

It contains:
- support for the Microchip SAM9X7 SoC:
-- power management
-- SoC identification
-- sysreg documentation updates
-- necessary Kconfig updates

* tag 'at91-soc-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
  ARM: at91: Kconfig: add config flag for SAM9X7 SoC
  ARM: at91: add support in SoC driver for new sam9x7
  ARM: at91: pm: add sam9x7 SoC init config
  ARM: at91: pm: add support for sam9x7 SoC family
  dt-bindings: atmel-sysreg: add sam9x7

Link: https://lore.kernel.org/r/20240901133110.2038675-3-claudiu.beznea@tuxon.dev
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agosoc: fsl: qe: ucc: Export ucc_mux_set_grant_tsa_bkpt
Herve Codina [Thu, 5 Sep 2024 07:22:15 +0000 (09:22 +0200)]
soc: fsl: qe: ucc: Export ucc_mux_set_grant_tsa_bkpt

When TSA is compiled as module the following error is reported:
  "ucc_mux_set_grant_tsa_bkpt" [drivers/soc/fsl/qe/tsa.ko] undefined!

Indeed, the ucc_mux_set_grant_tsa_bkpt symbol is not exported.

Simply export ucc_mux_set_grant_tsa_bkpt.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409051409.fszn8rEo-lkp@intel.com/
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'omap-for-v6.12/drivers-signed' of https://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Thu, 5 Sep 2024 14:11:37 +0000 (14:11 +0000)]
Merge tag 'omap-for-v6.12/drivers-signed' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap into soc/drivers

ARM: OMAP2+: misc driver updates for v6.12

* tag 'omap-for-v6.12/drivers-signed' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap:
  ARM: OMAP2+: Remove obsoleted declaration for gpmc_onenand_init
  bus: ti-sysc: Remove excess struct member 'disable_on_idle' description
  bus: ti-sysc: Use of_property_present()

Link: https://lore.kernel.org/r/7hcyljarit.fsf@baylibre.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'imx-drivers-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/shawn...
Arnd Bergmann [Thu, 5 Sep 2024 14:11:31 +0000 (14:11 +0000)]
Merge tag 'imx-drivers-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/drivers

i.MX drivers changes for 6.12:

- A couple of imx-weim bus driver changes from Wu Bo to support compile
  test and use devm_clk_get_enabled() helper to clean up code a bit

* tag 'imx-drivers-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  bus: imx-weim: change to use devm_clk_get_enabled() helper
  bus: imx-weim: support compile test

Link: https://lore.kernel.org/r/20240904143439.211552-1-shawnguo2@yeah.net
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'reset-for-v6.12' of git://git.pengutronix.de/pza/linux into soc/drivers
Arnd Bergmann [Thu, 5 Sep 2024 14:11:20 +0000 (14:11 +0000)]
Merge tag 'reset-for-v6.12' of git://git.pengutronix.de/pza/linux into soc/drivers

Reset controller updates for v6.12

Use get_device()/put_device() to keep reset controller devices alive
while their reset controls are acquired.
Enable support for the Amlogic T7 SoC reset controller.
Remove unused EyeQ reset bindings and add a reset controller driver
to be instantiated as auxiliary device by the EyeQ clock driver.
Fix OF node leaks in the k210 and berlin probe() error paths.
Add some simplifications and cleanup in the core, lcp18xx driver, and
uniphier bindings.

* tag 'reset-for-v6.12' of git://git.pengutronix.de/pza/linux:
  reset: eyeq: add platform driver
  Revert "dt-bindings: reset: mobileye,eyeq5-reset: add bindings"
  reset: reset-meson: Add support for Amlogic T7 SoC reset controller
  dt-bindings: reset: Add Amlogic T7 reset controller
  reset: core: add get_device()/put_device on rcdev
  reset: lpc18xx: simplify with devm_clk_get_enabled()
  reset: lpc18xx: simplify with dev_err_probe()
  reset: simplify locking with guard()
  reset: k210: fix OF node leak in probe() error path
  reset: berlin: fix OF node leak in probe() error path
  dt-bindings: reset: socionext,uniphier-glue-reset: add top-level constraints

Link: https://lore.kernel.org/r/20240904103921.1479579-1-p.zabel@pengutronix.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'integrator-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/linus...
Arnd Bergmann [Thu, 5 Sep 2024 14:11:08 +0000 (14:11 +0000)]
Merge tag 'integrator-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into soc/drivers

Integrator fixes for the v6.12 kernel cycle, some of_node_put():s
were missing in the SoC drivers.

* tag 'integrator-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  bus: integrator-lm: fix OF node leak in probe()
  ARM: versatile: fix OF node leak in CPUs prepare

Link: https://lore.kernel.org/r/CACRpkdahXECZXWA5uv=SZtkzU0E++fQj7QWK8kYuH0-asLUPqg@mail.gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'ti-driver-soc-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Wed, 4 Sep 2024 09:32:52 +0000 (09:32 +0000)]
Merge tag 'ti-driver-soc-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/drivers

TI SoC driver updates for v6.12

- pm33xx/knav_qmss_queue/pruss: Cleanups around device_node scope based cleanups
- knav: Additional fixes around of property
- k3-ringacc: Optimizations for data structure

* tag 'ti-driver-soc-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux:
  soc: ti: pm33xx: do device_node auto cleanup
  soc: ti: knav_qmss_queue: do device_node auto cleanup
  soc: ti: pruss: do device_node auto cleanup
  soc: ti: pruss: factor out memories setup
  soc: ti: knav: Use of_property_read_variable_u32_array()
  soc: ti: knav: Drop unnecessary check for property presence
  soc: ti: k3-ringacc: Constify struct k3_ring_ops

Link: https://lore.kernel.org/r/20240903155632.525twuumykwnfkiz@subtitle
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agosoc: fsl: cpm1: qmc: Fix dependency on fsl_soc.h
Christophe Leroy [Wed, 4 Sep 2024 07:51:09 +0000 (09:51 +0200)]
soc: fsl: cpm1: qmc: Fix dependency on fsl_soc.h

QMC driver requires fsl_soc.h to use function get_immrbase().
This header is provided by powerpc architecture and the functions
it declares are defined only when FSL_SOC is selected.

Today the dependency is the following:

depends on CPM1 || QUICC_ENGINE || \
   (FSL_SOC && (CPM || QUICC_ENGINE) && COMPILE_TEST)

This dependency tentatively ensure that FSL_SOC is there when doing a
COMPILE_TEST.

CPM1 is only selected by PPC_8xx and cannot be selected manually.
CPM1 selects FSL_SOC

QUICC_ENGINE on the other hand can be selected by ARM or ARM64 which
doesn't select FSL_SOC. QUICC_ENGINE can also be selected with just
COMPILE_TEST.

It is therefore possible to end up with CPM_QMC selected
without FSL_SOC.

So fix it by making it depend on FSL_SOC at all time.

The rest of the above dependency is the same as the one for CPM_TSA on
which CPM_QMC also depends, so it can go away, leaving only a simple
dependency on FSL_SOC.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/lkml/20240904104859.020fe3a9@canb.auug.org.au/
Fixes: 8655b76b7004 ("soc: fsl: cpm1: qmc: Handle QUICC Engine (QE) soft-qmc firmware")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agodt-bindings: arm: rockchip: Add rk3576 compatible string to pmu.yaml
Detlev Casanova [Tue, 3 Sep 2024 15:22:32 +0000 (11:22 -0400)]
dt-bindings: arm: rockchip: Add rk3576 compatible string to pmu.yaml

Add the compatible for the pmu mfd on rk3576.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240903152308.13565-3-detlev.casanova@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
10 months agoMerge tag 'soc_fsl-6.12-2' of https://github.com/chleroy/linux into soc/drivers
Arnd Bergmann [Tue, 3 Sep 2024 07:01:30 +0000 (07:01 +0000)]
Merge tag 'soc_fsl-6.12-2' of https://github.com/chleroy/linux into soc/drivers

- A series from Hervé Codina that bring support for the newer version
of QMC (QUICC Multi-channel Controller) and TSA (Time Slots Assigner)
found on MPC 83xx micro-controllers.

- Misc changes for qbman freescale drivers for removing a redundant
warning and using iommu_paging_domain_alloc()

* tag 'soc_fsl-6.12-2' of https://github.com/chleroy/linux: (38 commits)
  soc: fsl: qbman: Remove redundant warnings
  soc: fsl: qbman: Use iommu_paging_domain_alloc()
  MAINTAINERS: Add QE files related to the Freescale QMC controller
  soc: fsl: cpm1: qmc: Handle QUICC Engine (QE) soft-qmc firmware
  soc: fsl: cpm1: qmc: Add support for QUICC Engine (QE) implementation
  soc: fsl: qe: Add missing PUSHSCHED command
  soc: fsl: qe: Add resource-managed muram allocators
  soc: fsl: cpm1: qmc: Introduce qmc_version
  soc: fsl: cpm1: qmc: Rename SCC_GSMRL_MODE_QMC
  soc: fsl: cpm1: qmc: Handle RPACK initialization
  soc: fsl: cpm1: qmc: Rename qmc_chan_command()
  soc: fsl: cpm1: qmc: Introduce qmc_{init,exit}_xcc() and their CPM1 version
  soc: fsl: cpm1: qmc: Introduce qmc_init_resource() and its CPM1 version
  soc: fsl: cpm1: qmc: Re-order probe() operations
  soc: fsl: cpm1: qmc: Introduce qmc_data structure
  dt-bindings: soc: fsl: cpm_qe: Add QUICC Engine (QE) QMC controller
  soc: fsl: cpm1: qmc: Add missing spinlock comment
  soc: fsl: cpm1: qmc: Fix 'transmiter' typo
  soc: fsl: cpm1: qmc: Remove unneeded parenthesis
  soc: fsl: cpm1: qmc: Fix blank line and spaces
  ...

Link: https://lore.kernel.org/r/326d9a7d-7674-4c28-aa40-dd2c190244dd@csgroup.eu
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge branch 'support-for-quicc-engine-tsa-and-qmc'
Christophe Leroy [Fri, 23 Aug 2024 16:35:09 +0000 (18:35 +0200)]
Merge branch 'support-for-quicc-engine-tsa-and-qmc'

Herve Codina says:

================
This series add support for the QUICC Engine (QE) version of TSA and QMC
components.

CPM1 version is already supported and, as the QE version of those
component are pretty similar to the CPM1 version, the series extend
the already existing drivers to support for the QE version.

The TSA and QMC components are tightly coupled and so the series
provides modifications on both components.
Of course, this series can be split if it is needed. Let me know.

The series is composed of:
- Patches 1 and 2: Fixes related to TRNSYNC in the QMC driver
- Patches 3..6: Fixes of checkpatch detected issues in the TSA driver
- Patch 7: The QE TSA device-tree binding
- Patches 8..13: TSA driver preparations for adding support for QE
- Patches 14 and 15: The support for QE in TSA + MAINTAINERS update
- Patch 16: A TSA API improvement needed for the QE QMC driver
- Patch 17: A clarification in the QE QMC driver
- Patches 18..22: Fixes of checkpatch detected issues in the QMC driver
- Patch 23: The QE QMC device-tree binding
- Patches 24..31: QMC driver preparations for adding support for QE
- Patches 32 and 33: Missing features additions in QE code
- Patches 34..36: The QMC support for QE in QMC + MAINTAINERS update

Compared to the previous iteration, this v2 series updates device-tree
bindings and fixes issues detected by kernel test robots.

Related to the QE QMC device-tree binding, I kept the unit address in
decimal and the 3 compatible strings.
================

Link: https://lore.kernel.org/r/20240808071132.149251-1-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: qbman: Remove redundant warnings
Xiaolei Wang [Fri, 2 Aug 2024 02:16:51 +0000 (10:16 +0800)]
soc: fsl: qbman: Remove redundant warnings

This warning was added by commit 07f86917a450 ("soc/fsl/qbman: Use
shared-dma-pool for QMan private memory allocations") but
RESERVEDMEM_OF_DECLARE usage was removed by
commit 3e62273ac63a ("soc: fsl: qbman: Remove RESERVEDMEM_OF_DECLARE
usage") . For non-popwerpc platforms, such as ls1043, this warning
is redundant. ls1043 itself uses shared-dma-mem.

Fixes: 3e62273ac63a ("soc: fsl: qbman: Remove RESERVEDMEM_OF_DECLARE usage")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Link: https://lore.kernel.org/r/20240802021651.3854295-1-xiaolei.wang@windriver.com
[chleroy: Added more details in commit message]
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: qbman: Use iommu_paging_domain_alloc()
Lu Baolu [Mon, 12 Aug 2024 07:25:27 +0000 (15:25 +0800)]
soc: fsl: qbman: Use iommu_paging_domain_alloc()

An iommu domain is allocated in portal_set_cpu() and is attached to
pcfg->dev in the same function.

Use iommu_paging_domain_alloc() to make it explicit.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20240610085555.88197-14-baolu.lu@linux.intel.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agoMAINTAINERS: Add QE files related to the Freescale QMC controller
Herve Codina [Thu, 8 Aug 2024 07:11:29 +0000 (09:11 +0200)]
MAINTAINERS: Add QE files related to the Freescale QMC controller

The Freescale QMC controller driver supports both QE and CPM1.

Add the newly introduced QE files to the existing entry.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-37-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Handle QUICC Engine (QE) soft-qmc firmware
Herve Codina [Thu, 8 Aug 2024 07:11:28 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Handle QUICC Engine (QE) soft-qmc firmware

The QUICC Engine (QE) QMC can use a firmware to have the QMC working in
'soft-qmc' mode.

Handle this optional 'soft-qmc' firmware.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-36-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Add support for QUICC Engine (QE) implementation
Herve Codina [Thu, 8 Aug 2024 07:11:27 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Add support for QUICC Engine (QE) implementation

Add support for the QMC (QUICC Multichannel Controller) available in
some PowerQUICC SoC that uses a QUICC Engine (QE) block such as MPC8321.

This QE QMC is similar to the CPM QMC except that it uses UCCs (Unified
Communication Controllers) instead of SCCs (Serial Communication
Controllers). Also, compared against the CPM QMC, this QE QMC does not
use a fixed area for the UCC/SCC parameters area but it uses a dynamic
area allocated and provided to the hardware at runtime.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-35-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: qe: Add missing PUSHSCHED command
Herve Codina [Thu, 8 Aug 2024 07:11:26 +0000 (09:11 +0200)]
soc: fsl: qe: Add missing PUSHSCHED command

The PUSHSCHED command is missing in the QE header file.

This command is supported on MPC8321 and is used to modify the start
address for the task running on a given peripheral. It is needed for the
QMC in order to perform the re-initialization procedure and so, ensure
the correct UCC setup in that case.

Simply add the missing command in the commands list available in the QE
header file.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-34-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: qe: Add resource-managed muram allocators
Herve Codina [Thu, 8 Aug 2024 07:11:25 +0000 (09:11 +0200)]
soc: fsl: qe: Add resource-managed muram allocators

Introduce devm_cpm_muram_alloc() and devm_cpm_muram_alloc_fixed(), the
resource-managed version of cpm_muram_alloc and cpm_muram_alloc_fixed().

These resource-managed versions simplify the user avoiding the need to
call cpm_muram_free(). Indeed, the allocated area returned by these
functions will be automatically freed on driver detach.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-33-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Introduce qmc_version
Herve Codina [Thu, 8 Aug 2024 07:11:24 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Introduce qmc_version

Current code handles the CPM1 version of QMC.

In order to prepare the support for the QUICC Engine (QE) version of
QMC, introduce qmc_version to identify versions. This will enable the
code to make the distinction between several QMC implementations.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-32-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Rename SCC_GSMRL_MODE_QMC
Herve Codina [Thu, 8 Aug 2024 07:11:23 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Rename SCC_GSMRL_MODE_QMC

Current code handles CPM1 version of QMC. Even if GSMRL is specific to
the CPM1 version, the exact same purpose and format register (GUMRL) is
present in the QUICC Engine (QE) version of QMC. Compared to the QE
version, the values defined for the mode bitfield are different and the
0x0A value defined for the QMC mode is CPM1 specific.

In order to prepare the support for the QE version, rename this bitfield
value to clearly identify it as CPM1 specific.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-31-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Handle RPACK initialization
Herve Codina [Thu, 8 Aug 2024 07:11:22 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Handle RPACK initialization

Current code handles the CPM1 version of QMC, RPACK does not need to
be initialized. This is not the case in the QUICC Engine (QE) version.

In preparation of the support for QE, initialize the RPACK register
when the receiver is initialized and each time it is restarted.

This additional RPACK initialization has no impact in the CPM1 version
of QMC.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-30-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Rename qmc_chan_command()
Herve Codina [Thu, 8 Aug 2024 07:11:21 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Rename qmc_chan_command()

Current code handles CPM1 version of QMC and qmc_chan_command() is
clearly CPM1 specific.

In order to prepare the support for the QUICC Engine (QE) version,
rename qmc_chan_command() to reflect that point.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-29-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Introduce qmc_{init,exit}_xcc() and their CPM1 version
Herve Codina [Thu, 8 Aug 2024 07:11:20 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Introduce qmc_{init,exit}_xcc() and their CPM1 version

Current code handles the CPM1 version of QMC and initialize the QMC used
SCC. The QUICC Engine (QE) version uses an UCC (Unified Communication
Controllers) instead of the SCC (Serial Communication Controllers) used
in the CPM1 version. These controllers serve the same purpose and are
used in the same way but their inializations are slightly different.

In order to prepare the support for QE version of QMC, introduce
qmc_init_xcc() to initialize theses controllers (UCC in QE and SCC in
CPM1) and isolate the CPM1 specific SCC initialization in a specific
function.

Also introduce qmc_exit_xcc() for consistency to revert operations done
in qmc_init_xcc().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-28-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Introduce qmc_init_resource() and its CPM1 version
Herve Codina [Thu, 8 Aug 2024 07:11:19 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Introduce qmc_init_resource() and its CPM1 version

Current code handles the CPM1 version of QMC. Resources initialisations
(i.e. retrieving base addresses and offsets of different parts) will
be slightly different in the QUICC Engine (QE) version. Indeed, in QE
version, some resources need to be allocated and are no more "staticaly"
defined.

In order to prepare the support for QE version, introduce
qmc_init_resource() to initialize those resources and isolate the CPM1
specific operations in a specific function.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-27-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Re-order probe() operations
Herve Codina [Thu, 8 Aug 2024 07:11:18 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Re-order probe() operations

Current code handles CPM1 version of QMC. In the QUICC Engine (QE)
version, some operations done at probe() need to be done in a different
order.

In order to prepare the support for the QE version, changed the sequence
of operation done at probe():
- Retrieve the tsa_serial earlier, before initializing resources.
- Group SCC initialisation and do this initialization when it is really
  needed in the probe() sequence.

Having the QE compatible sequence in the CPM1 version does not lead to
any issue and works correctly without any regressions.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-26-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Introduce qmc_data structure
Herve Codina [Thu, 8 Aug 2024 07:11:17 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Introduce qmc_data structure

Current code handles CPM1 version of QMC. Some hardcoded values are used
several times to initialize the QMC state machine. In the QUICC Engine
(QE) version of QMC, these values are different.

In order to prepare the support for the QE version of QMC and avoid the
copy of the hardcoded values, introduce the qmc_data structure to define
these version specific values.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-25-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agodt-bindings: soc: fsl: cpm_qe: Add QUICC Engine (QE) QMC controller
Herve Codina [Thu, 8 Aug 2024 07:11:16 +0000 (09:11 +0200)]
dt-bindings: soc: fsl: cpm_qe: Add QUICC Engine (QE) QMC controller

Add support for the QMC (QUICC Multichannel Controller) available in
some PowerQUICC SoC that uses a QUICC Engine (QE) block such as MPC8321.

This QE QMC is similar to the CPM QMC except that it uses UCCs (Unified
Communication Controllers) instead of SCCs (Serial Communication
Controllers). Also, compared against the CPM QMC, this QE QMC does not
use a fixed area for the UCC/SCC parameters area but it uses a dynamic
area allocated and provided to the hardware at runtime.
Last point, the QE QMC can use a firmware to have the QMC working in
'soft-qmc' mode.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-24-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Add missing spinlock comment
Herve Codina [Thu, 8 Aug 2024 07:11:15 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Add missing spinlock comment

checkpatch.pl raises the following issue
  CHECK: spinlock_t definition without comment

Add the missing comments.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-23-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Fix 'transmiter' typo
Herve Codina [Thu, 8 Aug 2024 07:11:14 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Fix 'transmiter' typo

checkpatch.pl raises the following issue
  CHECK: 'transmiter' may be misspelled - perhaps 'transmitter'?

Indeed, fix it.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-22-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Remove unneeded parenthesis
Herve Codina [Thu, 8 Aug 2024 07:11:13 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Remove unneeded parenthesis

checkpatch.pl raises the following issue in several places
  CHECK: Unnecessary parenthesis around ...

Remove them.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-21-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Fix blank line and spaces
Herve Codina [Thu, 8 Aug 2024 07:11:12 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Fix blank line and spaces

checkpatch.pl raises the following issues
  CHECK: Please don't use multiple blank lines
  CHECK: Alignment should match open parenthesis

Fix them.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-20-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Use BIT(), GENMASK() and FIELD_PREP() macros
Herve Codina [Thu, 8 Aug 2024 07:11:11 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Use BIT(), GENMASK() and FIELD_PREP() macros

checkpatch.pl signals the following improvement for qmc.c
  CHECK: Prefer using the BIT macro

Follow its suggestion and convert the code to BIT() and related macros.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-19-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Rename QMC_TSA_MASK
Herve Codina [Thu, 8 Aug 2024 07:11:10 +0000 (09:11 +0200)]
soc: fsl: cpm1: qmc: Rename QMC_TSA_MASK

QMC_TSA_MASK is a bitfield. The value defined is a specific value of
this bitfield and correspond to the use of 8bit resolution for the
routing entry.

Be accurate and rename the defined constant to reflect this point.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-18-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Introduce tsa_serial_get_num()
Herve Codina [Thu, 8 Aug 2024 07:11:09 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Introduce tsa_serial_get_num()

TSA consumers in CPM1 implementation don't need to know about the serial
device number used by the TSA component. In QUICC Engine implementation,
this information is needed.

Improve the TSA API with tsa_serial_get_num() in order to provide this
information.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-17-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agoMAINTAINERS: Add QE files related to the Freescale TSA controller
Herve Codina [Thu, 8 Aug 2024 07:11:08 +0000 (09:11 +0200)]
MAINTAINERS: Add QE files related to the Freescale TSA controller

The Freescale TSA controller driver supports both QE and CPM1.

Add the newly introduced QE files to the existing entry.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-16-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Add support for QUICC Engine (QE) implementation
Herve Codina [Thu, 8 Aug 2024 07:11:07 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Add support for QUICC Engine (QE) implementation

Add support for the time slot assigner (TSA) available in some
PowerQUICC SoC that uses a QUICC Engine (QE) block such as MPC8321.

The QE TSA is similar to the CPM1 TSA except that it uses UCCs (Unified
Communication Controllers) instead of SCCs (Serial Communication
Controllers).
Also, compared against the CPM1 TSA, this QE TSA can handle up to 4 TDMs
instead of 2 and allows to configure the logic level of sync signals.

At a lower level, compared against CPM TSA implementation, some
registers are slightly different even if same features are present.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-15-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Introduce tsa_version
Herve Codina [Thu, 8 Aug 2024 07:11:06 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Introduce tsa_version

Current code handles CPM1 version of TSA.

In order to prepare the support for the QUICC Engine (QE) version of
TSA, introduce tsa_version to identify versions. This will enable the
code to make the distinction between several TSA implementations.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-14-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Isolate specific CPM1 part from tsa_serial_{dis}connect()
Herve Codina [Thu, 8 Aug 2024 07:11:05 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Isolate specific CPM1 part from tsa_serial_{dis}connect()

Current code handles the CPM1 version of TSA. Connecting and
disconnecting the SCC to/from the TSA consists in handling SICR register
which is CPM1 specific. The connection and disconnection operation in
the QUICC Engine (QE) version are slightly different.

In order to prepare the support for the QE version, clearly identify
SICR register as specific to CPM1 and isolate its handling done in
connect and disconnect functions.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-13-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Introduce tsa_setup() and its CPM1 compatible version
Herve Codina [Thu, 8 Aug 2024 07:11:04 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Introduce tsa_setup() and its CPM1 compatible version

Current code handles the CPM1 version of TSA. Setting up TSA consists in
handling SIMODE and SIGMR registers. These registers are CPM1 specific.

Setting up the QUICC Engine (QE) version of TSA is slightly different.

In order to prepare the support for QE version, clearly identify these
registers as CPM1 compatible and isolate their handling in a CPM1
specific function.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-12-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Make SIRAM entries specific to CPM1
Herve Codina [Thu, 8 Aug 2024 07:11:03 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Make SIRAM entries specific to CPM1

Current code handles the CPM1 version of TSA. Compared against QUICC
Engine (QE) version of TSA, CPM1 SIRAM entries are slightly different.

In order to prepare the support for the QE version, clearly identify
these entries and functions handling them as CPM1 compatible.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-11-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Use ARRAY_SIZE() instead of hardcoded integer values
Herve Codina [Thu, 8 Aug 2024 07:11:02 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Use ARRAY_SIZE() instead of hardcoded integer values

Loops handling the tdm array use hardcoded size and the initialization
part uses hardcoded indexes to initialize the array.

Use ARRAY_SIZE() to avoid the hardcoded size and initialize the array
using a loop.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-10-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Remove unused registers offset definition
Herve Codina [Thu, 8 Aug 2024 07:11:01 +0000 (09:11 +0200)]
soc: fsl: cpm1: tsa: Remove unused registers offset definition

SISTR, SICMR and SIRP registers offset definitions are not used.

In order to avoid unneeded code, remove them.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-9-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agodt-bindings: soc: fsl: cpm_qe: Add QUICC Engine (QE) TSA controller
Herve Codina [Thu, 8 Aug 2024 07:11:00 +0000 (09:11 +0200)]
dt-bindings: soc: fsl: cpm_qe: Add QUICC Engine (QE) TSA controller

Add support for the time slot assigner (TSA) available in some
PowerQUICC SoC that uses a QUICC Engine (QE) block such as MPC8321.

This QE TSA is similar to the CPM TSA except that it uses UCCs (Unified
Communication Controllers) instead of SCCs (Serial Communication
Controllers). Also, compared against the CPM TSA, this QE TSA can handle
up to 4 TDMs instead of 2 and allows to configure the logic level of
sync signals.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-8-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Add missing spinlock comment
Herve Codina [Thu, 8 Aug 2024 07:10:59 +0000 (09:10 +0200)]
soc: fsl: cpm1: tsa: Add missing spinlock comment

checkpatch.pl raises the following issue
  CHECK: spinlock_t definition without comment

Add the missing comment.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-7-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Fix blank line and spaces
Herve Codina [Thu, 8 Aug 2024 07:10:58 +0000 (09:10 +0200)]
soc: fsl: cpm1: tsa: Fix blank line and spaces

checkpatch.pl raises the following issues
  CHECK: Please don't use multiple blank lines
  CHECK: spaces preferred around that '/' (ctx:VxV)
  CHECK: spaces preferred around that '+' (ctx:VxV)
  CHECK: spaces preferred around that '-' (ctx:VxV)

Fix them.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-6-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Use BIT(), GENMASK() and FIELD_PREP() macros
Herve Codina [Thu, 8 Aug 2024 07:10:57 +0000 (09:10 +0200)]
soc: fsl: cpm1: tsa: Use BIT(), GENMASK() and FIELD_PREP() macros

checkpatch.pl signals the following improvement for tsa.c
  CHECK: Prefer using the BIT macro

Follow its suggestion and convert the code to BIT() and related macros.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-5-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: tsa: Fix tsa_write8()
Herve Codina [Thu, 8 Aug 2024 07:10:56 +0000 (09:10 +0200)]
soc: fsl: cpm1: tsa: Fix tsa_write8()

The tsa_write8() parameter is an u32 value. This is not consistent with
the function itself. Indeed, tsa_write8() writes an 8bits value.

Be consistent and use an u8 parameter value.

Fixes: 1d4ba0b81c1c ("soc: fsl: cpm1: Add support for TSA")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-4-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Enable TRNSYNC only when needed
Herve Codina [Thu, 8 Aug 2024 07:10:55 +0000 (09:10 +0200)]
soc: fsl: cpm1: qmc: Enable TRNSYNC only when needed

The TRNSYNC feature is enabled whatever the number of time-slots used.
The feature is needed only when more than one time-slot is used.

Improve the driver enabling TRNSYNC only when it is needed.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-3-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agosoc: fsl: cpm1: qmc: Update TRNSYNC only in transparent mode
Herve Codina [Thu, 8 Aug 2024 07:10:54 +0000 (09:10 +0200)]
soc: fsl: cpm1: qmc: Update TRNSYNC only in transparent mode

The TRNSYNC feature is available (and enabled) only in transparent mode.

Since commit 7cc9bda9c163 ("soc: fsl: cpm1: qmc: Handle timeslot entries
at channel start() and stop()") TRNSYNC register is updated in
transparent and hdlc mode. In hdlc mode, the address of the TRNSYNC
register is used by the QMC for other internal purpose. Even if no weird
results were observed in hdlc mode, touching this register in this mode
is wrong.

Update TRNSYNC only in transparent mode.

Fixes: 7cc9bda9c163 ("soc: fsl: cpm1: qmc: Handle timeslot entries at channel start() and stop()")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20240808071132.149251-2-herve.codina@bootlin.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
10 months agoMerge tag 'tegra-for-6.12-firmware' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 2 Sep 2024 10:23:22 +0000 (10:23 +0000)]
Merge tag 'tegra-for-6.12-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

firmware: tegra: Changes for v6.12-rc1

The changes in this set remove some unused code and simplify error paths
using scoped helpers.

* tag 'tegra-for-6.12-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  firmware: tegra: bpmp: Use scoped device node handling to simplify error paths
  firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp()

Link: https://lore.kernel.org/r/20240830141004.3195210-2-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'tegra-for-6.12-soc' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 2 Sep 2024 10:22:20 +0000 (10:22 +0000)]
Merge tag 'tegra-for-6.12-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

soc/tegra: Changes for v6.12-rc1

This is a single patch that simplifies code a little by employing the
new scoped OF helpers.

* tag 'tegra-for-6.12-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  soc/tegra: pmc: Simplify with scoped for each OF child loop

Link: https://lore.kernel.org/r/20240830141004.3195210-1-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'scmi-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 2 Sep 2024 10:20:13 +0000 (10:20 +0000)]
Merge tag 'scmi-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm SCMI updates for v6.12

Few main features include:

1. SCMI transport as stand-alone drivers

    Currently the SCMI transport layer is being built embedded into in
    the core SCMI stack. Some of these transports, despite being currently
    part of the main SCMI module, are indeed also registered with different
    subsystems like optee or virtio, and actively probed also by those.
    This leads to a few awkward and convoluted tricks to properly handle
    such interactions at boot time in the SCMI stack.

    This change adds the new logic to the core SCMI stack so that each
    existing transport is transitioned to be a standi-alone driver. With
    that all the probe deferral and awkward retries between the SCMI
    core stack and the transports has been removed, since no more needed.

2. Support for obtaining transport descriptors from the devicetree

    SCMI platform firmwares might have different designs depending on
    the platform. Some of the transport descriptors rely on such design.
    E.g. the maximum receive channel timeout value might vary depending
    on the specific underlying hardware and firmware design choices.

    This change adds support for max-rx-timeout-ms property to describe
    the transport needs of a specific platform design. It will be extended
    in the future to obtain other such hardware/firmware dependent
    transport related descriptors.

3. NXP i.MX95 specific SCMI vendor protocol extensions

    SCMI specification allows vendor or platform-specific extensions to
    the interface. NXP i.MX95 System Manager(SM) that implements SCMI
    extends the interface to implement couple of vendor/platform specific
    protocol, namely:
    a. Battery Backed Module(BBM) Protocol

       This protocol is intended provide access to the battery-backed
       module. This contains persistent storage (GPR), an RTC, and the
       ON/OFF button. The protocol can also provide access to similar
       functions implemented via external board components.

    b. MISC Protocol for misc settings

        This includes controls that are misc settings/actions that must
be exposed from the SM to agents. They are device specific and
are usually define to access bit fields in various mix block
control modules, IOMUX_GPR, and other GPR/CSR owned by the SM.

4. SCMI debug/tracking metrics

    Since SCMI involves interaction with the entity(software, firmware
    and/or hardware) providing services or features, it is quite useful
    to track certain metrics(for pure debugging purposes) like how many
    messages were sent or received, were there any failures, what kind
    of failures, ..etc. This feature adds support for the same via debugfs.

Apart from these main features, there are some miscellaneous updates, fixes
and cleanups.

* tag 'scmi-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (31 commits)
  rtc: support i.MX95 BBM RTC
  input: keyboard: support i.MX95 BBM module
  firmware: imx: Add i.MX95 MISC driver
  firmware: arm_scmi: Add initial support for i.MX MISC protocol
  firmware: arm_scmi: Add initial support for i.MX BBM protocol
  firmware: arm_scmi: Add NXP i.MX95 SCMI documentation
  dt-bindings: firmware: Add i.MX95 SCMI Extension protocol
  firmware: arm_scmi: Replace comma with the semicolon
  firmware: arm_scmi: Replace the use of of_node_put() to __free(device_node)
  firmware: arm_scmi: Fix trivial whitespace/coding style issues
  firmware: arm_scmi: Use max-rx-timeout-ms from devicetree
  dt-bindings: firmware: arm,scmi: Introduce property max-rx-timeout-ms
  firmware: arm_scmi: Remove const from transport descriptors
  firmware: arm_scmi: Simplify with scoped for each OF child loop
  firmware: arm_scmi: Update various protocols versions
  firmware: arm_scmi: Remove legacy transport-layer code
  firmware: arm_scmi: Make VirtIO transport a standalone driver
  firmware: arm_scmi: Make OPTEE transport a standalone driver
  firmware: arm_scmi: Make SMC transport a standalone driver
  firmware: arm_scmi: Make MBOX transport a standalone driver
  ...

Link: https://lore.kernel.org/r/20240830135918.2383664-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'ffa-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudee...
Arnd Bergmann [Mon, 2 Sep 2024 10:18:44 +0000 (10:18 +0000)]
Merge tag 'ffa-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm FF-A updates for v6.12

The main addition this time is the basic support for FF-A v1.2
specification which includes support for newly added:
1. FFA_MSG_SEND_DIRECT_{REQ,RESP}2
2. FFA_PARTITION_INFO_GET_REGS
3. FFA_YIELD support in direct messaging

Apart from these, the changes include support to fetch the Rx/Tx buffer
size using FFA_FEATURES, addition of the FF-A FIDs for v1.2 and some
coding style cleanups.

* tag 'ffa-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_ffa: Fetch the Rx/Tx buffer size using ffa_features()
  firmware: arm_ffa: Add support for FFA_YIELD in direct messaging
  firmware: arm_ffa: Add support for FFA_MSG_SEND_DIRECT_{REQ,RESP}2
  firmware: arm_ffa: Add support for FFA_PARTITION_INFO_GET_REGS
  firmware: arm_ffa: Move the function ffa_features() earlier
  firmware: arm_ffa: Update the FF-A command list with v1.2 additions
  firmware: arm_ffa: Some coding style fixes

Link: https://lore.kernel.org/r/20240830135759.2383431-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'versatile-soc-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 2 Sep 2024 10:17:33 +0000 (10:17 +0000)]
Merge tag 'versatile-soc-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into soc/drivers

Some long due cleanups and modernizations of the Versatile
SoC drivers from Krzysztof:

- Put OF handle
- Use devres to avoid memory leaks
- Enable compile testing

* tag 'versatile-soc-for-v6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator:
  soc: versatile: enable compile testing
  soc: versatile: realview: fix soc_dev leak during device remove
  soc: versatile: realview: fix memory leak during device remove
  soc: versatile: integrator: fix OF node leak in probe() error path

Link: https://lore.kernel.org/r/CACRpkda244rFHnnXPDPOhmKiJsRP08tNCcfFzpH5zR2cx1DFpw@mail.gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoreset: eyeq: add platform driver
Théo Lebrun [Tue, 30 Jul 2024 16:06:23 +0000 (18:06 +0200)]
reset: eyeq: add platform driver

Add Mobileye EyeQ reset controller driver, for EyeQ5, EyeQ6L and EyeQ6H
SoCs. Instances belong to a shared register region called OLB and gets
spawned as auxiliary device to the platform driver for clock.

There is one OLB instance for EyeQ5 and EyeQ6L. There are seven OLB
instances on EyeQ6H; three have a reset controller embedded:
 - West and east get handled by the same compatible.
 - Acc (accelerator) is another one.

Each instance vary in the number and types of reset domains.
Instances with single domain expect a single cell, others two.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240730-mbly-reset-v2-2-00b870a6a2ff@bootlin.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoRevert "dt-bindings: reset: mobileye,eyeq5-reset: add bindings"
Théo Lebrun [Tue, 30 Jul 2024 16:06:22 +0000 (18:06 +0200)]
Revert "dt-bindings: reset: mobileye,eyeq5-reset: add bindings"

Switch from one sub-node per functionality in the system-controller to a
single node representing the entire OLB instance. This is the
recommended approach for controllers handling many different
functionalities; it is a single controller and should be represented by
a single devicetree node.

The reset bindings is removed and all properties will be described by:
soc/mobileye/mobileye,eyeq5-olb.yaml

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240730-mbly-reset-v2-1-00b870a6a2ff@bootlin.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: reset-meson: Add support for Amlogic T7 SoC reset controller
Zelong Dong [Mon, 22 Apr 2024 11:11:44 +0000 (19:11 +0800)]
reset: reset-meson: Add support for Amlogic T7 SoC reset controller

There are 7 sets of Reset Source in Amlogic T7 SoC reset controller,
and the offset between base and level registers is 0x40.
Add a new compatible string and struct meson_reset_param to support
the reset controller on T7 SoC.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Signed-off-by: Kelvin Zhang <kelvin.zhang@amlogic.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240422-t7-reset-v2-2-cb82271d3296@amlogic.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agodt-bindings: reset: Add Amlogic T7 reset controller
Zelong Dong [Mon, 22 Apr 2024 11:11:43 +0000 (19:11 +0800)]
dt-bindings: reset: Add Amlogic T7 reset controller

Add a new compatible for Amlogic T7 reset controller.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Signed-off-by: Kelvin Zhang <kelvin.zhang@amlogic.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240422-t7-reset-v2-1-cb82271d3296@amlogic.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: core: add get_device()/put_device on rcdev
Clément Léger [Thu, 8 Aug 2024 15:46:56 +0000 (17:46 +0200)]
reset: core: add get_device()/put_device on rcdev

Since the rcdev structure is allocated by the reset controller drivers
themselves, they need to exists as long as there is a consumer. A call to
module_get() is already existing but that does not work when using
device-tree overlays. In order to guarantee that the underlying reset
controller device does not vanish while using it, add a get_device() call
when retrieving a reset control from a reset controller device and a
put_device() when releasing that control.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240808154658.247873-8-herve.codina@bootlin.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: lpc18xx: simplify with devm_clk_get_enabled()
Krzysztof Kozlowski [Sun, 25 Aug 2024 14:14:28 +0000 (16:14 +0200)]
reset: lpc18xx: simplify with devm_clk_get_enabled()

Use devm_clk_get_enabled() to drop clock prepare/unprepare parts and
make the code simpler.  Change to dev_err_probe() in handling
reset_controller_register() error to make it even simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20240825-reset-cleanup-scoped-v1-5-03f6d834f8c0@linaro.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: lpc18xx: simplify with dev_err_probe()
Krzysztof Kozlowski [Sun, 25 Aug 2024 14:14:27 +0000 (16:14 +0200)]
reset: lpc18xx: simplify with dev_err_probe()

Use dev_err_probe() to avoid dmesg flood on actual defer.  This makes
the code also simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20240825-reset-cleanup-scoped-v1-4-03f6d834f8c0@linaro.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: simplify locking with guard()
Krzysztof Kozlowski [Sun, 25 Aug 2024 14:14:26 +0000 (16:14 +0200)]
reset: simplify locking with guard()

Simplify error handling (less gotos) over locks with guard().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20240825-reset-cleanup-scoped-v1-3-03f6d834f8c0@linaro.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: k210: fix OF node leak in probe() error path
Krzysztof Kozlowski [Sun, 25 Aug 2024 14:14:25 +0000 (16:14 +0200)]
reset: k210: fix OF node leak in probe() error path

Driver is leaking OF node reference on memory allocation failure.
Acquire the OF node reference after memory allocation to fix this and
keep it simple.

Fixes: 5a2308da9f60 ("riscv: Add Canaan Kendryte K210 reset controller")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240825-reset-cleanup-scoped-v1-2-03f6d834f8c0@linaro.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoreset: berlin: fix OF node leak in probe() error path
Krzysztof Kozlowski [Sun, 25 Aug 2024 14:14:24 +0000 (16:14 +0200)]
reset: berlin: fix OF node leak in probe() error path

Driver is leaking OF node reference on memory allocation failure.
Acquire the OF node reference after memory allocation to fix this and
keep it simple.

Fixes: aed6f3cadc86 ("reset: berlin: convert to a platform driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240825-reset-cleanup-scoped-v1-1-03f6d834f8c0@linaro.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agoMerge tag 'v6.12-rockchip-drivers-1' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 2 Sep 2024 09:47:47 +0000 (09:47 +0000)]
Merge tag 'v6.12-rockchip-drivers-1' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/drivers

rk3308 io-domains, and some default settings for bits in the general
register files for rk3128 and the new rk3576 soc.

* tag 'v6.12-rockchip-drivers-1' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  soc: rockchip: grf: Add rk3576 default GRF values
  dt-bindings: soc: rockchip: Add rk3576 syscon compatibles
  soc: rockchip: grf: Set RK3128's vpu main clock
  soc: rockchip: io-domain: Add RK3308 IO voltage domains
  dt-bindings: power: rockchip: Document RK3308 IO voltage domains

Link: https://lore.kernel.org/r/23316481.ssLaC8jLEa@diego
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'memory-controller-drv-6.12' of https://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Mon, 2 Sep 2024 09:45:17 +0000 (09:45 +0000)]
Merge tag 'memory-controller-drv-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers

Memory controller drivers for v6.12

1. Tegra210 EMC: Driver refactoring and rework.
2. Tegra186 EMC: Drop unused function.
3. FSL WEIM: Correct fsl,weim-cs-timing property to properly validate it
   as an array.
4. TI AEMIF: Drop platform data support.
5. TI EMIF: Switch to of_property_read_bool().

6. Several cleanups in multiple drivers: TI AEMIF and EMIF, Tegra
   EMC/MC, Atmel EBI, Samsung Exynos5422 DMC, STM32 FMC2 EBI, OMAP GPMC,
   PL172 and PL1353 SMC.  These are mostly code simplifying around
   probe() like using
    - devm_clk_get_enabled(),
    - dev_err_probe(),
    - scoped device node handling (cleanup.h),
    - scoped for each OF child loops,
    - scoped/guard locks.

* tag 'memory-controller-drv-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: (35 commits)
  memory: mtk-smi: Use devm_clk_get_enabled()
  memory: pl353-smc: simplify with devm_clk_get_enabled()
  memory: pl353-smc: simplify with dev_err_probe()
  memory: pl172: simplify with devm_clk_get_enabled()
  memory: pl172: simplify with dev_err_probe()
  memory: omap-gpmc: simplify locking with guard()
  memory: emif: simplify locking with guard()
  memory: emif: drop unused 'irq_state' member
  memory: ti-aemif: Revert "memory: ti-aemif: don't needlessly iterate over child nodes"
  memory: ti-aemif: simplify with scoped for each OF child loop
  memory: ti-aemif: simplify with dev_err_probe()
  memory: tegra30-emc: simplify with scoped for each OF child loop
  memory: tegra20-emc: simplify with scoped for each OF child loop
  memory: tegra124-emc: simplify with scoped for each OF child loop
  memory: tegra-mc: simplify with scoped for each OF child loop
  memory: stm32-fmc2-ebi: simplify with dev_err_probe()
  memory: stm32-fmc2-ebi: simplify with scoped for each OF child loop
  memory: samsung: exynos5422-dmc: use scoped device node handling to simplify error paths
  memory: samsung: exynos5422-dmc: simplify dmc->dev usage
  memory: atmel-ebi: simplify with scoped for each OF child loop
  ...

Link: https://lore.kernel.org/r/20240827122926.30794-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agoMerge tag 'samsung-drivers-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Mon, 2 Sep 2024 09:44:21 +0000 (09:44 +0000)]
Merge tag 'samsung-drivers-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/drivers

Samsung SoC drivers for v6.12

1. Improve Samsung USI (Universal Serial Interface) DT binding,
2. Cleanup old Samsung MFC TXT binding.

* tag 'samsung-drivers-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  dt-bindings: media: s5p-mfc: Remove s5p-mfc.txt binding
  dt-bindings: samsung: exynos-usi: add missing constraints

Link: https://lore.kernel.org/r/20240827121638.29707-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Deduplicate command execution code
Marek Behún [Sat, 31 Aug 2024 09:20:50 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Deduplicate command execution code

Deduplicate rWTM command execution calls
  mbox_send_message()
  wait_for_completion()
  mox_get_status()
to one function
  mox_rwtm_exec()

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-17-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use ALIGN() instead of hardcoding
Marek Behún [Sat, 31 Aug 2024 09:20:49 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use ALIGN() instead of hardcoding

Use ALIGN(max, 4) instead of hardcoding ((max + 3) & ~3).

Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-16-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use EOPNOTSUPP instead of ENOSYS
Marek Behún [Sat, 31 Aug 2024 09:20:48 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use EOPNOTSUPP instead of ENOSYS

Checkpatch warns agains -ENOSYS:
  WARNING: ENOSYS means 'invalid syscall nr' and nothing else
Use EOPNOTSUPP instead.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-15-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use container_of() instead of hwrng .priv member
Marek Behún [Sat, 31 Aug 2024 09:20:47 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use container_of() instead of hwrng .priv member

Use container_of() to get driver private structure from hwnrg structure,
instead of the hwrng's .priv member, as suggested by Herbert for another
driver.

Link: https://lore.kernel.org/soc/ZmLhQBdmg613KdET@gondor.apana.org.au/
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-14-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use devm_mutex_init() instead of mutex_init()
Marek Behún [Sat, 31 Aug 2024 09:20:46 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use devm_mutex_init() instead of mutex_init()

Use devm_mutex_init() instead of mutex_init(), to properly call
mutex_destroy() on probe failure / driver unbind.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-13-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Drop redundant device pointer
Marek Behún [Sat, 31 Aug 2024 09:20:45 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Drop redundant device pointer

Drop redundant device pointer from driver's private structure.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-12-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use dev_err_probe() where possible
Marek Behún [Sat, 31 Aug 2024 09:20:44 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use dev_err_probe() where possible

Use dev_err_probe() where possible in the driver's .probe() method.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-11-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Convert rest to devm_* and get rid of driver .remove()
Marek Behún [Sat, 31 Aug 2024 09:20:43 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Convert rest to devm_* and get rid of driver .remove()

Use devm resource management for driver's mailbox. This allows us to get
rid of the driver's .remove() method and the gotos in .probe().

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-10-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Simplify debugfs code
Marek Behún [Sat, 31 Aug 2024 09:20:42 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Simplify debugfs code

Simplify debugfs code: do not check for errors, as debugfs errors should
be ignored, and use devm action for dropping the debugfs directory.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-9-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Don't create own kobject type
Marek Behún [Sat, 31 Aug 2024 09:20:41 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Don't create own kobject type

In order to create attribute files in /sys/firmware/turris-mox-rwtm,
this driver creates it's own kobject type.

Simplify this by dropping this own kobject creation, and instead
creating standard device attribute files.

For backwards compatibility with sysfs ABI, create a symlink
/sys/firmware/turris-mox-rwtm, pointing to this device's sysfs
directory.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-8-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use sysfs_emit() instead of sprintf()
Marek Behún [Sat, 31 Aug 2024 09:20:40 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use sysfs_emit() instead of sprintf()

Use sysfs_emit() instead of sprintf() in sysfs attribute .show()
method.

Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-7-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Fix driver includes
Marek Behún [Sat, 31 Aug 2024 09:20:39 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Fix driver includes

Drop including of.h, include several other headers that are used but not
included directly.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-6-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Hide signature related constants behind macros
Marek Behún [Sat, 31 Aug 2024 09:20:38 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Hide signature related constants behind macros

Hide signature generation related constants behind macros instead of
hardcoding the values.

Use SHA512_DIGEST_SIZE from crypto/sha2.h instead of hardcoded 64 as the
message size.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-5-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use the boolean type where appropriate
Marek Behún [Sat, 31 Aug 2024 09:20:37 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use the boolean type where appropriate

Use the boolean type for has_board_info, has_pubkey and last_sig_done
members of the driver's private structure.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-4-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use ETH_ALEN instead of hardcoded 6
Marek Behún [Sat, 31 Aug 2024 09:20:36 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use ETH_ALEN instead of hardcoded 6

Use the ETH_ALEN macro instead of hardcoded 6 for MAC address length.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-3-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agofirmware: turris-mox-rwtm: Use macro constant instead of hardcoded 4096
Marek Behún [Sat, 31 Aug 2024 09:20:35 +0000 (11:20 +0200)]
firmware: turris-mox-rwtm: Use macro constant instead of hardcoded 4096

The 4096 bytes limit in mox_hwrng_read() is due to the DMA buffer being
allocated to one PAGE_SIZE bytes. Use new local macro constant
RWTM_DMA_BUFFER_SIZE at allocation time and when used in mox_hwrng_read().

Use SZ_4K instead of PAGE_SIZE. Although PAGE_SIZE is never set to a
larger value on Armada 3720, it theoretically could, and this would be a
waste of space.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-2-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 months agodt-bindings: reset: socionext,uniphier-glue-reset: add top-level constraints
Krzysztof Kozlowski [Sun, 18 Aug 2024 17:28:19 +0000 (19:28 +0200)]
dt-bindings: reset: socionext,uniphier-glue-reset: add top-level constraints

Properties with variable number of items per each device are expected to
have widest constraints in top-level "properties:" block and further
customized (narrowed) in "if:then:".  Add missing top-level constraints
for clock-names and reset-names.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240818172819.121697-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
10 months agobus: integrator-lm: fix OF node leak in probe()
Krzysztof Kozlowski [Mon, 26 Aug 2024 05:49:34 +0000 (07:49 +0200)]
bus: integrator-lm: fix OF node leak in probe()

Driver code is leaking OF node reference from of_find_matching_node() in
probe().

Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/20240826054934.10724-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 months agoARM: versatile: fix OF node leak in CPUs prepare
Krzysztof Kozlowski [Mon, 26 Aug 2024 05:49:33 +0000 (07:49 +0200)]
ARM: versatile: fix OF node leak in CPUs prepare

Machine code is leaking OF node reference from of_find_matching_node()
in realview_smp_prepare_cpus().

Fixes: 5420b4b15617 ("ARM: realview: add an DT SMP boot method")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://lore.kernel.org/20240826054934.10724-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 months agobus: imx-weim: change to use devm_clk_get_enabled() helper
Wu Bo [Tue, 27 Aug 2024 03:23:48 +0000 (21:23 -0600)]
bus: imx-weim: change to use devm_clk_get_enabled() helper

Make the code cleaner and avoid call clk_disable_unprepare()

Signed-off-by: Wu Bo <bo.wu@vivo.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
10 months agobus: imx-weim: support compile test
Wu Bo [Tue, 27 Aug 2024 03:23:47 +0000 (21:23 -0600)]
bus: imx-weim: support compile test

Add COMPILE_TEST to support code compile test

Signed-off-by: Wu Bo <bo.wu@vivo.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
10 months agomemory: pl353-smc: simplify with scoped for each OF child loop
Krzysztof Kozlowski [Sun, 25 Aug 2024 13:50:01 +0000 (15:50 +0200)]
memory: pl353-smc: simplify with scoped for each OF child loop

Use scoped for_each_available_child_of_node_scoped() when iterating over
device nodes to make code a bit simpler.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20240825135001.48963-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
10 months agomemory: pl172: simplify releasing AMBA regions with devm
Krzysztof Kozlowski [Sun, 25 Aug 2024 13:50:00 +0000 (15:50 +0200)]
memory: pl172: simplify releasing AMBA regions with devm

Use devm_add_action_or_reset() and dev_err_probe() to make the probe()
error handling simpler around amba_release_regions() cleanup.  This
allows to drop the remove() callback entirely.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20240825135001.48963-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>