Age | Commit message (Collapse) | Author |
|
Signed-off-by: Andri Schmidt <a.schmidt@scewo.ch>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Return ENOTTY if no reader is using the TTY. Note that the
VirtIO transport used by RPmsg currently does not use the
return value of this callback, hence currently will not
influence operation in any way.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Pushing data while there is no reader seems to lock/crash the TTY
layer in some way. Especially when a reader gets attached again,
the kernel crashes with
Unable to handle kernel paging request at virtual address 00002248
Also use tty_insert_flip_string which handels the copying and TTY
buffer resizing if necessary.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
(cherry picked from commit 5aba75e2c61d4044bed21730b7c471822860fac1)
|
|
Let RPMSG_NUM_BUFS to be the number of buffers per VirtIO queue,
so that each queue (TX/RX) has 256 buffers. The change does not
affect the number of buffers. But specifing per VirtIO queue
aligns better with the way buffer sizes are specified on the
FreeRTOS side (in platform_info.c).
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
(cherry picked from commit 1db9a161430d3975b4b3822b91b2a14c5b8193ba)
|
|
This is the 4.9.144 stable release
|
|
commit 940c620d6af8fca7d115de40f19870fba415efac upstream.
Currently a failed allocation of channel->name leads to an
immediate return without freeing channel. Fix this by setting
ret to -ENOMEM and jumping to an exit path that kfree's channel.
Detected by CoverityScan, CID#1473692 ("Resource Leak")
Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Cc: stable@vger.kernel.org
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Add the power management operations into imx
rpmsg driver.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
Initialize spinlock before using, otherwise the below oops triggered if
CONFIG_DEBUG_SPINLOCK enabled.
BUG: spinlock bad magic on CPU#0, kthreadd/2
lock: imx_rpmsg_vprocs+0x1240/0x24a0, .magic: 00000000, .owner: <none>/-1, .ow0
CPU: 0 PID: 2 Comm: kthreadd Not tainted 4.9.88-04946-gf984c92 #324
Hardware name: Freescale i.MX7ULP (Device Tree)
[<8010ea64>] (unwind_backtrace) from [<8010b184>] (show_stack+0x10/0x14)
[<8010b184>] (show_stack) from [<803c3a8c>] (dump_stack+0x78/0x8c)
[<803c3a8c>] (dump_stack) from [<8016a744>] (do_raw_spin_lock+0xc4/0x120)
[<8016a744>] (do_raw_spin_lock) from [<809f7448>] (_raw_spin_lock_irqsave+0x20/)
[<809f7448>] (_raw_spin_lock_irqsave) from [<807bcdc8>] (imx_mu_rpmsg_isr+0x38/)
[<807bcdc8>] (imx_mu_rpmsg_isr) from [<801722d8>] (__handle_irq_event_percpu+0x)
[<801722d8>] (__handle_irq_event_percpu) from [<8017237c>] (handle_irq_event_pe)
[<8017237c>] (handle_irq_event_percpu) from [<801723f0>] (handle_irq_event+0x38)
[<801723f0>] (handle_irq_event) from [<801757f4>] (handle_fasteoi_irq+0xd0/0x1a)
[<801757f4>] (handle_fasteoi_irq) from [<80171594>] (generic_handle_irq+0x24/0x)
[<80171594>] (generic_handle_irq) from [<80171abc>] (__handle_domain_irq+0x7c/0)
[<80171abc>] (__handle_domain_irq) from [<801014e8>] (gic_handle_irq+0x48/0x8c)
[<801014e8>] (gic_handle_irq) from [<8010bb8c>] (__irq_svc+0x6c/0xa8)
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
|
|
NXP i.MX7ULP EVK boards all sensors connect with M4 core, A core
has to conmunicate with sensors by virtual io bus like rpmsg bus.
The driver implement the virtual sensor input driver to configure
sensors active/idle/delay actions and report the sensors' event to
user space.
Supply below sysfs for user to enable/disable detector and counter,
set poll delay:
/sys/class/misc/step_counter/enable
/sys/class/misc/step_detector/enable
/sys/class/misc/step_counter/poll_delay
Reviewed-by: Elven Wang <elven.wang@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
|
Because that there are two M4 cores on iMX8QM.
Enable the multi-core string echo support.
BuildInfo:
- SCFW a6fd9a48, IMX-MKIMAGE 0, ATF 0
- U-Boot 2017.03-imx_v2017.03_4.9.11_imx8_alpha+g258936c
Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
- Init multi-core mu power and clk.
- enable the multi-core rpmsg support
BuildInfo:
- SCFW a6fd9a48, IMX-MKIMAGE 0, ATF 0
- U-Boot 2017.03-imx_v2017.03_4.9.11_imx8_alpha+g258936c
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Tested-by: Andy Duan <fugang.duan@nxp.com>
|
|
Add rpmsg virtual gpio driver support.
i.MX7ULP GPIO PTA and PTB resource are managed by M4 core, setup one
simple protocol with M4 core based on RPMSG virtual IO to let A core
access such GPIOs that is what the driver do.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
|
|
- Init mu power and clk.
- Change the cycles of the pingpong demot refer to
the limitation of M4 side.
When the received data larger than 100, the
pingpong of M4 side would be finished.
BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
Add rpmsg support for imx8qxp.
The pingpong demo had been verified on 8qxp platforms.
Use memset_io replace memset, because that
the memory type of rpvq->addr is strong order type.
There would be kernel dump when memset is used
on imx8qxp.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
Similar to other subsystems it's useful to provide a mechanism to force
a specific driver match on a device, so introduce this.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Trivial cleanup for incorrect function in dev_err message
Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
We should unlock before returning if skb_dequeue() returns a NULL.
Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
This driver allows rpmsg instances to expose access to rpmsg endpoints
to user space processes. It provides a control interface, allowing
userspace to export endpoints and an endpoint interface for each exposed
endpoint.
The implementation is based on prior art by Texas Instrument, Google,
PetaLogix and was derived from a FreeRTOS performance statistics driver
written by Michal Simek.
The control interface provides a "create endpoint" ioctl, which is fed a
name, source and destination address. The three values are used to
create the endpoint, in a backend-specific way, and a rpmsg endpoint
device is created - with the three parameters are available in sysfs for
udev usage.
E.g. to create an endpoint device for one of the Qualcomm SMD channel
related to DIAG one would issue:
struct rpmsg_endpoint_info info = { "DIAG_CNTL", 0, 0 };
int fd = open("/dev/rpmsg_ctrl0", O_RDWR);
ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &info);
Each created endpoint device shows up as an individual character device
in /dev, allowing permission to be controlled on a per-endpoint basis.
The rpmsg endpoint will be created and destroyed following the opening
and closing of the endpoint device, allowing rpmsg backends to open and
close the physical channel, if supported by the wire protocol.
Cc: Marek Novak <marek.novak@nxp.com>
Cc: Matteo Sartori <matteo.sartori@t3lab.it>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Need call MU_Init before call other function
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
|
|
Commit 2a596c353234 ("MLK-13981-2 rpmsg: imx: enable rpmsg virt tty")
enabled support for imx7ulp but it broke support for imx7d since the
currently distributed M4 image for imx7d still uses the old
"rpmsg-openamp-demo-channel" naming.
While we could change the channel name in the M4 image it is better to
maintain backwards compatibility, so add the old naming back to the id
table.
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
|
|
Add rpmsg-keys driver on i.mx7ulp-evk board since vol+/vol- keys
are connected on m4 side and have to get the status of keys by
rpmsg.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
[Irina: updated for 4.9 APIs]
Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
|
|
- add the .data into the imx_rpmsg_dt_ids table, thus
the driver can distinguish the different platforms.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Tested-by: Daniel Baluta <daniel.baluta@nxp.com>
|
|
- change the module_init to subsys_initcall.
Otherwise, the pf1550-rpmsg would be invoked before
the rpmsg bus driver on imx7ulp.
Then, sdhc wouldn't be powered up properly if pf1550
isn't functional.
- remove the no longer used imc_rpmsg_exit.
- pass the real device id if the shared irq is requested.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Tested-by: Daniel Baluta <daniel.baluta@nxp.com>
|
|
- move imx_rpmsg from arch/arm/ to drivers/rpmsg.
- use the new MU generic APIs in the rpmsg implementation.
- Validated the pingpong test on both imx6sx and imx7d sdb boards.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
Message can be transferred between remote
device and iMX7ULP M4.
Then the message can be transferred between A7
and M4 by rpmsg channel.
demo howto:
- insmode the imx_rpmsg_tty.ko module after
login A7/Linux.
- Receive messages. Used the following command
to dump out the msg from the virtual tty.
./unit_tests/mxc_mcc_tty_test.out /dev/ttyRPMSG 115200 R 100 1000 &
- Send: use the following command to send the
message to M4.
echo <your string message> /dev/ttyRPMSG
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
rpmsg core didn't take care of high memory case which may be triggered
in 1:3 kernel/userspace memory split. Get correct page by vmalloc_to_page
instead of virt_to_page.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
|
|
Set the imx rpmsg tests to be module in defaut.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
(cherry picked from commit 20adce35ef6abfd6b0a52207febe069c7f09a1be)
|
|
send a message to our remote processor, and tell remote
processor about this channel
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit 2708c004a60c5b6da020803ee9291b83984d4a65)
|
|
enable the rpmsg pingpong and tty string echo tests
on imx amp socs
- pingpong test howto
insmod imx_rpmsg_pingpong.ko
- tty string echo test howto
- step 1, load the imx_rpmsg_tty.ko
insmod imx_rpmsg_tty.ko
- step 2, lanunch the mxc_mcc_tty_test.out in backend
./mxc_mcc_tty_test.out /dev/ttyRPMSG 115200 R 512 512 &
- step 3, issue the echo command
echo <string> > /dev/ttyRPMSG
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
|
|
commit 4a2e84c6ed85434ce7843e4844b4d3263f7e233b upstream.
All the managed resources would be freed by the time release function
is invoked. Handling such memory in qcom_smd_edge_release() would do
bad things.
Found this issue while testing Audio usecase where the dsp is started up
and shutdown in a loop.
This patch fixes this issue by using simple kzalloc for allocating
channel->name and channel which is then freed in qcom_smd_edge_release().
Without this patch restarting a remoteproc would crash the system.
Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Cc: <stable@vger.kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
commit 63447646ac657fde00bb658ce21a3431940ae0ad upstream.
Since commit 4dffed5b3ac796b ("rpmsg: Name rpmsg devices based on
channel id"), it is no more possible for a firmware to register twice
a service (on different endpoints). rpmsg_register_device function
is failing when calling device_add for the second time as second
device has the same name as first one already register.
It is because name is based only on service name and so is not more
unique. Previously name was unique thanks to the use of rpmsg_dev_index.
This patch adds destination and source endpoint numbers device name to
create an unique identifier.
Fixes: 4dffed5b3ac7 ("rpmsg: Name rpmsg devices based on channel id")
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
[bjorn: flipped name and address in device name]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
commit 1d74e7ed5dc1903ac081574a9b6aa94e7ba4ad45 upstream.
qcom_smd_send() should return -EAGAIN for non-blocking channels with
insufficient space, so that we can propagate this event to user space.
Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
The ARM allmodconfig build broke with the addition of the SMD rpmsg
driver that conflicts with the driver its replaces:
WARNING: drivers/soc/qcom/smd: 'qcom_smd_register_edge' exported twice. Previous export was in drivers/rpmsg/qcom_smd.ko
WARNING: drivers/soc/qcom/smd: 'qcom_smd_unregister_edge' exported twice. Previous export was in drivers/rpmsg/qcom_smd.ko
There is already a dependency that is meant to avoid the broken
configuration, but that only prevents the case where at least
one of the two are built-in, but not if both are modules.
This changes the dependency to "=n", to ensure that the new driver
can only be enabled if the other one is completely disabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
This introduces a new rpmsg backend for the Qualcomm SMD system,
allowing communication with various remote processors found in Qualcomm
platforms. The implementation is based on, and intends to replace,
drivers/soc/qcom/smd.c with the necessary adaptions for fitting with the
rpmsg core.
Based on original work by Sricharan R <sricharan@codeaurora.org>
Cc: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Some rpmsg backends support holding on to and redelivering messages upon
failed handling of them, so provide a way for the callback to report and
error and allow the backends to handle this.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Move virtio rpmsg implementation details from the public header file to
the virtio rpmsg implementation.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Create a container struct virtio_rpmsg_channel around the rpmsg_channel
to keep virtio backend information separate from the rpmsg and public
API. This makes the public structures independant of virtio.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Move the device and endpoint indirection tables to the rpmsg internal
header file, to hide them from the public API.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Extract the generic rpmsg core functionality from the virtio rpmsg
implementation, splitting the implementation in a rpmsg core and a
virtio backend.
Based on initial work by Sricharan R <sricharan@codeaurora.org>
Cc: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
The tail of create_channel() is common among all rpmsg backends, so
split it off from the virtio specific part to allow it to be extracted
to the rpmsg core.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Extract and move the helper function for finding rpmsg child devices to
the core.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Move the rpmsg_send() and rpmsg_destroy_ept() interface to the rpmsg
core, so that we eventually can hide the rpmsg_endpoint ops from the
public API.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Add indirection table for rpmsg_endpoint related operations and move
virtio implementation behind this, this finishes of the decoupling of
the virtio implementation from the public API.
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>
|
|
To allow for multiple backend implementations add an indireection table
for rpmsg_device related operations and move the virtio implementation
behind this table.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
The rpmsg device representing struct is called rpmsg_channel and the
variable name used throughout is rpdev, with the communication happening
on endpoints it's clearer to just call this a "device" in a public API.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
As we introduce support for additional rpmsg backends, some of these
only supports point-to-point "links" represented by a name. By making
rpmsg_create_ept() take a channel_info struct we allow for these
backends to either be passed a source address, a destination address or
a name identifier.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
The rpmsg_send() operations has been taking a rpmsg_device, but this
forces users of secondary rpmsg_endpoints to use the rpmsg_sendto()
interface - by extracting source and destination from the given data
structures. If we instead pass the rpmsg_endpoint to these functions a
service can use rpmsg_sendto() to respond to messages, even on secondary
endpoints.
In addition this would allow us to support operations on multiple
channels in future backends that does not support off-channel
operations.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
By basing rpmsg device names on channel id we end up with human readable
device names in sysfs and debug logs.
Reviewed-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
|
Make it possible to match rpmsg devices based on device tree node, in
addition to the id table. In some of these cases the rpmsg driver would
not have a id_table, so make this optional.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|