[U-Boot] [PATCH v1 2/5] cmd: pinmux: Add pinmux command
Michal Simek
michal.simek at xilinx.com
Thu Sep 20 13:53:40 UTC 2018
Hi,
On 20.9.2018 15:37, Patrice Chotard wrote:
> pinmux command allows to :
> - list all pin-controllers available on platforms
> - select a pin-controller
> - display the muxing of all pins of the current pin-controller
> or all pin-controllers depending of given options
>
> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
> ---
>
> cmd/Kconfig | 8 +++++
> cmd/Makefile | 3 ++
> cmd/pinmux.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 126 insertions(+)
> create mode 100644 cmd/pinmux.c
>
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index 13d4c991bf8b..2c687ceecf49 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -937,6 +937,14 @@ config CMD_PCMCIA
> about 1990. These devices are typically removable memory or network
> cards using a standard 68-pin connector.
>
> +config CMD_PINMUX
> + bool "pinmux - show pins muxing"
> + depends on PINCTRL
> + help
> + Parse all available pin-controllers and show pins muxing. This
> + is useful for debug purpoer to check the pin muxing and to know if
> + a pin is configured as a GPIO or as an alternate function.
> +
> config CMD_READ
> bool "read - Read binary data from a partition"
> help
> diff --git a/cmd/Makefile b/cmd/Makefile
> index 3487c80455c4..9e899c44bdef 100644
> --- a/cmd/Makefile
> +++ b/cmd/Makefile
> @@ -101,6 +101,9 @@ ifdef CONFIG_PCI
> obj-$(CONFIG_CMD_PCI) += pci.o
> endif
> obj-y += pcmcia.o
> +ifdef CONFIG_PINCTRL
> +obj-$(CONFIG_CMD_PINMUX) += pinmux.o
> +endif
you have dependency already setup in Kconfig that's why no reason to
have it here again.
> obj-$(CONFIG_CMD_PXE) += pxe.o
> obj-$(CONFIG_CMD_WOL) += wol.o
> obj-$(CONFIG_CMD_QFW) += qfw.o
> diff --git a/cmd/pinmux.c b/cmd/pinmux.c
> new file mode 100644
> index 000000000000..1442d6ef63d2
> --- /dev/null
> +++ b/cmd/pinmux.c
> @@ -0,0 +1,115 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
> + */
> +
> +#include <command.h>
> +#include <dm.h>
> +#include <errno.h>
> +#include <dm/pinctrl.h>
> +#include <dm/uclass-internal.h>
> +
> +#ifdef CONFIG_PINCTRL
and here again.
The rest looks quite standard from quick look.
Thanks,
Michal
More information about the U-Boot
mailing list