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.

[参考译文] Linux/AM5728:GPIO 读取错误

Guru**** 2618835 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/662365/linux-am5728-gpio-read-error

器件型号:AM5728

工具/软件:Linux

大家好、我们编写了驱动程序来操作 GPIO 输出或获取输入数据。 驱动程序代码的主要部分如下所示:

unsigned int reg_vir、gp2_vir、gp3_vir、value2、value3;

reg_vir =(unsigned int) ioremap_nocache (0x4a002000、8*1024);//8KB 映射 模块基址
_raW_writel (0xE、reg_vir + 0x151c);//gpio3_14 将填充配置为 GPIO
_raW_writel (0xE、reg_vir + 0x14e0);//GPIO2_31  将填充配置为 GPIO

gp2_vir =(unsigned int) ioremap_nocache (0x48055000、408);//映射 GPIO2
gp3_vir =(unsigned int) ioremap_nocache (0x48057000、408);//映射 GPIO3

//value2 =_raW_readl (GP2_vir + 0x134);//读取 GPIO_OE  
Value3 =__raW_readl (gp3_vir + 0x134);//读取 GPIO_OE

上述所有常量值均从 AM572x TRM 中输出。 GPIO3_14可以正常运行、但是如果我们取消注释 "value2 =__raW_readl (gp2_vir + 0x134);//读取 GPIO_OE "、我们 遇到了一些错误:

[52.398893]未处理的故障:异步外部中止(0x1211)、0x000000
[52.398896] PgD = ec65aac0
[52.398898]------ [在此处剪切]-----
[52.398910][000000000000]* PgD=ac4bd003、* PMD=f9df5003
[52.398917]内部错误:1211 [#1]抢占 SMP ARM
[52.399036]链接的模块:ti8168_GPIO (O) bc_example (O) rpmsg_PRU rpmsg_)
[52.399044] CPU:0 PID:1242 Comm:TEST_GPIO 被污染:G O 4.4.44
[52.399046]硬件名称:通用 DRA74X (平展器件树)
[52.39905]任务:ed71f400 ti:eccdc000 task.ti:eccdc000
[52.399062] PC 位于__COPY_TO_USER_STD+0xa8/0x3c4
[52.399071] LR 位于 ti81xx_GPIO_ioctl+0xac/0x13c [ti8168_GPIO]
[52.399077] PC:[ ] LR:[ ] PSR:00070013
[52.399077] sp:eccddecc ip:00000010 fp:eccdf14
[52.39908] R10:00000000 R9:eccdc000 R8:beea0b40
[52.399084] r7:0000013c R6:00000002 R5:ed76ef50 R4:beea0b40
[52.399087] r3:00000000 r2:fffffffff0 r1:eccddef8 r0:beea0b40
[52.399092]标志:模式 SVC_32 ISA ARM 段用户上 FIQ 上的 nzcv IRQ

上述错误似乎操作地址错误。我们多次检查地址、但没有发现问题。我们很想知道为什么 GPIO 组3上的相同操作正常、但 GPIO 组2上的相同操作失败。我们尝试在 GPIO 组1上执行相同操作、也失败了。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    驱动程序开发超出了此论坛的支持范围。 您应该检查此 GPIO 是否未被另一个 Linux 驱动程序使用。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    好的、谢谢 Biser。