radxa-pkg / radxa-overlays

Additional device tree overlays to support different hardwares on Radxa products
GNU General Public License v2.0
43 stars 31 forks source link

修复编译时的一些报错 #335

Open RadxaYuntian opened 5 months ago

RadxaYuntian commented 5 months ago

有的设备树节点缺少了比如#clock-cells的定义,会在编译时警告。这个因为dts有对应定义,实际上使用是没有问题的,但我们之后会打算增强dts的检查,所以现在先把这些简单的问题修复了

RadxaYuntian commented 4 months ago

按照你的修改后编译还是一大堆新的警告

RadxaYuntian commented 4 months ago

比如/ports: graph node has single child node 'port@0', #address-cells/#size-cells are not necessary就应该把ports/port@0转换成单独的port结点:

https://patchwork.kernel.org/project/linux-arm-kernel/patch/20180508135930.5768-1-robh@kernel.org/

CodeChenL commented 4 months ago

比如/ports: graph node has single child node 'port@0', #address-cells/#size-cells are not necessary就应该把ports/port@0转换成单独的port结点:

https://patchwork.kernel.org/project/linux-arm-kernel/patch/20180508135930.5768-1-robh@kernel.org/

你是使用什么内核?

RadxaYuntian commented 4 months ago
diff --git a/arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dts b/arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dts
index 42cc5b8..40da825 100644
--- a/arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dts
+++ b/arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dts
@@ -39,12 +39,7 @@
                status = "okay";

                ports {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       port@0 {
-                               reg = <0>;
-
+                       port {
                                panel_in_dsi1: endpoint {
                                        remote-endpoint = <&dsi1_out_panel>;
                                };
@@ -58,11 +53,7 @@

                port@1 {
                        reg = <1>;
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       dsi1_out_panel: endpoint@0 {
-                               reg = <0>;
+                       dsi1_out_panel: endpoint {
                                remote-endpoint = <&panel_in_dsi1>;
                        };
                };
RadxaYuntian commented 4 months ago

我直接用我现在的arch内核运行make arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dtbo

RadxaYuntian commented 4 months ago

第一个结点的修改可能有点问题,我看看

CodeChenL commented 4 months ago

我这不会报错啊

[chen@ChenArchLinux 15:48]
[0 ~/Documents/GitHub/overlays]$ make arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dtbo
cpp -nostdinc -undef -x assembler-with-cpp -E -I "/lib/modules/6.9.7-zen1-1-zen/build/include" "arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dts" "arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dtbo.tmp"
dtc -q -@ -I dts -O dtb -o "arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dtbo" "arch/arm64/boot/dts/rockchip/overlays/rock-3a-radxa-5inch-touchscreen.dtbo.tmp"
[chen@ChenArchLinux 15:48]
[0 ~/Documents/GitHub/overlays]$ uname -a
Linux ChenArchLinux 6.9.7-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Fri, 28 Jun 2024 04:32:27 +0000 x86_64 GNU/Linux
[chen@ChenArchLinux 15:49]
[0 ~/Documents/GitHub/overlays]$
RadxaYuntian commented 4 months ago

第一个diff我修改了一下,另外你要pull一下你本地的代码,dtc的-q我之前删了

RadxaYuntian commented 4 months ago

可以反编译试一试这么改和有@0的是不是一样的结果