2014-04-03 67 views
0

這是我從我的嵌入式Linux內核的設備樹中抽取的摘錄。 這是我現在該怎麼理解:解密設備樹

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

2)aemif驅動程序位於一個名爲davinci_aemif.c,它使用一個時鐘稱爲aemif

3)aemif上有2臺設備,一個是cs2,另一個是nand(我不認爲這個假設是正確的)

現在的問題:

1)什麼是reg = <0x21000a00 0x100>;行?如何在位於0x30000000aemif的地址空間爲0x21000a00

2)爲什麼cs2定義[email protected]而不是[email protected],0

3)什麼是線reg = <0x2 0x0 0x8000000 0x6 0x0 0x100>;幹什麼?

4)如何設置信號線(ta,rhold,rstrobe等)的任何解釋都會有幫助。

[email protected] { 
     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"; 

     [email protected] { 
      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>; 
     }; 

     [email protected],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"; 

      [email protected] { 
       label = "u-boot"; 
       reg = <0x0 0x100000>; 
       read-only; 
      }; 

      [email protected] { 
       label = "params"; 
       reg = <0x100000 0x80000>; 
       read-only; 
      }; 

      [email protected] { 
       label = "ubifs"; 
       reg = <0x180000 0x1fe80000>; 
      }; 
     }; 
    }; 

回答

1

您的設備樹顯然是錯誤的。

1/reg = <0x21000a00 0x100>;是通知aemif實際上位於0x21000a00並且具有32個寄存器(0x100的/ 4),所以單元地址必須0x21000a00[email protected]

2 /再次,單元地址必須匹配reg屬性,您在cs2中沒有reg屬性。

3/reg = <0x2 0x0 0x8000000 0x6 0x0 0x100>; reg指節點父節點的ranges屬性。在這裏,可以把它理解爲: - 從0X2範圍內,在偏移爲0x0(這將是0x30000000),大小爲0x8000000 - 從範圍爲0x6,偏移爲0x0,大小爲0x100

4 /你必須看起來司機有「ti,davinci-cs」兼容的字符串,我不禁要幫忙,因爲它不是主要的。