查看: 1087|回复: 1

[CodeWarrior] ls1046A的中断驱动没反应

[复制链接]
  • TA的每日心情

    2022-4-14 14:34
  • 签到天数: 1 天

    [LV.1]初来乍到

    3

    主题

    5

    帖子

    0

    注册会员

    Rank: 2

    积分
    104
    最后登录
    2023-8-14
    发表于 2022-4-14 14:24:58 | 显示全部楼层 |阅读模式
    本帖最后由 little2bird 于 2022-4-14 14:27 编辑

    我现在想使用中断IRQ09,已经在RCW中复用了相关引脚为IRQ09(IRQ_EXT——>000;IRQ_BASE——>0);
    设备树配置如下: 微信图片_20220414142536.png


    驱动:

    QQ截图20220414142555.png


    微信图片_20220414142542.png

    外部给这个引脚高电平没什么反应,可能是什么原因?



    最佳答案

    参照lx2160的步骤 做参考: The usage of external IRQ is same as other IP's irq, normally you need: 1) enable IRQ pin function in RCW, bit 402:410 2) Add interrupt related description in dts node 3) map ...
    啊啊啊
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2024-3-26 15:16
  • 签到天数: 266 天

    [LV.8]以坛为家I

    3298

    主题

    6545

    帖子

    0

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    32017
    最后登录
    2024-4-9
    发表于 2022-4-22 14:16:31 | 显示全部楼层
    参照lx2160的步骤 做参考:
    The usage of external IRQ is same as other IP's irq, normally you need:
    1) enable IRQ pin function in RCW, bit 402:410
    2) Add interrupt related description in dts node
    3) map hwirq to Linux irq
    4) request irq in device driver.

    For LX2ARDB, you can take 10G (DPMAC3) copper PHY interrupt as an example, the PHY of 10G Copper port (DPMAC3) connected with External IRQ3,
    1) RCW
    IRQ3 is enabled by default in RCW from LSDK

    2) dts.
    &emdio1 {
    aquantia_phy1: ethernet-phy@4 {
    interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
    reg = <0x4>;
    };

    Please be aware that the irq in dts is calculated as : irq = hwirq - 32. For this example, the PHY of 10G Copper port (DPMAC3) connected with External IRQ3,
    According to chapter <interrupt assignment > of LX2RM, the hwirq num of IRQ3 is 34, so in dts file it should be 34 - 32 = 2.

    3) map hwirq to Linux IRQ
    You can reference the following code to map hwirq to a Linux IRQ num : xgmac_mdio_probe->of_mdiobus_register->of_mdiobus_register_phy->fwnode_mdiobus_phy_device_register->fwnode_irq_get->of_irq_get

    4) request irq in driver
    void phy_request_interrupt(struct phy_device *phydev)
    {
    int err;

    err = request_threaded_irq(phydev->irq, NULL, phy_interrupt,
    IRQF_ONESHOT | IRQF_SHARED,
    phydev_name(phydev), phydev);
    ...
    }

    5) testing log
    # cat /porc/interrupt
    ...
    122: 6 0 0 0 GICv3 34 Level 0x0000000008b96000:04
    123: 6 0 0 0 GICv3 35 Level 0x0000000008b96000:05
    签到签到
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2024-4-24 20:57 , Processed in 0.147197 second(s), 23 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表