首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >破译设备树

破译设备树
EN

Stack Overflow用户
提问于 2014-04-03 13:27:13
回答 1查看 467关注 0票数 0

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

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

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

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

现在开始提问:

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

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

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

( 4)对信号线(ta、rhold、rstrobe等)的解释。会有帮助的。

代码语言:javascript
复制
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>;
            };
        };
    };
EN

回答 1

Stack Overflow用户

发布于 2014-04-04 10:39:43

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

1/ reg = <0x21000a00 0x100>;正在通知,aemif实际上位于0x21000a00,有32个寄存器(0x100/4),因此单元地址必须是0x21000a00aemif@21000a00

2/同样,单元地址必须与reg属性匹配,在cs2中没有reg属性。

3/ reg = <0x2 0x0 0x8000000 0x6 0x0 0x100>; reg是指节点父节点的ranges属性。在这里,它可以解释为:从范围0x2,在偏移量0x30000000处(即0x30000000),大小0x8000000 -来自范围0x6,偏移量0x0,大小0x100。

4/你必须找一个具有"ti,davinci-cs“兼容字符串的驱动程序,我无法控制,因为它不是主题词。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22839226

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档