Skip to contentSkip to conversation

rapidio: add support for RapidIO boot

PATCH New jacquiot.aurelien at gmail.com 2 participants 2 messages Nov 10, 2015 – Jan 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 rapidio: add support for RapidIO boot

From: Aurelien Jacquiot <[email protected]>

RapidIO is a high-performance packet-switched interconnect technology (www.rapidio.org) that can be used for messaging or memory transfers like Ethernet or PCIe.

This commit adds the RapidIO boot functionality for slave mode (i.e. U-Boot does not fetch the images, images are pushed by a peer device/board). A new 'rio' command group allows to initialize and perform basic RapidIO operations.

This feature has been firstly designed for TI KeyStone architecture but can used by any device that has hardware RapidIO support and corresponding driver.

For more information, read the doc/README.rapidio documentation.

---
 common/Kconfig   |    7 +-
 common/Makefile  |    1 +
 common/cmd_rio.c |  260 +++++++++++++++++++++++++++++++++++++
 include/rio.h    |  382 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 649 insertions(+), 1 deletions(-)
 create mode 100644 common/cmd_rio.c
 create mode 100644 include/rio.h
common/Kconfig +6 -1
index 0388a6c..2a3dbd2 100644
@@ -355,8 +355,13 @@ config CMD_REMOTEPROC
 	depends on REMOTEPROC
 	help
 	  Support for Remote Processor control
-endmenu
 
+config CMD_RIO
+        bool "rapidio"
+        help
+          RapidIO support.
+
+endmenu
 
 menu "Shell scripting commands"
 
common/Makefile +1 -0
index d986cde..7380958 100644
@@ -195,6 +195,7 @@ obj-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 obj-$(CONFIG_CMD_SPL) += cmd_spl.o
 obj-$(CONFIG_CMD_ZIP) += cmd_zip.o
 obj-$(CONFIG_CMD_ZFS) += cmd_zfs.o
+obj-$(CONFIG_CMD_RIO) += cmd_rio.o
 
 # others
 obj-$(CONFIG_BOOTSTAGE) += bootstage.o
common/cmd_rio.c new file +260 -0

260 lines not on this page · raw message

include/rio.h new file +382 -0

382 lines not on this page · raw message

Signature · 1 line
1.6.2.1
#1 lore raw

PATCH 2/4 rapidio: add support for RapidIO boot

Quoted 5 lines · jacquiot.aurelien at gmail.com

From: Aurelien Jacquiot <[email protected]>

RapidIO is a high-performance packet-switched interconnect technology (www.rapidio.org) that can be used for messaging or memory transfers like Ethernet or PCIe.

[snip]

common/Kconfig config CMD_REMOTEPROC · line 362

Quoted 4 lines
common/Kconfig +4 -0
+config CMD_RIO
+        bool "rapidio"
+        help
+          RapidIO support.

Please expand this to include what is and is not supported in RapidIO right now with your patches.

[snip]

common/cmd_rio.c line 42

Quoted 9 lines
common/cmd_rio.c new file +9 -0
+	/* hostid */
+	if (argc >= 2) {
+		riohdid = simple_strtol(argv[2], NULL, 10);
+	} else {
+		s = getenv("riohdid");
+		if (s != NULL)
+			riohdid = simple_strtol(s, NULL, 10);
+		goto call_init;
+	}

Here and elsewhere, command inputs are in hex not decimal. 'sleep' is the one and only exception (and causes headaches) to this rule.

Quoted 28 lines
common/cmd_rio.c new file +28 -0
+	/* dev-id size */
+	if (argc >= 3) {
+		riosize = simple_strtol(argv[3], NULL, 10);
+	} else {
+		s = getenv("riosize");
+		if (s != NULL)
+			riosize = simple_strtol(s, NULL, 10);
+		goto call_init;
+	}
+
+	/* port bitmask */
+	if (argc >= 4) {
+		rioports = simple_strtoul(argv[4], NULL, 16);
+	} else {
+		s = getenv("rioports");
+		if (s != NULL)
+			rioports = simple_strtoul(s, NULL, 16);
+		goto call_init;
+	}
+
+	/* port path mode */
+	if (argc >= 5) {
+		riopmode = simple_strtol(argv[5], NULL, 10);
+	} else {
+		s = getenv("riopathmode");
+		if (s != NULL)
+			riopmode = simple_strtol(s, NULL, 10);
+		goto call_init;

common/cmd_rio.c line 81

Quoted 10 lines
common/cmd_rio.c new file +10 -0
+	}
+
+	/* baudrate */
+	if (argc >= 6) {
+		riobaudrate = simple_strtol(argv[6], NULL, 10);
+	} else {
+		s = getenv("riobaudrate");
+		if (s != NULL)
+			riobaudrate = simple_strtol(s, NULL, 10);
+	}

At first glance this seems broken for the case where one of riopathmode/riobaudrate/etc are neither passed nor in the environment. Or will rio_init handle this case correctly and pass back failure? Also, is there a usecase for having these be set in the environment rather than passed?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160104/ce932fb7/attachment.sig>