【发布时间】:2014-03-24 17:36:10
【问题描述】:
我为我的 custom_hardware 开发了一个工作驱动程序,它依赖于设备树。因为我的驱动程序可能会发展,所以我不希望我的驱动程序成为内核的一部分(当我说“成为内核的一部分”时,我的意思是在内核创建期间与内核一起编译)
这是我的 dts 的一瞥:
custom_hardware: custom_hardware@0x41006000 {
compatible = "mfg,custom";
reg = <0x41006000 0x1000>;
#interrupt-cells = <0x1>;
interrupt-controller;
};
existing_hardware: existing_hardward@41004000 {
compatible = "mfg,existing";
reg = <0x41004000 0x1000>;
interrupt-parent = <&custom_hardware>;
interrupts = <0>;
};
existing_hardware 的驱动程序已经用内核编译(existing_hardware 的驱动程序在内核创建期间已经用内核编译)。
我想做的是将我的 custom_hardware 的驱动程序附加到 ramfs 并让内核在 之前加载 custom_hardware 的驱动程序existing_hardware 的驱动程序。
这很重要,因为 existing_hardware 的驱动程序从 custom_hardware 的 irq_domain 请求 virq'的司机。为了获得 irq_domain,必须先加载 custom_hardware 的驱动程序。
请注意,existing_hardware 的驱动程序在探测设备树期间被加载,这似乎发生在内核启动序列的早期阶段。
【问题讨论】:
-
您似乎夸大了要求。 “我不希望我的驱动程序成为内核的一部分。” “在设备树探测之前(之前)加载内核模块。” 似乎唯一突出的要求是custom_hardware驱动需要在existing_hardware驱动之前安装,这可以在现有框架内完成。看到这个Q&A
标签: linux-kernel embedded device-tree