aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mvebu/Kconfig9
-rw-r--r--cmd/mvebu/Makefile2
-rw-r--r--cmd/mvebu/bubt.c2
-rw-r--r--cmd/mvebu/rx_training.c57
4 files changed, 67 insertions, 3 deletions
diff --git a/cmd/mvebu/Kconfig b/cmd/mvebu/Kconfig
index ad10a572a3..f0e4f884d7 100644
--- a/cmd/mvebu/Kconfig
+++ b/cmd/mvebu/Kconfig
@@ -33,7 +33,7 @@ config MVEBU_SPI_BOOT
config MVEBU_MMC_BOOT
bool "eMMC flash boot"
- depends on MVEBU_MMC
+ depends on MVEBU_MMC || MMC_SDHCI_XENON
help
Enable boot from eMMC boot partition
Allow usage of eMMC/SD device as a target for "bubt" command
@@ -49,4 +49,11 @@ config MVEBU_UBOOT_DFLT_NAME
This option should contain a default file name to be used with
MVEBU "bubt" command if the source file name is omitted
+config CMD_MVEBU_RX_TRAINING
+ bool "rx_training"
+ depends on TARGET_MVEBU_ARMADA_8K
+ default n
+ help
+ Perform RX training sequence
+
endmenu
diff --git a/cmd/mvebu/Makefile b/cmd/mvebu/Makefile
index 96829c48eb..79299b0814 100644
--- a/cmd/mvebu/Makefile
+++ b/cmd/mvebu/Makefile
@@ -4,5 +4,5 @@
#
# https://spdx.org/licenses
-
obj-$(CONFIG_CMD_MVEBU_BUBT) += bubt.o
+obj-$(CONFIG_CMD_MVEBU_RX_TRAINING) += rx_training.o
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index b64996320c..5cd520e46b 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -798,7 +798,7 @@ struct bubt_dev *find_bubt_dev(char *dev_name)
#define DEFAULT_BUBT_DST "nand"
#elif defined(CONFIG_MVEBU_MMC_BOOT)
#define DEFAULT_BUBT_DST "mmc"
-else
+#else
#define DEFAULT_BUBT_DST "error"
#endif
#endif /* DEFAULT_BUBT_DST */
diff --git a/cmd/mvebu/rx_training.c b/cmd/mvebu/rx_training.c
new file mode 100644
index 0000000000..4bae7653ac
--- /dev/null
+++ b/cmd/mvebu/rx_training.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2017 Marvell International Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <command.h>
+#include <console.h>
+#include <dm.h>
+#include <fdtdec.h>
+#include <dm/device-internal.h>
+#include <mvebu/comphy.h>
+
+int rx_training_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ struct udevice *dev;
+ struct uclass *uc;
+ int ret, cp_index, comphy_index, i = 0;
+
+ if (argc != 3) {
+ printf("missing arguments\n");
+ return -1;
+ }
+
+ cp_index = simple_strtoul(argv[1], NULL, 16);
+ comphy_index = simple_strtoul(argv[2], NULL, 16);
+
+ ret = uclass_get(UCLASS_MISC, &uc);
+ if (ret) {
+ printf("Couldn't find UCLASS_MISC\n");
+ return ret;
+ }
+
+ uclass_foreach_dev(dev, uc) {
+ if (!(memcmp(dev->name, "comphy", 5))) {
+ if (i == cp_index) {
+ comphy_rx_training(dev, comphy_index);
+ return 0;
+ }
+
+ i++;
+ }
+ }
+
+ printf("Coudn't find comphy %d\n", cp_index);
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ rx_training, 3, 0, rx_training_cmd,
+ "rx_training <cp id> <comphy id>\n",
+ "\n\tRun RX training sequence, the user must state CP index (0/1) and comphy ID (0/5)"
+);