cb3daa51 | 05-Nov-2024 |
Herve Codina <herve.codina@bootlin.com> |
soc: fsl: cpm1: qmc: Set the ret error code on platform_get_irq() failure
A kernel test robot detected a missing error code: qmc.c:1942 qmc_probe() warn: missing error code 'ret'
Indeed, the err
soc: fsl: cpm1: qmc: Set the ret error code on platform_get_irq() failure
A kernel test robot detected a missing error code: qmc.c:1942 qmc_probe() warn: missing error code 'ret'
Indeed, the error returned by platform_get_irq() is checked and the operation is aborted in case of failure but the ret error code is not set in that case.
Set the ret error code.
Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202411051350.KNy6ZIWA-lkp@intel.com/ Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC") Cc: stable@vger.kernel.org Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20241105145623.401528-1-herve.codina@bootlin.com Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
show more ...
|
1117b916 | 09-Sep-2024 |
Herve Codina <herve.codina@bootlin.com> |
soc: fsl: cpm1: qmc: Fix unused data compilation warning
In some configuration, compilation raises warnings related to unused data. Indeed, depending on configuration, those data can be unused.
mar
soc: fsl: cpm1: qmc: Fix unused data compilation warning
In some configuration, compilation raises warnings related to unused data. Indeed, depending on configuration, those data can be unused.
mark those data as __maybe_unused to avoid compilation warnings.
Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202409071707.ou2KFNKO-lkp@intel.com/ Fixes: eb680d563089 ("soc: fsl: cpm1: qmc: Add support for QUICC Engine (QE) implementation") Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20240909121129.57067-1-herve.codina@bootlin.com Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
show more ...
|
122019f0 | 30-Sep-2024 |
Geert Uytterhoeven <geert+renesas@glider.be> |
soc: fsl: cpm1: qmc: Do not use IS_ERR_VALUE() on error pointers
ppc64_book3e_allmodconfig:
drivers/soc/fsl/qe/qmc.c: In function ‘qmc_qe_init_resources’: include/linux/err.h:28:49: error:
soc: fsl: cpm1: qmc: Do not use IS_ERR_VALUE() on error pointers
ppc64_book3e_allmodconfig:
drivers/soc/fsl/qe/qmc.c: In function ‘qmc_qe_init_resources’: include/linux/err.h:28:49: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 28 | #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) | ^ include/linux/compiler.h:77:45: note: in definition of macro ‘unlikely’ 77 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ drivers/soc/fsl/qe/qmc.c:1764:13: note: in expansion of macro ‘IS_ERR_VALUE’ 1764 | if (IS_ERR_VALUE(info)) { | ^~~~~~~~~~~~
IS_ERR_VALUE() is only meant for pointers. Fix this by checking for a negative error value instead, which matches the documented behavior of devm_qe_muram_alloc() aka devm_cpm_muram_alloc(). While at it, remove the unneeded print in case of a memory allocation failure, and propagate the returned error code.
Fixes: eb680d563089e55b ("soc: fsl: cpm1: qmc: Add support for QUICC Engine (QE) implementation") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Herve Codina <herve.codina@bootlin.com> Acked-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/8b113596b2c8cdda6655346232cc603efdeb935a.1727708905.git.geert+renesas@glider.be Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
show more ...
|
8655b76b | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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.
S
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>
show more ...
|
eb680d56 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 suc
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>
show more ...
|
c6f39c7c | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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().
T
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>
show more ...
|
b741b66f | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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
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>
show more ...
|
8f55d06b | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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
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>
show more ...
|
278d799c | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 prepa
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>
show more ...
|
ef0878a5 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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) ve
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>
show more ...
|
de5fdb7d | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 (U
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>
show more ...
|
727b3ab4 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 differe
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>
show more ...
|
a13bf605 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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
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>
show more ...
|
d23ae9f1 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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)
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>
show more ...
|
211ddf7c | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 <her
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>
show more ...
|
e49dd637 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 <he
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>
show more ...
|
1934f6aa | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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 <he
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>
show more ...
|
f06ab938 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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.
S
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>
show more ...
|
44beb343 | 08-Aug-2024 |
Herve Codina <herve.codina@bootlin.com> |
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
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>
show more ...
|