From 961ab07df65efd54a062960081b22d769b7699b2 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 5 May 2021 09:15:10 +0200 Subject: cmd: mvebu: Rename rx_training to mvebu_comphy_rx_training MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename the misleading cmd "rx_training" to "mvebu_comphy_rx_training" to avoid confusion and mixup with DDR3/4 training. This makes it clear, that this command is platform specific and handles the COMPHY RX training. Also depend this cmd on ARMADA_8K and not TARGET_MVEBU_ARMADA_8K to make is available for OcteonTX2 CN913x. Signed-off-by: Stefan Roese Cc: Pali Rohár Cc: Marek Behun Cc: Kostya Porotchkin Cc: Nadav Haklai Acked-by: Marek Behún Acked-by: Pali Rohár --- cmd/mvebu/Kconfig | 9 +++---- cmd/mvebu/Makefile | 2 +- cmd/mvebu/comphy_rx_training.c | 57 ++++++++++++++++++++++++++++++++++++++++++ cmd/mvebu/rx_training.c | 57 ------------------------------------------ 4 files changed, 62 insertions(+), 63 deletions(-) create mode 100644 cmd/mvebu/comphy_rx_training.c delete mode 100644 cmd/mvebu/rx_training.c (limited to 'cmd') diff --git a/cmd/mvebu/Kconfig b/cmd/mvebu/Kconfig index f0e4f884d7..7c42c75afb 100644 --- a/cmd/mvebu/Kconfig +++ b/cmd/mvebu/Kconfig @@ -49,11 +49,10 @@ 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 +config CMD_MVEBU_COMPHY_RX_TRAINING + bool "mvebu_comphy_rx_training" + depends on ARMADA_8K help - Perform RX training sequence + Perform COMPHY RX training sequence endmenu diff --git a/cmd/mvebu/Makefile b/cmd/mvebu/Makefile index 79299b0814..ca96ad01d9 100644 --- a/cmd/mvebu/Makefile +++ b/cmd/mvebu/Makefile @@ -5,4 +5,4 @@ # https://spdx.org/licenses obj-$(CONFIG_CMD_MVEBU_BUBT) += bubt.o -obj-$(CONFIG_CMD_MVEBU_RX_TRAINING) += rx_training.o +obj-$(CONFIG_CMD_MVEBU_COMPHY_RX_TRAINING) += comphy_rx_training.o diff --git a/cmd/mvebu/comphy_rx_training.c b/cmd/mvebu/comphy_rx_training.c new file mode 100644 index 0000000000..0798decfae --- /dev/null +++ b/cmd/mvebu/comphy_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 +#include +#include +#include +#include +#include +#include + +int mvebu_comphy_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( + mvebu_comphy_rx_training, 3, 0, mvebu_comphy_rx_training_cmd, + "mvebu_comphy_rx_training \n", + "\n\tRun COMPHY RX training sequence, the user must state CP index (0/1) and comphy ID (0/5)" +); diff --git a/cmd/mvebu/rx_training.c b/cmd/mvebu/rx_training.c deleted file mode 100644 index 4bae7653ac..0000000000 --- a/cmd/mvebu/rx_training.c +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2017 Marvell International Ltd. - * - * SPDX-License-Identifier: GPL-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include - -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 \n", - "\n\tRun RX training sequence, the user must state CP index (0/1) and comphy ID (0/5)" -); -- cgit v1.2.3