aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/stm32_rproc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-09-15remoteproc: stm32: Fix pointer assignementMathieu Poirier1-1/+1
Fix the assignment of the @state pointer - it is obviously wrong. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Fixes: 376ffdc04456 ("remoteproc: stm32: Properly set co-processor state when attaching") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200831213758.206690-1-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Update M4 state in stm32_rproc_stop()Mathieu Poirier1-0/+12
Update the co-processor state in function stm32_rproc_stop() so that it can be used in scenarios where the remoteproc core is attaching to the M4. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714200445.1427257-12-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Introduce new attach() operationMathieu Poirier1-0/+8
Introduce new attach function to be used when attaching to a remote processor. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-11-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Properly handle the resource table when attachingMathieu Poirier1-0/+76
Properly set the remote processor's resource table based on where it was loaded by the external entity when attaching to a remote processor. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-10-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Parse memory regions when attaching to M4Mathieu Poirier1-3/+20
Split function stm32_rproc_parse_fw() in two parts, the first one to parse the memory regions and the second one to load the resource table. That way parsing of the memory regions can be done without having do deal with the resource table when attaching to a remote processor. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-9-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Properly set co-processor state when attachingMathieu Poirier1-0/+31
Introduce the required mechanic to set the state of the M4 in order to properly deal with scenarios where the co-processor has been started by another entity. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-7-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Parse syscon that will manage M4 synchronisationMathieu Poirier1-0/+26
Get from the DT the syncon to probe the state of the remote processor and the location of the resource table. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-6-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Remove memory translation from DT parsingMathieu Poirier1-1/+5
Other than one has to be done after the other, there is no correlation between memory translation and DT parsing. As such move function stm32_rproc_of_memory_translations() to stm32_rproc_probe() so that stm32_rproc_parse_dt() can be extended to look for attach bindings in a clean way. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-5-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Decouple rproc from DT parsingMathieu Poirier1-11/+12
Remove the remote processor from the process of parsing the device tree since (1) there is no correlation between them and (2) to use the information that was gathered to make a decision on whether to synchronise with the M4 or not. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-4-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Request IRQ with platform deviceMathieu Poirier1-2/+3
Request IRQ with platform device rather than remote proc in order to call stm32_rproc_parse_dt() before rproc_alloc(). That way we can know whether we need to synchronise with the MCU or not. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Decouple rproc from memory translationMathieu Poirier1-4/+4
Remove the remote processor from the process of parsing the memory ranges since there is no correlation between them. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-2-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-08Merge tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteprocLinus Torvalds1-1/+2
Pull remoteproc updates from Bjorn Andersson: "This introduces device managed versions of functions used to register remoteproc devices, add support for remoteproc driver specific resource control, enables remoteproc drivers to specify ELF class and machine for coredumps. It integrates pm_runtime in the core for keeping resources active while the remote is booted and holds a wake source while recoverying a remote processor after a firmware crash. It refactors the remoteproc device's allocation path to simplify the logic, fix a few cleanup bugs and to not clone const strings onto the heap. Debugfs code is simplifies using the DEFINE_SHOW_ATTRIBUTE and a zero-length array is replaced with flexible-array. A new remoteproc driver for the JZ47xx VPU is introduced, the Qualcomm SM8250 gains support for audio, compute and sensor remoteprocs and the Qualcomm SC7180 modem support is cleaned up and improved. The Qualcomm glink subsystem-restart driver is merged into the main glink driver, the Qualcomm sysmon driver is extended to properly notify remote processors about all other remote processors' state transitions" * tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: (43 commits) remoteproc: Fix an error code in devm_rproc_alloc() MAINTAINERS: Add myself as reviewer for Ingenic rproc driver remoteproc: ingenic: Added remoteproc driver remoteproc: Add support for runtime PM dt-bindings: Document JZ47xx VPU auxiliary processor remoteproc: wcss: Fix arguments passed to qcom_add_glink_subdev() remoteproc: Fix and restore the parenting hierarchy for vdev remoteproc: Fall back to using parent memory pool if no dedicated available remoteproc: Replace zero-length array with flexible-array remoteproc: wcss: add support for rpmsg communication remoteproc: core: Prevent system suspend during remoteproc recovery remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use remoteproc: qcom_q6v5_mss: Drop accesses to MPSS PERPH register space dt-bindings: remoteproc: qcom: Replace halt-nav with spare-regs remoteproc: qcom: pas: Add SM8250 PAS remoteprocs dt-bindings: remoteproc: qcom: pas: Add SM8250 remoteprocs remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region dt-bindings: remoteproc: qcom: Use memory-region to reference memory remoteproc: qcom: pas: Add SC7180 Modem support ...
2020-04-22remoteproc: remove rproc_elf32_sanity_checkClement Leger1-1/+1
Since checks are present in the remoteproc elf loader before calling da_to_va, loading a elf64 will work on 32bits flavors of kernel. Indeed, if a segment size is larger than what size_t can hold, the loader will return an error so the functionality is equivalent to what exists today. Acked-by: Suman Anna <s-anna@ti.com> Signed-off-by: Clement Leger <cleger@kalray.eu> Link: https://lore.kernel.org/r/20200422093017.10985-1-cleger@kalray.eu Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-19remoteproc: use rproc_coredump_set_elf_info in driversClement Leger1-0/+1
Modify drivers which are using remoteproc coredump functionality to use rproc_coredump_set_elf_info in order to create correct elf coredump format. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Clement Leger <cleger@kalray.eu> Link: https://lore.kernel.org/r/20200410102433.2672-3-cleger@kalray.eu Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-17remoteproc: pull in slab.hMichael S. Tsirkin1-0/+1
In preparation to virtio header changes, include slab.h directly as this module is using it. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-03-25remoteproc: stm32: demote warning about optional property absenceAhmad Fatoum1-1/+1
The mainline device trees lack the "st,syscfg-pdds", so probing the driver always throws the warning. As the property is optional per binding and the driver can deal with its absence, demote the warning to info log level. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.kernel.org/r/20200224172519.15315-1-a.fatoum@pengutronix.de Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-03-25remoteproc: Rename rproc_elf_sanity_check for elf32Clement Leger1-1/+1
Since this function will be modified to support both elf32 and elf64, rename the existing one to elf32 (which is the only supported format at the moment). This will allow not to introduce possible side effect when adding elf64 support (ie: all backends will still support only elf32 if not requested explicitely using rproc_elf_sanity_check). Signed-off-by: Clement Leger <cleger@kalray.eu> Link: https://lore.kernel.org/r/20200302093902.27849-6-cleger@kalray.eu Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-11-18remoteproc: stm32: fix probe error caseFabien Dessenne1-2/+15
If the rproc driver is probed before the mailbox driver and if the rproc Device Tree node has some mailbox properties, the rproc driver probe shall be deferred instead of being probed without mailbox support. Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Link: https://lore.kernel.org/r/1573812188-19842-1-git-send-email-fabien.dessenne@st.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-11-14remoteproc: stm32: wakeup the system by wdg irqFabien Dessenne1-0/+45
If the device node defines the 'wakeup-source' property, use the WDG exti IRQ as a wakeup source of the system. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Link: https://lore.kernel.org/r/1566833923-16718-3-git-send-email-fabien.dessenne@st.com [bjorn: Replace ifdef with __maybe_unused for suspend/resume functions] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-11-08remoteproc: stm32: use workqueue to treat mailbox callbackArnaud Pouliquen1-5/+33
The mailbox callback is under interrupt context. A consequence is that RPMsg Callbacks are also in interrupt context. Create workqueue to treat the callbacks in normal context. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-08-26remoteproc: stm32: manage the get_irq probe defer caseFabien Dessenne1-0/+3
Manage the -EPROBE_DEFER error case for "wdg" IRQ. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-08-26remoteproc: stm32: clear MCU PDDS at firmware startFabien Dessenne1-0/+11
When remoteproc stops a firmware, it sets the MCU PDDS flag, allowing the platform to reach the Standby power mode if needed. Symmetrically, clear this flag before running a firmware. This fixes the issue where the system goes to Standby mode when the MCU crashes while MPU is in CSTOP mode. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-08remoteproc: stm32: fix building without ARM SMCCArnd Bergmann1-1/+1
When compile testing this driver without SMCC support enabled, we get a link error: drivers/remoteproc/stm32_rproc.o: In function `stm32_rproc_start': stm32_rproc.c:(.text+0x776): undefined reference to `__arm_smccc_smc' drivers/remoteproc/stm32_rproc.o: In function `stm32_rproc_stop': stm32_rproc.c:(.text+0x92c): undefined reference to `__arm_smccc_smc' Make the actual call to arm_smccc_smc conditional on the Kconfig symbol controlling its implementation. Fixes: 13140de09cc2 ("remoteproc: stm32: add an ST stm32_rproc driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-06-29remoteproc: stm32: add an ST stm32_rproc driverFabien Dessenne1-0/+628
This patch introduces a new remoteproc driver to control Cortex-M4 co-processor of the STM32 family. It provides with the following features: - start and stop - dedicated co-processor memory regions registration - coredump and recovery Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> [bjorn: Fixup of dev_dbg types and cast of int to pointer in mbox send] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>