summaryrefslogtreecommitdiff
path: root/drivers/soc/microchip
AgeCommit message (Collapse)Author
2024-01-22soc: microchip: Fix POLARFIRE_SOC_SYS_CTRL input promptGeert Uytterhoeven
The symbol's prompt should be a one-line description, instead of just duplicating the symbol name. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-12-06soc: microchip: mpfs: add auto-update subdev to system controllerConor Dooley
The PolarFire SoC's system controller offers the ability to re-program the FPGA from a user application via two, related, mechanisms. In-Application Programming (IAP) is not ideal for use in Linux, as it will immediately take down the system when requested. Auto Update is preferred, as it will only take affect at device power up*, allowing the OS (and potential applications in AMP) to be shut down gracefully. * Auto Update occurs at device initialisation, which can also be triggered by device reset - possible with the v2023.02 version of the Hart Software Services (HSS) and reference design. Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-12-06soc: microchip: mpfs: print service status in warning messageConor Dooley
Now that resp_status is set for failed services, print the status in the error path's warning. Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-12-06soc: microchip: mpfs: enable access to the system controller's flashConor Dooley
The system controller has a flash that contains images used to reprogram the FPGA using IAP (In-Application Programming). Introduce a function that allows a driver with a reference to the system controller to get one to a flash device attached to it. Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-09-25soc/microchip: mpfs-sys-controller: Convert to platform remove callback ↵Uwe Kleine-König
returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However, the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here, there is a quest to make the remove callback return void. In the first step of this quest, all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-07-29soc: microchip: Explicitly include correct DT includesRob Herring
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. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230714175139.4067685-1-robh@kernel.org [claudiu.beznea: added link] Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
2023-04-03soc: microchip: mpfs: add a prefix to rx_callback()Conor Dooley
Add a prefix to the function name to match the rest of the file. Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-04-03soc: microchip: mpfs: handle timeouts and failed services differentlyConor Dooley
The system controller will only deliver an interrupt if a service succeeds. This leaves us in the unfortunate position with current code where there is no way to differentiate between a legitimate timeout where the service has not completed & where it has completed, but failed. mbox_send_message() has its own completion, and it will time out of the system controller does not lower the busy flag. In this case, a timeout has occurred and the error can be propagated back to the caller. If the busy flag is lowered, but no interrupt has arrived to trigger the rx callback, the service can be deemed to have failed. Report -EBADMSG in this case so that callers can differentiate. Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-04-03soc: microchip: mpfs: simplify error handling in mpfs_blocking_transaction()Conor Dooley
The error handling has a kinda weird nested-if setup that is not really adding anything. Switch it to more of an early return arrangement as a predatory step for adding different handing for timeouts and failed services. Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-04-03soc: microchip: mpfs: use a consistent completion timeoutConor Dooley
Completion timeouts use jiffies, so passing a number directly will produce inconsistent timeouts depending on config. Define the timeout in ms and convert it to jiffies instead. Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2023-04-03soc: microchip: mpfs: fix some horrible alignmentConor Dooley
mpfs_sys_controller_delete() has some horrible alignment that upsets my OCD... Move the RHS of the assignment to a new line for greater satifaction. Tested-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2022-03-23Merge tag 'arm-drivers-5.18' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM driver updates from Arnd Bergmann: "There are a few separately maintained driver subsystems that we merge through the SoC tree, notable changes are: - Memory controller updates, mainly for Tegra and Mediatek SoCs, and clarifications for the memory controller DT bindings - SCMI firmware interface updates, in particular a new transport based on OPTEE and support for atomic operations. - Cleanups to the TEE subsystem, refactoring its memory management For SoC specific drivers without a separate subsystem, changes include - Smaller updates and fixes for TI, AT91/SAMA5, Qualcomm and NXP Layerscape SoCs. - Driver support for Microchip SAMA5D29, Tesla FSD, Renesas RZ/G2L, and Qualcomm SM8450. - Better power management on Mediatek MT81xx, NXP i.MX8MQ and older NVIDIA Tegra chips" * tag 'arm-drivers-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (154 commits) ARM: spear: fix typos in comments soc/microchip: fix invalid free in mpfs_sys_controller_delete soc: s4: Add support for power domains controller dt-bindings: power: add Amlogic s4 power domains bindings ARM: at91: add support in soc driver for new SAMA5D29 soc: mediatek: mmsys: add sw0_rst_offset in mmsys driver data dt-bindings: memory: renesas,rpc-if: Document RZ/V2L SoC memory: emif: check the pointer temp in get_device_details() memory: emif: Add check for setup_interrupts dt-bindings: arm: mediatek: mmsys: add support for MT8186 dt-bindings: mediatek: add compatible for MT8186 pwrap soc: mediatek: pwrap: add pwrap driver for MT8186 SoC soc: mediatek: mmsys: add mmsys reset control for MT8186 soc: mediatek: mtk-infracfg: Disable ACP on MT8192 soc: ti: k3-socinfo: Add AM62x JTAG ID soc: mediatek: add MTK mutex support for MT8186 soc: mediatek: mmsys: add mt8186 mmsys routing table soc: mediatek: pm-domains: Add support for mt8186 dt-bindings: power: Add MT8186 power domains soc: mediatek: pm-domains: Add support for mt8195 ...
2022-03-18soc/microchip: fix invalid free in mpfs_sys_controller_deleteConor Dooley
Fix an invalid kfree in mpfs_sys_controller_delete, by replacing the devm_kzalloc with a regular kzalloc. Change the error handling in the probe function to free the sys_controller struct if the probe fails. > cocci warnings: (new ones prefixed by >>) > >> drivers/soc/microchip/mpfs-sys-controller.c:73:1-6: WARNING: invalid free of devm_ allocated data Link: https://lore.kernel.org/linux-mm/202203180259.lgIylRZV-lkp@intel.com/ Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Conor Dooley <mail@conchuod.ie> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-02-28soc: microchip: make mpfs_sys_controller_put staticConor Dooley
dsafsdfd0054 ("soc: add microchip polarfire soc system controller") incorrectly exported mpfs_sys_controller_put. Remove the export and make the function static instead. This fixes the "no previous prototype for 'mpfs_sys_controller_put'" warning spotted by the kernel test robot. Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Conor Dooley <mail@conchuod.ie> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-02-25soc: add microchip polarfire soc system controllerConor Dooley
This driver provides an interface for other drivers to access the functions of the system controller on the Microchip PolarFire SoC. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20220217101349.2374873-2-conor.dooley@microchip.com