Age | Commit message (Collapse) | Author |
|
On some boards the SoC can use one pin "PMIC_STBY_REQ" to notify th PMIC
about state changes. In this case internal state of PMIC must be
preconfigured for upcomming state change.
It works fine with the current regulator framework, except with the
power-off case.
This patch is providing an optional pm_power_off_prepare handler
which will configure standby state of the PMIC to disable all power lines.
In my power consumption test on RIoTBoard, I got the following results:
power off without this patch: 320 mA
power off with this patch: 2 mA
suspend to ram: 40 mA
Related-to: ELB-3580
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry-picked from commit c29daffa322ad36978cbce487f8ebcd9c3c3f7c0)
(tuned for 4.14 kernel)
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
The shutdown() callback of i2c client device calls for both scenarios,
power off and reboot the system.
In case of rebooting, the PMIC is configured to power off the power rails
when receiveing the PMIC_STBY_REQ request.
It leads to powering the module down and system hanging while suspending
the system after soft reboot.
Remove the shutdown() callback.
Related-to: ELB-3580
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
(cherry-picked from commit 22072a0ae32d68771e254aeb45c0edf87c61f7d5)
(tuned for kernel 4.14)
|
|
toradex_4.14-2.3.x-imx
|
|
We saw earlier with a lot of docker compose up and down work that this
was failing. Disabling this feature solves this issue:
[ 5169.152016] mmc0: cqhci: timeout for tag 20
[ 5169.156209] mmc0: cqhci: ============ CQHCI REGISTER DUMP ===========
[ 5169.162650] mmc0: cqhci: Caps: 0x0000310a | Version: 0x00000510
[ 5169.169089] mmc0: cqhci: Config: 0x00001001 | Control: 0x00000000
[ 5169.175529] mmc0: cqhci: Int stat: 0x00000000 | Int enab: 0x00000006
[ 5169.181969] mmc0: cqhci: Int sig: 0x00000006 | Int Coal: 0x00000000
[ 5169.188408] mmc0: cqhci: TDL base: 0x7807a000 | TDL up32: 0x00000000
[ 5169.194848] mmc0: cqhci: Doorbell: 0xb3700003 | TCN: 0x00000000
[ 5169.201287] mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000002
[ 5169.207727] mmc0: cqhci: Task clr: 0x00000000 | SSC1: 0x00011000
[ 5169.214166] mmc0: cqhci: SSC2: 0x00000001 | DCMD rsp: 0x00000800
[ 5169.220605] mmc0: cqhci: RED mask: 0xfdf9a080 | TERRI: 0x00000000
[ 5169.227044] mmc0: cqhci: Resp idx: 0x0000000d | Resp arg: 0x00000000
[ 5169.233484] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 5169.239925] mmc0: sdhci: Sys addr: 0xbd2d4000 | Version: 0x00000002
[ 5169.246367] mmc0: sdhci: Blk size: 0x00000200 | Blk cnt: 0x000000d8
[ 5169.252806] mmc0: sdhci: Argument: 0x00018000 | Trn mode: 0x00000023
[ 5169.259246] mmc0: sdhci: Present: 0x01f88008 | Host ctl: 0x00000030
[ 5169.265686] mmc0: sdhci: Power: 0x00000002 | Blk gap: 0x00000080
[ 5169.272125] mmc0: sdhci: Wake-up: 0x00000008 | Clock: 0x0000000f
[ 5169.278564] mmc0: sdhci: Timeout: 0x0000008f | Int stat: 0x00000000
[ 5169.285004] mmc0: sdhci: Int enab: 0x107f4000 | Sig enab: 0x107f4000
[ 5169.291443] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000502
[ 5169.297883] mmc0: sdhci: Caps: 0x07eb0000 | Caps_1: 0x8000b407
[ 5169.304323] mmc0: sdhci: Cmd: 0x00000d1a | Max curr: 0x00ffffff
[ 5169.310762] mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0xffc003ff
[ 5169.317203] mmc0: sdhci: Resp[2]: 0x328f5903 | Resp[3]: 0x00d07f01
[ 5169.323643] mmc0: sdhci: Host ctl2: 0x00000088
[ 5169.328086] mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x7809dcd8
[ 5169.334525] mmc0: sdhci: ============================================
which lead to hang the module.
Related-to: ELB-2612
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
brcmfamc driver attach mmc func devices only when func1 device's
node exist, and whose compatible string match "brcm,bcm4329-fmac".
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit: b9945d63c2b8a6c1c9b018869eb2479781501608)
|
|
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Add initial driver for the e-con Systems e-CAM50_CUIMX8.
This is the driver part from the following patch we got from Yogaesh <yogaesh@e-consystems.com> on
May 8, 2020:
apalis_imx8qm_embedded_linux_eCAM50_support.patch
Related-to: ELB-2793
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
The 'nand_usdhc_bus' clock is only need to be enabled when usdhc
or nand module is active, so change it to non-critical clock type.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit 32caf053fc38697bd418ef95bb3ff9962f6b7019)
|
|
Fix conflicts after merging changes from the latest NXP branch.
Conflicts:
arch/arm64/boot/dts/freescale/fsl-imx8qm-device.dtsi
drivers/pci/dwc/pci-imx6.c
Related-to: ELB-1306
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
CL_MEM_USE_HOST_PHYSICAL_ADDR_VIV
CL_MEM_USE_HOST_PHYSICAL_ADDR_VIV will use host physical memory directly, logical address is zero.
gckOS_UnlockPages will check Logical address and return invalid parameter,
that causes memory leak in OpenCL user library, need remove this check.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit 85a7c0f80d4f44d990f9ba85ecf2b6baea06053c)
(cherry picked from commit d3f9bbb64cc198f06a92676eb536a7b4c0f08eeb)
|
|
This helps knowing which test did fail.
Related-to: ELB-2702
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
|
|
Documentation/devicetree/bindings/gpio/gpio.txt says: "The names are
assigned starting from line offset 0 from left to right from the
passed array. An incomplete array (where the number of passed named
are less than ngpios) will still be used up until the last provided
valid line index". This patch makes it actually work this way.
Signed-off-by: Christophe Blaess <christophe.blaess@logilin.fr>
Signed-off-by: Patrick Boettcher <p@yai.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 8dc196974429b28f1a2f2563d30d02b7561a46aa)
Related-to: ELB-1143
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Commit aec2aa8cd60b5 ("MLK-11360-01 crypto: caam_snvs: add snvs clock
management") allows for an 'optional' clock property, so demote the
kernel output to info if the clock is missing.
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
|
|
Only one group voltage support on L4.14 so that the below two patches for
dts are not enough since 1.8V/0.8V not support by pmic driver:
commit 1c923bdd27021b011358f9422a6a18cbf30de491
("MLK-23275-2: ARM64: dts: freescale: fsl-imx8mn-ddr4-evk: correct ldo1/ldo2 voltage")
commit 8574922dd583141a332be58fe1656ee05c9e5dd4
("MLK-23275-1: ARM64: dts: freescale: fsl-imx8mm-evk: correct ldo1/ldo2 voltage")
So change ldo1/ldo2 voltage to 1.6V~1.9V/0.8V per i.mx8mm/i.mx8mn for quick
fix. For the kernel from L4.19, no need this patch.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit 4166421be644aea1c7add0f786c859c4b81f6923)
|
|
memory
Need flush outer cache after zero CMA allocated memory on arm32 platform.
Change-Id: Ieaa7c62bf65e4490f904d68bed1fa16fb7c5d8fa
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
Reviewed-by: Bing Song <bing.song@nxp.com>
(cherry picked from commit 9e51da339eb290f35eb79d9acc0ea147d8bdf0cf)
|
|
ION CMA memory default is cacheable, need flush cache after memset(),
else cache and physical memory not sync may cause problem.
Issue case:
VPU Video playback or GPU render have dirty line issue.
Root cause:
ION CMA allocate cacheable buffer and do memset(), some data still in cache
not in physical memory, VPU or GPU write the buffer with physical address,
or user call ion_mmap() to map the buffer through pgprot_writecombine() as
no-cache and write the buffer, later some CPU cache access trigger cache
flush, previous memset() data go to physical memory as dirty data.
Change-Id: I82b4cb61bbe6cffc687d452f9f81c1e35914d2f1
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
(cherry picked from commit 5d360f25f3523311b5f478b7b1c7bc9020cfda58)
|
|
kfifo memory size must roundup to power-of-two if it is
allocated by driver. Because kfifo elements size will
roundup to power-of-two in kfifo_init(), must guarantee
allocated memory is enough.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
(cherry picked from commit c900bb4cd98efc43dddfb18d96c8af358e804481)
|
|
This reverts commit dc1f576a8423568cb16eb077f7406c08affec9ec.
This patch breaks dma for HDMI-Audio. So reverting it.
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Conflicts:
drivers/dma/imx-sdma.c
|
|
The incorrect traversal of the scatterlist, during the linearization phase
lead to computing the hash value of the wrong input buffer.
New implementation uses scatterwalk_map_and_copy()
to address this issue.
Fixes: 15b59e7c3733 ("crypto: mxs - Add Freescale MXS DCP driver")
Signed-off-by: Rosioru Dragos <dragos.rosioru@nxp.com>
Acked-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
|
|
The KSZ9131 provides DLL controlled delays on RXC and TXC lines. This
patch makes use of those delays. The information which delays should
be enabled or disabled comes from the interface names, documented in
ethernet-controller.yaml:
rgmii: Disable RXC and TXC delays
rgmii-id: Enable RXC and TXC delays
rgmii-txid: Enable only TXC delay, disable RXC delay
rgmii-rxid: Enable onlx RXC delay, disable TXC delay
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bd734a742d5533fb9190ecd8cf25befc1f759a5b)
Replace phy_modify_mmd with phy_read_mmd and phy_write_mmd.
Related-to: ELB-2581
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
This reverts commit f49da0d7dbf67030f7e12a94fd18a7f1a0b845e0.
There is now a mainline solution for that. Drop this solution in favor
of the upstream one. We will use "rgmii-id" tag now to declare that
delays.
Related-to: ELB-2581
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Suggest to use vmalloc for fifo entity.
Then use kfifo_init to init the fifo structure.
Then we do not have to require contiguous memory from buddy,
especially in a high pressure of memory resource.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
(cherry picked from commit 0cd3c661b95ecb273da5ee76fe7353ab7abd38c9)
|
|
Signed-off-by: Wojciech Slenska <wojciech.slenska@gmail.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Make Epson RX8130 device tree and ACPI aware.
Fixes: ee0981be7704 ("rtc: ds1307: Add support for Epson RX8130CE")
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
(cherry picked from commit 47dd47292828a552d62d0e68b7cd6bdc99d9e0aa)
|
|
With this patch one is able to control the rx dll and tx dll bypass
bits, hence the 2ns delay on rxc and txc lines in devicetree.
Related-to: ELB-1299
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Add support for Microchip Technology KSZ9131 10/100/1000 Ethernet PHY
Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bff5b4b3737219195ca0caef4ff7884303cb5dc1)
Backport:
Added the line: '.config_aneg = genphy_config_aneg,' to KSZ9131
data structure
Related-to: ELB-1299
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
The debug message of max device speed setting is shown
when an error in spi_setup() occurs.
It should be shown when the setup call is succeeded instead.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
The debug message in spidev_message() shows wrong xfer speed:
...
[ 1227.702714] spidev spi0.0: setup mode 0, 32 bits/w, 20000000 Hz max --> 0
(real speed sets to 20000000Hz)
[ 1227.731801] spidev spi0.0: xfer len 4096 tx 32bits 0 usec 10000000Hz
(debug message shows 10000000Hz that is the original max speed of this
spidev set from DT)
...
Fix the data source for the debug message.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
This is wrong approach to fix the speed issue.
This reverts commit 6eb4142030916c2db5c3dd0a4301dbd1141593e2.
Related-to: ELB-2387
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
spi->max_speed_hz always sets to the previous value.
Fixing the logic allows IOCTL command SPI_IOC_WR_MAX_SPEED_HZ
to store the new requested value to spi->max_speed_hz.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- replace the array with the shift operation
- remove the extra comparing operation.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
commit 2801b2f5fad3d1e9ea0ac8484584051071065645 upstream
The dynamic bursts mode allows to group together multiple words into a
single burst. To do so, it's necessary that words can be packed into the
32-bits FIFO entries, so we can't allow using this mode with bit_per_words
different to 8, 16 or 32.
This prevents shitfing out extra clock ticks for transfers with
bit_per_word values not aligned on 8 bits.
With that , we are sure that only the correct number of bits is
shifted out at each transfer, so we don't need to mask out the remaining
parts of the words.
Related-to: ELB-1418
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
|
|
Conflicts:
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/freescale/fsl-imx8qm-device.dtsi
|
|
This is the 4.14.170 stable release
Conflicts:
drivers/net/phy/phy_device.c
drivers/tty/serial/imx.c
include/linux/platform_data/dma-imx-sdma.h
net/wireless/util.c
|
|
|
|
In caam_hash_state struct, caam_ctx buffer needs to have a
separate cacheline, not sharing it with "update" callback.
On imx8, the cacheline size is 64 and the MAX_CTX_LEN,
from caam_ctx buffer, is (8 + 64).
Therefore, add a ____cacheline_aligned to the update callback,
in caam_hash_state struct, to ensure that caam_ctx buffer is
not sharing the cacheline.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
|
|
To avoid potential dump when access the HSIO CRR registers during
PCIE initialization.
Add the PHY_PER and MISC clocks for both PCI controllers.
PCIEB has one more PER clock, since the PCIEA CSR register would be
configuired when PCIEB is initialized.
Enable the clocks before CRR registers manipulations.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
To avoid potential dump when access the PHY and MISC CRR registers.
Add the CRRS clocks into SATA driver.
The codes are merged back from 4.19 to 4.14 refer to MLK-21695.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
|
|
system
In caam_jr_enqueue, under heavy DDR load, smp_wmb() or dma_wmb()
fail to make the input ring be updated before the CAAM starts
reading it. So, CAAM will process, again, an old descriptor address
and will put it in the output ring. This will make caam_jr_dequeue()
to fail, since this old descriptor is not in the software ring.
To fix this, use wmb() which works on the full system instead of
inner/outer shareable domains.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
(cherry picked from commit e4978516eeacb083412753dbc523de7d9dca8463)
It looks like this also fixes MLK-23259, so cherry-pick
from LF linux-lts-nxp:lf-5.4.y into linux-imx:imx_4.14.y.
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
|
|
This fixes building with disabled CONFIG_FB_MXC_OVERLAY.
Fixes: dffeff8e10a6 ("MLK-22304-2 fbdev: mxsfb: fix build warnings if CONFIG_PM_SLEEP off")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
Related-to: ELB-2289
Signed-off-by: Valentin Raevsky <valentin@compulab.co.il>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Fixes: 6862ae242104 ("drm/panel: simple: add display timings for logic technologies displays")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
|
|
For 5.3 we had to revert a nice ext4 IO pattern improvement, because it
caused a bootup regression due to lack of entropy at bootup together
with arguably broken user space that was asking for secure random
numbers when it really didn't need to.
See commit 72dbcf721566 (Revert "ext4: make __ext4_get_inode_loc plug").
This aims to solve the issue by actively generating entropy noise using
the CPU cycle counter when waiting for the random number generator to
initialize. This only works when you have a high-frequency time stamp
counter available, but that's the case on all modern x86 CPU's, and on
most other modern CPU's too.
What we do is to generate jitter entropy from the CPU cycle counter
under a somewhat complex load: calling the scheduler while also
guaranteeing a certain amount of timing noise by also triggering a
timer.
I'm sure we can tweak this, and that people will want to look at other
alternatives, but there's been a number of papers written on jitter
entropy, and this should really be fairly conservative by crediting one
bit of entropy for every timer-induced jump in the cycle counter. Not
because the timer itself would be all that unpredictable, but because
the interaction between the timer and the loop is going to be.
Even if (and perhaps particularly if) the timer actually happens on
another CPU, the cacheline interaction between the loop that reads the
cycle counter and the timer itself firing is going to add perturbations
to the cycle counter values that get mixed into the entropy pool.
As Thomas pointed out, with a modern out-of-order CPU, even quite simple
loops show a fair amount of hard-to-predict timing variability even in
the absense of external interrupts. But this tries to take that further
by actually having a fairly complex interaction.
This is not going to solve the entropy issue for architectures that have
no CPU cycle counter, but it's not clear how (and if) that is solvable,
and the hardware in question is largely starting to be irrelevant. And
by doing this we can at least avoid some of the even more contentious
approaches (like making the entropy waiting time out in order to avoid
the possibly unbounded waiting).
Cc: Ahmed Darwish <darwish.07@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Nicholas Mc Guire <hofrat@opentech.at>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Alexander E. Patrakov <patrakov@gmail.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 50ee7529ec4500c88f8664560770a7a1b65db72b)
|
|
pxp_soft_reset is writing to registers that are not clocked and then
resulting in a lockup. Interestingly I could only see this behaviour
when starting a kernel using kexec.
This could have something to do with how u-boot enables clocks on a
regular boot.
In this commit this gets fixed with enabling the clocks before doing
a pxp_soft_reset.
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
Improve module help messages and logging operations
in debug mode.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
- Fix a probing to handle errors in scu notifier registration.
- Unregister scu notifier properly on unload, so it is possible to
load driver again.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
1. Fix this compilation error:
/workdir/oe/tmp-glibc/work-shared/verdin-imx8mm/kernel-source/drivers/
rpmsg/virtio_rpmsg_bus.c:1106:23: error: redeclaration of 'newch'
with no linkage
struct rpmsg_device *newch;
^~~~~
/workdir/oe/tmp-glibc/work-shared/verdin-imx8mm/kernel-source/drivers/
rpmsg/virtio_rpmsg_bus.c:1101:23: note: previous declaration of
'newch' was here
struct rpmsg_device *newch;
2. Fix warnings that are reproduced when RPMsg char device support is
disabled.
Fixes: 1172ee2e ("rpmsg: virtio rpmsg: Add RPMsg char driver support")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
|
|
Ordering of stuff in lpspi probe was a little off.
- num_chipselect gets set with devm_spi_register_controller.
- devm_spi_register_controller needs data that gets set into
controller variable
Order stuff appropriate so num_chipselect gets set before it is used.
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
This commit adds the possibility to choose the compatible
"regulator-fixed-clock" in devicetree.
This is a special regulator-fixed that has to have a clock, from which
the regulator gets switched on and off.
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Link: https://lore.kernel.org/r/20190910062103.39641-2-philippe.schenker@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 8959e5324485ace9bedc33ce1e760b759d4dd2ac)
Conflicts:
drivers/regulator/fixed.c
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
|
|
virtio rpmsg was not implemented to use RPMsg char driver.
Each virtio ns announcement will create a new RPMsg device which
is supposed to bound to a RPMsg driver. It doesn't support
dynamic endpoints with name service per RPMsg device.
With RPMsg char driver, you can have multiple endpoints per
RPMsg device.
Here is the change from this patch:
* Introduce a macro to indicate if want to use RPMsg char driver
for virtio RPMsg. The RPMsg device can either be bounded to
a simple RPMsg driver or the RPMsg char driver.
* Create Virtio RPMsg char device when the virtio RPMsg driver is
probed.
* when there is a remote service announced, keep it in the virtio
proc remote services list.
* when there is an endpoint created, bind it to a remote service
from the remote services list. If the service doesn't exist yet,
create one and mark the service address as ANY.
That patch ported to our 4.14 kernel + additional fixes added [1].
Example of usage from userspace app:
```
char data_buf [] = {'a', 'b', 'c', 'd', '\0'};
struct rpmsg_endpoint_info ept_info = {"rpmsg-openamp-demo-channel", 0x2, 0x1};
int fd = open("/dev/rpmsg_ctrl0", O_RDWR);
/* create endpoint interface */
ioctl(fd, RPMSG_CREATE_EPT_IOCTL, &ept_info);
/* create endpoint */
int fd_ept = open("/dev/rpmsg0", O_RDWR);
/* receive data from remote device */
read(fd_ept, &data_buf, sizeof(data_buf));
/* send data to remote device */
write(fd_ept, &data_buf, sizeof(data_buf));
/* destroy endpoint */
ioctl(fd_ept, RPMSG_DESTROY_EPT_IOCTL);
close(fd_ept);
close(fd);
```
[1] https://patchwork.kernel.org/patch/10145779/
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
|