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 U-boot pin mux problem

Hi,

I'm working on a custom board based on Sitara AM335x,

I found errors on PIN MUX init for the AM335x EVM under U-boot. We start from AM335x PSP 04.06.00.09 and modify \u-boot-am33x\board\ti\am335x\mux.c to configure pin mux for our board.

U-boot configure I2C0 pins with internal pull-down resistor enabled:

#define PULLUP_EN    (0x1 << 4) /* Pull UP Selection */
#define PULLUDEN    (0x0 << 3) /* Pull up enabled */
#define PULLUDDIS    (0x1 << 3) /* Pull up disabled */

......

static struct module_pin_mux i2c0_pin_mux[] = {
    {OFFSET(i2c0_sda), (MODE(0) | RXACTIVE |
            PULLUDEN | SLEWCTRL)}, /* I2C_DATA */
    {OFFSET(i2c0_scl), (MODE(0) | RXACTIVE |
            PULLUDEN | SLEWCTRL)}, /* I2C_SCLK */
    {-1},
};

Externally we place 10K pull-up to VDDSHV6 (3.3V) so the result is a voltage divider to approximately 2.5V on the I2C lines

You can see the same behaviour on AM335x Starter Kit (TMDSSK3358) but the voltage drops to 2.9V, because of the 4.7K pull-ups on I2C lines

best regards

Matteo Geromin

  • Hi Matteo,
     
    Thanks for reporting this. The bug report has been forwarded to the factory team.
  • Hi Matteo,

    Thanks, I also noticed that the i2c0 pin-mux looks wrong in the TI SDK 6.0 u-boot (u-boot board/ti/am335x/mux.c).  I guess no one has fixed the u-boot git repo?  What pin mux setting did you decide on using for i2c0_pin_mux?

    I guess you noticed that the same issue (i2c0 mux) is present in the TI SDK 6.0 Linux 3.2 kernel source (linux board-am335xevm.c).  But it looks like it has been fixed in the latest Linux git repo (using the new device tree system):

    http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-evm.dts

    	i2c0_pins: pinmux_i2c0_pins {
    		pinctrl-single,pins = <
    			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
    			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
    		>;
    	};
    

     

    Cheers,

        John.

  • Hi John,

    I fix I2C mux settings with new defines, that for me seems more clear. I added these defines on top of mux.c file:

    /* Pull Up/Down Definitions
      00 -> Down En
      01 -> Disable
      10 -> Up En
      11 -> Disable
    */
    #define PULLUP_EN    (0x2 << 3)
    #define PULLDOWN_EN    (0x0 << 3)
    #define PULL_NONE    (0x3 << 3)

    So the resulting I2C0 mux seems like this:

    static struct module_pin_mux i2c0_pin_mux[] = {
        {OFFSET(i2c0_sda), (MODE(0) | RXACTIVE | PULLUP_EN | SLEWCTRL)}, /* I2C_DATA */
        {OFFSET(i2c0_scl), (MODE(0) | RXACTIVE | PULLUP_EN | SLEWCTRL)}, /* I2C_SCLK */
        {-1},
    };

     

    Bye

    Matteo

  • Thanks, I've used the same settings in u-boot and Linux.

    /debug/omap_mux # cat i2c0_scl
    name: i2c0_scl.i2c0_scl (0x44e1098c/0x98c = 0x0070), b NA, t NA
    mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP | AM33XX_SLEWCTRL_SLOW
    signals: i2c0_scl | NA | NA | NA | NA | NA | NA | gpio3_6
    /debug/omap_mux # cat i2c0_sda
    name: i2c0_sda.i2c0_sda (0x44e10988/0x988 = 0x0070), b NA, t NA
    mode: OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP | AM33XX_SLEWCTRL_SLOW
    signals: i2c0_sda | NA | NA | NA | NA | NA | NA | gpio3_5
    /debug/omap_mux #