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.

AM3358: PINMUX configuration

Part Number: AM3358

Hi,

u-boot-2018.01/board/ti/am335x/mux.c

#define RXACTIVE (0x1 << 5)

#define PULLDOWN_EN (0x0 << 4) /* Pull Down Selection */

#define PULLUP_EN (0x1 << 4) /* Pull Up Selection */

#define PULLUDEN (0x0 << 3) /* Pull up enabled */

#define PULLUDDIS (0x1 << 3) /* Pull up disabled */

Why when pins configured as out put, there is no need to set PULLUP_EN?

For example below code about UART and GPIO.

static struct module_pin_mux gpio0_7_pin_mux[] = {
	{OFFSET(ecap0_in_pwm0_out), (MODE(7) | PULLUDEN)},	/* GPIO0_7 */
	{-1},
};

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},
};

  • Refer to 9.2.2.2 Pull Selection in TRM for recommended configuration.
    After POR, software must set the pad functional multiplexing and configuration registers to the
    desired values according to the requested device configuration.
    In your example, the gpio0_7 is used to control VTT regulator for DDR3 on AM335x SK board.
    The code snippet in "board/ti/am335x/board.c" is listed below:

    void sdram_init(void)
    {
    ...
    	if (board_is_evm_sk()) {
    		/*
    		 * EVM SK 1.2A and later use gpio0_7 to enable DDR3.
    		 * This is safe enough to do on older revs.
    		 */
    		gpio_request(GPIO_DDR_VTT_EN, "ddr_vtt_en");
    		gpio_direction_output(GPIO_DDR_VTT_EN, 1);
    	}
    ...
    }

  • Hi,

    Thanks!

    Why the pinmux configuration are different? There is no need to configure both PULLUDEN and PULLUP_EN ?

    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},
    };

  • As specified in Table 9-1. Pad Control Register Field Descriptions of the TRM.
    Comments in code snippet needs to be corrected as listed below:

    #define PULLUDEN	(0x0 << 3) /* Pull up enabled */	=>	/* pull up/down enable */
    #define PULLUDDIS	(0x1 << 3) /* Pull up disabled */	=>	/* pull up/down disable */

    There is no automatic gating control to ensure that internal weak pull-down/pull-up resistors on a pad are disconnected whenever the pad is configured as output. If a pad is always configured in output mode, it is recommended for user software to disable any internal pull resistor tied to it, to avoid unnecessary consumption.

    The internal pull-up/down resistors are only recommended for holding a valid logic state when the respective input buffer is associated with an unconnected package terminal.

    In general, internal weak pull-up/down enable/selection need to be configured according to specific pin usage in user's board/system design.
    Also considering each pin/ball default state/value out of POR as specified in the data sheet.