82
- 收藏
- 点赞
- 分享
- 举报
mcp251xfd内核驱动无法获取到spi->irq
内核版本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
请问如上问题是设备树写错了?还是哪里配置不对?
我来回答
回答0个
时间排序
认可量排序
暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2019-12-08 23:16:45
-
2024-11-13 15:35:25
-
2018-10-30 10:34:27
-
2013-07-26 23:39:25
-
2016-12-21 17:06:44
-
2020-02-24 11:02:20
-
2020-03-10 09:21:35
-
2023-06-29 09:55:50
-
2016-07-21 09:37:04
-
2019-01-07 16:42:38
-
2022-06-11 16:53:34
-
2016-04-20 11:39:24
-
2019-12-30 09:44:52
-
2019-12-30 09:31:50
-
2018-12-22 09:38:48
-
2019-08-02 10:41:04
-
2020-11-09 15:30:52
-
2015-04-09 17:22:05
-
2018-01-28 22:46:04
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
-
10求HI3519DV500_SDK_V2.0.1.1
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认