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.

AM3351: Output pullup/pulldown resistor

Part Number: AM3351

We are using AM3351 based custom board.

In Am335x pinmux configuration we see output pullup option.

What is the purpose of output pullup. In what scenario output pullup needs to be enabled ? and in what scenario ouput pull-up shouldn't be enabled.

  • Pad pullup/pulldown resistors are typically used when the pin is configured as input. Where exactly did you see "output pullup"?
  • Sorry I forgot to mention that in Linux code we see that

    Actually it is available in

    include/dt-bindings/pinctrl/omap.h

    and it is being used in am335x-evm.dts and am335x-boneblack.dts. Boneblack DTS uses PIN_OUTPUT_PULLUP and PIN_OUTPUT_PULLDOWN.

  • Ankur,

    First make sure that omap.h PIN_OUTPUT_PULLUP value is not overwritten by am33xx.h PIN_OUTPUT_PULLUP value, where only pullup is set:

    linux-kernel/include/dt-bindings/pinctrl/omap.h #define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP)
    linux-kernel/include/dt-bindings/pinctrl/am33xx.h #define PIN_OUTPUT_PULLUP (PULL_UP)

    Regarding scenario usage, refer to the below pointers:

    processors.wiki.ti.com/index.php
    linux-kernel/Documentation/devicetree/bindings/soc/ti/wkup_m3_ipc.txt

    e2e.ti.com/.../1575375

    Regards,
    Pavel
  • Thank you for reply Pavel,

    I checked dts and dtsi files and it seems dt-bindings/pinctrl/am33xx.h gets included in our dts file however am335x.h includes omap.h So not sure who replaces what ? I assume defines in omap.h is overwritten by am335x.h

    So if in my case when I used PIN_OUTPUT_PULLUP, it just selects PULLUP but won't make pin output ? and won't even enable PULLUP ? Or by default PIN state is output ? Because PIN_OUTPUT also just disables the PULLUP.

    I went through the points you provided I think I understand however to make it clear I will write my understanding here.

    So OUTPUT pull up helps in situation where after returning from Deep sleep we need pinstate to be high unless it is pulled low by driving pin low.

    Is my understanding correct? Am I missing something ?

  • It depends on the specific pin you are using, as different pins has different default states. I would suggest you to check/read the pinmux registers value from user space with devmem2/omapconf tool, just you will be sure what is the final value.

    Regards,
    Pavel

  • Thank you for reply Pavel,

    we have ZCE type AM3351.

    I have following devicetree configuration

    reset_eMMC: reset_eMMC {
    		pinctrl-single,pins = <
    			0x07C (PIN_OUTPUT_PULLUP | MUX_MODE7 )   /* gpmc_csn0.gpio1_29, BGA W8 (ZCE) RST_eMMC */
    		>;
    	};
    
    
    	RESET_EMMC {
    		pinctrl-names = "default";
    		pinctrl-0 = <&reset_eMMC>;
    		compatible = "gpio-leds";
    
    		remmc {
    			label = "reset_eMMC";
    			gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
    			default-state = "on";
    		};
    	};

    When I read pinmux register I see following value

    # devmem2 0x44e1007c
    /dev/mem opened.
    Memory mapped at address 0xb6f64000.
    Value at address 0x44E1007C (0xb6f6407c): 0x0

    Now I don't know why 4th bit is 0. For 4th bit TRM says "0: Pulldown selected".

    I see pin being high from sysfs I don't know why pulldown is selected.

    GPIO_DATAOUT register also reads following value

    # devmem2 0x4804c13c
    /dev/mem opened.
    Memory mapped at address 0xb6f1c000.
    Value at address 0x4804C13C (0xb6f1c13c): 0x20000000

    Default state of the pin on reset is i.e. High-impedance with an active pullup resistor.

    Thanks,

    Regards,

    Ankur

  • Ankur,

    Ankur Tank said:
    reset_eMMC: reset_eMMC { pinctrl-single,pins = < 0x07C (PIN_OUTPUT_PULLUP | MUX_MODE7 ) /* gpmc_csn0.gpio1_29, BGA W8 (ZCE) RST_eMMC */ >; };

    What is this? Where you have found such pinmux format?

    In AM335x TI PSDK 4.02 (kernel 4.9.59) we have the below pinmux format used:

    linux-4.9.59/arch/arm/boot/dts/am335x-evm.dts

    &am33xx_pinmux {
        pinctrl-names = "default";
        pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0 &clkout2_pin>;

        matrix_keypad_s0: matrix_keypad_s0 {
            pinctrl-single,pins = <
                AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21 */
                .........

    >;
        };

    davinci_mdio_default: davinci_mdio_default {
            pinctrl-single,pins = <
                /* MDIO */
                AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)    /* mdio_data.mdio_data */
                AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0)            /* mdio_clk.mdio_clk */
            >;
        };

     

    Another example is AM335x StarterKit DTS file:

    linux-4.9.59/arch/arm/boot/dts/am335x-evmsk.dts

    wl12xx_gpio: pinmux_wl12xx_gpio {
            pinctrl-single,pins = <
                AM33XX_IOPAD(0x87c, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_csn0.gpio1_29 */
            >;
        };

     

    Regards,
    Pavel

     

  • Pavel,

    Device tree snippet I posted is from custom board which we have,

    That pinmux node is under &am33xx_pinmux  node, and actual RESET_EMMC node is under(root) node.

    I am trying to configuration eMMC reset line, To create that node, I was referring evm dts file.

    That's where questions about OUTPUT_PULLUP arose.

    Thanks,

    Regards,

    Ankur

  • Hi Pavel,

    I changed reset eMMC pin configuration to following

        reset_eMMC: reset_eMMC {
            pinctrl-single,pins = <
                0x07C (PIN_OUTPUT | MUX_MODE7)   /* gpmc_csn0.gpio1_29, BGA W8 (ZCE) RST_eMMC */
            >;
        };

    Previously I was reading wrong pinmux register,

    # devmem2 0x44E1087C
    /dev/mem opened.
    Memory mapped at address 0xb6f83000.
    Value at address 0x44E1087C (0xb6f8387c): 0xF

    Now PINMUX register value matches with pinmux configuration.

    I dumped PULLUP as we don't have deepsleep mode.

    Do you suggest to keep PULLUP?

    Thanks,

    Regards,

    Ankur

  • Ankur,

    Ankur Tank said:
    Do you suggest to keep PULLUP?

    If you need internal pullup on that output pin, then I suggest to keep PULLUP.

    Regards,
    Pavel