How to configure pinmux?

Hi,

To configure PWM01 and GPIO35 as PWM
Here are the steps:

  • Modify the file "Jetson-AGX-Series-DevKit-Pinmux-Configuration-Template.xlsm"
  • Copy the generated dtsi files to the /Linux_for_Tegra/kernel/pinmux/t19x directory.
  • Use the pinmux-dts2cfg.py tool to convert the dtsi file to a cfg file. Here are the operational commands:
  • lion@lion:~/nvidia/xavier16G-jp4.2.3/JetPack_4.2.3_Linux_GA_P2888/Linux_for_Tegra/kernel/pinmux/t19x$ python pinmux-dts2cfg.py --pinmux --mandatory_pinmux_file mandatory_pinmux.txt addr_info.txt gpio_addr_info.txt por_val.txt tegra19x-jetson_agx_devkit-pinmux.dtsi tegra19x-jetson_agx_devkit-gpio-default.dtsi 1.0 > tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg
    

    But it will report an error.

    ERROR: pin dap1_sclk_ps0(0x00000440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
    ERROR: pin dap1_fs_ps3(0x00000440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
    ERROR: pin eqos_rd3_pf1(0x00022470) field nvidia,lpbk(0x00000020) is not matching, val = 0x01 expected = 0x00
    ERROR: pin eqos_sma_mdio_pf4(0x00022440) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin sdmmc4_cmd(0x00002440) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin soc_gpio10_pg6(0x00000410) field nvidia,tristate(0x00000010) is not matching, val = 0x01 expected = 0x00
    ERROR: pin soc_gpio13_ph1(0x00000411) field nvidia,tristate(0x00000010) is not matching, val = 0x01 expected = 0x00
    ERROR: pin gp_pwm2_px2(0x00000410) field nvidia,tristate(0x00000010) is not matching, val = 0x01 expected = 0x00
    ERROR: pin gp_pwm3_px3(0x00000410) field nvidia,tristate(0x00000010) is not matching, val = 0x01 expected = 0x00
    ERROR: pin uart2_tx_px4(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin uart2_rts_px6(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin uart5_tx_py5(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin uart5_rts_py7(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin uart3_tx_pcc5(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin soc_gpio22_pq2(0x00000459) field nvidia,pull(0x0000000c) is not matching, val = 0x02 expected = 0x00
    ERROR: pin uart1_tx_pr2(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    ERROR: pin dap4_sclk_pa4(0x0000c440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
    ERROR: pin dap4_fs_pa7(0x0000c440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
    ERROR: pin ufs0_ref_clk_pff0(0x00022420) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x01
    ERROR: pin ufs0_rst_pff1(0x00022420) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
    
    1. How to convert dtsi file to cfg file?
    2. How to use PWM for Xavier?

    Thanks.

    hello lk_xiang,

    1. may I have your confirmation that which JetPack release you’re working with?
      please check from release tag to check the software version, you may also refer to JetPack Archive, to check which JetPack release it was.
      for example,
    $ cat /etc/nv_tegra_release | head -1
    
    1. you may refer to below steps to configure PWM.
      thanks
    $ sudo -i
    # echo 0 > /sys/class/pwm/pwmchip0/export 
    # echo <value> > /sys/class/pwm/pwmchip0/pwm0/period
    

    hello JerryChang.

    JetPack release is R32.2.3

    nvidia@xavier:~$ cat /etc/nv_tegra_release | head -1
    # R32 (release), REVISION: 2.3, GCID: 17644089, BOARD: t186ref, EABI: aarch64, DATE: Tue Nov  5 21:48:17 UTC 2019
    

    Thanks.

    hello lk_xiang,

    please note that,
    that mandatory file is optional now and without using mandatory file we’re able to generate the cfg without any failures.
    for example,

    $ python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt tegra19x-jetson_agx_devkit-pinmux.dtsi tegra19x-jetson_agx_devkit-gpio-default.dtsi 1.0 > galen.cfg
    

    even several messages shown, that configuration files still generated.

    $ ll galen.cfg 
    -rw-rw-r-- 1 jerry jerry 30403 Dec 24 14:09 galen.cfg
    

    please refer to flashing messages to know which pinmux cfg you’re using.
    for example,

    ...
    copying pinmux_config($OUT/Linux_for_Tegra/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg)... done.
    

    you may overwrite the configure files, i.e. tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg
    then, perform a whole flash to update the board.
    thanks

    Thank you, JerryChang.

    I reflashed the BCT file.
    How to verify that PWM01 and GPIO35 are set to GP_PWM8 and GP_PWM5?

    hello lk_xiang,

    you may dump the register values for confirmation.
    please access Xavier Technical Reference Manual from download center.
    you should check the register and review its GPIO_SF_SEL values.
    thanks