这是我从嵌入式Linux内核的设备树中提取的一段摘录。这就是我现在的理解:
1)接口位于物理地址aemif
2)驱动程序位于名为davinci_aemif.c的文件中,它使用名为0x30000000的时钟
3)aemif上有两个设备,一个是aemif另一个是aemif(我认为这个假设不正确)
现在回答以下问题:
1)线路cs2在做什么?位于nandreg = <0x21000a00 0x100>;如何在aemif有地址空间?
2)为什么要定义0x30000000而不是0x21000a00
3)线路cs2在做什么?
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>;
            };
        };
    };

最佳答案

你的设备树显然是错的。
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,偏移量0x0(即0x30000000),大小0x8000000
-从范围0x6,偏移量0x0,大小0x100
4/你得找一个有“t I,davinci cs”兼容字符串的驱动程序,我没办法,因为它没有主线。

关于linux - 解密设备树,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22839226/

10-12 05:25