simon
易百纳技术社区
易百纳技术社区
0 访问量
0 原创专栏
0 资料
0 粉丝
个性签名:此E友还没有留下个性签名哦~
加入易百纳时间:2024-11-06

个人成就

易百纳技术社区 共获得 0 个点赞
易百纳技术社区 共获得 0 个收藏
易百纳技术社区 共获得 0 次评论/回复

个人勋章

分类专栏

Ta擅长的领域

暂无
  • 内核版本5.10,芯片Hi3519DV500,系统spi3.1挂载一个mcp2518fd芯片(linux-5.10\drivers\net\can\spi\mcp251xfd)。设备树修改如下:open_source/linux/linux-5.10.y/arch/arm64/boot/dts/vendor/hi3519dv500-demb.dts ... ... &spi_bus3{ status = "okay"; // #address-cells = <1>; // #size-cells = <0>; spidev@0 { compatible = "rohm,dh2228fv"; reg = <0>; pl022,interface = <0>; pl022,com-mode = <0>; spi-max-frequency = <25000000>; }; // spidev@1 { // compatible = "rohm,dh2228fv"; // reg = <1>; // pl022,interface = <0>; // pl022,com-mode = <0>; // spi-max-frequency = <25000000>; // }; can1:can@1 { status = "okay"; compatible = "microchip,mcp2518fd"; // compatible = "rohm,dh2228fv"; clocks = <&can1_clk>; reg = <1>; // pl022,interface = <0>; // pl022,com-mode = <0>; spi-cpol; // CPOL = 1 spi-cpha; // CPHA = 1 spi-max-frequency = <20000000>; rx-int-gpio = <&gpio_chip5 3 GPIO_ACTIVE_HIGH>; interrupt-parent = <&gpio_chip5>; interrupts= <3 IRQ_TYPE_LEVEL_LOW>; }; }; &gpio_chip0 { status = "okay"; }; &gpio_chip1 { status = "okay"; }; &gpio_chip2 { status = "okay"; }; &gpio_chip3 { status = "okay"; }; &gpio_chip4 { status = "okay"; }; &gpio_chip5 { status = "okay"; interrupt-controller; }; ... ... open_source/linux/linux-5.10.y/arch/arm64/boot/dts/vendor/hi3519dv500.dtsi soc { #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; device_type = "soc"; ranges = <0x0 0x00000000 0x0 0xffffffff>; clk_3m: clk_3m { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <3000000>; }; can0_clk: can0_clk { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <40000000>; }; can1_clk: can1_clk { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <40000000>; }; ... ... 内核配置: CONFIG_CAN=y CONFIG_CAN_RAW=y CONFIG_CAN_BCM=y CONFIG_CAN_GW=y CONFIG_CAN_DEV=y CONFIG_CAN_CALC_BITTIMING=y CONFIG_CAN_MCP251XFD=m CONFIG_CAN_MCP251XFD_SANITY=y 编译模块进行加载后,报错 : No IRQ specified (maybe node “interrupts-extended” in DT missing)! static int mcp251xfd_probe(struct spi_device *spi) { const void *match; struct net_device *ndev; struct mcp251xfd_priv *priv; struct gpio_desc *rx_int; struct regulator *reg_vdd, *reg_xceiver; struct clk *clk; u32 freq; int err; if (!spi->irq) return dev_err_probe(&spi->dev, -ENXIO, "No IRQ specified (maybe node \"interrupts-extended\" in DT missing)!\n"); rx_int = devm_gpiod_get_optional(&spi->dev, "rx-int-gpio", GPIOD_IN); if (PTR_ERR(rx_int) == -EPROBE_DEFER) return -EPROBE_DEFER; else if (IS_ERR(rx_int)) return PTR_ERR(rx_int); ... ... 内核spi.c文件中添加相关的调试信息: of_irq_get print , of_irq_parse_one -75 spi_drv_probe test print spi->irq -75 spi_drv_probe test print spi->irq 0 根据手册《外围设备驱动操作指南》关闭内核中gpio5,使用gpio_request驱动中无法获取gpio相关资源所以目前设备树中gpio5配置状态是okay 请问如上问题是设备树写错了?还是哪里配置不对?
    2024-11-06
    0 0 320
易百纳技术社区
共1条
易百纳技术社区