Part Number: SK-AM62P-LP
Tool/software:
Hi,
we are developing a linux BSP with kernel 6.6 and we trying to set some GPIO pins to output on Boot. We tried to set the pin state through bootloader device tree and through evm.c, but in every case it dosen't work.
which would be the proper way of doing that.
Bellow is shown the methods that we had used and didn't worked.
through evm.c
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index a3662fee913..ff0056cf92d 100644
--- a/board/ti/am62px/evm.c
+++ b/board/ti/am62px/evm.c
@@ -92,7 +92,9 @@ void spl_board_init(void)
int ft_board_setup(void *blob, struct bd_info *bd)
{
int ret = -1;
+
+ gpio_direction_output(119, 0);
+
if (IS_ENABLED(CONFIG_FDT_SIMPLEFB))
ret = fdt_simplefb_enable_and_mem_rsv(blob);
through bootloader device tree
diff --git a/arch/arm/dts/k3-am62p5-sk.dts b/arch/arm/dts/k3-am62p5-sk.dts
index 474a033d22a..256fa3f100d 100644
--- a/arch/arm/dts/k3-am62p5-sk.dts
+++ b/arch/arm/dts/k3-am62p5-sk.dts
@@ -177,6 +177,14 @@
&main_gpio0 {
bootph-all;
+
+ gpio_71: io_gpio71_out {
+ gpio-hog;
+ gpios = <71 GPIO_ACTIVE_HIGH>;
+ line-name = "MMC2_SDCD.GPIO0_71";
+ output-low;
+ };
+
};
&main_gpio1 {
@@ -354,8 +362,9 @@
wlan_en_pins_default: wlan-en-default-pins {
pinctrl-single,pins = <
- AM62PX_IOPAD(0x0124, PIN_INPUT, 7) /* (J25) MMC2_SDCD.GPIO0_71 */
+ AM62PX_IOPAD(0x0124, PIN_OUTPUT, 7) /* (J25) MMC2_SDCD.GPIO0_71 */
>;
+ bootph-all;
};
main_dpi_pins_default: main-dpi-default-pins {
@@ -520,6 +529,10 @@
};
};
+&gpio_71 {
+ bootph-all;
+};
+
&main_i2c2 {
status = "okay";
pinctrl-names = "default";
BR,