嵌入式爱好者

6254 GPIOCHIP号不对的问题

2023-3-28 09:18| 发布者: ljb2019001| 查看: 299| 评论: 0

类目: AM6254系列产品  >  linux     文档编号: 959

现象如下,gpiochip1对应的gpio092个引脚,但是488-402=86,只有87个引脚

root@ok6254:~# cat /sys/kernel/debug/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  lo

 gpio-440 (                    |RT9186              ) out lo

 gpio-441 (                    |fixed-regulator-lvds) 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:

root@ok6254:~#

通过搜索打印信息定位代码,发现OK6254-linux-kernel/drivers/gpio/gpiolib.c中相关内容

seq_printf(s, "%s%s: GPIOs %d-%d", (char *)s->private,

                   dev_name(&gdev->dev),

                   gdev->base, gdev->base + gdev->ngpio - 1);

而这个ngpio是通过设备配置的,如下

main_gpio0: gpio@600000 {

compatible = "ti,am64-gpio", "ti,keystone-gpio";

reg = <0x0 0x00600000 0x0 0x100>;

gpio-controller;

#gpio-cells = <2>;

interrupt-parent = <&main_gpio_intr>;

interrupts = <190>, <191>, <192>,

     <193>, <194>, <195>;

interrupt-controller;

#interrupt-cells = <2>;

ti,ngpio = <87>;

ti,davinci-gpio-unbanked = <0>;

power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>;

clocks = <&k3_clks 77 0>;

clock-names = "gpio";

};

所以修改方法就是把ti,ngpio = <87>;修改为ti,ngpio = <92>;

同理其他两组gpio也是不对的


已解决

未解决

只是看看

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-12-22 18:16

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部