Categorization of pinmux


#1

Hi,

I’m referring one code related GPIO and it shows as folows:

+#if ENABLE_CUST_GPIO
+/* SPI0 /
+/
SPI0_MISO --> GPIO 17 */
+&spi5_default {

  • pinmux_gpio {
  •   function = "gpio";
    
  •   pins = "gpio17", "gpio18", "gpio19";
    
  • };
    +};
    +#endif /* ENABLE_CUST_GPIO */

+#if ENABLE_CUST_GPIO
+/* SPI1 /
+/
SPI1_MISO, SPI1_MOSI, SPI1_CS_N --> GPIO 8,9,10 /
+/
SPI1_CLK (gpio11) : no change */
+&spi3_default {

  • pinmux {
  •   function = "gpio";
    
  •   pins = "gpio8", "gpio9";
    
  • };
  • pinmux_cs {
  •   function = "gpio";
    
  •   pins = "gpio10";
    
  • };
    +};
    +#else
    &blsp_spi3 {
    status = “okay”;
    };
    +#endif

However I haven’t understood how to categorize

  • pinmux_gpio
  • pinmux_cs
  • pinmux
    (and more?)

Could you please let me know the guidline of pinmux_***?

regards,
Marty


#2

pinmux: multiplexes across different functions of pins (mutually exclusive)
pinconf: configure electrical pins characteristics.

You can find pins/pads and their functions/alternate-functions in the APQ8016 datasheet.
This is what is configured by the pinmux entries.

pinmux, pinmux_cs and pinmux_gpio all define pinmuxing, they have different names because a device tree node path must be unique (you can not have same node name a same level). I assume pinmux is for MISO, MOSI, SCLK pin muxing and pinmux_cs for ‘chip select’.


#3

Hi Loic,

Thank you for your prompt answer. I got it.

regards,
Marty