测试方法 cat /sys/kernel/debug/gpio //查看gpio分组 gpiochip2: GPIOs 314-401, parent: platform/601000.gpio, 601000.gpio: gpio-330 ( |led1 ) out lo gpio-331 ( |led2 ) out lo gpio-332 ( |led3 ) out lo gpio-333 ( |led4 ) out lo gpio-336 ( |fixed-regulator-rgb ) out lo gpiochip1: GPIOs 402-488, parent: platform/600000.gpio, 600000.gpio: gpio-433 ( |net-5g-rst ) out lo ACTIVE LOW gpio-437 ( |phy_rstn ) out lo gpio-438 ( |id ) in hi gpio-440 ( |RT9186 ) out lo gpio-442 ( |phy_rstn ) out lo gpio-444 ( |heartbeat ) out lo gpio-473 ( |regulator-6 ) out lo gpiochip0: GPIOs 489-511, parent: platform/4201000.gpio, 4201000.gpio: 通过地址可知489-511的gpio为M核的 echo 496 > /sys/class/gpio/export 以mcu_gpio0_7为例,gpio号为489+7=496 echo out > /sys/class/gpio/gpio496/direction 设置输出 echo 0/1 > /sys/class/gpio/gpio496/value 设置电平高低 设备树修改见patch 需要MCU的gpio的节点去调用该引脚服用才可以控制 diff --git a/arch/arm64/boot/dts/ti/OK6254-C.dts b/arch/arm64/boot/dts/ti/OK6254-C.dts index cf9420ab0..730837b90 100644 --- a/arch/arm64/boot/dts/ti/OK6254-C.dts +++ b/arch/arm64/boot/dts/ti/OK6254-C.dts @@ -591,6 +591,12 @@ }; }; +&mcu_gpio0 { +pinctrl-names = "default"; +pinctrl-0 =<&mcu_gpio_led_pins_default>; +status = "okay"; +}; + &mcu_spi0 { pinctrl-names = "default"; pinctrl-0 = <&mcu_spi0_pins_default>; |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 17:28
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.