Hi,
we need to control MCU_GPIOs in Uboot but not able find the dts node in mcu.dtsi file
kindly advise on controlling MCU GPIOs in uboot
Regards,
Sushmitha K
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.
Hi,
we need to control MCU_GPIOs in Uboot but not able find the dts node in mcu.dtsi file
kindly advise on controlling MCU GPIOs in uboot
Regards,
Sushmitha K
Hi Sushmitha,
You can try adding the DT node from kernel.
mcu_gpio0: gpio@4201000 {
compatible = "ti,am64-gpio", "ti,keystone-gpio";
reg = <0x00 0x04201000 0x00 0x100>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&mcu_gpio_intr>;
interrupts = <30>, <31>;
interrupt-controller;
#interrupt-cells = <2>;
ti,ngpio = <24>;
ti,davinci-gpio-unbanked = <0>;
power-domains = <&k3_pds 79 TI_SCI_PD_EXCLUSIVE>;
clocks = <&k3_clks 79 0>;
clock-names = "gpio";
status = "okay";
};Hi Aparna,
Where should I add this node in uboot source ?
Regards,
Sushmitha K
Hi Sushmitha,
You can add this DT node in /ti-processor-sdk-linux-edgeai-am62axx-evm-09_00_01_03/board-support/u-boot-xx/arch/arm/dts/k3-am62a-mcu.dtsi
Regards,
Aparna
Hi Aparna,
Which is the compatible driver for "mcu_gpio_intr"
Regards,
Sushmitha K
Hi,
In U-boot source which is the compatible driver for "mcu_gpio_intr" ?
Regards,
Sushmitha K
Hi,
U-boot is a bootloader (serial execution), so there are no interrupts here.
Hence, no compatible driver.
One of the methods is to do raw register writes to control GPIOs from U-boot.
Can you give some details about your end goal? Will this method work for you?
Thanks,
Aparna
Hi,
I just want to make "MCU_GPIO0_12" high in uboot.
Can you provide an example for writing this to raw register
Regards,
Sushmitha K
Hi Sushmitha,
Sorry for delayed response!
Please follow the below steps to set a pin high, in this case MCU_GPIO0_12:
1) Find the instance in datasheet, to get more information on the pins it is associated with, in this case we got MCU_PADCONFIG12. We also have the PADCONFIG register address for the same.
2) Search for the PADCONFIG register address, and write to this PADCONFIG register the value that comes after setting appropriate bits, to enable the GPIO pin, that you want to use. 
3) Then you can proceed to the actual GPIO toggling part. Search for that GPIO, in the TRM GPIO chapter.
Additionally, you can use mw command to write registers from U-boot prompt.
Regards,
Aparna
Hi Aparna,
I have written the below registers for MCU_GPIO0_12. We have set the direction to output by writing to 12th bit of "0x04201010" register address. Then we made 12th bit High for "0x04201014" register address. Then we have probed and checked the voltage. But the volatage is not toggling.
md.l 0x04201010 1
mw.l 0x04201010 0xFFFFEFF7
md.l 0x04201010 1
md.l 0x04201014 1
mw.l 0x04201014 0x00001000
Regards,
Sushmitha K
Hi Sushmitha,
The register addresses and the values set looks correct.
Which pin are you probing to check for the voltage level?
Regards,
Aparna