【问题标题】:Deciphering Device Tree解密设备树
【发布时间】:2014-04-03 13:27:13
【问题描述】:

这是我从嵌入式 Linux 内核上的设备树中提取的摘录。 这就是我现在的理解:

1)aemif接口位于物理地址0x30000000

2) aemif 驱动程序位于名为 davinci_aemif.c 的文件中,它使用名为 aemif 的时钟

3)aemif 上面有 2 个设备,一个是 cs2,另一个是 nand(我认为这个假设不正确)

现在回答问题:

1) reg = <0x21000a00 0x100>; 行在做什么?位于0x30000000aemif 如何拥有0x21000a00 的地址空间?

2) 为什么cs2 定义为cs2@30000000 而不是cs2@1,0

3) reg = <0x2 0x0 0x8000000 0x6 0x0 0x100>; 行在做什么?

4) 任何关于如何设置信号线(ta、rhold、rstrobe 等)的说明都会有所帮助。

aemif@30000000 {
        compatible = "ti,davinci-aemif";
        #address-cells = <0x2>;
        #size-cells = <0x1>;
        reg = <0x21000a00 0x100>;
        ranges = <0x2 0x0 0x30000000 0x8000000 0x3 0x0 0x34000000 0x4000000 0x4 0x0 0x38000000 0x4000000 0x5 0x0 0x3c000000 0x4000000 0x6 0x0 0x21000a00 0x100>;
        clocks = <0x11>;
        clock-names = "aemif";

        cs2@30000000 {
            compatible = "ti,davinci-cs";
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            ti,davinci-cs-ta = <0xc>;
            ti,davinci-cs-rhold = <0x6>;
            ti,davinci-cs-rstrobe = <0x17>;
            ti,davinci-cs-rsetup = <0x9>;
            ti,davinci-cs-whold = <0x8>;
            ti,davinci-cs-wstrobe = <0x17>;
            ti,davinci-cs-wsetup = <0x8>;
        };

        nand@2,0 {
            compatible = "ti,davinci-nand";
            reg = <0x2 0x0 0x8000000 0x6 0x0 0x100>;
            #address-cells = <0x1>;
            #size-cells = <0x1>;
            ti,davinci-chipselect = <0x0>;
            ti,davinci-mask-ale = <0x2000>;
            ti,davinci-mask-cle = <0x4000>;
            ti,davinci-mask-chipsel = <0x0>;
            ti,davinci-ecc-mode = "hw";
            ti,davinci-ecc-bits = <0x4>;
            ti,davinci-nand-use-bbt;
            ti,davinci-no-subpage-write;
            clocks = <0x11>;
            clock-names = "aemif";

            partition@0 {
                label = "u-boot";
                reg = <0x0 0x100000>;
                read-only;
            };

            partition@100000 {
                label = "params";
                reg = <0x100000 0x80000>;
                read-only;
            };

            partition@180000 {
                label = "ubifs";
                reg = <0x180000 0x1fe80000>;
            };
        };
    };

【问题讨论】:

    标签: linux linux-device-driver embedded-linux device-tree


    【解决方案1】:

    您的设备树显然是错误的。

    1/ reg = &lt;0x21000a00 0x100&gt;; 通知 aemif 实际上位于 0x21000a00 并且有 32 个寄存器 (0x100/4) 所以单元地址必须是 0x21000a00: aemif@21000a00

    2/ 再次,unit-address 必须匹配 reg 属性,您在 cs2 中没有 reg 属性..

    3/ reg = &lt;0x2 0x0 0x8000000 0x6 0x0 0x100&gt;; reg 引用节点父节点的范围属性。在这里,它可以解释为: - 从范围 0x2,偏移量 0x0(即 0x30000000),大小 0x8000000 - 从范围 0x6,偏移量 0x0,大小 0x100

    4/ 您必须查看具有“ti,davinci-cs”兼容字符串的驱动程序,因为它不是主线,所以我无能为力。

    【讨论】:

      猜你喜欢
      • 2013-02-21
      • 2013-12-29
      • 1970-01-01
      • 2015-12-13
      • 2015-10-25
      • 1970-01-01
      • 2015-07-19
      • 1970-01-01
      相关资源
      最近更新 更多