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.

Change pinmux for AM335x using device tree

Hi:

          I am using AM335x starter kit and SDK7.0, if i want to change pinmux, i need to modify the device tree, i am not sure which dts is i need to modify?? can anyone tell me?? 

  • Hi:

           My board is AM335x starter kit, so i need to modify am335x-evmsk.dts, am i right!? But i didn't see mmc1 definition inside, it is used to connect WLAN Module.

  • Hi Ivan,

    Yes, you have to change that dts file as per your requirement, it could be any change MMC1 or anything.

    Perhaps, MMC1 is muxed with some other peripheral so you have to disable that one if defined into that dts file and enable MMC1 for WLAN as you requested.

  • Hi:

               Because I saw AM335x starter kit schematic named"TMDSSK3358_3H0009_REV1_2B_SCH.pdf", mmc1_D0~mmc1_D3 are configured to connect to WLAN, but i didn't see the definition of them in the am335x-evmsk.dts....... So now i'm confused. 

  • Hi Ivan,

    I'm able to see the "MMC1"  pinmux settings in arch/arm/boot/dts/am335x-evmsk.dts of TI AM335x SDK7.0

    		mmc1_pins_default: pinmux_mmc1_pins {
    			pinctrl-single,pins = <
    				0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat3.mmc0_dat3 */
    				0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat2.mmc0_dat2 */
    				0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat1.mmc0_dat1 */
    				0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_dat0.mmc0_dat0 */
    				0x100 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_clk.mmc0_clk */
    				0x104 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mmc0_cmd.mmc0_cmd */
    				0x1A0 (PIN_INPUT_PULLUP | MUX_MODE7)	/* mcasp0_aclkr.gpio3_18 */
    				0x160 (PIN_INPUT | MUX_MODE7)		/* spi0_cs1.gpio0_6 */
    			>;
    		};
    

  • Yes, I know that, but they connect to SD Card module, not WLAN, you can see the comments said they are "mmc0_data0~mmc0_data4", but i want to know that where are the definition of "mmc1_data0~mm1_data3", because i saw schematic show that they connect to WLAN, but i can't find the definition of them. I show them as following picture.

  • Oops. Yes, you are right. I didn't notice that comment.

    Could you give me the link that where you downloaded the schematics of your TI EVM board.

    MMC1 pins were pinmuxed with GPMC_AD0 (available), GPMC_AD8 (used for LCD) and GMII1_TXCLK (used for ethernet)

    I'm also not able to see any MMC1 definitions on dts files.

    You can create new entry and try to use the following code for MMC1 pinmuxing.

    		mmc1_wlan_pins: pinmux_mmc1_wlan_pins {
    			pinctrl-single,pins = <
    				0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
    				0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
    				0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
    				0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
    				0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
    				0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
    >;
    };
  • Yes, But why the schematic show that connection(MMC1<->WLAN), they are not really connected, i'm afraid this would make other people misunderstand. The schematic link is http://processors.wiki.ti.com/images/a/a2/TMDSSK3358_3H0009_REV1_2B_SCH.pdf.

    Thank you for your code. I just want to confirm whether the definition of MMC1 is really existing, or in other files.

  • Hi Ivan,

    "dts" file is the only file for doing the platform initialization in SDK7

    Please refer to the following TI E2E post.

    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/269538/941708.aspx#941708

    According to the above link, TI AM335x SDK5.05 has the code support for WLAN.

    Also try to add the pinmux of MMC1 in AM335x SK's dts  file for WLAN  support and let us know the status.

  • Hi, OK, I'll try later. Because my requirement is connect MMC1 to eMMC(Custom board). I know the dts(am335x-bone-common.dtsi) have the definition of eMMC connection. I copy the definition directly from there to the am335x-evmsk.dts, delete some redefined pins (For Leds) and compile to generate dtb. Then put it into the /boot/ of filesystem. I boot the device and key cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins to check the status of those pins I modified. I found they don't save the value I gave in dts. What steps i missed??? the values of them are 0x27(Mode 7), they are should be Mode1...