summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'rpmsg-v4.9' of git://github.com/andersson/remoteprocLinus Torvalds2016-10-061-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * rpmsg: Move rpmsg_device API to new fileBjorn Andersson2016-09-081-2/+2
| | | | | | | | | | | | | | 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>
* | remoteproc: Refactor rproc module lockingBjorn Andersson2016-10-021-12/+8
| | | | | | | | | | | | | | | | | | 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>
* | remoteproc: Split driver and consumer dereferencingBjorn Andersson2016-10-028-17/+32
| | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: Correct resource handling upon boot failureBjorn Andersson2016-10-021-4/+5
| | | | | | | | | | | | | | | | | | 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: 988d204cdaf6 ("remoteproc: Move handling of cached table to boot/shutdown") Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: Drop unnecessary NULL checkBjorn Andersson2016-09-191-7/+0
| | | | | | | | | | | | | | | | 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>
* | remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in paLoic PALLARDY2016-09-061-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: qcom: wcnss: Fix return value check in wcnss_probe()Wei Yongjun2016-08-221-2/+2
| | | | | | | | | | | | | | | | | | 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>
* | remoteproc: qcom: Introduce WCNSS peripheral image loaderBjorn Andersson2016-08-185-0/+852
| | | | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: Only update table_ptr if we have a loaded tableBjorn Andersson2016-08-181-10/+6
| | | | | | | | | | | | | | | | 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>
* | remoteproc: Move handling of cached table to boot/shutdownBjorn Andersson2016-08-171-37/+18
| | | | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: Move vdev handling to boot/shutdownBjorn Andersson2016-08-171-22/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: Calculate max_notifyid during loadBjorn Andersson2016-08-171-12/+4
| | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: Introduce auto-boot flagBjorn Andersson2016-08-173-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc/omap: revise a minor error trace messageAnna, Suman2016-08-121-1/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc/omap: fix various code formatting issuesAnna, Suman2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: print hex numbers with a leading 0x formatAnna, Suman2016-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
* | remoteproc: align code with open parenthesisAnna, Suman2016-08-125-39/+39
| | | | | | | | | | | | | | | | | | 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>
* | remoteproc: fix bare unsigned type usageAnna, Suman2016-08-121-6/+6
| | | | | | | | | | | | | | | | | | While there is nothing wrong with defining an unsigned integer variable or argument using the bare unsigned type, it is better to use the checkpatch preferred 'unsigned int' type. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: use variable names for sizeof() operatorAnna, Suman2016-08-121-2/+2
| | | | | | | | | | | | | | | | | | Fix the code formatting to use the kernel preferred style of using the actual variables to determize the size using the sizeof() operator. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: fix couple of minor typosAnna, Suman2016-08-122-2/+2
| | | | | | | | | | | | | | | | Fix couple of minor mis-spelled words in all the remoteproc source files. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: use proper format-specifier for printing dma_addr_tAnna, Suman2016-08-121-6/+6
| | | | | | | | | | | | | | | | | | | | The dma_addr_t types can be printed properly using the %pad printk format-specifier, there is no need to resort to the unsigned long long type-casting to deal with different possible type sizes. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: qcom: hexagon: Fix error return code in q6v5_probe()Wei Yongjun2016-08-101-1/+3
| | | | | | | | | | | | | | | | Fix to return a negative error code from the state get failed error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: core: Remove pointless OOM printLee Jones2016-08-101-1/+0
| | | | | | | | | | | | | | | | These types of error prints are superfluous. The system will pick up on OOM issues and let the user know. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: core: Trivial: Improve error checking, spelling and debug printsLee Jones2016-08-101-6/+6
| | | | | | | | | | | | | | Trivial patch to clean up a couple of minor misgivings. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: core: Ensure error message is clearLee Jones2016-08-101-2/+3
|/ | | | | | | | | | | | | | | | | Before this patch, the dma_alloc_coherent() failure path printed out: "dma_alloc_coherent err: 16760832" ... alluding to the Linux error code being 16760832, but seeing as Linux error codes are all negative, this looks like a signed/unsigned issue. In fact, the message is trying to print the length of the requested memory region. Let's clear that up. While we're at it, let's standardise the way 'len' is printed. In all other locations 'len' is in hex prefixed by a '0x' for clarity. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* dma-mapping: use unsigned long for dma_attrsKrzysztof Kozlowski2016-08-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dma-mapping core and the implementations do not change the DMA attributes passed by pointer. Thus the pointer can point to const data. However the attributes do not have to be a bitfield. Instead unsigned long will do fine: 1. This is just simpler. Both in terms of reading the code and setting attributes. Instead of initializing local attributes on the stack and passing pointer to it to dma_set_attr(), just set the bits. 2. It brings safeness and checking for const correctness because the attributes are passed by value. Semantic patches for this change (at least most of them): virtual patch virtual context @r@ identifier f, attrs; @@ f(..., - struct dma_attrs *attrs + unsigned long attrs , ...) { ... } @@ identifier r.f; @@ f(..., - NULL + 0 ) and // Options: --all-includes virtual patch virtual context @r@ identifier f, attrs; type t; @@ t f(..., struct dma_attrs *attrs); @@ identifier r.f; @@ f(..., - NULL + 0 ) Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> Acked-by: Mark Salter <msalter@redhat.com> [c6x] Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> [cris] Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> [drm] Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Acked-by: Joerg Roedel <jroedel@suse.de> [iommu] Acked-by: Fabien Dessenne <fabien.dessenne@st.com> [bdisp] Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> [vb2-core] Acked-by: David Vrabel <david.vrabel@citrix.com> [xen] Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [xen swiotlb] Acked-by: Joerg Roedel <jroedel@suse.de> [iommu] Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon] Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k] Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390] Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> [avr32] Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc] Acked-by: Robin Murphy <robin.murphy@arm.com> [arm64 and dma-iommu] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* remoteproc: qcom: hexagon: Clean up mpss validationBjorn Andersson2016-07-141-11/+7
| | | | | | | | | | As reported by Dan the unsigned "val" can't be negative. But instead correcting the check for early errors here followed by a wait for the validation result to show the error or success we can consolidate these two parts of the validation process into the validation function. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: qcom: remove redundant dev_err call in q6v5_init_mem()Wei Yongjun2016-07-141-6/+2
| | | | | | | | | There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: qcom: Driver for the self-authenticating Hexagon v5Bjorn Andersson2016-07-135-0/+1124
| | | | | | | | | | This driver supports bringing the Q6V5 out of reset, load and drive the self-authenticating boot loader and use this to load the mdt and subsequent bXX files. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: Fix potential race condition in rproc_addDave Gerlach2016-06-141-6/+9
| | | | | | | | | | | | | | | rproc_add adds the newly created remoteproc to a list for use by rproc_get_by_phandle and then does some additional processing to finish adding the remoteproc. This leaves a small window of time in which the rproc is available in the list but not yet fully initialized, so if another driver comes along and gets a handle to the rproc, it will be invalid. Rearrange the code in rproc_add to make sure the rproc is added to the list only after it has been successfuly initialized. Fixes: fec47d863587 ("remoteproc: introduce rproc_get_by_phandle API") Cc: stable@vger.kernel.org Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: Add additional crash reasonsBjorn Andersson2016-05-121-0/+2
| | | | | | | | The Qualcomm WCNSS can crash by watchdog or a fatal software error. Add these types to the list of remoteproc crash reasons. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: core: Make the loaded resource table optionalBjorn Andersson2016-05-121-6/+2
| | | | | | | | | Remote processors like the ones found in the Qualcomm SoCs does not have a resource table passed to them, so make it optional by only populating it if it does exist. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: core: Task sync during rproc_fw_boot()Lee Jones2016-05-063-3/+29
| | | | | | | | | | | | | | | By default, rproc_fw_boot() needs to wait for rproc to be configured, but a race may occur when using rpmsg/virtio. In this case, it can be called locally in a safe manor. This patch represents two usecases: - External call (via exported rproc_boot()), which waits - Internal call can use 'nowait' version of rproc_boot() Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: st: fix check of syscon_regmap_lookup_by_phandle() return valueVladimir Zapolskiy2016-03-281-2/+2
| | | | | | | | | | syscon_regmap_lookup_by_phandle() returns either a valid pointer to struct regmap or ERR_PTR() error value, check for NULL is invalid and on error path may lead to oops, the change corrects the check. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: Supply controller driver for ST's Remote ProcessorsLee Jones2016-01-293-0/+307
| | | | | | Signed-off-by: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: debugfs: Add ability to boot remote processor using debugfsLee Jones2016-01-291-0/+34
| | | | | | | | | | | This functionality is especially useful during the testing phase. When used in conjunction with Mailbox's Test Framework we can trivially conduct end-to-end testing i.e. boot co-processor, send and receive messages to the co-processor, then shut it down again (repeat as required). Signed-off-by: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: debugfs: Return error on invalid 'count' valueLee Jones2016-01-291-1/+1
| | | | | | | | If 'count' value is invalid, return -EINVAL. Signed-off-by: Lee Jones <lee.jones@linaro.org> [bjorn: changed commit message] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc/wkup_m3: Use MODULE_DEVICE_TABLE to export aliasDave Gerlach2016-01-291-0/+1
| | | | | | | | Use MODULE_DEVICE_TABLE with wkup_m3_rproc_of_match so the module alias is exported and the wkup_m3_rproc driver can automatically probe. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc: report error if resource table doesn't existStefan Agner2016-01-291-1/+3
| | | | | | | | | | Currently, if the resource table is completely missing in the firmware, powering up the remoteproc fails silently. Add a message indicating that the resource table is missing in the firmware. Signed-off-by: Stefan Agner <stefan@agner.ch> Acked-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* virtio: make find_vqs() checkpatch.pl-friendlyStefan Hajnoczi2016-01-121-1/+1
| | | | | | | | | | | | | | | | | | | checkpatch.pl wants arrays of strings declared as follows: static const char * const names[] = { "vq-1", "vq-2", "vq-3" }; Currently the find_vqs() function takes a const char *names[] argument so passing checkpatch.pl's const char * const names[] results in a compiler error due to losing the second const. This patch adjusts the find_vqs() prototype and updates all virtio transports. This makes it possible for virtio_balloon.c, virtio_input.c, virtgpu_kms.c, and virtio_rpmsg_bus.c to use the checkpatch.pl-friendly type. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
* remoteproc: fix memory leak of remoteproc ida cache layersSuman Anna2015-11-261-0/+2
| | | | | | | | | | | | | | | | | The remoteproc core uses a static ida named rproc_dev_index for assigning an automatic index number to a registered remoteproc. The ida core may allocate some internal idr cache layers and ida bitmap upon any ida allocation, and all these layers are truely freed only upon the ida destruction. The rproc_dev_index ida is not destroyed at present, leading to a memory leak when using the remoteproc core as a module and atleast one rproc device is registered and unregistered. Fix this by invoking ida_destroy() in the remoteproc core module exit. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc: avoid stack overflow in debugfs fileArnd Bergmann2015-11-261-1/+1
| | | | | | | | | | | | | | | | | Recent gcc versions warn about reading from a negative offset of an on-stack array: drivers/remoteproc/remoteproc_debugfs.c: In function 'rproc_recovery_write': drivers/remoteproc/remoteproc_debugfs.c:167:9: warning: 'buf[4294967295u]' may be used uninitialized in this function [-Wmaybe-uninitialized] I don't see anything in sys_write() that prevents us from being called with a zero 'count' argument, so we should add an extra check in rproc_recovery_write() to prevent the access and avoid the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 2e37abb89a2e ("remoteproc: create a 'recovery' debugfs entry") Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc: fix !CONFIG_OF build breakageOhad Ben-Cohen2015-06-181-0/+7
| | | | | | | | | | | | | Fix this: drivers/remoteproc/remoteproc_core.c: In function 'rproc_get_by_phandle': >> drivers/remoteproc/remoteproc_core.c:1167:2: error: implicit declaration of function 'of_find_node_by_phandle' [-Werror=implicit-function-declaration] np = of_find_node_by_phandle(phandle); Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: Dave Gerlach <d-gerlach@ti.com> Cc: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc/wkup_m3: add a remoteproc driver for TI Wakeup M3Dave Gerlach2015-06-173-0/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a remoteproc driver to load the firmware and boot a small Wakeup M3 processor present on TI AM33xx and AM43xx SoCs. This Wakeup M3 remote processor is an integrated Cortex M3 that allows the SoC to enter the lowest possible power state by taking control from the MPU after it has gone into its own low power state and shutting off any additional peripherals. The Wakeup M3 processor has two internal memory regions - 16 kB of unified instruction memory called UMEM used to store executable code, and 8 kB of data memory called DMEM used for all data sections. The Wakeup M3 processor executes its code entirely from within the UMEM and uses the DMEM for any data. It does not use any external memory or any other external resources. The device address view has the UMEM at address 0x0 and DMEM at address 0x80000, and these are computed automatically within the driver based on relative address calculation from the corresponding device tree IOMEM resources. These device addresses are used to aid the core remoteproc ELF loader code to properly translate and load the firmware segments through the .rproc_da_to_va ops. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc: add a rproc ops for performing address translationSuman Anna2015-06-171-6/+25
| | | | | | | | | | | | | | | | | | | | | | | The rproc_da_to_va API is currently used to perform any device to kernel address translations to meet the different needs of the remoteproc core/drivers (eg: loading). The functionality is achieved within the remoteproc core, and is limited only for carveouts allocated within the core. A new rproc ops, da_to_va, is added to provide flexibility to platform implementations to perform the address translation themselves when the above conditions cannot be met by the implementations. The rproc_da_to_va() API is extended to invoke this ops if present, and fallback to regular processing if the platform implementation cannot provide the translation. This will allow any remoteproc implementations to translate addresses for dedicated memories like internal memories. While at this, also update the rproc_da_to_va() documentation since it is an exported function. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc: introduce rproc_get_by_phandle APIDave Gerlach2015-06-161-0/+50
| | | | | | | | | | | | | | | | Allow users of remoteproc the ability to get a handle to an rproc by passing a phandle supplied in the user's device tree node. This is useful in situations that require manual booting of the rproc. This patch uses the code removed by commit 40e575b1d0b3 ("remoteproc: remove the get_by_name/put API") for the ref counting but is modified to use a simple list and locking mechanism and has rproc_get_by_name replaced with an rproc_get_by_phandle API. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com> [fix order of Signed-off-by tags] Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc: fix various checkpatch warningsSuman Anna2015-05-022-19/+10
| | | | | | | | | | | | | Fix all the checkpatch warnings in the core remoteproc code. The fixes cover the following warnings: 1. WARNING: void function return statements are not generally useful 2. WARNING: Possible unnecessary 'out of memory' message 3. WARNING: line over 80 characters 4. WARNING: braces {} are not necessary for single statement blocks 5. WARNING: Unnecessary space before function pointer arguments Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc/davinci: fix quoted split string checkpatch warningSuman Anna2015-05-021-2/+1
| | | | | | | | | | | Fix the following checkpatch warning, WARNING: quoted string split across lines + "\n\t\tName of DSP firmware file in /lib/firmware" + " (if not specified defaults to 'rproc-dsp-fw')"); Signed-off-by: Suman Anna <s-anna@ti.com> [remove leading whitespace as well] Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* remoteproc/ste: add blank lines after declarationsSuman Anna2015-05-021-2/+2
| | | | | | | | Fix couple of checkpatch warnings of the type, "WARNING: Missing a blank line after declarations" Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>