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.

LINUXSDK-OMAPL138: configure device tree file - OMAPl138-LCDK

Part Number: LINUXSDK-OMAPL138

Hi TI team,

Good wishes to you. I'm currently working on the DSP + ARM L138/C674x development board using the below-mentioned SDK guide.

https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/Foundational_Components.html

I want to configure a device tree to initialise some peripherals.

In the device tree, GPIOs are initialised by default. I want to set GPIO8_10 to low.

In the da850-lcdk.dts file, I have made the below changes:

&gpio {
status = "okay";
};

&gpio8 {
pinctrl-names = "default";
pinctrl-0 = <&gpio8_pins>;
status = "okay";
p10{
gpio-hog;
gpios = <10 GPIO_ACTIVE_LOW>;
output;
};

then I want to set pinmux also.

Please tell me how to set pinmux (pmx_core) in this dts file and how to mention those addresses, like,

&pmx_core {
status = "okay";

mcasp0_pins: pinmux_mcasp0_pins {
pinctrl-single,bits = <
/* AHCLKX AFSX ACLKX */
0x00 0x00101010 0x00f0f0f0
/* ARX13 ARX14 */
0x04 0x00000110 0x00000ff0
>;
};

And what are the changes I need to make?

Thanks in advance.

Regards,

Priyadharshini. 

  • Hi Bin Liu,

    Thanks for your response. I have already referenced the above thread. but I can't get it.

    They changed the following in the previous thread:

    Have I modified my arch/arm/mach-davinci/include/mach/mux.h to include

    DA850_GPIO0_9,
    DA850_GPIO2_12,
    DA850_GPIO6_12,

    In pinmux

    MUX_CFG(DA850, GPIO0_9, 0, 24, 15, 8, false) MUX_CFG(DA850, GPIO2_12, 5, 12, 15, 8, false) MUX_CFG(DA850, GPIO6_12, 13, 12, 15, 8, false)

    and I have also modified both arch/arm/mach-davinci/board-omapl138-hawk.c and arch/arm/mach-davinci/board-da850-evm.c to include

    	/* Configure the LED Pins D7, D6, D5, D4 for LCDK */
    	ret = davinci_cfg_reg(DA850_GPIO0_9);
    	if (ret)
    		pr_warn("%s:GPIO(0,9) mux setup failed\n", __func__);
    
    	ret = davinci_cfg_reg(DA850_GPIO2_12);
    	if (ret)
    		pr_warn("%s:GPIO(2,12) mux setup failed\n", __func__);
    
    	ret = davinci_cfg_reg(DA850_GPIO6_12);
    	if (ret)
    		pr_warn("%s:GPIO(6,12) mux setup failed\n", __func__);
    
    	ret = davinci_cfg_reg(DA850_GPIO6_13);
    	if (ret)
    		pr_warn("%s:GPIO(6,13) mux setup failed\n", __func__);			

    Did I need to modify it like that?

    And I have another doubt.

    gpio: gpio@226000

    And then in da850-lcdk.dts, it is enabled like:
    &gpio {
    status = "okay";
    };

    So you just need to figure out the pin number you want to use, pinmux it, and make sure it is not used in any other DTS node.

    In this answer, I can't get the correct way,

    In the device tree, they define total GPIOs with address gpio@226000 in the datasheet. Also, they give the address for GPIO as 0x01E2 6000 (base address) and 0x01E2 6FFF (end address) for 4K GPIO.

    in this stage.

    I want to configure GPIO8_10 to low.

    pin calculation

    (bank-1)*16+pin = ((8-1)*16)+10 = 122

    will I modify my device tree like

    &gpio {
    pinctrl-names = "default";
    status = "okay";
    p122{
    gpio-hog;
    gpios = <122 GPIO_ACTIVE_LOW>;
    output;
    };
    }

    is this correct?

    or

    will need to set all gpio banks like gpio0,gpio1 to gpio9

    then i have one more doubt in pinmux,

    pinctrl-single,bits = <
    /* AHCLKX AFSX ACLKX */
    0x00 0x00101010 0x00f0f0f0
    /* ARX13 ARX14 */
    0x04 0x00000110 0x00000ff0 

    how to mention those addresses.

    Thanks in advance.

    Regards,

    Priyadharshini

  • Hi Team,

      Please give me a response for above threat.

    Regards,

    Priyadharshini.