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.

AM335x Add serial ports to device tree

Other Parts Discussed in Thread: AM3356

Hi,


I want to use all serial ports in AM3356 chip in costume board developed by us. 


I know that we need to modify dts file and need to recompile it. But am bit unfamiliar with dts files . I found following in the device tree source files for am335xx chips.

uart0_pins: pinmux_uart0_pins {
            pinctrl-single,pins = <
                0x170 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart0_rxd.uart0_rxd */
                0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)        /* uart0_txd.uart0_txd */
            >;
        };
uart1_pins_default: pinmux_uart1_pins_default {
            pinctrl-single,pins = <
                0x178 (PIN_INPUT | MUX_MODE0)            /* uart1_ctsn.uart1_ctsn */
                0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart1_rtsn.uart1_rtsn */
                0x180 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
                0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)     /* uart1_txd.uart1_txd */
            >;
        };
I want to add pin mux details for UART2,UART3 and UART5.
What is 0x170,0x174 etc.. refereed in the above snippet .what will be this values for  UART2,UART3 and UART5.

Thanks and regards

Gokul CG [gokul.g@kalkitech.in]

  • Hi,

    You will need to add similar entries for the other UARTS.

    Gokul cg said:
    What is 0x170,0x174 etc.. refereed in the above snippet .what will be this values for  UART2,UART3 and UART5.

    These are the address offsets for the pad configuration registers. See Table 9-7 in the AM335X TRM Rev. K for correct addresses. Note that you will need to subtract 0x800 from the offset given in the table. You need to look for "conf_xxxxxxx" registers. Registers names (xxxxxxxx) come from the pin function in Mode 0.

  • Hi Gokul,

    Those values (0x170, 0x174, etc.) are the offsets of the pinmux registers for UART0 & UART1 pins.

    If you inspect closely the dts file, where pinmuxing is done you will see that UART1 structure is a sub-node of

     am33xx_pinmux: pinmux@44e10800 {

        ........

    Here 0x44e10800 is the base address of the pinmux conf_xxx registers, see Table 2-1. L3 Memory Map (search for Control Module) & Table 9-7. CONTROL_MODULE REGISTERS in AM3356 TRM.  You can see that the CONF_<MODULE_PIN> registers start at offset 0x800 => the base address for pinmux structure is 0x44E10800.

    Adding offset of 0x170 to 0x44E10800 gives the address of conf_uart0_txd register (pinmux register for UART0_TXD).

    So, for example, one option for UART2 would be:

    0x188 => uart2_ctsn  (conf_i2c0_sda register in Table 9-7 in TRM)

    0x18C => uart2_rtsn  (conf_i2c0_scl)

    0x12C => uart2_rxd   (conf_mii1_tx_clk)

    0x110 => uart2_txd   (conf_mii1_rx_er)

    NOTE that device pins can be mapped on more than one device pad. Based on your hw design you should search for the options in Table 4-1. Ball Characteristics (ZCE and ZCZ Packages) (continued) in AM3356 Data Manual & compare the  PIN NAME value against the corresponding register in Table 9-7. CONTROL_MODULE REGISTERS (continued) in AM335x TRM to determine the offset of the register you need to set.

    Hope this helps.

    Best Regards,

    Yordan

  • Hi,
    i'm also facing same issue can you provide me the exact document link please.