From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [Uboot-stm32] [PATCH v3 0/5] Add get_alt_function ops
Date: Tue, 11 Sep 2018 15:45:54 +0200 [thread overview]
Message-ID: <c8177223-c342-4821-af3d-f628dac39b73@xilinx.com> (raw)
In-Reply-To: <6044c24f-0f92-ee22-afb0-d4eee9c555d7@st.com>
On 11.9.2018 15:31, Patrice CHOTARD wrote:
> On 09/11/2018 02:17 PM, Michal Simek wrote:
>> On 11.9.2018 13:12, Patrice CHOTARD wrote:
>>> Hi,
>>>
>>> On 09/11/2018 12:24 PM, Michal Simek wrote:
>>>> Hi,
>>>>
>>>> On 11.9.2018 09:31, Patrice CHOTARD wrote:
>>>>> Hi Michal
>>>>>
>>>>> On 09/11/2018 07:51 AM, Michal Simek wrote:
>>>>>> On 10.9.2018 18:11, Patrice Chotard wrote:
>>>>>>>
>>>>>>> This series :
>>>>>>> - Add new gpio ops get_alt_function
>>>>>>> - Add get_function and get_alt_function support to stm32 gpio driver
>>>>>>> - Add get_alt_function test
>>>>>>
>>>>>>
>>>>>> I went quickly over this series and TBH I am not getting what this is
>>>>>> for. It looks like that this is the part of pinmux.
>>>>>>
>>>>>> Can you please elaborate more what this is for?
>>>>>
>>>>> Currently, get_function callback returns the state of a gpio
>>>>> (GPIOF_INPUT, GPIOF_OUTPUT or GPIO_FUNC).
>>>>>
>>>>> If a pin's state is GPIO_FUNC, it's useful to know which alternate
>>>>> function is selected for debug purpose.
>>>>>
>>>>> As example, on STM32 SoCs, a pins can be configured as GPIO or also
>>>>> configured with up to 16 alternate function. Using command "gpio", user
>>>>> can retrieve this information as shown below:
>>>>>
>>>>> STM32MP> gpio state -a
>>>>>
>>>>> Bank GPIOA:
>>>>> GPIOA0: unused: 0 [ ]
>>>>> GPIOA1: unused: 0 [ ]
>>>>> GPIOA2: unused: 0 [ ]
>>>>> GPIOA3: unused: 0 [ ]
>>>>> GPIOA4: unused: 0 [ ]
>>>>> GPIOA5: unused: 0 [ ]
>>>>> GPIOA6: unused: 0 [ ]
>>>>> GPIOA7: unused: 0 [ ]
>>>>> GPIOA8: func: 9
>>>>> GPIOA9: func: 10
>>>>> GPIOA10: unused: 0 [ ]
>>>>> GPIOA11: unused: 0 [ ]
>>>>> GPIOA12: unused: 0 [ ]
>>>>> GPIOA13: output: 1 [x] red.gpios
>>>>> GPIOA14: output: 0 [x] green.gpios
>>>>> GPIOA15: unused: 0 [ ]
>>>>>
>>>>> It shows that pin 8 and 9 of bank A are configured respectively in
>>>>> alternate function 9 and 10.
>>>>
>>>> Can you list that functionality? Isn't it something what should be shown
>>>> with a name instead of number?
>>>
>>> Listing this functionality is possible and printing name instead of
>>> number also, but for each pins, alternate function configuration is
>>> different and need to store all these informations into a table, which
>>> consumes a lot of memory.
>>>
>>>> I expect that user has to go to any decode table to find out what 9 or
>>>> 10 means.
>>>
>>> Yes, using the SoC's datasheet, user can find the corresponding
>>> alternate function description.
>>
>> Can you give some examples of that functionality or link to datasheet
>> and page?
>
> As example, regarding the pin 8 of bank A (GPIOA8 above), alternate
> function 9 means that pins is currently configured as SDMMC2_DATA4.
>
> For this pins, here are all the possible alternate function :
>
> alternate function description
>
> AF0 MCO0
> AF1 TIM1_CH1
> AF2
> AF3 TIM8_BKIN2
> AF4 I2C3_SCL
> AF5 SPI3_MOSI/SDO
> AF6
> AF7 USART1_CK
> AF8 SDMMC2 CKIN
> AF9 SDMMC2 DATA4
> AF10 USB_SOF
> AF11
> AF12 SAI4_SD_B
> AF13 UART7_RX
> AF14 LCD_R6
> AF15 EVENTOUT
ok that means that it is pin mux decoding and you want to use gpio
status command to show it. I would expect when you set a value for gpio
that nothing is going to change because it is not propagated to output pin.
I can do it for zynq/zynqmp device but I don't think this is something
what should be shown via gpio status command.
In my case there is even different address range which should be used to
get this value.
Anyway I think that it would be better to create regular pinctrl command
for this instead of trying to reuse gpio command for that but that's
just my opinion.
Thanks,
Michal
next prev parent reply other threads:[~2018-09-11 13:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 16:11 [U-Boot] [PATCH v3 0/5] Add get_alt_function ops Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 1/5] dm: gpio: " Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 2/5] gpio: stm32f7: Add ops get_function Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 3/5] gpio: stm32f7: Add ops get_alt_function Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 4/5] gpio: sandbox: Rename GPIOF_(OUTPUT|HIGH|ODR) to SANDBOX_GPIO_(OUTPUT|HIGH|ODR) Patrice Chotard
2018-09-10 16:11 ` [U-Boot] [PATCH v3 5/5] test: dm: Add gpio get_alt_function ops test Patrice Chotard
2018-09-11 5:51 ` [U-Boot] [PATCH v3 0/5] Add get_alt_function ops Michal Simek
2018-09-11 7:31 ` Patrice CHOTARD
2018-09-11 10:24 ` Michal Simek
2018-09-11 11:12 ` Patrice CHOTARD
2018-09-11 12:17 ` Michal Simek
2018-09-11 13:31 ` [U-Boot] [Uboot-stm32] " Patrice CHOTARD
2018-09-11 13:45 ` Michal Simek [this message]
2018-09-11 17:03 ` [U-Boot] " Stephen Warren
2018-09-12 7:09 ` Patrice CHOTARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8177223-c342-4821-af3d-f628dac39b73@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.