[U-Boot] [Uboot-stm32] [PATCH v1 2/5] cmd: pinmux: Add pinmux command

Patrice CHOTARD patrice.chotard at st.com
Thu Sep 20 15:34:20 UTC 2018


Hi Michal

On 09/20/2018 03:53 PM, Michal Simek wrote:
> 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.

Yes, i will remove it

> 
>>  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.

ok

Thanks

Patrice

> 
> The rest looks quite standard from quick look.
> 
> Thanks,
> Michal
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32 at st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
> 


More information about the U-Boot mailing list