]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 months agosoc: versatile: enable compile testing
Krzysztof Kozlowski [Sun, 25 Aug 2024 18:05:25 +0000 (20:05 +0200)] 
soc: versatile: enable compile testing

Enable compile testing for broader build coverage.  None of the drivers
use anything from "asm", so code should build everywhere.
CONFIG_PLAT_VERSATILE is being selected by driver dependencies
(CONFIG_ARCH_INTEGRATOR and CONFIG_ARCH_REALVIEW), so directory can be
always added to Makefile targets without impacting other configurations.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20240825-soc-dev-fixes-v1-4-ff4b35abed83@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 months agosoc: versatile: realview: fix soc_dev leak during device remove
Krzysztof Kozlowski [Sun, 25 Aug 2024 18:05:24 +0000 (20:05 +0200)] 
soc: versatile: realview: fix soc_dev leak during device remove

If device is unbound, the soc_dev should be unregistered to prevent
memory leak.

Fixes: a2974c9c1f83 ("soc: add driver for the ARM RealView")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20240825-soc-dev-fixes-v1-3-ff4b35abed83@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 months agosoc: versatile: realview: fix memory leak during device remove
Krzysztof Kozlowski [Sun, 25 Aug 2024 18:05:23 +0000 (20:05 +0200)] 
soc: versatile: realview: fix memory leak during device remove

If device is unbound, the memory allocated for soc_dev_attr should be
freed to prevent leaks.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20240825-soc-dev-fixes-v1-2-ff4b35abed83@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 months agosoc: versatile: integrator: fix OF node leak in probe() error path
Krzysztof Kozlowski [Sun, 25 Aug 2024 18:05:22 +0000 (20:05 +0200)] 
soc: versatile: integrator: fix OF node leak in probe() error path

Driver is leaking OF node reference obtained from
of_find_matching_node().

Fixes: f956a785a282 ("soc: move SoC driver for the ARM Integrator")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20240825-soc-dev-fixes-v1-1-ff4b35abed83@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
9 months agosoc/tegra: pmc: Simplify with scoped for each OF child loop
Jinjie Ruan [Tue, 27 Aug 2024 11:46:04 +0000 (19:46 +0800)] 
soc/tegra: pmc: Simplify with scoped for each OF child loop

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

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
9 months agortc: support i.MX95 BBM RTC
Peng Fan [Fri, 23 Aug 2024 09:05:22 +0000 (17:05 +0800)] 
rtc: support i.MX95 BBM RTC

The BBM module provides RTC feature. To i.MX95, this module is managed by
System Manager and exported System Control Management Interface(SCMI).
Linux could use i.MX SCMI BBM Extension protocol to use RTC feature.

This driver is to use SCMI interface to get/set RTC.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-6-e600ed9e9271@nxp.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agoinput: keyboard: support i.MX95 BBM module
Peng Fan [Fri, 23 Aug 2024 09:05:23 +0000 (17:05 +0800)] 
input: keyboard: support i.MX95 BBM module

The BBM module provides BUTTON feature. To i.MX95, this module
is managed by System Manager and exported using System Management
Control Interface(SCMI). Linux could use i.MX SCMI BBM Extension
protocol to use BUTTON feature.

This driver is to use SCMI interface to enable pwrkey.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-7-e600ed9e9271@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: imx: Add i.MX95 MISC driver
Peng Fan [Fri, 23 Aug 2024 09:05:21 +0000 (17:05 +0800)] 
firmware: imx: Add i.MX95 MISC driver

The i.MX95 System manager exports SCMI MISC protocol for linux to do
various settings, such as set board gpio expander as wakeup source.

The driver is to add the support.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-5-e600ed9e9271@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: arm_scmi: Add initial support for i.MX MISC protocol
Peng Fan [Fri, 23 Aug 2024 09:05:19 +0000 (17:05 +0800)] 
firmware: arm_scmi: Add initial support for i.MX MISC protocol

i.MX95 System Manager(SM) firmware includes a SCMI vendor protocol, SCMI
MISC protocol which 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 General Purpose registers, Control Status Registers
owned by the SM.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-3-e600ed9e9271@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: arm_scmi: Add initial support for i.MX BBM protocol
Peng Fan [Fri, 23 Aug 2024 09:05:18 +0000 (17:05 +0800)] 
firmware: arm_scmi: Add initial support for i.MX BBM protocol

i.MX95 has a battery-backed module(BBM), which has persistent storage
(GPR), an RTC, and the ON/OFF button. The System Manager(SM) firmware
use SCMI vendor protocol(SCMI BBM) to let agent be able to use GPR, RTC
and ON/OFF button.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-2-e600ed9e9271@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: arm_scmi: Add NXP i.MX95 SCMI documentation
Peng Fan [Fri, 23 Aug 2024 09:05:20 +0000 (17:05 +0800)] 
firmware: arm_scmi: Add NXP i.MX95 SCMI documentation

Add NXP i.MX95 System Control Management Interface(SCMI) vendor
extensions protocol documentation.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-4-e600ed9e9271@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agodt-bindings: firmware: Add i.MX95 SCMI Extension protocol
Peng Fan [Fri, 23 Aug 2024 09:05:17 +0000 (17:05 +0800)] 
dt-bindings: firmware: Add i.MX95 SCMI Extension protocol

Add i.MX SCMI Extension protocols bindings for:
- Battery Backed Module(BBM) Protocol
  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.
- MISC Protocol.
  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.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20240823-imx95-bbm-misc-v2-v8-1-e600ed9e9271@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: arm_scmi: Replace comma with the semicolon
Sudeep Holla [Tue, 27 Aug 2024 14:38:38 +0000 (15:38 +0100)] 
firmware: arm_scmi: Replace comma with the semicolon

Replace the typo comma with the semicolon. No functional change.

Message-Id: <20240827143838.1465913-4-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: arm_scmi: Replace the use of of_node_put() to __free(device_node)
Sudeep Holla [Tue, 27 Aug 2024 14:38:37 +0000 (15:38 +0100)] 
firmware: arm_scmi: Replace the use of of_node_put() to __free(device_node)

Use __free for device_node values, and thus drop calls to of_node_put.

The goal is simplify of_node reference cleanup by using this scope-based
of_node_put() cleanup to simplify function exit handling. When using __free
a resource is allocated within a block, it is automatically freed at the
end of the block.

This cleanup aligns well with the recent change in shmem.c to use __free
instead of explicit of_node_put() calls.

Message-Id: <20240827143838.1465913-3-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: arm_scmi: Fix trivial whitespace/coding style issues
Sudeep Holla [Tue, 27 Aug 2024 14:38:36 +0000 (15:38 +0100)] 
firmware: arm_scmi: Fix trivial whitespace/coding style issues

Fix couple of unnecessary multiple blank lines and spaces instead of
tabs.

No functional change.

Message-Id: <20240827143838.1465913-2-sudeep.holla@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
9 months agofirmware: tegra: bpmp: Use scoped device node handling to simplify error paths
Krzysztof Kozlowski [Fri, 16 Aug 2024 13:57:22 +0000 (15:57 +0200)] 
firmware: tegra: bpmp: Use scoped device node handling to simplify error paths

Obtain the device node reference with scoped/cleanup.h to reduce error
handling and make the code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
9 months agofirmware: tegra: bpmp: Drop unused mbox_client_to_bpmp()
Krzysztof Kozlowski [Fri, 16 Aug 2024 13:57:21 +0000 (15:57 +0200)] 
firmware: tegra: bpmp: Drop unused mbox_client_to_bpmp()

mbox_client_to_bpmp() is not used, W=1 builds:

  drivers/firmware/tegra/bpmp.c:28:1: error: unused function 'mbox_client_to_bpmp' [-Werror,-Wunused-function]

Fixes: cdfa358b248e ("firmware: tegra: Refactor BPMP driver")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
9 months agodt-bindings: media: s5p-mfc: Remove s5p-mfc.txt binding
Aakarsh Jain [Thu, 8 Aug 2024 13:44:32 +0000 (19:14 +0530)] 
dt-bindings: media: s5p-mfc: Remove s5p-mfc.txt binding

s5p-mfc bindings to json-schema is already merged with
this commit 538af6e5856b ("dt-bindings: media: s5p-mfc:
convert bindings to json-schema"). Remove s5p-mfc.txt
file.

Fixes: 538af6e5856b ("dt-bindings: media: s5p-mfc: convert bindings to json-schema")
Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240808134432.50073-1-aakarsh.jain@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: mtk-smi: Use devm_clk_get_enabled()
Rong Qianfeng [Wed, 21 Aug 2024 03:25:57 +0000 (11:25 +0800)] 
memory: mtk-smi: Use devm_clk_get_enabled()

Replace devm_clk_get() and clk_prepare_enable() with
devm_clk_get_enabled() in .probe().

Fix the bug of missing clk_disable_unprepare() in .remove() by
using devm_clk_get_enabled() that can disables and unprepares
it automatically on driver detach.

Fixes: 3c8f4ad85c4b ("memory/mediatek: add support for mt2701")
Cc: honghui.zhang@mediatek.com
Signed-off-by: Rong Qianfeng <rongqianfeng@vivo.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20240821032558.43052-1-rongqianfeng@vivo.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: pl353-smc: simplify with devm_clk_get_enabled()
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:16:02 +0000 (12:16 +0200)] 
memory: pl353-smc: simplify with devm_clk_get_enabled()

Use devm_clk_get_enabled() to drop clock prepare/unprepare parts and
make code simpler.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-7-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: pl353-smc: simplify with dev_err_probe()
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:16:01 +0000 (12:16 +0200)] 
memory: pl353-smc: simplify with dev_err_probe()

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

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-6-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: pl172: simplify with devm_clk_get_enabled()
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:16:00 +0000 (12:16 +0200)] 
memory: pl172: simplify with devm_clk_get_enabled()

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

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-5-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: pl172: simplify with dev_err_probe()
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:15:59 +0000 (12:15 +0200)] 
memory: pl172: simplify with dev_err_probe()

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

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-4-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: omap-gpmc: simplify locking with guard()
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:15:58 +0000 (12:15 +0200)] 
memory: omap-gpmc: simplify locking with guard()

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

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-3-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: emif: simplify locking with guard()
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:15:57 +0000 (12:15 +0200)] 
memory: emif: simplify locking with guard()

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

The driver used file-scope variable 'irq_state' for storing IRQ state
with spin_lock_irqsave, so move it into respective local scopes.  This
should be equivalent, but more readable (less global variables).

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-2-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: emif: drop unused 'irq_state' member
Krzysztof Kozlowski [Fri, 23 Aug 2024 10:15:56 +0000 (12:15 +0200)] 
memory: emif: drop unused 'irq_state' member

Driver does not use 'emif_data.irq_state'.

Link: https://lore.kernel.org/r/20240823-b4-cleanup-h-guard-v1-1-01668915bd55@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agomemory: ti-aemif: Revert "memory: ti-aemif: don't needlessly iterate over child nodes"
Bartosz Golaszewski [Sat, 24 Aug 2024 08:02:35 +0000 (10:02 +0200)] 
memory: ti-aemif: Revert "memory: ti-aemif: don't needlessly iterate over child nodes"

This reverts commit 23a641d5c2bce4c723fff9118a5d865ee6b9d05a.

The first-level children of the aemif node are not the device nodes (ones
containing the 'compatible' property) but the chip-select nodes which
instead have their own children.

of_platform_populate() will skip such nodes so we must indeed iterate
over the direct children of the aemif node. The problem here is that we
never call of_platform_depopulate() as it takes the root device as
argument. We only have an unpopulated chip-select nodes so we will leak
these devices if any of the calls to of_platform_populate() fails.

I don't have a batter idea right now but my patch was not correct so we
need to revert it. While at it: at least use the scoped variant of the
OF node iterator. Down the line, we should find a better solution to fix
this potential resource leak in error path.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240824080235.56472-1-brgl@bgdev.pl
Fixes: 23a641d5c2bc ("memory: ti-aemif: don't needlessly iterate over child nodes")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
9 months agosoc: rockchip: grf: Add rk3576 default GRF values
Detlev Casanova [Thu, 22 Aug 2024 19:53:37 +0000 (15:53 -0400)] 
soc: rockchip: grf: Add rk3576 default GRF values

Set SW controlled i3c weak pull up and disable JTAG function on SDMMC IO.

The i3c weak pull up is activated to let all gpio banks be controlled
by the pinctrl driver.

Disabling the JTAG function lets the SDMMC core use its full IO width.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Acked-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/20240822195706.920567-3-detlev.casanova@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
9 months agodt-bindings: soc: rockchip: Add rk3576 syscon compatibles
Detlev Casanova [Thu, 22 Aug 2024 19:53:36 +0000 (15:53 -0400)] 
dt-bindings: soc: rockchip: Add rk3576 syscon compatibles

Add all syscon compatibles for RK3576.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240822195706.920567-2-detlev.casanova@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
9 months agosoc: rockchip: grf: Set RK3128's vpu main clock
Alex Bee [Thu, 23 May 2024 18:56:32 +0000 (20:56 +0200)] 
soc: rockchip: grf: Set RK3128's vpu main clock

RK3128 has a setting in GRF which selects whether the vpu attached iommu
uses the AXI clock of the decoder (vdpu) or the encoder (vepu). The
default is vepu but some part of the vendor firmware sets it to vdpu.

In order to be independent on whether any of those vendor firmware blobs is
used to boot the SoC reset "vpu main clock" setting to it's default value.

Signed-off-by: Alex Bee <knaerzche@gmail.com>
Link: https://lore.kernel.org/r/20240523185633.71355-3-knaerzche@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
9 months agosoc: rockchip: io-domain: Add RK3308 IO voltage domains
David Wu [Tue, 21 May 2024 21:10:13 +0000 (21:10 +0000)] 
soc: rockchip: io-domain: Add RK3308 IO voltage domains

Add IO voltage domains support for the RK3308 SoC.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://lore.kernel.org/r/20240521211029.1236094-11-jonas@kwiboo.se
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
9 months agodt-bindings: power: rockchip: Document RK3308 IO voltage domains
Jonas Karlman [Tue, 21 May 2024 21:10:12 +0000 (21:10 +0000)] 
dt-bindings: power: rockchip: Document RK3308 IO voltage domains

Document dt-bindings for RK3308 IO voltage domains.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240521211029.1236094-10-jonas@kwiboo.se
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
10 months agomemory: ti-aemif: simplify with scoped for each OF child loop
Krzysztof Kozlowski [Fri, 16 Aug 2024 10:54:37 +0000 (12:54 +0200)] 
memory: ti-aemif: 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.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240816-cleanup-h-of-node-put-memory-v2-13-9eed0ee16b78@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
10 months agomemory: ti-aemif: simplify with dev_err_probe()
Krzysztof Kozlowski [Fri, 16 Aug 2024 10:54:35 +0000 (12:54 +0200)] 
memory: ti-aemif: simplify with dev_err_probe()

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

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240816-cleanup-h-of-node-put-memory-v2-11-9eed0ee16b78@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
10 months agomemory: tegra30-emc: simplify with scoped for each OF child loop
Krzysztof Kozlowski [Fri, 16 Aug 2024 10:54:34 +0000 (12:54 +0200)] 
memory: tegra30-emc: simplify with scoped for each OF child loop

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

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240816-cleanup-h-of-node-put-memory-v2-10-9eed0ee16b78@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>