This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to reconcile pinmux.h values generated by pinmux tool with code in U-Boot?

Other Parts Discussed in Thread: AM3352

Hi All,

I have a pinmux.h file generated by one of the hardware guys.  In pinmux.h there's a big #define in the form of:

#define MUX_EVM() \

MUX_VAL(CONTROL_PADCONF_GPMC_AD0, (IEN | PD | MODE1 )) /* MMC1_DAT0_MUX2 */\

MUX_VAL(CONTROL_PADCONF_GPMC_AD1, (IEN | PD | MODE1 )) /* MMC1_DAT1_MUX2 */\

MUX_VAL(CONTROL_PADCONF_GPMC_AD2, (IEN | PD | MODE1 )) /* MMC1_DAT2_MUX2 */\

...

My new board uses the AM3352 Sitara CPU.  In U-Boot the above MUX_EVM macro seems to be called in setup_mux_conf_regs() in board/ti/evm/evm.c, called by arch/arm/cpu/armv7/omap3/board.c.  However this file does not seem to be relevant for the AM335X build (it uses arch/arm/cpu/armv7/am33xx/board.c, which makes no call to MUX_EVM).

Therefore, do we need to paste in the values from pinmux.h to board/ti/evm/evm.h?  It would seem they would have no effect as they're not compiled for the AM335X build.

Instead of using the pinmux.h macros, the AM335X U-Boot eval. code seems to configure pins using C code.  UART0 is configured with:

static struct module_pin_mux uart0_pin_mux[] = {
        {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},  /* UART0_RXD */
        {OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},              /* UART0_TXD */
        {-1},
};

in board/ti/am335x/mux.c.  So I am wondering do we need to apply the settings from pinmux.h to the above C structures?  The above C structure looks correct to me for configuring UART0.  However the UART0 definition from pinmux.h is:

MUX_VAL(CONTROL_PADCONF_UART0_RXD, (IEN | OFF | MODE0 )) /* UART0_RXD */\
MUX_VAL(CONTROL_PADCONF_UART0_TXD, (IEN | OFF | MODE0 )) /* UART0_TXD */\

This does not look correct, as why would you configure the transmit pin to be input enabled?

Thanks to anyone who can help clarify the above.

  • Sean:

    The pin mux utility does not generate u-boot source code directly, but example code.  Its main use is to identify a pin mux

    configuration that will bring out all the interfaces that are needed.  We do have good training for board porting here:

    https://docs.google.com/file/d/0BzESOSf028mLTjlPYmVJTUlTODA/edit?usp=drive_web

    The input enable defaults to IEN (InputEnabled) for Input and I/O signals and IDIS (Input disabled) for

    output signals - based on the signal that is selected in the row.  You can change the Input Enable bit in the tool

    by R clicking selected balls in the first column.  Input enable determines if the external signal gets enabled

    into the connectted module.

    MichaelT

  • Thanks for the response.

    With the file pinmux.h auto generated from the pinmux tool, why is the transmit pin setup with input enabled:

    MUX_VAL(CONTROL_PADCONF_UART0_RXD, (IEN | OFF | MODE0 )) /* UART0_RXD */\
    MUX_VAL(CONTROL_PADCONF_UART0_TXD, (IEN | OFF | MODE0 )) /* UART0_TXD */\

    Surely it should be setup as an output only?

    Also I tried loading our board's pinmux .dat file into the pinmux tool, but am getting a bunch of errors such as:

    INFO: At row 35 in GUI, Importing Mode 0 Name "GPMC_CSN3" for Mux Mode 1. "Reserved" in design file was changed to "Not Selected" to match current device model.
    INFO: At row 35 in GUI, Importing Mode 0 Name "GPMC_CSN3" for Mux Mode 2. "Reserved" in design file was changed to "Not Selected" to match current device model.
    INFO: At row 57 in GUI, Importing Mode 0 Name "LCD_VSYNC" for Mux Mode 2. "Reserved" in design file was changed to "Not Selected" to match current device model.
    INFO: At row 58 in GUI, Importing Mode 0 Name "LCD_HSYNC" for Mux Mode 2. "Reserved" in design file was changed to "Not Selected" to match current device model.
    Error: Ball with location string "2 ZCE E15 - ZCZ B15 - " with Mode 0 Name "PORZ" in design file was not found in the current device model.

    Any ideas why I am getting these errors?  The file can be read OK by my co-worker.  I am using version 2.5 and he is using version 2.4.1, could that be the problem?

  • Sean:

    You can ignore those errors.  If you scroll down in the release_notes.txt file (in Start menu) you will see discussion about that.

    In v2.5.2 we have support for AM335x Rev 1.x and 2.x.  AM335xA is 2.x.  In v2.5.2 we removed ball locations from the tool where there

    is not actual mode selection implemented - so if you import a file made with an earlier version of pin mux you will get those messages.

    The "ExampleDesign_AM335x_Rev_2.x_GP_EVM_Profile_0.dat" file has Input Enabled for uart0_txd for some reason.  You can change the setting

    in the tool.  Highlight the cell in the first column. R-Click and Edit Selected Pad Configs to change it.

    MichaelT

  • Thanks, I was able to find a previous version of pin mux and that opened the design file without errors.

    In the design the MMC1 data lines 0..7 are configured as IO IEN PD.  I assume PD means pull down?  If so, why would these lines be pull down when in the sample code in board/ti/am335x/mux.c for MMC1 they are configured pull up?  I would have expected a pull down in the pin mux tool to be configured as a pull down in the code too.

    static struct module_pin_mux mmc1_pin_mux[] = {
            {OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE | PULLUP_EN)},   /* MMC1_DAT3 */
            {OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE | PULLUP_EN)},   /* MMC1_DAT2 */
            {OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE | PULLUP_EN)},   /* MMC1_DAT1 */
            {OFFSET(gpmc_ad0), (MODE(1) | RXACTIVE | PULLUP_EN)},   /* MMC1_DAT0 */
            {OFFSET(gpmc_csn1), (MODE(2) | RXACTIVE | PULLUP_EN)},  /* MMC1_CLK */
            {OFFSET(gpmc_csn2), (MODE(2) | RXACTIVE | PULLUP_EN)},  /* MMC1_CMD */
            {OFFSET(gpmc_csn0), (MODE(7) | RXACTIVE | PULLUP_EN)},  /* MMC1_WP */
            {OFFSET(gpmc_advn_ale), (MODE(7) | RXACTIVE | PULLUP_EN)},      /* MMC1_CD */
            {-1},
    };

  • Sean:

    It depends if you are designing for AM335x Rev 1.0 or Rev 2.1 which is coming.  Pin Mux v2.5.2 includes additional pin mux features that were added for Rev 2.0.

    There are no pinmux changes in Rev 2.1.  Rev 2.1 is what will go to production.   The errors you reported are just informational messages.  You can ignore that

    and you should use v2.5.2.  The best reference for the pinmux settings (for the boards designed by TI) is the u-boot source code which is frrequently updated where as the example design in Pin Mux is fixed.

    MichaelT