aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/imx
AgeCommit message (Collapse)AuthorFilesLines
2024-08-28firmware: imx: Add i.MX95 MISC driverPeng Fan3-0/+131
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 <[email protected]> Signed-off-by: Peng Fan <[email protected]> Message-Id: <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
2024-01-04firmware: imx-dsp: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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 <[email protected]> Link: https://lore.kernel.org/r/f4cc1ffe30b837d5eab96f2924f51999dfa9f671.1703693980.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-11-01Merge tag 'pmdomain-v6.7' of ↵Linus Torvalds1-6/+0
git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm Pull pmdomain updates from Ulf Hansson: - Move Kconfig files into the pmdomain subsystem - Drop use of genpd's redundant ->opp_to_performance_state() callback - amlogic: - Add support for the T7 power-domains controller - Fix mask for the second NNA mem power-domain - bcm: Fixup ASB register read and comparison for bcm2835-power - imx: Fix device link problem for consumers of the pgc power-domain - mediatek: Add support for the MT8365 power domains - qcom: - Add support for the rpmhpds for SC8380XP power-domains - Add support for the rpmhpds for SM8650 power-domains - Add support for the rpmhpd clocks for SM7150 - Add support for the rpmpds for MSM8917 (families) power-domains - starfive: Add support for the JH7110 AON PMU * tag 'pmdomain-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: (56 commits) pmdomain: amlogic: Fix mask for the second NNA mem PD domain pmdomain: qcom: rpmhpd: Add SC8380XP power domains pmdomain: qcom: rpmhpd: Add SM8650 RPMh Power Domains dt-bindings: power: rpmpd: Add SC8380XP support dt-bindings: power: qcom,rpmhpd: Add GMXC PD index dt-bindings: power: qcom,rpmpd: document the SM8650 RPMh Power Domains pmdomain: imx: Make imx pgc power domain also set the fwnode pmdomain: qcom: rpmpd: Add QM215 power domains pmdomain: qcom: rpmpd: Add MSM8917 power domains dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215 pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable pmdomain: qcom: rpmhpd: Drop the ->opp_to_performance_state() callback pmdomain: qcom: rpmpd: Drop the ->opp_to_performance_state() callback pmdomain: qcom: cpr: Drop the ->opp_to_performance_state() callback pmdomain: Use device_get_match_data() pmdomain: ti: add missing of_node_put pmdomain: mediatek: Add support for MT8365 pmdomain: mediatek: Add support for MTK_SCPD_STRICT_BUS_PROTECTION cap pmdomain: mediatek: Add support for WAY_EN operations pmdomain: mediatek: Unify configuration for infracfg and smi ...
2023-10-10firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels()Hao Ge1-1/+1
dsp_chan->name and chan_name points to same block of memory, because dev_err still needs to be used it,so we need free it's memory after use to avoid use_after_free. Fixes: e527adfb9b7d ("firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()") Signed-off-by: Hao Ge <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-10-04pmdomain: imx: Move Kconfig options to the pmdomain subsystemUlf Hansson1-6/+0
The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc- and firmware subsystem to the pmdomain subsystem. Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Peng Fan <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Acked-by: Peng Fan <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2023-09-19firmware: imx-dsp: Fix an error handling path in imx_dsp_setup_channels()Christophe JAILLET1-0/+1
If mbox_request_channel_byname() fails, the memory allocated a few lines above still need to be freed before going to the error handling path. Fixes: 046326989a18 ("firmware: imx: Save channel name for further use") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-30Merge tag 'soc-arm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds3-1/+2
Pull ARM SoC cleanups from Arnd Bergmann: "These are all minor cleanups for platform specific code in arch/arm/ and some of the associated drivers. The majority of these are work done by Rob Herring to improve the way devicetreee header files are handled" * tag 'soc-arm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (49 commits) ARM: davinci: Drop unused includes ARM: s5pv210: Explicitly include correct DT includes ARM: dove: Drop unused includes ARM: mvebu: Explicitly include correct DT includes Documentation/process: maintainer-soc: document dtbs_check requirement for Samsung MAINTAINER: samsung: document dtbs_check requirement for Samsung Documentation/process: maintainer-soc: add clean platforms profile MAINTAINERS: soc: reference maintainer profile ARM: nspire: Remove unused header file mmio.h ARM: nspire: Use syscon-reboot to handle restart soc: fsl: Explicitly include correct DT includes soc: xilinx: Explicitly include correct DT includes soc: sunxi: Explicitly include correct DT includes soc: rockchip: Explicitly include correct DT includes soc: mediatek: Explicitly include correct DT includes soc: aspeed: Explicitly include correct DT includes firmware: Explicitly include correct DT includes bus: Explicitly include correct DT includes ARM: spear: Explicitly include correct DT includes ARM: mvebu: Explicitly include correct DT includes ...
2023-08-30Merge tag 'soc-drivers-6.6' of ↵Linus Torvalds3-22/+125
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "The main change this time was the introduction of the drivers/genpd subsystem that gets split out from drivers/soc to keep common functionality together. The SCMI driver subsystem gets an update to version 3.2 of the specification. There are also updates to memory, reset and other firmware drivers. On the soc driver side, the updates are mostly cleanups across a number of Arm platforms. On driver for loongarch adds power management for DT based systems, another driver is for HiSilicon's Arm server chips with their HCCS system health interface. The remaining updates for the most part add support for additional hardware in existing drivers or contain minor cleanups. Most of these are for the Qualcomm Snapdragon platform" * tag 'soc-drivers-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (136 commits) bus: fsl-mc: Use common ranges functions soc: kunpeng_hccs: fix some sparse warnings about incorrect type soc: loongson2_pm: add power management support soc: dt-bindings: add loongson-2 pm soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1 genpd: rockchip: Add PD_VO entry for rv1126 bus: ti-sysc: Fix cast to enum warning soc: kunpeng_hccs: add MAILBOX dependency MAINTAINERS: remove OXNAS entry dt-bindings: interrupt-controller: arm,versatile-fpga-irq: mark oxnas compatible as deprecated irqchip: irq-versatile-fpga: remove obsolete oxnas compatible soc: qcom: aoss: Tidy up qmp_send() callers soc: qcom: aoss: Format string in qmp_send() soc: qcom: aoss: Move length requirements from caller soc: kunpeng_hccs: fix size_t format string soc: ti: k3-socinfo.c: Add JTAG ID for AM62PX dt-bindings: firmware: qcom: scm: Updating VMID list firmware: imx: scu-irq: support identifying SCU wakeup source from sysfs firmware: imx: scu-irq: enlarge the IMX_SC_IRQ_NUM_GROUP firmware: imx: scu-irq: add imx_scu_irq_get_status ...
2023-08-17genpd: imx: relocate scu-pd under genpdPeng Fan2-429/+0
Move scu-pd driver under genpd directory where the driver should be. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
2023-08-12firmware: Explicitly include correct DT includesRob Herring3-1/+2
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. Acked-by: Dinh Nguyen <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Rob Herring <[email protected]> Acked-by: Sudeep Holla <[email protected]> Link: https://lore.kernel.org/r/20230803-dt-header-cleanups-for-soc-v2-17-d8de2cc88bff@kernel.org Signed-off-by: Arnd Bergmann <[email protected]>
2023-08-11firmware: imx: scu-irq: support identifying SCU wakeup source from sysfsRanjani Vaidyanathan1-0/+70
Record SCU wakeup interrupt in /sys/power/pm_wakeup_irq The user can further identify the exact wakeup source by using the following interface: cat /sys/firmware/scu_wakeup_source/wakeup_src The above will print the wake groups and the irqs that could have contributed to waking up the kernel. For example if ON/OFF button was the wakeup source: cat /sys/firmware/scu_wakeup_source/wakeup_src Wakeup source group = 3, irq = 0x1 The user can refer to the SCFW API documentation to identify all the wake groups and irqs. Signed-off-by: Ranjani Vaidyanathan <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-11firmware: imx: scu-irq: enlarge the IMX_SC_IRQ_NUM_GROUPPeng Fan1-1/+1
Per SCFW update, update the IMX_SC_IRQ_NUM_GROUP to 9. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-11firmware: imx: scu-irq: add imx_scu_irq_get_statusPeng Fan1-13/+27
Extract the scu irq get status code from imx_scu_irq_work_handler and make into a new function imx_scu_irq_get_status which could be used by others, such as SECO. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-11firmware: imx: scu-irq: fix RCU complaint after M4 partition resetRobin Gong1-4/+4
Use blocking_notifier_chain instead of atomic_notifier_chain, otherwise there will be RCU complaint, because unregister/register_virtio_device() will issue mbox message. mbox_send_message() is blocking again after received M4 partition reset. Actually, no need atomic notifier for scu irq notification since this notifier is called in worker instead of interrupt handler. [ 389.706645] i2c-rpmsg virtio0.rpmsg-i2c-channel.-1.2: i2c rpmsg driver is removed [ 389.767362] Wait for remote ready timeout, use first_notify. [ 389.774084] ------------[ cut here ]------------ [ 389.778729] WARNING: CPU: 0 PID: 397 at kernel/rcu/tree_plugin.h:293 rcu_note_context_switch+0x34/0x338 [ 389.788131] Modules linked in: [ 389.791195] CPU: 0 PID: 397 Comm: kworker/0:13 Not tainted 5.4.0-rc5-02977-g08f78722f07b #26 [ 389.799633] Hardware name: Freescale i.MX8DXL MEK (DT) [ 389.805481] Workqueue: events imx_scu_irq_work_handler Signed-off-by: Robin Gong <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-11firmware: imx: scu: use soc name for soc_idPeng Fan1-3/+17
Same as soc-imx8m and soc-imx driver, use soc name for soc_id which is user friendly. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-11firmware: imx: scu: increase RPC timeoutDong Aisheng1-1/+1
When system loading is high, we can meet some command timeout issue occasionally, so increase the timeout to a safe value. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-08-11firmware: imx: scu: change init level to subsys_initcall_syncDong Aisheng1-1/+6
Change firmware init level to subsys_initcall_sync to ensure it's probed before most devices to avoid unnecessary defer probe. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-03-06firmware: imx: scu-pd: add missed lvds lpi2c and pwm power domainsClark Wang1-0/+4
LVDS' lpi2c and pwm power domains definitions are missed. Add them here. Signed-off-by: Clark Wang <[email protected]> Reviewed-by: Frank Li <[email protected]> Signed-off-by: Marcel Ziswiler <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2023-03-06firmware: imx: scu: use dev_err_probeAlexander Stein1-3/+2
This simplifies the code and silences -517 error messages. Also the reason is listed in /sys/kernel/debug/devices_deferred. Signed-off-by: Alexander Stein <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-10-24firmware: imx: scu-pd: add missed USB_1_PHY pdFrank Li1-0/+1
USB_1_PHY is not defined in pd driver on 8DXL. Signed-off-by: Frank Li <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-02-20firmware: imx: scu-pd: imx8q: add vpu mu resourcesMing Qian1-0/+4
the vpu core depends on the mu resources. if they're missed, the vpu can't work. Signed-off-by: Ming Qian <[email protected]> Signed-off-by: Shijie Qin <[email protected]> Signed-off-by: Zhou Peng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2022-02-12firmware: imx: add get resource owner apiPeng Fan1-0/+45
Add resource owner management API, this API could be used to check whether M4 is under control of Linux. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2021-03-29firmware: imx: scu-pd: add missed ADC1 pdFrank Li1-1/+1
ADC1 is not defined in pd driver on 8QM. Signed-off-by: Frank Li <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2021-03-29firmware: imx: scu-pd: Update comments for single global power domainUlf Hansson1-2/+9
Since the introduction of the PM domain support for the scu-pd, the genpd framework has been continuously improved. More preciously, using a single global power domain can quite easily be deployed for imx platforms. To avoid confusions, let's therefore make an update to the comments about the missing pieces. Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2021-03-15firmware: imx: scu-pd: do not power off console domainDong Aisheng1-1/+27
Do not power off console domain in runtime pm. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2021-01-18firmware: imx: select SOC_BUS to fix firmware buildRandy Dunlap1-0/+1
Fix build error in firmware/imx/ selecting SOC_BUS. riscv32-linux-ld: drivers/firmware/imx/imx-scu-soc.o: in function `.L9': imx-scu-soc.c:(.text+0x1b0): undefined reference to `soc_device_register' Fixes: edbee095fafb ("firmware: imx: add SCU firmware driver support") Signed-off-by: Randy Dunlap <[email protected]> Reported-by: kernel test robot <[email protected]> Cc: Atish Patra <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Anson Huang <[email protected]> Cc: Daniel Baluta <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-30firmware: imx: scu-pd: Add some power domains support for i.MX8qxp MIPI1 ↵Liu Ying1-0/+4
subsystem This patch adds the main power domain, pwm0 power domain and i2c0/1 power domains support for i.MX8qxp MIPI1 subsystem. Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Pengutronix Kernel Team <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: NXP Linux Team <[email protected]> Signed-off-by: Liu Ying <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-30firmware: imx: scu-pd: Add main power domain support for i.MX8qxp LVDS1 ↵Liu Ying1-0/+1
subsystem This patch adds the main power domain support for i.MX8qxp LVDS1 subsystem. Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Pengutronix Kernel Team <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: NXP Linux Team <[email protected]> Signed-off-by: Liu Ying <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-30firmware: imx: scu-pd: Add video0/1 power domains support for i.MX8qxp DC0 ↵Liu Ying1-0/+1
subsystem This patch adds video0/1 power domains support for i.MX8qxp DC0 subsystem. Cc: Shawn Guo <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Pengutronix Kernel Team <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: NXP Linux Team <[email protected]> Signed-off-by: Liu Ying <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-16firmware: imx-dsp: Export functions to request/free channelsDaniel Baluta1-0/+25
In order to save power, we only need to request a channel when the communication with the DSP active. For this we export the following functions: - imx_dsp_request_channel, gets a channel with a given index - imx_dsp_free_channel, frees a channel with a given index Notice that we still request channels at probe to support devices that do not have PM callbacks implemented. More explanations about why requesting a channel has an effect on power savings: - requesting an mailbox channel will call mailbox's startup function. - startup function calls pm_runtime_get_sync which increments device usage count and will keep the device active. Specifically, mailbox clock will be always ON when a mailbox channel is requested. Signed-off-by: Daniel Baluta <[email protected]> Reviewed-by: Paul Olaru <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-16firmware: imx: Save channel name for further useDaniel Baluta1-3/+3
We want to request / free channels on demand later in order to save power. For this for each channel we save the name and use it to reference the channel later. Signed-off-by: Daniel Baluta <[email protected]> Reviewed-by: Paul Olaru <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-16firmware: imx: Introduce imx_dsp_setup_channelsDaniel Baluta1-15/+26
Create a separate function that sets up DSP mailbox channels so that imx_dsp_probe function will be easier to read. Signed-off-by: Daniel Baluta <[email protected]> Reviewed-by: Paul Olaru <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-11-16firmware: imx: scu-pd: Add power domains for imx-jpegMirela Rabulea1-0/+6
The power domains are for imx8qxp/imx8qm JPEG encoder & decoder. Each has 4 slots and a wrapper. Signed-off-by: Mirela Rabulea <[email protected]> Acked-by: Daniel Baluta <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-09-13firmware: imx: scu-pd: ignore power domain not ownedPeng Fan1-0/+4
Should not register power domain that not owned by current partition. Alought power domains will not be registered when power on failure, we have to let CPU waste more cycles. Whether power on or owned check, both need communicate with SCU, but with owned check, we no need to run more code path to save CPU cycles. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Leonard Crestez <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-07-13firmware: imx: Move i.MX SCU soc driver into imx firmware folderAnson Huang3-1/+143
The i.MX SCU soc driver depends on SCU firmware driver, so it has to use platform driver model for proper defer probe operation, since it has no device binding in DT file, a simple platform device is created together inside the platform driver. To make it more clean, we can just move the entire SCU soc driver into imx firmware folder and initialized by i.MX SCU firmware driver. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-06-23firmware: imx: scu-pd: add more cm4 resourcesPeng Fan1-2/+12
Add more cm4 resources, then linux could use cm4's i2c/lpuart and could kick cm4 core. Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-06-23firmware: imx: add resource management apiPeng Fan2-1/+46
Add resource management API, when we have multiple partition running together, resources not owned to current partition should not be used. Reviewed-by: Leonard Crestez <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-06-23firmware: imx: scu-pd: fix cm40 power domainPeng Fan1-2/+2
The postfix needs to be false. Alought compiler use 0 for postfix now, and take start_from as 0, it is better we add explicit false to postfix. Fixes: 705dcca91d0a("firmware: imx: scu-pd: add power domain for I2C and INTMUX in CM40 SS") Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-06-17firmware: imx: make sure MU irq can wake up system from suspend modeAnson Huang1-0/+2
IRQF_NO_SUSPEND flag is set for MU IRQ of IPC work, but with this flag set, IRQD_WAKEUP_ARMED flag will NOT be set during suspend_device_irq() phase, then when MU IRQ arrives, it will NOT wake up system from suspend. To fix this issue, pm_system_wakeup() is called in general MU IRQ handler to make sure system can be waked up when MU IRQ arrives. Signed-off-by: Anson Huang <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-05-26Merge tag 'imx-drivers-5.8' of ↵Arnd Bergmann1-16/+48
git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers i.MX drivers update for 5.8: - Optimize imx-scu driver to use one TX and one RX instead of four for talking to SCU. - Fix one possible message header corruption where the response is longer than the request. - Move System Control defines into dt-bindings header, so that DT can use them as well. - A couple of small fixups. * tag 'imx-drivers-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: firmware: imx: scu: Fix possible memory leak in imx_scu_probe() dt-bindings: firmware: imx: Add more system controls and PM clock types dt-bindings: firmware: imx: Move system control into dt-binding headfile firmware: imx: scu: Fix corruption of header firmware: imx-scu: Support one TX and one RX soc: imx8m: No need to put node when of_find_compatible_node() failed Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2020-05-20firmware: imx: scu: Fix possible memory leak in imx_scu_probe()Wei Yongjun1-0/+1
'chan_name' is malloced in imx_scu_probe() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: edbee095fafb ("firmware: imx: add SCU firmware driver support") Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-05-13dt-bindings: firmware: imx: Move system control into dt-binding headfileDong Aisheng1-1/+0
i.MX8 SoCs DTS file needs system control macro definitions, so move them into dt-binding headfile, then include/linux/firmware/imx/types.h can be removed and those drivers using it should be changed accordingly. Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Jacky Bai <[email protected]> Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-04-23firmware: imx: scu: Fix corruption of headerFranck LENORMAND1-5/+5
The header of the message to send can be changed if the response is longer than the request: - 1st word, the header is sent - the remaining words of the message are sent - the response is received asynchronously during the execution of the loop, changing the size field in the header - the for loop test the termination condition using the corrupted header It is the case for the API build_info which has just a header as request but 3 words in response. This issue is fixed storing the header locally instead of using a pointer on it. Fixes: edbee095fafb (firmware: imx: add SCU firmware driver support) Signed-off-by: Franck LENORMAND <[email protected]> Reviewed-by: Leonard Crestez <[email protected]> Signed-off-by: Leonard Crestez <[email protected]> Cc: [email protected] Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-04-20firmware: imx-scu: Support one TX and one RXPeng Fan1-11/+43
Current imx-scu requires four TX and four RX to communicate with SCU. This is low efficient and causes lots of mailbox interrupts. With imx-mailbox driver could support one TX to use all four transmit registers and one RX to use all four receive registers, imx-scu could use one TX and one RX. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-04-17firmware: imx: fix compile-testingArnd Bergmann1-2/+2
It is nice to allow compile-testing the firmware drivers, but this fails when the dependency is a loadable module: aarch64-linux-ld: drivers/firmware/imx/scu-pd.o: in function `imx_sc_pd_power': scu-pd.c:(.text+0xd8): undefined reference to `imx_scu_call_rpc' aarch64-linux-ld: scu-pd.c:(.text+0x108): undefined reference to `imx_scu_call_rpc' aarch64-linux-ld: drivers/firmware/imx/scu-pd.o: in function `imx_sc_pd_probe': Change the dependencies to ensure that any driver we depend on is either reachable or we are compile-testing and it is disabled, effectively reverting most of the previous changes that turned out to be incorrect. Fixes: a9f85f93ed73 ("firmware: imx: add COMPILE_TEST support") Fixes: 5b00b8375416 ("firmware: imx: add COMPILE_TEST for IMX_SCU driver") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-04-03Merge tag 'arm-drivers-5.7' of ↵Linus Torvalds1-1/+12
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM driver updates from Arnd Bergmann: "These are the usual updates for SoC specific device drivers and related subsystems that don't have their own top-level maintainers: - ARM SCMI/SCPI updates to allow pluggable transport layers - TEE subsystem cleanups - A new driver for the Amlogic secure power domain controller - Various driver updates for the NXP Layerscape DPAA2, NXP i.MX SCU and TI OMAP2+ sysc drivers. - Qualcomm SoC driver updates, including a new library module for "protection domain" notifications - Lots of smaller bugfixes and cleanups in other drivers" * tag 'arm-drivers-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (70 commits) soc: fsl: qe: fix sparse warnings for ucc_slow.c soc: fsl: qe: ucc_slow: remove 0 assignment for kzalloc'ed structure soc: fsl: qe: fix sparse warnings for ucc_fast.c soc: fsl: qe: fix sparse warnings for qe_ic.c soc: fsl: qe: fix sparse warnings for ucc.c soc: fsl: qe: fix sparse warning for qe_common.c soc: fsl: qe: fix sparse warnings for qe.c soc: qcom: Fix QCOM_APR dependencies soc: qcom: pdr: Avoid uninitialized use of found in pdr_indication_cb soc: imx: drop COMPILE_TEST for IMX_SCU_SOC firmware: imx: add COMPILE_TEST for IMX_SCU driver soc: imx: gpc: fix power up sequencing soc: imx: increase build coverage for imx8m soc driver soc: qcom: apr: Add avs/audio tracking functionality dt-bindings: soc: qcom: apr: Add protection domain bindings soc: qcom: Introduce Protection Domain Restart helpers devicetree: bindings: firmware: add ipq806x to qcom_scm memory: tegra: Correct debugfs clk rate-range on Tegra124 memory: tegra: Correct debugfs clk rate-range on Tegra30 memory: tegra: Correct debugfs clk rate-range on Tegra20 ...
2020-03-18firmware: imx: add COMPILE_TEST supportAnson Huang1-2/+2
Add COMPILE_TEST support to i.MX SCU drivers for better compile testing coverage. Signed-off-by: Anson Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-16firmware: imx: add COMPILE_TEST for IMX_SCU driverAnson Huang1-1/+1
Add COMPILE_TEST support to IMX_SCU driver for better compile testing coverage. Any driver depending on IMX_SCU shouldn't have COMPILE_TEST though. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-03-10firmware: imx: scu-pd: add power domain for I2C and INTMUX in CM40 SSJoakim Zhang1-0/+4
Add power domain for I2C and INTMUX in CM40 SS. Signed-off-by: Joakim Zhang <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
2020-02-24firmware: imx: Align imx_sc_msg_req_cpu_start to 4Leonard Crestez1-1/+1
The imx SC api strongly assumes that messages are composed out of 4-bytes words but some of our message structs have odd sizeofs. This produces many oopses with CONFIG_KASAN=y. Fix by marking with __aligned(4). Fixes: d90bf296ae18 ("firmware: imx: Add support to start/stop a CPU") Signed-off-by: Leonard Crestez <[email protected]> Signed-off-by: Shawn Guo <[email protected]>