summaryrefslogtreecommitdiffstats
path: root/drivers/soc
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge tag 'mtk-soc-for-v6.8' of ↵Arnd Bergmann2023-12-225-676/+1334
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into soc/drivers MediaTek soc driver updates for v6.8 This adds a refactoring of the MediaTek Smart Voltage Scaling (SVS) driver and the addition of support for MT8186 and MT8195 in it, and adds support for the MT8188 VDOSYS and resets in the MMSYS driver. * tag 'mtk-soc-for-v6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux: (24 commits) soc: mediatek: mtk-svs: Constify runtime-immutable members of svs_bank soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency soc: mediatek: mtk-svs: Check if SVS mode is available in the beginning soc: mediatek: mtk-svs: Cleanup of svs_probe() function soc: mediatek: mtk-svs: Compress of_device_id entries soc: mediatek: mtk-svs: Remove redundant print in svs_get_efuse_data soc: mediatek: mtk-svs: Commonize MT8192 probe function for MT8186 soc: mediatek: mtk-svs: Drop supplementary svs per-bank pointer soc: mediatek: mtk-svs: Commonize efuse parse function for most SoCs soc: mediatek: mtk-svs: Move t-calibration-data retrieval to svs_probe() soc: mediatek: mtk-svs: Add SVS-Thermal coefficient to SoC platform data soc: mediatek: mtk-svs: Add a map to retrieve fused values soc: mediatek: mtk-svs: Change the thermal sensor device name soc: mediatek: mtk-svs: Reduce memory footprint of struct svs_bank soc: mediatek: mtk-svs: Build bank name string dynamically soc: mediatek: mtk-svs: Convert sw_id and type to enumerations soc: mediatek: mtk-svs: Subtract offset from regs_v2 to avoid conflict soc: mediatek: Add MT8188 VDOSYS reset bit map soc: mediatek: Support reset bit mapping in mmsys driver soc: mediatek: Support MT8188 VDOSYS1 Padding in mtk-mmsys ... Link: https://lore.kernel.org/r/20231212114515.121695-2-angelogioacchino.delregno@collabora.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * | soc: mediatek: mtk-svs: Constify runtime-immutable members of svs_bankAngeloGioacchino Del Regno2023-12-111-573/+631
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some members of struct svs_bank are not changed during runtime, so those are not variables but constants: move all of those to a new structure called svs_bank_pdata and refactor the code to make use of that and reorder members by size where possible. This effectively moves at least 50 bytes to the text segment. While at it, also uniform the thermal zone names across the banks. Link: https://lore.kernel.org/r/20231121125044.78642-19-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequencyAngeloGioacchino Del Regno2023-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `freq` variable is of type unsigned long and, even though it does currently work with u32 because no frequency is higher than U32_MAX, it is not guaranteed that in the future we will see one. Initialize the freq variable with ULONG_MAX instead of U32_MAX. Link: https://lore.kernel.org/r/20231121125044.78642-18-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Check if SVS mode is available in the beginningAngeloGioacchino Del Regno2023-12-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The svs_init01() and svs_init02() functions are already checking if the INIT01 and INIT02 modes are available - but that's done in for loops and for each SVS bank. Give those a shortcut to get out early if no SVS bank features the desired init mode: this is especially done to avoid some locking in the svs_init01(), but also to avoid multiple for loops to check the same, when no bank supports a specific mode. Link: https://lore.kernel.org/r/20231121125044.78642-17-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Cleanup of svs_probe() functionAngeloGioacchino Del Regno2023-12-111-21/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup the svs_probe() function: use dev_err_probe() where possible, change some efuse read failure gotos and then remove now impossible IS_ERR_OR_NULL() checks (as they will never return true) for nvmem (efuse read) failures. Also remove some unnecessary blank lines. Link: https://lore.kernel.org/r/20231121125044.78642-16-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Compress of_device_id entriesAngeloGioacchino Del Regno2023-12-111-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Compress each entry to one line, as they fit in 84 columns, which is acceptable. While at it, also change the capital 'S' to 's' in 'sentinel'. Link: https://lore.kernel.org/r/20231121125044.78642-15-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Remove redundant print in svs_get_efuse_dataAngeloGioacchino Del Regno2023-12-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Callers of svs_get_efuse_data() are already printing an error in case anything goes wrong, and the error print for nvmem_cell_read() failure is redundant: remove it. Link: https://lore.kernel.org/r/20231121125044.78642-14-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Commonize MT8192 probe function for MT8186AngeloGioacchino Del Regno2023-12-111-37/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Include the additions of svs_mt8186_platform_probe() in the common svs_mt8192_platform_probe() function, remove the former, and use the latter as .probe() callback for MT8186. Link: https://lore.kernel.org/r/20231121125044.78642-13-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Drop supplementary svs per-bank pointerAngeloGioacchino Del Regno2023-12-111-47/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the "pbank" pointer from struct svs_bank: this was used to simply pass a pointer to the SVS bank that the flow was working on. That for instance needs more locking, and it's avoidable by adding one more parameter to functions working on specific banks, either a bank index number, or passing the svs_bank pointer directly from the caller. Even if the locking can now be reduced, for now, it was still left in place for the sake of making sure to not introduce any stability and/or reliability regression. Link: https://lore.kernel.org/r/20231121125044.78642-12-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Commonize efuse parse function for most SoCsAngeloGioacchino Del Regno2023-12-111-266/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove almost all of the per-SoC .efuse_parsing() callbacks and replace them with one common callback svs_common_parse_efuse(): to do that, also change the function signature of the callback to add the newly required pointer to struct svs_platform_data, containing the SVS-global fuse map. This is done for MT8186, MT8188, MT8192, MT8195. As for MT8183, the efuse parse function was simplified by using the new fuse maps. Link: https://lore.kernel.org/r/20231121125044.78642-11-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Move t-calibration-data retrieval to svs_probe()AngeloGioacchino Del Regno2023-12-111-26/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The t-calibration-data (SVS-Thermal calibration data) shall exist for all SoCs or SVS won't work anyway: move it to the common svs_probe() function and remove it from all of the per-SoC efuse_parsing() probe callbacks. Link: https://lore.kernel.org/r/20231121125044.78642-10-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Add SVS-Thermal coefficient to SoC platform dataAngeloGioacchino Del Regno2023-12-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for commonizing the efuse parsing function, add the SVS-Thermal coefficients for all SoCs for which said function can be commonized (MT8186, MT8188, MT8192, MT8195) and assign those to their platform data structure. That will be used to calculate the MTS parameter with the equation MTS = (ts_coeff * 2) / 1000 This commit brings no functional changes. Link: https://lore.kernel.org/r/20231121125044.78642-9-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Add a map to retrieve fused valuesAngeloGioacchino Del Regno2023-12-111-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for adding a common efuse parsing function which will greatly reduce code duplication, add a SoC-specific mapping that will be used to retrieve the right SVS calibration values from the fuses. The maps are two: one is a Global Map used for reading parameters that are SVS-global, and one is a Bank Map for reading calibrations for each SVS Bank. While at it, also populate the map in the platform data for each SoC. Being this a preparation commit, there are no functional changes. Link: https://lore.kernel.org/r/20231121125044.78642-8-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Change the thermal sensor device nameAngeloGioacchino Del Regno2023-12-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver tries to create a device link to the thermal sensor device: change all instances of "lvts" and "thermal" to "thermal-sensor", as that's what the devicetree node name must be. Note for MT8183: As specified in a previous commit, this SoC never got SVS probing, so this is not a breaking change and it does not require fallback for older device trees. Link: https://lore.kernel.org/r/20231121125044.78642-7-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Reduce memory footprint of struct svs_bankAngeloGioacchino Del Regno2023-12-111-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many 32-bit members of this struct can be size reduced to either 16-bit or even 8-bit, for a total saving of ~61 bytes per bank. Keeping in mind that one SoC declares at least two banks, this brings a minimum of ~122 bytes saving (depending on compiler optimization). Link: https://lore.kernel.org/r/20231121125044.78642-6-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Build bank name string dynamicallyAngeloGioacchino Del Regno2023-12-111-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In svs_bank_resource_setup() there is a "big" switch assigning different names depending on sw_id and type and this will surely grow: for example MT8186 has got a two-line type (high/low) SVS bank for CPU_BIG, and this would require more switch nesting. Simplify all of this by changing that to a devm_kasprintf() call that will concatenate the SW_ID string (e.g. SVSB_CPU_LITTLE) with the Type string (e.g. _LOW), resulting in the expected full bank name (e.g. SVSB_CPU_LITTLE_LOW). This being a dynamic allocation can be slower, but this happens only once in the life of this driver and it's not a performance path, so it's totally acceptable. Link: https://lore.kernel.org/r/20231121125044.78642-5-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Convert sw_id and type to enumerationsAngeloGioacchino Del Regno2023-12-111-86/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sw_id and type specifiers currently are defined as BIT(x) for unknown reasons: nothing in this code makes any AND/OR check for those, and that would never happen anyway because both sw_id and type are exclusive, as in: - There will never be a bank that is for both CPU and GPU, or for CPU and CCI together; - A bank cannot be contemporarily of one-line and two-line type, as much as it cannot contemporarily have both HIGH and LOW roles Change those definitions to enumerations and also add some kerneldoc to better describe what they are for and what they indicate. While at it, also change the names adding _SWID or _TYPE to increase human readability. Link: https://lore.kernel.org/r/20231121125044.78642-4-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mtk-svs: Subtract offset from regs_v2 to avoid conflictAngeloGioacchino Del Regno2023-12-111-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The svs_regs_v2 array of registers was offsetted by 0xc00 because the SVS node was supposed to have the same iostart as the thermal sensors. That's wrong for two reasons: 1. Two different devices cannot have the same iostart in devicetree, as those would technically be the same device otherwise; and 2. SVS and Thermal Sensor (be it LVTS or AUXADC thermal) are not the same IP, and those two do obviously have a different iospace. Even though there already are users of this register array, the only one that declares a devicetree node for SVS is MT8183 - but it never actually worked because the "tzts1" thermal zone missed thermal trips, hence this driver's probe always failed on that SoC. Knowing this - it is safe to say that keeping compatibility with older device trees is pointless, hence simply subtract the 0xc00 offset from the register offset array. Link: https://lore.kernel.org/r/20231121125044.78642-3-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: Add MT8188 VDOSYS reset bit mapHsiao Chien Sung2023-12-112-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | Add MT8188 reset bit map for VDOSYS0 and VDOSYS1. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: Support reset bit mapping in mmsys driverHsiao Chien Sung2023-12-112-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reset ID must starts from 0 and be consecutive, but the reset bits in our hardware design is not continuous, some bits are left unused, we need a map to solve the problem - Use old style 1-to-1 mapping if .rst_tb is not defined Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: Support MT8188 VDOSYS1 Padding in mtk-mmsysHsiao Chien Sung2023-12-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Add Padding components - Add Mutex module definitions for Padding Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: Support MT8188 VDOSYS1 in mtk-mmsysHsiao Chien Sung2023-12-114-0/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add register definitions for MT8188 - Add VDOSYS1 routing table - Update MUTEX definitions accordingly - Set VSYNC length from 0x40 (default) to 1 since ETHDR is bypassed Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: mmsys: Add support for MT8188 VPPSYSyu-chang.lee2023-12-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Add MT8188 VPPSYS0 and VPPSYS1 driver data. Signed-off-by: yu-chang.lee <yu-chang.lee@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: svs: Add support for MT8186 SoCMark Tseng2023-12-111-0/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MT8186 svs has a number of banks which used as optimization of opp voltage table for corresponding dvfs drivers. MT8186 svs big core uses 2-line high bank and low bank to optimize the voltage of opp table for higher and lower frequency respectively. Signed-off-by: Mark Tseng <chun-jen.tseng@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
| * | soc: mediatek: svs: Add support for MT8195 SoCMark Tseng2023-12-111-0/+136
| |/ | | | | | | | | | | | | | | | | MT8195 svs gpu uses 2-line high bank and low bank to optimize the voltage of opp table for higher and lower frequency respectively. Signed-off-by: Mark Tseng <chun-jen.tseng@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
* | Merge tag 'fsl_qmc_tsa_v6.8' of https://github.com//hcodina/linux into ↵Arnd Bergmann2023-12-222-169/+511
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | soc/drivers PowerQUICC QMC and TSA drivers updates for v6.8 This pull request contains updates to prepare the support for the QMC HDLC driver. - Perform some fixes - Add support for child devices - Add QMC dynamic timeslot support Signed-off-by: Herve Codina <herve.codina@bootlin.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * | soc: fsl: cpm1: qmc: Introduce functions to change timeslots at runtimeHerve Codina2023-12-121-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce qmc_chan_{get,set}_ts_info() function to allow timeslots modification at runtime. The modification is provided using qmc_chan_set_ts_info() and will be applied on next qmc_chan_start(). qmc_chan_set_ts_info() must be called with the channel rx and/or tx stopped. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-18-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Remove timeslots handling from setup_chan()Herve Codina2023-12-121-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeslots setting is done at channel start() and stop(). There is no more need to do that during setup_chan(). Simply remove timeslot setting from setup_chan(). Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-17-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Handle timeslot entries at channel start() and stop()Herve Codina2023-12-121-46/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support runtime timeslot route changes, enable the channel timeslot entries at channel start() and disable them at channel stop(). Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-16-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Introduce is_tsa_64rxtx flagHerve Codina2023-12-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support runtime timeslot route changes, some operations will be different according the routing table used (common Rx and Tx table or one table for Rx and one for Tx). The is_tsa_64rxtx flag is introduced to avoid extra computation to determine the table format each time we need it. It is set once at initialization. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-15-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Split Tx and Rx TSA entries setupHerve Codina2023-12-121-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Tx and Rx entries for a given channel are set in one function. In order to modify Rx entries and Tx entries independently of one other, split this function in one for the Rx part and one for the Tx part. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-14-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Add support for disabling channel TSA entriesHerve Codina2023-12-121-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to allow runtime timeslot route changes, disabling channel TSA entries needs to be supported. Add support for this new feature. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-13-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Check available timeslots in qmc_check_chans()Herve Codina2023-12-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The timeslots checked in qmc_check_chans() are the timeslots used. With the introduction of the available timeslots, the used timeslots are a subset of the available timeslots. The timeslots checked during the qmc_check_chans() call should be the available ones. Simply update and check the available timeslots instead of the used timeslots in qmc_check_chans(). Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-12-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans()Herve Codina2023-12-121-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly introduced qmc_chan_setup_tsa* functions check that the channel entries are not already used. These checks are also performed by qmc_check_chans() and are no more needed. Remove them from qmc_check_chans(). Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-11-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Introduce qmc_chan_setup_tsa*Herve Codina2023-12-121-36/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the qmc_chan_setup_tsa* functions to setup entries related to the given channel. Use them during QMC channels setup. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-10-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Rename qmc_setup_tsa* to qmc_init_tsa*Herve Codina2023-12-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qmc_setup_tsa* are called once at initialisation. They initialize the QMC TSA table. In order to introduce setup function later on for dynamic timeslots management, rename the function to avoid later confusion. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-9-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Introduce available timeslots masksHerve Codina2023-12-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Available timeslots masks define timeslots available for the related channel. These timeslots are defined by the QMC binding. Timeslots used are initialized to available timeslots but can be a subset of available timeslots. This prepares the dynamic timeslots management (ie. changing timeslots 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/20231205152116.122512-8-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Add support for child devicesHerve Codina2023-12-121-20/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMC child devices support is needed to avoid orphan DT nodes that use a simple DT phandle to reference a QMC channel. Allow to instantiate child devices and also extend the API to get the qmc_chan using a child device. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20231205152116.122512-7-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Remove inline function specifiersHerve Codina2023-12-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The inline function specifier is present on some functions but it is better to let the compiler decide inlining or not these functions. Remove inline specifiers. Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC") Signed-off-by: Herve Codina <herve.codina@bootlin.com> Suggested-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-6-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Extend the API to provide Rx statusHerve Codina2023-12-121-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In HDLC mode, some status flags related to the data read transfer can be set by the hardware and need to be known by a QMC consumer for further analysis. Extend the API in order to provide these transfer status flags at the read complete() call. In TRANSPARENT mode, these flags have no meaning. Keep only one read complete() API and update the consumers working in transparent mode. In this case, the newly introduced flags parameter is simply unused. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-5-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Fix rx channel resetHerve Codina2023-12-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qmc_chan_reset_rx() set the is_rx_stopped flag. This leads to an inconsistent state in the following sequence. qmc_chan_stop() qmc_chan_reset() Indeed, after the qmc_chan_reset() call, the channel must still be stopped. Only a qmc_chan_start() call can move the channel from stopped state to started state. Fix the issue removing the is_rx_stopped flag setting from qmc_chan_reset() Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC") 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/20231205152116.122512-4-herve.codina@bootlin.com
| * | soc: fsl: cpm1: qmc: Fix __iomem addresses declarationHerve Codina2023-12-121-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running sparse (make C=1) on qmc.c raises a lot of warning such as: ... warning: incorrect type in assignment (different address spaces) expected struct cpm_buf_desc [usertype] *[noderef] __iomem bd got struct cpm_buf_desc [noderef] [usertype] __iomem *txbd_free ... Indeed, some variable were declared 'type *__iomem var' instead of 'type __iomem *var'. Use the correct declaration to remove these warnings. Fixes: 3178d58e0b97 ("soc: fsl: cpm1: Add support for QMC") 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/20231205152116.122512-3-herve.codina@bootlin.com
| * | soc: fsl: cpm1: tsa: Fix __iomem addresses declarationHerve Codina2023-12-121-11/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running sparse (make C=1) on tsa.c raises a lot of warning such as: --- 8< --- warning: incorrect type in assignment (different address spaces) expected void *[noderef] si_regs got void [noderef] __iomem * --- 8< --- Indeed, some variable were declared 'type *__iomem var' instead of 'type __iomem *var'. Use the correct declaration to remove these warnings. Fixes: 1d4ba0b81c1c ("soc: fsl: cpm1: Add support for TSA") Cc: stable@vger.kernel.org Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202312051959.9YdRIYbg-lkp@intel.com/ Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20231205152116.122512-2-herve.codina@bootlin.com
* | Merge tag 'hisi-drivers-for-6.8' of https://github.com/hisilicon/linux-hisi ↵Arnd Bergmann2023-12-222-33/+134
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into soc/drivers HiSilicon driver updates for v6.8 - Add support for the platform with PCC type3 and interrupt ack - Few cleanups and improvements: correct the format of some strings and domain typo, add failure log * tag 'hisi-drivers-for-6.8' of https://github.com/hisilicon/linux-hisi: soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack doc: kunpeng_hccs: Fix incorrect email domain name soc: hisilicon: kunpeng_hccs: Remove an unused blank line soc: hisilicon: kunpeng_hccs: Add failure log for no _CRS method soc: hisilicon: kunpeng_hccs: Fix some incorrect format strings Link: https://lore.kernel.org/r/6572C41B.6050703@hisilicon.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * | soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and ↵Huisong Li2023-12-072-25/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interrupt ack Support the platform with PCC type3 and interrupt ack. And a version specific structure is introduced to handle the difference between the device in the code. Signed-off-by: Huisong Li <lihuisong@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
| * | soc: hisilicon: kunpeng_hccs: Remove an unused blank lineHuisong Li2023-12-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove an unused blank line. Signed-off-by: Huisong Li <lihuisong@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
| * | soc: hisilicon: kunpeng_hccs: Add failure log for no _CRS methodHuisong Li2023-12-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver gets the PCC channel id by using the PCC GAS in _CRS. But, currently, if the firmware has no _CRS method on platform, there is not any failure log. So this patch adds the log for this. Signed-off-by: Huisong Li <lihuisong@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
| * | soc: hisilicon: kunpeng_hccs: Fix some incorrect format stringsHuisong Li2023-12-071-6/+6
| |/ | | | | | | | | | | | | | | Fix some incorrect format strings. Signed-off-by: Huisong Li <lihuisong@huawei.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
* | soc: apple: mailbox: Add explicit include of platform_device.hRob Herring2023-11-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other and pull in various other headers. In preparation to fix this, adjust the includes for what is actually needed. platform_device.h is implicitly included by of_platform.h, but that's going to be removed. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Hector Martin <marcan@marcan.st>
* | soc: apple: mailbox: Rename config symbol to APPLE_MAILBOXHector Martin2023-11-232-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | With the original owner of APPLE_MAILBOX removed, let's rename the new APPLE_MBOX to the old name. This avoids .config churn for downstream users, and leaves us with an identical config symbol and module name as before. Acked-by: Eric Curtin <ecurtin@redhat.com> Acked-by: Neal Gompa <neal@gompa.dev> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Signed-off-by: Hector Martin <marcan@marcan.st>