The adsp-pil driver relies on SCM and causes a build error without it:
ERROR: "qcom_scm_pas_supported" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_is_available" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_auth_and_reset" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_shutdown" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_mem_setup" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_init_image" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
This adds a 'select', as SCM is a silent Kconfig symbol that gets
enabled implicitly by all its users.
Fixes: b9e718e950 ("remoteproc: Introduce Qualcomm ADSP PIL")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In the event that rproc_boot() is called before the firmware loaded
completion has been flagged it will wait with the mutex held,
obstructing the request_firmware_nowait() callback from completing the
wait.
As rproc_fw_config_virtio() has been reduced to only triggering
auto-boot there is no longer a reason for waiting in rproc_boot(), so
drop this.
Cc: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Back in July 2014 I asked around what was the intended target
platform for the STE Modem remoteproc driver, so that I could add the
proper hardware dependency to its config option. The answer I got was
that there was no known publicly available hardware needing it and it
was unlikely that there ever would.
So I think it's time to delete this driver to lower the maintenance
burden.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Suman Anna <s-anna@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Warning users that remoteproc and it's binary format are under
development doesn't serve much of a purpose. Different drivers support
different image formats and the resource table has a version field that
would need to be bumped when incompatible changes are introduced.
So lets drop this warning to clean up the kernel log.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The adsp-pil driver relies on SCM and causes a build error without it:
ERROR: "qcom_scm_pas_supported" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_is_available" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_auth_and_reset" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_shutdown" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_mem_setup" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
ERROR: "qcom_scm_pas_init_image" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
This adds a 'select', as SCM is a silent Kconfig symbol that gets
enabled implicitly by all its users.
Fixes: b9e718e950 ("remoteproc: Introduce Qualcomm ADSP PIL")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Add linux/sizes.h to prevent build failure on non ARM architectures
as:
CC [M] drivers/remoteproc/qcom_mdt_loader.o
In file included from include/linux/cache.h:4:0,
from include/linux/printk.h:8,
from include/linux/kernel.h:13,
from include/asm-generic/bug.h:13,
from arch/x86/include/asm/bug.h:35,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from arch/x86/include/asm/elf.h:7,
from include/linux/elf.h:4,
from drivers/remoteproc/qcom_mdt_loader.c:18:
drivers/remoteproc/qcom_mdt_loader.c: In function ‘qcom_mdt_parse’:
drivers/remoteproc/qcom_mdt_loader.c:90:52: error: ‘SZ_4K’ undeclared
(first use in this function)
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The transition from rproc_put to rproc_free raced with the review of the
Qualcomm ADSP and ST SLIMproc drivers and these where not updated
accordingly.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
When qcom_smd is a loadable module and wcnss-pil is built-in,
we get a link error:
drivers/remoteproc/qcom_wcnss_pil.o: In function `wcnss_smd_remove':
qcom_wcnss_iris.c:(.text.wcnss_smd_remove+0x10): undefined reference to `qcom_smd_unregister_edge'
drivers/remoteproc/qcom_wcnss_pil.o: In function `wcnss_smd_probe':
qcom_wcnss_iris.c:(.text.wcnss_smd_probe+0x12): undefined reference to `qcom_smd_register_edge'
This adds a Kconfig dependency to avoid this. We can still allow
build-testing with SMD disabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Add xo clock support required to boot up Qualcomm ADSP processor.
The ADSP remoteproc driver keeps xo clock enabled until the
driver receives "handover" irq, in order to allow ADSP processor
to vote for xo clock with rpm.
Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The newly added driver tries to 'select' a symbol that it has an
implicit dependency on, which confuses Kconfig:
subsection "Kconfig recursive dependency limitations"
drivers/remoteproc/Kconfig:3: symbol REMOTEPROC is selected by QCOM_ADSP_PIL
As REMOTEPROC is itself user-visible, we clearly should not select
it from a driver, removing the line fixes the problem.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The Qualcomm ADSP Peripheral Image Loader is used on a variety of
different Qualcomm platforms for loading firmware into and controlling
the Hexagon based ADSP.
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The tie between the main WCNSS driver and the IRIS driver causes a
circular dependency between the two modules. Neither part makes sense to
have on their own so lets merge them into one module.
For the sake of picking up the clock and regulator resources described
in the iris of_node we need an associated struct device. But, to keep
the size of the patch down we continue to represent the IRIS part as its
own platform_driver, within the same module, rather than setting up a
dummy device.
Fixes: aed361adca ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
As all vdev resources are allocated before we boot the remote processor
we no longer need to support modifying the resource table while the
remote is running.
This saves us from the table_ptr dance, but more importantly allow the
remote processor to enable security lock down of the loaded table memory
region.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The vdev handler is now just another resource allocator, so handle all
resource types in a single pass.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Vrings are now allocated as we parse the resource table, before we
boot the rproc or register any virtio devices, so it's safe to bump
max_notifyid as part of this process.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Represent the virtio device part of the vdev resources as remoteproc
subdevices to finalize the decoupling of the virtio resource and device
handling.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tie the vdev (and hence vring) life cycle to the resource parsing and
resource cleanup operations, allowing us to safely register and
unregister virtio devices on the go.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Instead of having the vrings being allocated and freed as they are
requested by the virtio device tie their life cycle to the vdev
resource. This allows us to decouple the vdev resource management from
the virtio device management.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Allow the wcnss smd edge to be described as a child of the wcnss
remoteproc node and make the edge life cycle follow the running state of
the remoteproc.
This bond is necessary to clean up the smd state when the remote
processor is suddenly removed, and in some cases even when it shut down
in a controlled fasion.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
A subdevice is an abstract entity that can be used to tie actions to the
booting and shutting down of a remote processor. The subdevice object is
expected to be embedded in concrete implementations, allowing for a
variety of use cases to be implemented.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Fix to return a negative error code from the st_rproc_state() error
handling case instead of 0, as done elsewhere in this function.
Fixes: 63edb0310a ("remoteproc: Supply controller driver for ST's Remote Processors")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Since there is now an always available state file in sysfs with the same
function as this one in debugfs, remove the redundant entry.
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This patch adds a sysfs interface to rproc allowing the firmware name
and processor state to be changed dynamically.
State was previously available in debugfs, and is replicated here. The
firmware file allows retrieval of the running firmware name, and a new
one to be specified at run time, so long as the remote processor has
been stopped.
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/remoteproc/qcom_wcnss_iris.ko | grep alias
$
After this patch:
$ modinfo drivers/remoteproc/qcom_wcnss_iris.ko | grep alias
alias: of:N*T*Cqcom,wcn3680C*
alias: of:N*T*Cqcom,wcn3680
alias: of:N*T*Cqcom,wcn3660C*
alias: of:N*T*Cqcom,wcn3660
alias: of:N*T*Cqcom,wcn3620C*
alias: of:N*T*Cqcom,wcn3620
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/remoteproc/qcom_wcnss.ko | grep alias
$
After this patch:
$ modinfo drivers/remoteproc/qcom_wcnss.ko | grep alias
alias: of:N*T*Cqcom,pronto-v2-pilC*
alias: of:N*T*Cqcom,pronto-v2-pil
alias: of:N*T*Cqcom,pronto-v1-pilC*
alias: of:N*T*Cqcom,pronto-v1-pil
alias: of:N*T*Cqcom,riva-pilC*
alias: of:N*T*Cqcom,riva-pil
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/remoteproc/qcom_q6v5_pil.ko | grep alias
$
After this patch:
$ modinfo drivers/remoteproc/qcom_q6v5_pil.ko | grep alias
alias: of:N*T*Cqcom,q6v5-pilC*
alias: of:N*T*Cqcom,q6v5-pil
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Storage of the firmware name was inconsistent, either storing a pointer
to a name stored with unknown ownership, or a variable length tacked
onto the end of the struct proc allocated in rproc_alloc.
In preparation for allowing the firmware of an already allocated struct
rproc to be changed, instead always keep a locally maintained copy of
the firmware name.
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Make REMOTEPROC core a selectable kconfig option, and update
remoteproc client drivers to 'depends on' the core. This avoids
some nasty Kconfig recursive dependency issues. Also when using
menuconfig client drivers will be hidden until the core has been
enabled.
Documentation/kbuild/kconfig-language.txt:
Note:
select should be used with care. select will force
a symbol to a value without visiting the dependencies.
By abusing select you are able to select a symbol FOO even
if FOO depends on BAR that is not set.
In general use select only for non-visible symbols
(no prompts anywhere) and for symbols with no dependencies.
That will limit the usefulness but on the other hand avoid
the illegal configurations all over.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
slim core is used as a basis for many IPs in the STi
chipsets such as fdma and demux. To avoid duplicating
the elf loading code in each device driver a slim
rproc driver has been created.
This driver is designed to be used by other device drivers
such as fdma, or demux whose IP is based around a slim core.
The device driver can call slim_rproc_alloc() to allocate
a slim rproc and slim_rproc_put() when finished.
This driver takes care of ioremapping the slim
registers (dmem, imem, slimcore, peripherals), whose offsets
and sizes can change between IP's. It also obtains and enables
any clocks used by the device. This approach avoids having
a double mapping of the registers as slim_rproc does not register
its own platform device. It also maps well to device tree
abstraction as it allows us to have one dt node for the whole
device.
All of the generic rproc elf loading code can be reused, and
we provide start() stop() hooks to start and stop the slim
core once the firmware has been loaded. This has been tested
successfully with fdma driver.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
The bulk of these patches involve splitting the rpmsg implementation into a
framework/API part and a virtio specific backend part. It then adds the
Qualcomm Shared Memory Device (SMD) as an additional supported wire format.
Also included is a set of code style cleanups that have been lingering for a
while.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJX9XANAAoJEAsfOT8Nma3FwocP/1EMKjeyMOiyS/giPNye7EjQ
3EIms4Or6F4ULo+/mZTgyF69RGBirFgYm2GKs2GgFcAnf4bZRmXpPNYiuJZ8LGQe
9gep35eZ+vE+KArba26Sau1bjpPiWsokeJg7JPBj8KE3uR1lH3QTVjoHa3dPXRwa
NrImfZw3P2/RTgtIoDJA6CoCT8cBIiitcA++1bNGhHTu7R5hkw25mse1OFJ8sb1l
D3rsnmoTcXZqY2dDA9GYqy9/krBU69Xe7QJYCyjuNI0FHIqS60M/gTJS+v4fxJbX
ueM7Qsimdbmcm/tINeT3RcyM0gUrGukDgrEhwg+Ipohhji9tf7AYx0hIJ11Ylzq+
m2orJ5xDRg3/mxFMFg4bqWXKt0uYUSBMiztAneCdOdTPR5DBpVB47/i+Nqq0t5fm
Ql7Ev4G877A2cZp3O/xHahGCzk9xeAWnRonGeWGqIS0V2tCXWMuVtzwBB5oa0Pd0
nlb9JFnmb2lzU5ud/y681B7LdwDEjlW8o8u7JPOqEbXTVEjOebdy/nXpBCg7I9Ik
NwQLOQ8B5eOGcrki7W7qodx8BCMyEFsHrRoozdvloXePCgwOuhA5s+Ai8VqJi9Yr
9xpQpd4QHtbYHXbyM4/Pn/93MTIclcHNdE8D2qJ4/nlVtbbjwQe8p2cT7THfXTK+
GVqj+PrmRoiVS9MQ0C+1
=3bKf
-----END PGP SIGNATURE-----
Merge tag 'rpmsg-v4.9' of git://github.com/andersson/remoteproc
Pull rpmsg updates from Bjorn Andersson:
"The bulk of these patches involve splitting the rpmsg implementation
into a framework/API part and a virtio specific backend part. It then
adds the Qualcomm Shared Memory Device (SMD) as an additional
supported wire format.
Also included is a set of code style cleanups that have been lingering
for a while"
* tag 'rpmsg-v4.9' of git://github.com/andersson/remoteproc: (26 commits)
rpmsg: smd: fix dependency on QCOM_SMD=n
rpmsg: Introduce Qualcomm SMD backend
rpmsg: Allow callback to return errors
rpmsg: Move virtio specifics from public header
rpmsg: virtio: Hide vrp pointer from the public API
rpmsg: Hide rpmsg indirection tables
rpmsg: Split rpmsg core and virtio backend
rpmsg: Split off generic tail of create_channel()
rpmsg: Move helper for finding rpmsg devices to core
rpmsg: Move endpoint related interface to rpmsg core
rpmsg: Indirection table for rpmsg_endpoint operations
rpmsg: Move rpmsg_device API to new file
rpmsg: Introduce indirection table for rpmsg_device operations
rpmsg: Clean up rpmsg device vs channel naming
rpmsg: Make rpmsg_create_ept() take channel_info struct
rpmsg: rpmsg_send() operations takes rpmsg_endpoint
rpmsg: Name rpmsg devices based on channel id
rpmsg: Enable matching devices with drivers based on DT
rpmsg: Drop prototypes for non-existing functions
samples/rpmsg: add support for multiple instances
...
Lock the implementation as we hand out references to client drivers
rather than when they try to boot the remote processor. This allows
auto-booting remote processors to be shut down by unloading their
module, in addition to first unbinding them.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In order to be able to lock a rproc driver implementations only when
used by a client, we must differ between the dereference operation of a
client and the implementation itself.
This patch brings no functional change.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The freeing of resources will attempt to clear values previously set in
the cached resource table, so make sure to free the table after we have
cleaned up the resources.
Fixes: 988d204cda ("remoteproc: Move handling of cached table to boot/shutdown")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
rproc_alloc() will make sure that the "firmware" pointer is either a
driver supplied value or pointing to a generated firmware filename, it
can't be NULL. So drop the extra check in the rproc_boot() path.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Extract the now indirect rpmsg_create_ept() interface to a separate
file and start building up a rpmsg core.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In current implementation, struct fw_rsc_vdev_vring which describes
vring resource in firmware resource table owns only device address,
because it assumes that host is responsible of vring allocation and
only device address is needed by coprocessor.
But if vrings need to be fixed in system memory map for any reasons
(security, SoC charactieristics...), physical address is needed exatly
identified the memory chunck by host.
For that let's transform reserved field of struct fw_rsc_vdev_vring
to pa (physical address).
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This introduces the peripheral image loader, for loading WCNSS firmware
and boot the core on e.g. MSM8974. The firmware is verified and booted
with the help of the Peripheral Authentication System (PAS) in
TrustZone.
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
In the case that we have a resource table, but not a loaded one we
should leave the table_ptr intact, as subsequent resource handling could
otherwise dereference the NULL pointer.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
As we moved the vdev handling to the main boot/shutdown code path we can
further simplify the resource table handling by moving the parsing spet
to boot as well. The lifespan of the resource table is changed to live
from rproc_boot() to rproc_shutdown().
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The newly introduced "always-on" flag allows us to stop giving the vdevs
special treatment. The ordering of resource allocation and life cycle of
the remote processor is kept intact.
This allows us to mark a remote processor with vdevs to not boot unless
explicitly requested to do so by a client driver.
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The calculation of max_notifyid must only be done before we call start()
on the remoteproc drivers, so move the calculation to be part of the
loading steps.
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Introduce an "auto-boot" flag on rprocs to make it possible to flag
remote processors without vdevs to automatically boot once the firmware
is found.
Preserve previous behavior of the wkup_m3 processor being explicitly
booted by a consumer.
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Loic Pallardy <loic.pallardy@st.com>
Cc: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
The omap_mbox_msg_send() is the legacy API for sending a mailbox
message. It has been replaced with the mbox_send_message() from
the mailbox framework. Revise the failure trace to print a generic
failure message instead of referencing the actual function name.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This patch fixes some of the existing checkpatch warnings in OMAP
remoteproc code. The fixes are to the following warnings:
1. WARNING: missing space after return type
2. WARNING: Unnecessary space after function pointer name
3. CHECK: Alignment should match open parenthesis
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
There are couple of debug statements that are printing hexadecimal
numbers without the leading 0x. Fix these and use the standard 0x%x
format specifier so that there is no confusion when looking at the
traces.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This patch fixes the existing alignment checkpatch check
warnings of the type "Alignment should match open parenthesis"
in the remoteproc core source files.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>