Add RPMsg framework
Subsystems (4)
cover Add RPMsg framework
Remote Processor Messaging (RPMsg) framework is used to communicate with remote processor. RPMsg is a virtio-based messaging bus that allows U-Boot drivers to communicate with remote processors available on the system. This patch also introduces new virtio transport layer driver.
To keep things minimal for now hard-coded endpoint is used in U-Boot to communicate with remote processor using RPMsg protocol. This will be modified to use multiple endpoints in future.
U-Boot can't receive interrupts from remote processor as per design. Hence, user has to know when the data will be available from remote processor and call rpmsg_recv accordingly. Mostly it will be called to receive response of query done using rpmsg_send.
Some code is already available to allocate memory for RPMsg however, that framework is mostly TI platform specific and isn't used by any other platforms. This series makes sure it does not break previous code for other platforms. If platforms wants to use this new framework it is expected to set "support_rpmsg_virtio" flag in relative remoteproc device's platform data.
Also the framework introduced by this series is ported from the Linux kernel so other platforms which already support RPMsg in the Linux kernel can easily use this framework in U-Boot as well.
---
Tanmay Shah (10):
remoteproc: move resource table definition
firmware: zynqmp: move zynqmp_pm_request_node API
remoteproc: add remoteproc virtio transport driver
drivers: add RPMsg framework
rpmsg: add sample client driver
cmd: add rpmsg framework commands
remoteproc: add attach/detach commands
remoteproc: add zynqmp driver
configs: zynqmp: enable remoteproc and rpmsg
configs: sandbox: enable rpmsg
MAINTAINERS | 15 + arch/sandbox/dts/test.dts | 8 + cmd/Kconfig | 6 + cmd/Makefile | 1 + cmd/remoteproc.c | 14 +- cmd/rpmsg.c | 61 +++ configs/sandbox_defconfig | 4 + configs/xilinx_zynqmp_virt_defconfig | 6 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/firmware/firmware-zynqmp.c | 27 ++ drivers/power/domain/zynqmp-power-domain.c | 7 - drivers/remoteproc/Kconfig | 20 + drivers/remoteproc/Makefile | 2 + drivers/remoteproc/rproc-elf-loader.c | 33 -- drivers/remoteproc/rproc-uclass.c | 125 +++++- drivers/remoteproc/rproc_virtio.c | 422 +++++++++++++++++++++ drivers/remoteproc/xlnx_rproc.c | 411 ++++++++++++++++++++ drivers/rpmsg/Kconfig | 39 ++ drivers/rpmsg/Makefile | 13 + drivers/rpmsg/rpmsg-uclass.c | 156 ++++++++ drivers/rpmsg/rpmsg_internal.h | 52 +++ drivers/rpmsg/rpmsg_sample_client.c | 63 +++ drivers/rpmsg/sandbox_test_rpmsg.c | 88 +++++ drivers/rpmsg/virtio_rpmsg_bus.c | 384 +++++++++++++++++++ drivers/virtio/virtio-uclass.c | 1 + drivers/virtio/virtio_ring.c | 16 + include/dm/uclass-id.h | 1 + include/remoteproc.h | 130 ++++++- include/rpmsg.h | 145 +++++++ include/rproc_virtio.h | 33 ++ include/virtio.h | 7 +- include/virtio_ring.h | 32 ++ include/zynqmp_firmware.h | 30 +- test/dm/Makefile | 1 + test/dm/rpmsg.c | 41 ++ 36 files changed, 2321 insertions(+), 76 deletions(-) create mode 100644 cmd/rpmsg.c create mode 100644 drivers/remoteproc/rproc_virtio.c create mode 100644 drivers/remoteproc/xlnx_rproc.c create mode 100644 drivers/rpmsg/Kconfig create mode 100644 drivers/rpmsg/Makefile create mode 100644 drivers/rpmsg/rpmsg-uclass.c create mode 100644 drivers/rpmsg/rpmsg_internal.h create mode 100644 drivers/rpmsg/rpmsg_sample_client.c create mode 100644 drivers/rpmsg/sandbox_test_rpmsg.c create mode 100644 drivers/rpmsg/virtio_rpmsg_bus.c create mode 100644 include/rpmsg.h create mode 100644 include/rproc_virtio.h create mode 100644 test/dm/rpmsg.c
base-commit: 94e7cb181ad6bd25d36a11c58e0df64e9f815888
Signature · 1 line
2.25.1
RFC PATCH 1/10 remoteproc: move resource table definition
Resource table is defined in multiple files. Instead move definition to remoteproc header file and include header file in multiple c files where resource table definition is needed.
--- drivers/remoteproc/rproc-elf-loader.c | 33 --------------------------- drivers/remoteproc/rproc-uclass.c | 7 ------ include/remoteproc.h | 33 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 40 deletions(-)
drivers/remoteproc/rproc-elf-loader.c +0 -33
@@ -12,39 +12,6 @@#include <dm/device_compat.h> #include <linux/compat.h> -/** -* struct resource_table - firmware resource table header -* @ver: version number -* @num: number of resource entries -* @reserved: reserved (must be zero) -* @offset: array of offsets pointing at the various resource entries -* -* A resource table is essentially a list of system resources required -* by the remote processor. It may also include configuration entries. -* If needed, the remote processor firmware should contain this table -* as a dedicated ".resource_table" ELF section. -* -* Some resources entries are mere announcements, where the host is informed -* of specific remoteproc configuration. Other entries require the host to -* do something (e.g. allocate a system resource). Sometimes a negotiation -* is expected, where the firmware requests a resource, and once allocated, -* the host should provide back its details (e.g. address of an allocated -* memory region). -* -* The header of the resource table, as expressed by this structure, -* contains a version number (should we need to change this format in the -* future), the number of available resource entries, and their offsets -* in the table. -* -* Immediately following this header are the resource entries themselves. -*/ -struct resource_table { -u32 ver; -u32 num; -u32 reserved[2 ]; -u32 offset[0 ]; -} __packed; -/* Basic function to verify ELF32 image format */ int rproc_elf32_sanity_check (ulong addr,ulong size) {
drivers/remoteproc/rproc-uclass.c +0 -7
@@ -23,13 +23,6 @@DECLARE_GLOBAL_DATA_PTR ; -struct resource_table { -u32 ver; -u32 num; -u32 reserved[2 ]; -u32 offset[0 ]; -} __packed; -typedef int (*handle_resource_t ) (struct udevice *,void *,int offset,int avail);static struct resource_table *rsc_table;
include/remoteproc.h +33 -0
@@ -15,6 +15,39 @@*/ #include <dm/platdata.h> /* For platform data support - non dt world */ +/** +* struct resource_table - firmware resource table header +* @ver: version number +* @num: number of resource entries +* @reserved: reserved (must be zero) +* @offset: array of offsets pointing at the various resource entries +* +* A resource table is essentially a list of system resources required +* by the remote processor. It may also include configuration entries. +* If needed, the remote processor firmware should contain this table +* as a dedicated ".resource_table" ELF section. +* +* Some resources entries are mere announcements, where the host is informed +* of specific remoteproc configuration. Other entries require the host to +* do something (e.g. allocate a system resource). Sometimes a negotiation +* is expected, where the firmware requests a resource, and once allocated, +* the host should provide back its details (e.g. address of an allocated +* memory region). +* +* The header of the resource table, as expressed by this structure, +* contains a version number (should we need to change this format in the +* future), the number of available resource entries, and their offsets +* in the table. +* +* Immediately following this header are the resource entries themselves. +*/ +struct resource_table { +u32 ver; +u32 num; +u32 reserved[2 ]; +u32 offset[0 ]; +} __packed; +/** * struct fw_rsc_hdr - firmware resource entry header * @type: resource type
Signature · 1 line
2.25.1
Re: [RFC PATCH 01/10] remoteproc: move resource table definition
Quoted 11 lines · Tanmay Shah
Resource table is defined in multiple files. Instead move definition to remoteproc header file and include header file in multiple c files where resource table definition is needed.
Signed-off-by Tanmay Shah <[email protected]>--- drivers/remoteproc/rproc-elf-loader.c | 33 --------------------------- drivers/remoteproc/rproc-uclass.c | 7 ------ include/remoteproc.h | 33 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 40 deletions(-)
RFC PATCH 2/10 firmware: zynqmp: move zynqmp_pm_request_node API
In reply to Tanmay ShahRequesting node to firmware can be used by multiple drivers. Move this API to firmware driver from power driver so others can use the same interface.
--- drivers/firmware/firmware-zynqmp.c | 7 +++++++ drivers/power/domain/zynqmp-power-domain.c | 7 ------- include/zynqmp_firmware.h | 14 ++++++++------ 3 files changed, 15 insertions(+), 13 deletions(-)
drivers/firmware/firmware-zynqmp.c +7 -0
@@ -195,6 +195,13 @@ int zynqmp_pm_set_sd_config(u32 node, enum pm_sd_config_type config, u32 value)return ret; } +int zynqmp_pm_request_node (const u32 node,const u32 capabilities, +const u32 qos,const enum zynqmp_pm_request_ack ack) +{ +return xilinx_pm_request (PM_REQUEST_NODE , node, capabilities, + qos, ack,NULL ); +} +int zynqmp_pm_is_function_supported (const u32 api_id,const u32 id) {int ret;
drivers/power/domain/zynqmp-power-domain.c +0 -7
@@ -14,13 +14,6 @@#include <zynqmp_firmware.h> -static int zynqmp_pm_request_node (const u32 node,const u32 capabilities, -const u32 qos,const enum zynqmp_pm_request_ack ack) -{ -return xilinx_pm_request (PM_REQUEST_NODE , node, capabilities, - qos, ack,NULL ); -} -static int zynqmp_power_domain_request (struct power_domain *power_domain) {int ret =0 ;
include/zynqmp_firmware.h +8 -6
@@ -444,12 +444,20 @@ enum pm_gem_config_type {*/ #define PAYLOAD_ARG_CNT 5U +enum zynqmp_pm_request_ack { +ZYNQMP_PM_REQUEST_ACK_NO =1 , +ZYNQMP_PM_REQUEST_ACK_BLOCKING =2 , +ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING =3 , +}; +unsigned int zynqmp_firmware_version (void );int zynqmp_pmufw_node (u32 id);int zynqmp_pmufw_config_close (void );int zynqmp_pmufw_load_config_object (const void *cfg_obj,size_t size);int xilinx_pm_request (u32 api_id,u32 arg0,u32 arg1,u32 arg2,u32 arg3,u32 *ret_payload); +int zynqmp_pm_request_node (const u32 node,const u32 capabilities, +const u32 qos,enum zynqmp_pm_request_ack ack);int zynqmp_pm_set_sd_config (u32 node,enum pm_sd_config_type config,u32 value);int zynqmp_pm_set_gem_config (u32 node,enum pm_gem_config_type config,u32 value);
@@ -474,12 +482,6 @@ int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);#define PM_CONFIG_IPI_PSU_CORTEXR5_0_MASK 0x00000100#define PM_CONFIG_IPI_PSU_CORTEXR5_1_MASK 0x00000200 -enum zynqmp_pm_request_ack { -ZYNQMP_PM_REQUEST_ACK_NO =1 , -ZYNQMP_PM_REQUEST_ACK_BLOCKING =2 , -ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING =3 , -}; -/* Node capabilities */ #define ZYNQMP_PM_CAPABILITY_ACCESS 0x1U#define ZYNQMP_PM_CAPABILITY_CONTEXT 0x2U
Signature · 1 line
2.25.1
RFC PATCH 3/10 remoteproc: add remoteproc virtio transport driver
In reply to Tanmay ShahRemoteproc virtio is virtio transport layer driver for remoteproc. Implement virtio config ops used by actual virtio driver using remoteproc virtio device
Ported from the Linux kernel version 6.4-rc2 (d848a4819d85), Introduced in kernel version v3.10 (ac8954a41393)
file: drivers/remoteproc/remoteproc_virtio.c.
--- MAINTAINERS | 6 + drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/rproc-uclass.c | 42 ++- drivers/remoteproc/rproc_virtio.c | 422 ++++++++++++++++++++++++++++++ drivers/virtio/virtio_ring.c | 16 ++ include/remoteproc.h | 66 +++-- include/rproc_virtio.h | 29 ++ include/virtio.h | 3 + include/virtio_ring.h | 17 ++ 10 files changed, 593 insertions(+), 20 deletions(-) create mode 100644 drivers/remoteproc/rproc_virtio.c create mode 100644 include/rproc_virtio.h
MAINTAINERS +6 -0
@@ -1319,6 +1319,12 @@ S: Maintained T: git https://source.denx.de/u-boot/custodians/u-boot-nand-flash.git F: drivers/mtd/nand/raw/ +REMOTEPROC +M: Tanmay Shah <[email protected]> +S: Maintained +F: drivers/remoteproc/rproc_virtio.c +F: include/rproc_virtio.h + RISC-V M: Rick Chen <[email protected]> M: Leo <[email protected]>
drivers/remoteproc/Kconfig +11 -0
@@ -102,4 +102,15 @@ config REMOTEPROC_TI_IPU help Say 'y' here to add support for TI' K3 remoteproc driver. +config REMOTEPROC_VIRTIO + bool "Support remoteproc virtio devices" + select REMOTEPROC + select VIRTIO + depends on DM + help + Say 'y' here to add support of remoteproc virtio devices. + rproc_virtio is virtio transport layer driver. The transport + drivers provide a set of ops for the real virtio device + driver to call. + endmenu
drivers/remoteproc/Makefile +1 -0
@@ -16,3 +16,4 @@ obj-$(CONFIG_REMOTEPROC_TI_K3_R5F) += ti_k3_r5f_rproc.o obj-$(CONFIG_REMOTEPROC_TI_POWER) += ti_power_proc.o obj-$(CONFIG_REMOTEPROC_TI_PRU) += pru_rproc.o obj-$(CONFIG_REMOTEPROC_TI_IPU) += ipu_rproc.o +obj-$(CONFIG_REMOTEPROC_VIRTIO) += rproc_virtio.o
drivers/remoteproc/rproc-uclass.c +41 -1
66 lines not on this page · raw message
drivers/remoteproc/rproc_virtio.c new file +422 -0
422 lines not on this page · raw message
drivers/virtio/virtio_ring.c +16 -0
@@ -331,6 +331,22 @@ static struct virtqueue *__vring_new_virtqueue(unsigned int index,return vq; } +struct virtqueue *vring_new_virtqueue (unsigned int index, +struct vring vring, +struct udevice *udev) +{ +struct virtqueue *vq; + + vq =__vring_new_virtqueue (index, vring, udev); +if (!vq) +return NULL ; + +debug ("(%s): created vring @ %p for vq @ %p\n" , udev->name, + vring.desc, vq); + +return vq; +} +struct virtqueue *vring_create_virtqueue (unsigned int index,unsigned int num,unsigned int vring_align,struct udevice *udev)
include/remoteproc.h +47 -19
124 lines not on this page · raw message
include/rproc_virtio.h new file +29 -0
@@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2023, Advanced Micro Devices Inc. +*/ + +#ifndef _RPROC_VIRTIO_H_ +#define _RPROC_VIRTIO_H_ + +#include <remoteproc.h> +#include <dm/device.h> + +void rproc_flush_dcache (struct udevice *dev); + +#ifndef CONFIG_SANDBOX + +int rproc_virtio_create_dev (struct udevice *parent,struct fw_rsc_vdev *rsc, +int offset); + +#else + +int rproc_virtio_create_dev (struct udevice *parent,struct fw_rsc_vdev *rsc, +int offset) +{ +return -ENODEV ; +} + +#endif /* CONFIG_SANDBOX */ + +#endif /* _RPROC_VIRTIO_H_ */
include/virtio.h +3 -0
@@ -69,6 +69,9 @@/* v1.0 compliant */ #define VIRTIO_F_VERSION_1 32 +/* packed virtqueue layout */ +#define VIRTIO_F_RING_PACKED 34 +/* * If clear - device has the IOMMU bypass quirk feature. * If set - use platform tools to detect the IOMMU.
include/virtio_ring.h +17 -0
@@ -2,6 +2,7 @@/* * Copyright (C) 2018, Tuomas Tynkkynen <[email protected]> * Copyright (C) 2018, Bin Meng <[email protected]> +* Copyright (C) 2023, Advanced Micro Devices Inc. * * From Linux kernel include/uapi/linux/virtio_ring.h */
@@ -227,6 +228,22 @@ void virtqueue_kick(struct virtqueue *vq);*/ void *virtqueue_get_buf (struct virtqueue *vq,unsigned int *len); +/** +* vring_new_virtqueue - create a virtqueue at user defined vring address +* +* @index: the index of the queue +* @vring: vring created at user defined address +* @udev: the virtio transport udevice +* @return: the virtqueue pointer or NULL if failed +* +* This creates a virtqueue using vring address decided by the user of API +* +* This API is supposed to be called by the virtio transport driver in the +* virtio find_vqs() uclass method. +*/ +struct virtqueue *vring_new_virtqueue (unsigned int index,struct vring vring, +struct udevice *udev); +/** * vring_create_virtqueue - create a virtqueue for a virtio device *
Signature · 1 line
2.25.1
Re: [RFC PATCH 03/10] remoteproc: add remoteproc virtio transport driver
Hi Tanmay,
Quoted 10 lines · Tanmay Shah
Remoteproc virtio is virtio transport layer driver for remoteproc. Implement virtio config ops used by actual virtio driver using remoteproc virtio device
Ported from the Linux kernel version 6.4-rc2 (
d848a4819d85), Introduced in kernel version v3.10 (ac8954a41393)
file:drivers/remoteproc/remoteproc_virtio.c.Signed-off-by Tanmay Shah <[email protected]>
Quoted 14 lines
--- MAINTAINERS | 6 + drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/rproc-uclass.c | 42 ++- drivers/remoteproc/rproc_virtio.c | 422 ++++++++++++++++++++++++++++++ drivers/virtio/virtio_ring.c | 16 ++ include/remoteproc.h | 66 +++-- include/rproc_virtio.h | 29 ++ include/virtio.h | 3 + include/virtio_ring.h | 17 ++ 10 files changed, 593 insertions(+), 20 deletions(-) create mode 100644 drivers/remoteproc/rproc_virtio.c create mode 100644 include/rproc_virtio.h
Can you split this patch up a bit? It seems to add a new method and lots of other stuff.
Quoted 73 lines
MAINTAINERS +6
-0@@ -1319,6 +1319,12 @@ S: Maintained T: git https://source.denx.de/u-boot/custodians/u-boot-nand-flash.git F: drivers/mtd/nand/raw/ +REMOTEPROC +M: Tanmay Shah <[email protected]> +S: Maintained +F: drivers/remoteproc/rproc_virtio.c +F: include/rproc_virtio.h + RISC-V M: Rick Chen <[email protected]> M: Leo <[email protected]>drivers/remoteproc/Kconfig +11
-0@@ -102,4 +102,15 @@ config REMOTEPROC_TI_IPU help Say 'y' here to add support for TI' K3 remoteproc driver. +config REMOTEPROC_VIRTIO + bool "Support remoteproc virtio devices" + select REMOTEPROC + select VIRTIO + depends on DM + help + Say 'y' here to add support of remoteproc virtio devices. + rproc_virtio is virtio transport layer driver. The transport + drivers provide a set of ops for the real virtio device + driver to call. + endmenudrivers/remoteproc/Makefile +1
-0@@ -16,3 +16,4 @@ obj-$(CONFIG_REMOTEPROC_TI_K3_R5F) += ti_k3_r5f_rproc.o obj-$(CONFIG_REMOTEPROC_TI_POWER) += ti_power_proc.o obj-$(CONFIG_REMOTEPROC_TI_PRU) += pru_rproc.o obj-$(CONFIG_REMOTEPROC_TI_IPU) += ipu_rproc.o +obj-$(CONFIG_REMOTEPROC_VIRTIO) += rproc_virtio.odrivers/remoteproc/rproc-uclass.c +11
-0@@ -14,6 +14,7 @@#include <malloc.h> #include <virtio_ring.h> #include <remoteproc.h> +#include <rproc_virtio.h> #include <asm/io.h> #include <dm/device-internal.h> #include <dm.h> @@ -279,6 +280,33 @@ static int rproc_config_pagetable(struct udevice *dev, unsigned int virt,return 0 ; } +/** +* rproc_find_res_by_name() - After parsing the resource table add the mappings +* @dev: device we finished probing +* @name: name of rproc_mem_entry resource +* +* Return: If failed NULL, else first carveout entry with matching name. +*/ +struct rproc_mem_entry *rproc_find_res_by_name (struct udevice *dev, +const char *name) +{
drivers/remoteproc/rproc-uclass.c static int rproc_config_pagetable(struct udevice *dev, unsigned int virt, · line 302
Quoted 10 lines
drivers/remoteproc/rproc-uclass.c +10
-0+struct rproc *rproc =rproc_get_cfg (dev); +struct rproc_mem_entry *mapping =NULL ; +int ret; + +if (!rproc) +return NULL ; + +list_for_each_entry (mapping, &rproc->mappings.node, node) { + ret =strcmp (mapping->name, name); +if (!ret)
Do we need ret?
drivers/remoteproc/rproc-uclass.c static int rproc_config_pagetable(struct udevice *dev, unsigned int virt, · line 306
Quoted 4 lines
drivers/remoteproc/rproc-uclass.c +4
-0+return mapping; + } + +debug ("%s: %s carveout not found\n" , dev->name, name);
We typically put a blank line before the final return
Quoted 16 lines
drivers/remoteproc/rproc-uclass.c +4
-0+return NULL ; +} +UCLASS_DRIVER (rproc) = { .id =UCLASS_REMOTEPROC , .name ="remoteproc" ,@@ -688,6 +716,7 @@ static int alloc_vring(struct udevice *dev, struct fw_rsc_vdev *rsc, int i)static int handle_vdev (struct udevice *dev,struct fw_rsc_vdev *rsc,int offset,int avail) { +struct rproc *rproc;int i, ret;void *pa;@@ -720,7 +749,18 @@ static int handle_vdev(struct udevice *dev, struct fw_rsc_vdev *rsc, }
drivers/remoteproc/rproc-uclass.c static int handle_vdev(struct udevice *dev, struct fw_rsc_vdev *rsc, · line 758
Quoted 10 lines
drivers/remoteproc/rproc-uclass.c +7
-1/* -* allocate the vrings +* If virtio device creation is supported, then prefer to get vrings +* during find_vq op +*/ + rproc =rproc_get_cfg (dev); + +if (rproc && rproc->support_rpmsg_virtio && + !(IS_ENABLED (CONFIG_SANDBOX ))) {
Why the special case for sandbox? Can't it work like real hardware?
drivers/remoteproc/rproc-uclass.c static int handle_vdev(struct udevice *dev, struct fw_rsc_vdev *rsc, · line 764
Quoted 6 lines
drivers/remoteproc/rproc-uclass.c +5
-0+return rproc_virtio_create_dev (dev, rsc, offset); + } + +/* +* allocate the vrings traditional way */
Single-line comment style
Quoted 45 lines
drivers/remoteproc/rproc-uclass.c +0
-0for (i =0 ; i < rsc->num_of_vrings; i++) { ret =alloc_vring (dev, rsc, i);drivers/remoteproc/rproc_virtio.c new file +37
-0@@ -0,0 +1,422 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Remote Processor Messaging transport +* +* Copyright (C) 2011 Texas Instruments, Inc. +* Copyright (C) 2011 Google, Inc. +* Copyright (C) 2023, Advanced Micro Devices Inc. +* +* VirtIO RPMsg transport driver +* Ported from Linux drivers/remoteproc/remoteproc_virtio.c +*/ + +#include <common.h> +#include <dm.h> +#include <log.h> +#include <remoteproc.h> +#include <rproc_virtio.h> +#include <virtio.h> +#include <virtio_ring.h> +#include <virtio_types.h> +#include <asm/io.h> +#include <dm/device_compat.h> +#include <dm/device-internal.h> +#include <linux/bug.h> +#include <linux/compat.h> +#include <linux/err.h> + +/** +* rproc_flush_dcache() - flush shared memory regions +* @dev: valid remoteproc virtio device +* +* Some platforms have dcache enabled. If dcache is on then data written +* to shared memory is actually written to cache memory. This function +* checks if cache is on or not and if it is on, then it performs +* flush and invalidate operation on address range or reserved memory +* created by platform driver for remoteproc +*
drivers/remoteproc/rproc_virtio.c line 47
Quoted 10 lines
drivers/remoteproc/rproc_virtio.c new file +10
-0+* Return: none +*/ +void rproc_flush_dcache (struct udevice *dev) +{ +struct rproc *rproc =rproc_get_cfg (dev->parent); +struct rproc_mem_entry *mapping =NULL ; +struct list_head *mapping_node =NULL ; + +/* If dcache is off, don't perform cache operation */ +if (dcache_status () == false)
if (!dcache_status())
Quoted 10 lines
drivers/remoteproc/rproc_virtio.c new file +10
-0+return ; + +/* +* If cache is on, then flush cache +* specially reserved mem regions for, +* resource table, vrings and vdevbuffer of platform dev +*/ +list_for_each (mapping_node, &rproc->mappings.node) { + mapping = container_of(mapping_node, struct rproc_mem_entry, + node);
drivers/remoteproc/rproc_virtio.c line 67
Quoted 10 lines
drivers/remoteproc/rproc_virtio.c new file +10
-0+ +/* +* First flush data so current data from cache is written +* to actual memory from cache. Then invalidate cache so +* next time data will be accessed from actual memory +*/ +flush_dcache_range (mapping->da, mapping->da + mapping->len); +invalidate_dcache_range (mapping->da, mapping->da + mapping->len); + } +}
[..]
Regards,
Simon
RFC PATCH 4/10 drivers: add RPMsg framework
In reply to Tanmay ShahRPMsg framework is used to communicate to remote processor using rpmsg protocol.
This framework is ported from the Linux kernel
directory: drivers/rpmsg/
kernel version: 6.4-rc2 (d848a4819d85)
--- MAINTAINERS | 7 + arch/sandbox/dts/test.dts | 8 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/rpmsg/Kconfig | 31 +++ drivers/rpmsg/Makefile | 10 + drivers/rpmsg/rpmsg-uclass.c | 156 ++++++++++++ drivers/rpmsg/rpmsg_internal.h | 52 ++++ drivers/rpmsg/sandbox_test_rpmsg.c | 88 +++++++ drivers/rpmsg/virtio_rpmsg_bus.c | 384 +++++++++++++++++++++++++++++ drivers/virtio/virtio-uclass.c | 1 + include/dm/uclass-id.h | 1 + include/rpmsg.h | 140 +++++++++++ include/rproc_virtio.h | 8 +- include/virtio.h | 4 +- include/virtio_ring.h | 15 ++ test/dm/Makefile | 1 + test/dm/rpmsg.c | 41 +++ 18 files changed, 947 insertions(+), 3 deletions(-) create mode 100644 drivers/rpmsg/Kconfig create mode 100644 drivers/rpmsg/Makefile create mode 100644 drivers/rpmsg/rpmsg-uclass.c create mode 100644 drivers/rpmsg/rpmsg_internal.h create mode 100644 drivers/rpmsg/sandbox_test_rpmsg.c create mode 100644 drivers/rpmsg/virtio_rpmsg_bus.c create mode 100644 include/rpmsg.h create mode 100644 test/dm/rpmsg.c
MAINTAINERS +7 -0
@@ -1365,6 +1365,13 @@ F: drivers/usb/gadget/f_rockusb.c F: cmd/rockusb.c F: doc/README.rockusb +RPMSG +M: Tanmay Shah <[email protected]> +S: Maintained +F: drivers/rpmsg/* +F: include/rpmsg.h +F: test/dm/rpmsg.c + SANDBOX M: Simon Glass <[email protected]> S: Maintained
arch/sandbox/dts/test.dts +8 -0
@@ -1247,6 +1247,14 @@ compatible = "sandbox,sandbox-rng"; }; + rpmsg_1: rpmsg@1 { + compatible = "sandbox,test-rpmsg"; + }; + + rpmsg_2: rpmsg@2 { + compatible = "sandbox,test-rpmsg"; + }; + rproc_1: rproc@1 { compatible = "sandbox,test-processor"; remoteproc-name = "remoteproc-test-dev1";
drivers/Kconfig +2 -0
@@ -112,6 +112,8 @@ source "drivers/reset/Kconfig" source "drivers/rng/Kconfig" +source "drivers/rpmsg/Kconfig" + source "drivers/rtc/Kconfig" source "drivers/scsi/Kconfig"
drivers/Makefile +1 -0
@@ -109,6 +109,7 @@ obj-y += mfd/ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ +obj-y += rpmsg/ obj-y += input/ obj-y += iommu/ # SOC specific infrastructure drivers.
drivers/rpmsg/Kconfig new file +31 -0
@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2023, Advanced Micro devices, Inc. + +menu "RPMsg drivers" + +# RPMsg gets selected by drivers as needed +# All users should depend on DM +config RPMSG + bool + depends on DM + +config VIRTIO_RPMSG_BUS + bool "virtio rpmsg bus" + depends on DM + select RPMSG + select REMOTEPROC_VIRTIO + help + Say 'y' here to enable virtio based RPMsg. RPMsg allows + U-Boot drivers to communicate with remote processors. + +config RPMSG_SANDBOX + bool "RPMsg driver for sandbox platform" + depends on DM + select RPMSG + depends on SANDBOX + help + Say 'y' here to add sandbox driver for RPMsg framework used + for dummy communication with remote processor on sandbox platform + +endmenu
drivers/rpmsg/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2023, Advanced Micro Devices, Inc. + +obj-$(CONFIG_RPMSG) += rpmsg-uclass.o + +obj-$(CONFIG_RPMSG_SANDBOX) += sandbox_test_rpmsg.o + +# virtio driver for rpmsg +obj-$(CONFIG_VIRTIO_RPMSG_BUS) += virtio_rpmsg_bus.o
drivers/rpmsg/rpmsg-uclass.c new file +156 -0
156 lines not on this page · raw message
drivers/rpmsg/rpmsg_internal.h new file +52 -0
52 lines not on this page · raw message
drivers/rpmsg/sandbox_test_rpmsg.c new file +88 -0
88 lines not on this page · raw message
drivers/rpmsg/virtio_rpmsg_bus.c new file +384 -0
384 lines not on this page · raw message
drivers/virtio/virtio-uclass.c +1 -0
@@ -31,6 +31,7 @@ static const char *const virtio_drv_name[VIRTIO_ID_MAX_NUM] = { [VIRTIO_ID_NET] = VIRTIO_NET_DRV_NAME, [VIRTIO_ID_BLOCK] = VIRTIO_BLK_DRV_NAME, [VIRTIO_ID_RNG] = VIRTIO_RNG_DRV_NAME, + [VIRTIO_ID_RPROC] = VIRTIO_RPROC_DRV_NAME, }; int virtio_get_config(struct udevice *vdev, unsigned int offset,
include/dm/uclass-id.h +1 -0
@@ -114,6 +114,7 @@ enum uclass_id {UCLASS_REMOTEPROC ,/* Remote Processor device */ UCLASS_RESET ,/* Reset controller device */ UCLASS_RNG ,/* Random Number Generator */ +UCLASS_RPMSG ,/* RPMsg device */ UCLASS_RTC ,/* Real time clock device */ UCLASS_SCMI_AGENT ,/* Interface with an SCMI server */ UCLASS_SCSI, /* SCSI device */
include/rpmsg.h new file +140 -0
140 lines not on this page · raw message
include/rproc_virtio.h +6 -2
@@ -9,15 +9,19 @@#include <remoteproc.h> #include <dm/device.h> -void rproc_flush_dcache (struct udevice *dev); -#ifndef CONFIG_SANDBOX +void rproc_flush_dcache (struct udevice *dev); +int rproc_virtio_create_dev (struct udevice *parent,struct fw_rsc_vdev *rsc,int offset);#else +void rproc_flush_dcache (struct udevice *dev) +{ +} +int rproc_virtio_create_dev (struct udevice *parent,struct fw_rsc_vdev *rsc,int offset) {
include/virtio.h +3 -1
@@ -26,11 +26,13 @@#define VIRTIO_ID_NET 1/* virtio net */ #define VIRTIO_ID_BLOCK 2/* virtio block */ #define VIRTIO_ID_RNG 4/* virtio rng */ -#define VIRTIO_ID_MAX_NUM 5 +#define VIRTIO_ID_RPROC 7/* virtio rproc */ +#define VIRTIO_ID_MAX_NUM 8#define VIRTIO_NET_DRV_NAME "virtio-net"#define VIRTIO_BLK_DRV_NAME "virtio-blk"#define VIRTIO_RNG_DRV_NAME "virtio-rng" +#define VIRTIO_RPROC_DRV_NAME "virtio-rpmsg-bus"/* Status byte for guest to report progress, and synchronize features */
include/virtio_ring.h +15 -0
@@ -264,6 +264,21 @@ struct virtqueue *vring_create_virtqueue(unsigned int index, unsigned int num,unsigned int vring_align, struct udevice *udev); +/** +* vring_new_virtqueue - create a virtqueue at user defined address +* +* @index: the index of the queue +* @vring: vring created at user defined address +* @udev: the virtio transport udevice +* @return: the virtqueue pointer or NULL if failed +* +* This creates a virtqueue using vring address decided by the user of API +* +* This API is supposed to be called by the virtio transport driver in the +* virtio find_vqs() uclass method. +*/ +struct virtqueue *vring_new_virtqueue (unsigned int index,struct vring vring, +struct udevice *udev);/** * vring_del_virtqueue - destroy a virtqueue *
test/dm/Makefile +1 -0
@@ -97,6 +97,7 @@ obj-$(CONFIG_RAM) += ram.o obj-y += regmap.o obj-$(CONFIG_REMOTEPROC) += remoteproc.o obj-$(CONFIG_DM_RESET) += reset.o +obj-$(CONFIG_RPMSG) += rpmsg.o obj-$(CONFIG_SYSRESET) += sysreset.o obj-$(CONFIG_DM_REGULATOR) += regulator.o obj-$(CONFIG_DM_RNG) += rng.o
test/dm/rpmsg.c new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [RFC PATCH 04/10] drivers: add RPMsg framework
Hi Tanmay,
Quoted 29 lines · Tanmay Shah
RPMsg framework is used to communicate to remote processor using rpmsg protocol.
This framework is ported from the Linux kernel
directory:drivers/rpmsg/
kernel version: 6.4-rc2 (d848a4819d85)Signed-off-by Tanmay Shah <[email protected]>--- MAINTAINERS | 7 + arch/sandbox/dts/test.dts | 8 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/rpmsg/Kconfig | 31 +++ drivers/rpmsg/Makefile | 10 + drivers/rpmsg/rpmsg-uclass.c | 156 ++++++++++++ drivers/rpmsg/rpmsg_internal.h | 52 ++++ drivers/rpmsg/sandbox_test_rpmsg.c | 88 +++++++ drivers/rpmsg/virtio_rpmsg_bus.c | 384 +++++++++++++++++++++++++++++ drivers/virtio/virtio-uclass.c | 1 + include/dm/uclass-id.h | 1 + include/rpmsg.h | 140 +++++++++++ include/rproc_virtio.h | 8 +- include/virtio.h | 4 +- include/virtio_ring.h | 15 ++ test/dm/Makefile | 1 + test/dm/rpmsg.c | 41 +++ 18 files changed, 947 insertions(+), 3 deletions(-)
Quoted 8 lines
create mode 100644 drivers/rpmsg/Kconfig create mode 100644 drivers/rpmsg/Makefile create mode 100644 drivers/rpmsg/rpmsg-uclass.c create mode 100644 drivers/rpmsg/rpmsg_internal.h create mode 100644 drivers/rpmsg/sandbox_test_rpmsg.c create mode 100644 drivers/rpmsg/virtio_rpmsg_bus.c create mode 100644 include/rpmsg.h create mode 100644 test/dm/rpmsg.c
Again there is a lot going on in this patch and it could use a split.
Quoted 79 lines
MAINTAINERS +7
-0@@ -1365,6 +1365,13 @@ F: drivers/usb/gadget/f_rockusb.c F: cmd/rockusb.c F: doc/README.rockusb +RPMSG +M: Tanmay Shah <[email protected]> +S: Maintained +F: drivers/rpmsg/* +F: include/rpmsg.h +F: test/dm/rpmsg.c + SANDBOX M: Simon Glass <[email protected]> S: Maintainedarch/sandbox/dts/test.dts +8
-0@@ -1247,6 +1247,14 @@ compatible = "sandbox,sandbox-rng"; }; + rpmsg_1: rpmsg@1 { + compatible = "sandbox,test-rpmsg"; + }; + + rpmsg_2: rpmsg@2 { + compatible = "sandbox,test-rpmsg"; + }; + rproc_1: rproc@1 { compatible = "sandbox,test-processor"; remoteproc-name = "remoteproc-test-dev1";drivers/Kconfig +2
-0@@ -112,6 +112,8 @@ source "drivers/reset/Kconfig" source "drivers/rng/Kconfig" +source "drivers/rpmsg/Kconfig" + source "drivers/rtc/Kconfig" source "drivers/scsi/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mfd/ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ +obj-y += rpmsg/ obj-y += input/ obj-y += iommu/ # SOC specific infrastructure drivers.drivers/rpmsg/Kconfig new file +10
-0@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2023, Advanced Micro devices, Inc. + +menu "RPMsg drivers" + +# RPMsg gets selected by drivers as needed +# All users should depend on DM +config RPMSG + bool
drivers/rpmsg/Kconfig line 20
Quoted 10 lines
drivers/rpmsg/Kconfig new file +10
-0+ depends on DM + +config VIRTIO_RPMSG_BUS + bool "virtio rpmsg bus" + depends on DM + select RPMSG + select REMOTEPROC_VIRTIO + help + Say 'y' here to enable virtio based RPMsg. RPMsg allows + U-Boot drivers to communicate with remote processors.
Please expand abbreviations in Kconfig
Quoted 59 lines
drivers/rpmsg/Kconfig new file +11
-0+ +config RPMSG_SANDBOX + bool "RPMsg driver for sandbox platform" + depends on DM + select RPMSG + depends on SANDBOX + help + Say 'y' here to add sandbox driver for RPMsg framework used + for dummy communication with remote processor on sandbox platform + +endmenudrivers/rpmsg/Makefile new file +10
-0@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2023, Advanced Micro Devices, Inc. + +obj-$(CONFIG_RPMSG) += rpmsg-uclass.o + +obj-$(CONFIG_RPMSG_SANDBOX) += sandbox_test_rpmsg.o + +# virtio driver for rpmsg +obj-$(CONFIG_VIRTIO_RPMSG_BUS) += virtio_rpmsg_bus.odrivers/rpmsg/rpmsg-uclass.c new file +26
-0@@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* remote processor messaging bus +* +* Copyright (C) 2023, Advanced Micro Devices, Inc. +*/ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <log.h> +#include <malloc.h> +#include <rpmsg.h> +#include <virtio.h> +#include <dm/device_compat.h> +#include <dm/device-internal.h> +#include <dm/lists.h> +#include <dm/uclass.h> +#include <dm/uclass-internal.h> + +#include "rpmsg_internal.h" + +int rpmsg_init (int core_id) +{ +struct udevice *udev =NULL ; +int ret;
drivers/rpmsg/rpmsg-uclass.c line 36
Quoted 10 lines
drivers/rpmsg/rpmsg-uclass.c new file +10
-0+ + ret =uclass_find_device_by_seq (UCLASS_RPMSG , core_id, &udev); +if (ret) { +debug ("can't find rpmsg dev for core_id %d\n" , core_id); +return ret; + } + + ret =device_probe (udev); +if (ret) +debug ("failed to probe rpmsg dev, ret = %d\n" , ret);
If you use uclass_get_device_by_seq() it does the probe for you.
Quoted 37 lines
drivers/rpmsg/rpmsg-uclass.c new file +37
-0+ +return ret; +} + +static int rpmsg_find_device (int core_id,struct udevice **rpdev) +{ +int core_count; + + core_count =uclass_id_count (UCLASS_RPMSG ); +if (core_id >= core_count) { +debug ("invalid core id = %d\n" , core_id); +return -EINVAL ; + } + +return uclass_find_device (UCLASS_RPMSG , core_id, rpdev); +} + +/** +* rpmsg_send() - send a message across to the remote processor +* @core_id: remote processor core id +* @data: payload of message +* @len: length of payload +* +* This function sends @data of length @len on the @core_id endpoint. +* The message will be sent to the remote processor which the @core_id +* belongs to, using @ept's address and its associated rpmsg +* device destination addresses. +* In case there are no TX buffers available, the function will fail +* immediately +* +* Return: 0 on success and an appropriate error value on failure. +*/ +int rpmsg_send (int core_id,void *data,int len) +{ +struct udevice *rpdev =NULL ; +const struct rpmsg_device_ops *ops; +int ret;
drivers/rpmsg/rpmsg-uclass.c line 83
Quoted 10 lines
drivers/rpmsg/rpmsg-uclass.c new file +10
-0+ + ret =rpmsg_find_device (core_id, &rpdev); +if (ret) { +debug ("no rpmsg device for core = %d, ret = %d\n" , core_id, ret); +return ret; + } +if (!rpdev) +return -ENODEV ; + + ops = (const struct rpmsg_device_ops *)device_get_ops (rpdev);
Create an rpmsg_get_ops() macro like done in other subsystems.
Quoted 8 lines
drivers/rpmsg/rpmsg-uclass.c new file +8
-0+if (!ops) { +debug ("send op not registered for device %s\n" , rpdev->name); +return -EINVAL ; + } + +return ops->send (rpdev, data, len); +} +
[..]
drivers/rpmsg/rpmsg-uclass.c line 122
Quoted 8 lines
drivers/rpmsg/rpmsg-uclass.c new file +8
-0+void rpmsg_debug_data (int core_id,int vq_id) +{ +struct udevice *rpdev =NULL ; +const struct rpmsg_device_ops *ops; +int ret; + +if (vq_id >1 ) +debug ("vq_id %d not supported\n" , vq_id);
Return error?
drivers/rpmsg/rpmsg-uclass.c line 131
Quoted 9 lines
drivers/rpmsg/rpmsg-uclass.c new file +9
-0+ + ret =rpmsg_find_device (core_id, &rpdev); +if (ret || !rpdev) { +debug ("no rpmsg device for core = %d, ret = %d\n" , core_id, ret); +return ; + } + + ops = (const struct rpmsg_device_ops *)device_get_ops (rpdev); +if (!ops || !ops->debug_data) {
Generally !ops is not allowed, so we can refuse to bind or probe in that case and avoid this check in every method.
drivers/rpmsg/rpmsg-uclass.c line 144
Quoted 13 lines
drivers/rpmsg/rpmsg-uclass.c new file +13
-0+debug ("recv op not registered for device %s\n" , rpdev->name); +return ; + } + + ops->debug_data (rpdev, vq_id); +} + +int rpmsg_uclass_init (struct uclass *class) +{ +int ret; + +/* make sure virtio framework is initialized */ + ret =virtio_init ();
I suppose this is OK. It creates a dependency on virtio just to init this uclass.
Quoted 57 lines
drivers/rpmsg/rpmsg-uclass.c new file +12
-0+if (ret) +debug ("virtio init failed, %d\n" , ret); + +return ret; +} + +UCLASS_DRIVER (rpmsg_bus) = { + .name ="rpmsg_bus" , + .id =UCLASS_RPMSG , + .init = rpmsg_uclass_init, + .flags =DM_UC_FLAG_SEQ_ALIAS , +};drivers/rpmsg/rpmsg_internal.h new file +39
-0@@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* remote processor messaging bus internals +* +* Copyright (C) 2011 Texas Instruments, Inc. +* Copyright (C) 2011 Google, Inc. +* Copyright (C) 2023, Advanced Micro Devices, Inc. +* +* Ohad Ben-Cohen <[email protected]> +* Brian Swetland <[email protected]> +*/ + +#ifndef __RPMSG_INTERNAL_H__ +#define __RPMSG_INTERNAL_H__ + +#include <rpmsg.h> +#include <virtio.h> + +/** +* struct rpmsg_hdr - common header for all rpmsg messages +* @src: source address +* @dst: destination address +* @reserved: reserved for future use +* @len: length of payload (in bytes) +* @flags: message flags +* @data: @len bytes of message payload data +* +* Every message sent(/received) on the rpmsg bus begins with this header. +*/ +struct rpmsg_hdr { +__rpmsg32 src; +__rpmsg32 dst; +__rpmsg32 reserved; +__rpmsg16 len; +__rpmsg16 flags; +u8 data[]; +} __packed; + +/**
drivers/rpmsg/rpmsg_internal.h line 49
Quoted 10 lines
drivers/rpmsg/rpmsg_internal.h new file +10
-0+* struct rpmsg_device_ops - indirection table for the rpmsg_device operations +* @send: send data to core +* @recv: recv data to buf. data limited to buf_len bytes and buf is expected +* to have that much memory allocated +* @debug_data: calls virtqueue_dump debug utility to print vq data +*/ +struct rpmsg_device_ops { +int (*send)(struct udevice *rpdev,void *data,int len); +int (*recv)(struct udevice *rpdev,rpmsg_rx_cb_t cb); +void (*debug_data)(struct udevice *rpdev,int vq_id);
We normally write out the function docs in full here.
Need to add declarations for rpmsg_send(), etc. here.
Looks like you have memory leaks in the error paths of your init functions, but perhaps it doesn't matter.
[..]
Quoted 116 lines
include/rpmsg.h new file +110
-0@@ -0,0 +1,140 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _RPMSG_H_ +#define _RPMSG_H_ + +/** +* struct dm_rpmsg_uclass_pdata - platform data for a CPU +* @name: Platform-specific way of naming the RPMsg platform device +* @driver_plat_data: driver specific platform data that may be needed. +* +* This can be accessed with dev_get_uclass_plat() for any UCLASS_RPMSG +* device. +* +*/ +struct dm_rpmsg_uclass_pdata { +const char *name; +void *driver_plat_data; +}; + +typedef __u16 __bitwise __rpmsg16 ; +typedef __u32 __bitwise __rpmsg32 ; +typedef __u64 __bitwise __rpmsg64 ; + +#define RPMSG_ADDR_ANY 0xFFFFFFFF + +#define RPMSG_NAME_SIZE 32 + +static inline bool rpmsg_is_little_endian (void ) +{ +#ifdef __LITTLE_ENDIAN +return true; +#else +return false; +#endif +} + +static inline u16 __rpmsg16_to_cpu (bool little_endian,__rpmsg16 val) +{ +if (little_endian) +return le16_to_cpu ((__force __le16 )val); +else +return be16_to_cpu ((__force __be16 )val); +} + +static inline __rpmsg16 __cpu_to_rpmsg16 (bool little_endian,u16 val) +{ +if (little_endian) +return (__force __rpmsg16 )cpu_to_le16 (val); +else +return (__force __rpmsg16 )cpu_to_be16 (val); +} + +static inline u32 __rpmsg32_to_cpu (bool little_endian,__rpmsg32 val) +{ +if (little_endian) +return le32_to_cpu ((__force __le32 )val); +else +return be32_to_cpu ((__force __be32 )val); +} + +static inline __rpmsg32 __cpu_to_rpmsg32 (bool little_endian,u32 val) +{ +if (little_endian) +return (__force __rpmsg32 )cpu_to_le32 (val); +else +return (__force __rpmsg32 )cpu_to_be32 (val); +} + +static inline u64 __rpmsg64_to_cpu (bool little_endian,__rpmsg64 val) +{ +if (little_endian) +return le64_to_cpu ((__force __le64 )val); +else +return be64_to_cpu ((__force __be64 )val); +} + +static inline __rpmsg64 __cpu_to_rpmsg64 (bool little_endian,u64 val) +{ +if (little_endian) +return (__force __rpmsg64 )cpu_to_le64 (val); +else +return (__force __rpmsg64 )cpu_to_be64 (val); +} + +static inline u16 rpmsg16_to_cpu (__rpmsg16 val) +{ +return __rpmsg16_to_cpu (rpmsg_is_little_endian (), val); +} + +static inline __rpmsg16 cpu_to_rpmsg16 (u16 val) +{ +return __cpu_to_rpmsg16 (rpmsg_is_little_endian (), val); +} + +static inline u32 rpmsg32_to_cpu (__rpmsg32 val) +{ +return __rpmsg32_to_cpu (rpmsg_is_little_endian (), val); +} + +static inline __rpmsg32 cpu_to_rpmsg32 (u32 val) +{ +return __cpu_to_rpmsg32 (rpmsg_is_little_endian (), val); +} + +static inline u64 rpmsg64_to_cpu (__rpmsg64 val) +{ +return __rpmsg64_to_cpu (rpmsg_is_little_endian (), val); +} + +static inline __rpmsg64 cpu_to_rpmsg64 (u64 val) +{
include/rpmsg.h line 120
Quoted 10 lines
include/rpmsg.h new file +10
-0+return __cpu_to_rpmsg64 (rpmsg_is_little_endian (), val); +} + +typedef int (*rpmsg_rx_cb_t )(void *buf,int msg_len,u32 msgs_received); + +#if IS_ENABLED (CONFIG_RPMSG ) + +int rpmsg_init (int core_id); +int rpmsg_send (int core_id,void *data,int len); +int rpmsg_recv (int core_id,rpmsg_rx_cb_t cb);
function comments?
include/rpmsg.h line 125
Quoted 5 lines
include/rpmsg.h new file +5
-0+ +#else +int rpmsg_init (int core_id) +{ +return -ENODEV ;
-ENOSYS
Quoted 5 lines
include/rpmsg.h new file +5
-0+} + +int rpmsg_send (int core_id,void *data,int len) +{ +return -ENODEV ;
include/rpmsg.h line 140
Quoted 10 lines
include/rpmsg.h new file +10
-0+} + +int rpmsg_recv (int core_id,rpmsg_rx_cb_t cb) +{ +return -ENODEV ; +} + +#endif /* IS_ENABLED(CONFIG_RPMSG) */ + +#endif /* _RPMSG_H */
[..]
Regards,
Simon
RFC PATCH 5/10 rpmsg: add sample client driver
In reply to Tanmay ShahAdd driver to demonstrate use of rpmsg framework.
--- drivers/rpmsg/Kconfig | 8 ++++ drivers/rpmsg/Makefile | 3 ++ drivers/rpmsg/rpmsg_sample_client.c | 63 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 drivers/rpmsg/rpmsg_sample_client.c
drivers/rpmsg/Kconfig +8 -0
@@ -28,4 +28,12 @@ config RPMSG_SANDBOX Say 'y' here to add sandbox driver for RPMsg framework used for dummy communication with remote processor on sandbox platform +config RPMSG_SAMPLE_CLIENT + bool "Sample RPMsg client driver" + depends on DM + select RPMSG + help + Say 'y' here to enable driver that demonstrate use of RPMsg framework. + This driver uses RPMsg APIs to communicate with remote processor. + endmenu
drivers/rpmsg/Makefile +3 -0
@@ -6,5 +6,8 @@ obj-$(CONFIG_RPMSG) += rpmsg-uclass.o obj-$(CONFIG_RPMSG_SANDBOX) += sandbox_test_rpmsg.o +# Sample driver demonstrate how to use rpmsg framework +obj-$(CONFIG_RPMSG_SAMPLE_CLIENT) += rpmsg_sample_client.o + # virtio driver for rpmsg obj-$(CONFIG_VIRTIO_RPMSG_BUS) += virtio_rpmsg_bus.o
drivers/rpmsg/rpmsg_sample_client.c new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [RFC PATCH 05/10] rpmsg: add sample client driver
Hi Tanmay,
Quoted 10 lines · Tanmay Shah
Add driver to demonstrate use of rpmsg framework.
Signed-off-by Tanmay Shah <[email protected]>--- drivers/rpmsg/Kconfig | 8 ++++ drivers/rpmsg/Makefile | 3 ++ drivers/rpmsg/rpmsg_sample_client.c | 63 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 drivers/rpmsg/rpmsg_sample_client.c
Quoted 6 lines
drivers/rpmsg/Kconfig +0
-0
drivers/rpmsg/Kconfig config RPMSG_SANDBOX · line 36
Quoted 9 lines
drivers/rpmsg/Kconfig +6
-0@@ -28,4 +28,12 @@ config RPMSG_SANDBOX Say 'y' here to add sandbox driver for RPMsg framework used for dummy communication with remote processor on sandbox platform +config RPMSG_SAMPLE_CLIENT + bool "Sample RPMsg client driver" + depends on DM + select RPMSG + help + Say 'y' here to enable driver that demonstrate use of RPMsg framework.
enable a driver
demonstrates
Quoted 30 lines
drivers/rpmsg/Kconfig +2
-0+ This driver uses RPMsg APIs to communicate with remote processor. + endmenudrivers/rpmsg/Makefile +3
-0@@ -6,5 +6,8 @@ obj-$(CONFIG_RPMSG) += rpmsg-uclass.o obj-$(CONFIG_RPMSG_SANDBOX) += sandbox_test_rpmsg.o +# Sample driver demonstrate how to use rpmsg framework +obj-$(CONFIG_RPMSG_SAMPLE_CLIENT) += rpmsg_sample_client.o + # virtio driver for rpmsg obj-$(CONFIG_VIRTIO_RPMSG_BUS) += virtio_rpmsg_bus.odrivers/rpmsg/rpmsg_sample_client.c new file +8
-0@@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2011 Texas Instruments, Inc. +* Copyright (C) 2011 Google, Inc. +* Copyright (C) 2023, Advanced Micro Devices, Inc. +* +* Sample client that shows use of rpmsg APIs +*/
drivers/rpmsg/rpmsg_sample_client.c line 18
Quoted 10 lines
drivers/rpmsg/rpmsg_sample_client.c new file +10
-0+ +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <log.h> +#include <malloc.h> +#include <rpmsg.h> +#include <dm/device-internal.h> +#include <dm/uclass.h> +#include <dm/uclass-internal.h>
Do you need those three?
Quoted 46 lines
drivers/rpmsg/rpmsg_sample_client.c new file +45
-1+#include <linux/delay.h> + +static int rpmsg_rx_callback (void *buf,int msg_len,u32 msgs_received) +{ +printf ("APU: rx: %s\n" , (char *)buf); + +return 0 ; +} + +static int rpmsg_sample_client_probe (struct udevice *udev) +{ +char data[80 ] = {0 }; +int i; + +/* Initialize rpmsg for core 0 */ +rpmsg_init (0 ); + +/* wait for RPU to initialize vdev */ +mdelay (20 ); + +/* assume rpmsg init is already done */ +for (i =1 ; i <5 ; i++) { +sprintf (data,"rpmsg buf %d" , i); +printf ("APU: tx: %s\n" , data); +rpmsg_send (0 , data,strlen (data)); + +/* 20ms delay before receiving the data */ +mdelay (20 ); + +rpmsg_recv (0 , rpmsg_rx_callback); +printf ("\n" ); + } +return 0 ; +} + +U_BOOT_DRIVER (rpmsg_sample_client) = { + .name ="rpmsg-sample-client" , + .id =UCLASS_MISC , + .probe = rpmsg_sample_client_probe, + .flags =DM_FLAG_PRE_RELOC , +}; + +U_BOOT_DRVINFO (rpmsg_sample_client) = { + .name ="rpmsg-sample-client" , +}; --
Quoted 2 lines
2.25.1
REgards,
SImon
RFC PATCH 6/10 cmd: add rpmsg framework commands
In reply to Tanmay ShahThis patch introduces commands to use rpmsg framework
rpmsg init <core id>
- Initialize rpmsg framework for remote core
rpmsg debug_data <core id> <"tx" / "rx">
- debug tx or rx virtqueues. This command simply uses virtqueue_dump_data and prints virtqueue for rpmsg device mapped to <core id>
--- MAINTAINERS | 1 + cmd/Kconfig | 6 +++++ cmd/Makefile | 1 + cmd/rpmsg.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ include/rpmsg.h | 5 ++++ 5 files changed, 74 insertions(+) create mode 100644 cmd/rpmsg.c
MAINTAINERS +1 -0
@@ -1368,6 +1368,7 @@ F: doc/README.rockusb RPMSG M: Tanmay Shah <[email protected]> S: Maintained +F: cmd/rpmsg.c F: drivers/rpmsg/* F: include/rpmsg.h F: test/dm/rpmsg.c
cmd/Kconfig +6 -0
@@ -1450,6 +1450,12 @@ config CMD_REMOTEPROC help Support for Remote Processor control +config CMD_RPMSG + bool "rpmsg" + help + Support for RPMsg protocol over virtio for data transfer between + U-Boot and remote processor firmware + config CMD_SATA bool "sata - Access SATA subsystem" select SATA
cmd/Makefile +1 -0
@@ -149,6 +149,7 @@ obj-$(CONFIG_CMD_REGINFO) += reginfo.o obj-$(CONFIG_CMD_REISER) += reiser.o obj-$(CONFIG_CMD_REMOTEPROC) += remoteproc.o obj-$(CONFIG_CMD_RNG) += rng.o +obj-$(CONFIG_CMD_RPMSG) += rpmsg.o obj-$(CONFIG_CMD_KASLRSEED) += kaslrseed.o obj-$(CONFIG_CMD_ROCKUSB) += rockusb.o obj-$(CONFIG_CMD_RTC) += rtc.o
cmd/rpmsg.c new file +61 -0
61 lines not on this page · raw message
include/rpmsg.h +5 -0
@@ -118,6 +118,7 @@ typedef int (*rpmsg_rx_cb_t)(void *buf, int msg_len, u32 msgs_received);int rpmsg_init (int core_id);int rpmsg_send (int core_id,void *data,int len);int rpmsg_recv (int core_id,rpmsg_rx_cb_t cb); +void rpmsg_debug_data (int core_id,int vq_id);#else int rpmsg_init (int core_id)
@@ -135,6 +136,10 @@ int rpmsg_recv(int core_id, rpmsg_rx_cb_t cb)return -ENODEV ; } +void rpmsg_debug_data (int core_id,int vq_id) +{ +} +#endif /* IS_ENABLED(CONFIG_RPMSG) */ #endif /* _RPMSG_H */
Signature · 1 line
2.25.1
Re: [RFC PATCH 06/10] cmd: add rpmsg framework commands
Hi Tanmay,
Quoted 12 lines · Tanmay Shah
This patch introduces commands to use rpmsg framework
rpmsg init <core id>
- Initialize rpmsg framework for remote corerpmsg
debug_data<core id> <"tx" / "rx">
- debug tx or rx virtqueues. This command simply usesvirtqueue_dump_dataand prints virtqueue for rpmsg device mapped to <core id>Signed-off-by Tanmay Shah <[email protected]>
Quoted 9 lines
--- MAINTAINERS | 1 + cmd/Kconfig | 6 +++++ cmd/Makefile | 1 + cmd/rpmsg.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ include/rpmsg.h | 5 ++++ 5 files changed, 74 insertions(+) create mode 100644 cmd/rpmsg.c
Please add doc/usage/cmd file
as well as a test for your command in test/dm/rpmsg.c
You can see test/dm/acpi.c for an example.
Regards,
Simon
RFC PATCH 7/10 remoteproc: add attach/detach commands
In reply to Tanmay ShahCurrent remoteproc framework provides commands to start/stop remote processor. However, If remote processor is already running before U-Boot then there is no way to connect to remote processor.
Implements attach/detach commands to connect to already running remote processor. During attach operation, remoteproc framework gets resource table from remote processor using platform specific callback and then creates vdev devices and other resources accordingly.
This approach is derived from the Linux kernel remoteproc framework.
kernel version: 6.4-rc2 (d848a4819d85)
file: drivers/remoteproc/remoteproc_core
--- cmd/remoteproc.c | 14 +++++- drivers/remoteproc/rproc-uclass.c | 76 ++++++++++++++++++++++++++++++- include/remoteproc.h | 31 +++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-)
cmd/remoteproc.c +13 -1
@@ -173,6 +173,10 @@ static int do_remoteproc_wrapper(struct cmd_tbl *cmdtp, int flag, int argc, ret =rproc_start (id); }else if (!strcmp (argv[0 ],"stop" )) { ret =rproc_stop (id); + }else if (!strcmp (argv[0 ],"attach" )) { + ret =rproc_attach (id); + }else if (!strcmp (argv[0 ],"detach" )) { + ret =rproc_detach (id); }else if (!strcmp (argv[0 ],"reset" )) { ret =rproc_reset (id); }else if (!strcmp (argv[0 ],"is_running" )) {
@@ -220,6 +224,12 @@ static struct cmd_tbl cmd_remoteproc_sub[] = {U_BOOT_CMD_MKENT (stop,1 ,1 , do_remoteproc_wrapper,"Stop remote processor" ,"id - ID of the remote processor (see 'list' cmd)\n" ), +U_BOOT_CMD_MKENT (attach,1 ,1 , do_remoteproc_wrapper, +"Attach remote processor" , +"id - ID of the remote processor (see 'list' cmd)\n" ), +U_BOOT_CMD_MKENT (detach,1 ,1 , do_remoteproc_wrapper, +"detach remote processor" , +"id - ID of the remote processor (see 'list' cmd)\n" ),U_BOOT_CMD_MKENT (reset,1 ,1 , do_remoteproc_wrapper,"Reset remote processor" , "id - ID of the remote processor (see 'list' cmd)\n"),
@@ -262,7 +272,7 @@ static int do_remoteproc(struct cmd_tbl *cmdtp, int flag, int argc,U_BOOT_CMD (rproc,5 ,1 , do_remoteproc,"Control operation of remote processors in an SoC" , -" [init|list|load|start|stop|reset|is_running|ping]\n" +" [attach|detach|init|list|load|start|stop|reset|is_running|ping]\n" "\t\t Where:\n" "\t\t[addr] is a memory address\n" "\t\t<id> is a numerical identifier for the remote processor\n"
@@ -271,6 +281,8 @@ U_BOOT_CMD(rproc, 5, 1, do_remoteproc,"\t\tNote: Services are dependent on the driver capability\n" "\t\t 'list' command shows the capability of each device\n" "\n\tSubcommands:\n" +"\tattach <id> - attach to already running remote processor\n" +"\tdetach <id> - unbind driver with already attached device\n" "\tinit <id> - Enumerate and initalize the remote processor.\n" "\t if id is not passed, initialize all the remote prcessors\n" "\tlist - list available remote processors\n"
drivers/remoteproc/rproc-uclass.c +75 -1
103 lines not on this page · raw message
include/remoteproc.h +31 -0
@@ -498,6 +498,22 @@ struct dm_rproc_ops {*/ int (*stop)(struct udevice *dev); +/** +* attach() - Attach the remoteproc device (optional) +* +* @dev: Remote proc device +* @return 0 if all ok, else appropriate error value. +*/ +int (*attach)(struct udevice *dev); + +/** +* detach() - Detach the remoteproc device (optional) +* +* @dev: Remote proc device +* @return 0 if all ok, else appropriate error value. +*/ +int (*detach)(struct udevice *dev); +/** * reset() - Reset the remoteproc device (optional) *
@@ -600,6 +616,19 @@ int rproc_start(int id);*/ int rproc_stop (int id); +/** +* rproc_attach() - Attach a remote processor +* @id: id of the remote processor +* Return: 0 if all ok, else appropriate error value. +*/ +int rproc_attach (int id); + +/** +* rproc_detach() - Detach a remote processor +* @id: id of the remote processor +* Return: 0 if all ok, else appropriate error value. +*/ +int rproc_detach (int id);/** * rproc_reset() - reset a remote processor * @id: id of the remote processor
@@ -752,6 +781,8 @@ int rproc_elf_load_rsc_table(struct udevice *dev, ulong fw_addr,unsigned long rproc_parse_resource_table (struct udevice *dev,struct rproc *cfg); +unsigned long rproc_attach_resource_table (struct udevice *dev); +struct resource_table *rproc_find_resource_table (struct udevice *dev,unsigned int addr,int *tablesz);
Signature · 1 line
2.25.1
Re: [RFC PATCH 07/10] remoteproc: add attach/detach commands
Quoted 16 lines · Tanmay Shah
Current remoteproc framework provides commands to start/stop remote processor. However, If remote processor is already running before U-Boot then there is no way to connect to remote processor.
Implements attach/detach commands to connect to already running remote processor. During attach operation, remoteproc framework gets resource table from remote processor using platform specific callback and then creates vdev devices and other resources accordingly.
This approach is derived from the Linux kernel remoteproc framework.
kernel version: 6.4-rc2 (
d848a4819d85)
file:drivers/remoteproc/remoteproc_core
Quoted 6 lines
Signed-off-by Tanmay Shah <[email protected]>--- cmd/remoteproc.c | 14 +++++- drivers/remoteproc/rproc-uclass.c | 76 ++++++++++++++++++++++++++++++- include/remoteproc.h | 31 +++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-)
This seems to need an additional test.
Regards,
Simon
RFC PATCH 8/10 remoteproc: add zynqmp driver
In reply to Tanmay ShahZynqMP platform has ARM Cortex-R5 dual core remote processor also known as RPU (Real-time Processing Unit).
This remoteproc platform driver is responsible to configure the RPU and manages life-cycle of the RPU along with other platform specific operations.
--- MAINTAINERS | 1 + drivers/firmware/firmware-zynqmp.c | 20 ++ drivers/remoteproc/Kconfig | 9 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/xlnx_rproc.c | 411 +++++++++++++++++++++++++++++ include/zynqmp_firmware.h | 16 ++ 6 files changed, 458 insertions(+) create mode 100644 drivers/remoteproc/xlnx_rproc.c
MAINTAINERS +1 -0
@@ -1323,6 +1323,7 @@ REMOTEPROC M: Tanmay Shah <[email protected]> S: Maintained F: drivers/remoteproc/rproc_virtio.c +F: drivers/remoteproc/xlnx_rproc.c F: include/rproc_virtio.h RISC-V
drivers/firmware/firmware-zynqmp.c +20 -0
@@ -202,6 +202,26 @@ int zynqmp_pm_request_node(const u32 node, const u32 capabilities, qos, ack, NULL); } +/** +* zynqmp_pm_request_wake - PM call to wake up selected master or subsystem +* @node: Node ID of the master or subsystem +* @set_addr: Specifies whether the address argument is relevant +* @address: Address from which to resume when woken up +* @ack: Flag to specify whether acknowledge requested +* +* Return: status, either success or error+reason +*/ +int zynqmp_pm_request_wake (const u32 node, +const bool set_addr, +const u64 address, +const enum zynqmp_pm_request_ack ack) +{ +/* set_addr flag is encoded into 1st bit of address */ +return xilinx_pm_request (PM_REQUEST_WAKEUP , node, +lower_32_bits (address | set_addr), +upper_32_bits (address), ack,NULL ); +} +int zynqmp_pm_is_function_supported (const u32 api_id,const u32 id) {int ret;
drivers/remoteproc/Kconfig +9 -0
@@ -113,4 +113,13 @@ config REMOTEPROC_VIRTIO drivers provide a set of ops for the real virtio device driver to call. +config REMOTEPROC_XLNX + bool "Support for AMD-Xilinx platform's remoteproc driver" + select REMOTEPROC_VIRTIO + depends on DM + depends on ZYNQMP_FIRMWARE + help + Say 'y' here to add support for remoteproc platform + driver for various AMD-Xilinx platforms + endmenu
drivers/remoteproc/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_REMOTEPROC_TI_POWER) += ti_power_proc.o obj-$(CONFIG_REMOTEPROC_TI_PRU) += pru_rproc.o obj-$(CONFIG_REMOTEPROC_TI_IPU) += ipu_rproc.o obj-$(CONFIG_REMOTEPROC_VIRTIO) += rproc_virtio.o +obj-$(CONFIG_REMOTEPROC_XLNX) += xlnx_rproc.o
drivers/remoteproc/xlnx_rproc.c new file +411 -0
411 lines not on this page · raw message
include/zynqmp_firmware.h +16 -0
@@ -450,6 +450,21 @@ enum zynqmp_pm_request_ack { ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING = 3, }; +enum rpu_boot_mem { +PM_RPU_BOOTMEM_LOVEC =0 , +PM_RPU_BOOTMEM_HIVEC =1 , +}; + +enum rpu_tcm_comb { +PM_RPU_TCM_SPLIT =0 , +PM_RPU_TCM_COMB =1 , +}; + +enum rpu_oper_mode { +PM_RPU_MODE_LOCKSTEP =0 , +PM_RPU_MODE_SPLIT =1 , +}; +unsigned int zynqmp_firmware_version (void );int zynqmp_pmufw_node (u32 id);int zynqmp_pmufw_config_close (void );
@@ -461,6 +476,7 @@ int zynqmp_pm_request_node(const u32 node, const u32 capabilities,int zynqmp_pm_set_sd_config (u32 node,enum pm_sd_config_type config,u32 value);int zynqmp_pm_set_gem_config (u32 node,enum pm_gem_config_type config,u32 value); +int zynqmp_pm_set_rpu_mode (u32 node,int rpu_mode);int zynqmp_pm_is_function_supported (const u32 api_id,const u32 id);int zynqmp_mmio_read (const u32 address,u32 *value);int zynqmp_mmio_write (const u32 address,const u32 mask,const u32 value);
Signature · 1 line
2.25.1
RFC PATCH 9/10 configs: zynqmp: enable remoteproc and rpmsg
In reply to Tanmay ShahEnable configurations to build remoteproc and rpmsg framework. Also enable remoteproc and rpmsg framework commands. Enable misc commands to probe rpmsg_sample_client driver.
--- configs/xilinx_zynqmp_virt_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
configs/xilinx_zynqmp_virt_defconfig +6 -0
@@ -73,10 +73,13 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_PWM=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y +CONFIG_CMD_MISC=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y CONFIG_CMD_NAND_LOCK_UNLOCK=y CONFIG_CMD_POWEROFF=y +CONFIG_CMD_REMOTEPROC=y +CONFIG_CMD_RPMSG=y CONFIG_CMD_SDRAM=y CONFIG_CMD_SF_TEST=y CONFIG_CMD_SPI=y
@@ -191,7 +194,10 @@ CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_PWM=y CONFIG_PWM_CADENCE_TTC=y +CONFIG_REMOTEPROC_XLNX=y CONFIG_RESET_ZYNQMP=y +CONFIG_VIRTIO_RPMSG_BUS=y +CONFIG_RPMSG_SAMPLE_CLIENT=y CONFIG_DM_RTC=y CONFIG_RTC_EMULATION=y CONFIG_RTC_ZYNQMP=y
Signature · 1 line
2.25.1
RFC PATCH 10/10 configs: sandbox: enable rpmsg
In reply to Tanmay ShahEnable configs required to test rpmsg on sandbox build. CMD_MISC is enabled to probe rpmsg_sample_client driver.
Test procedure:
- boot sandbox build
- command to run rpmsg tests: ut dm rpmsg
- command to run sample driver: misc list
--- configs/sandbox_defconfig | 4 ++++ 1 file changed, 4 insertions(+)
configs/sandbox_defconfig +4 -0
@@ -77,6 +77,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_LOADM=y CONFIG_CMD_LSBLK=y CONFIG_CMD_MBR=y +CONFIG_CMD_MISC=y CONFIG_CMD_MMC=y CONFIG_CMD_MUX=y CONFIG_CMD_OSD=y
@@ -84,6 +85,7 @@ CONFIG_CMD_PCI=y CONFIG_CMD_PCI_MPS=y CONFIG_CMD_READ=y CONFIG_CMD_REMOTEPROC=y +CONFIG_CMD_RPMSG=y CONFIG_CMD_SPI=y CONFIG_CMD_TEMPERATURE=y CONFIG_CMD_USB=y
@@ -274,6 +276,8 @@ CONFIG_REMOTEPROC_SANDBOX=y CONFIG_SANDBOX_RESET=y CONFIG_RESET_SYSCON=y CONFIG_RESET_SCMI=y +CONFIG_RPMSG_SANDBOX=y +CONFIG_RPMSG_SAMPLE_CLIENT=y CONFIG_DM_RTC=y CONFIG_RTC_MAX313XX=y CONFIG_RTC_RV8803=y
Signature · 1 line
2.25.1
Re: [RFC PATCH 10/10] configs: sandbox: enable rpmsg
Quoted 9 lines · Tanmay Shah
Enable configs required to test rpmsg on sandbox build.
CMD_MISCis enabled to proberpmsg_sample_clientdriver.Test procedure:
- boot sandbox build
- command to run rpmsg tests: ut dm rpmsg
- command to run sample driver: misc list
Quoted 5 lines
Signed-off-by Tanmay Shah <[email protected]>--- configs/sandbox_defconfig | 4 ++++ 1 file changed, 4 insertions(+)