㈠ 如何設置uboot環境變數bootcmd
直接 setenv bootcmdtftp;
setenv 既可以增加變數,也可以修改,也可以刪除。
setenv bootcmdtftp 20008000,是修改和增加
setenv bootcmdtftp是刪除
㈡ 編譯linux內核設備樹文件使用什麼命令
Linux源碼的arch/powerpc/boot/dts/目錄下存放了很多dts文件,可以作為參考文件。另外dtc編譯器在內核專源碼2.6.25版本之後已經被屬包含進去。在2.6.26版本之後,生成blob的簡單規則已經加入makefile,如下命令:
$ make ARCH=powerpc canyonlands.dtb
也可以根據自己的硬體修改好dts文件後,用下面類似命令生成dtb文件。
$ dtc -f -I dts -O dtb -R 8 -S 0x3000 test.dts > mpc836x_mds.dtb
$ mkimage -A ppc -O Linux -T flat_dt -C none -a 0x300000 -e 0 -d mpc836x_mds.dtb mpc836x_mds.dtu
㈢ u-boot使用make編譯出現找不到dtc命令,如何解決啊
dtc是device-tree-compiler的縮寫,來即設備樹自編譯器,說明系統中沒有安裝這個編譯器,如多用的是apt-get install device-tree-compiler安裝後就可以成功編譯了。
㈣ 如何編譯高通kernal設備樹
DTS (device tree source)
.dts文件是一種ASCII 文本格式的Device
Tree描述,此文本格式非常人性化,適合人類的閱讀習慣。基本上,在ARM
Linux在,一個。dts文件對應一個ARM的machine,一般放置在內核的arch/arm/boot/dts/目錄。由於一個SoC可能對應多個machine(一個SoC可以對應多個產品和電路板),勢必這些。dts文件需包含許多共同的部分,Linux內核為了簡化,把SoC公用的部分或者多個machine共同的部分一般提煉為。dtsi,類似於C語言的頭文件。其他的machine對應的。dts就include這個。dtsi。譬如,對於VEXPRESS而言,vexpress-v2m.dtsi就被vexpress-v2p-ca9.dts所引用,
vexpress-v2p-ca9.dts有如下一行:
/include/
「vexpress-v2m.dtsi」
當然,和C語言的頭文件類似,。dtsi也可以include其他的。dtsi,譬如幾乎所有的ARM
SoC的。dtsi都引用了skeleton.dtsi。
.dts(或者其include的。dtsi)基本元素即為前文所述的結點和屬性:
[plain] view
plainprint?
/ {
node1 {
a-string-property = 「A string」;
a-string-list-property = 「first string」, 「second string」;
a-byte-data-property = [0x01 0x23 0x34 0x56];
child-node1 {
first-child-property;
second-child-property = <1>;
a-string-property = 「Hello, world」;
};
child-node2 {
};
};
node2 {
an-empty-property;
a-cell-property = <1 2 3 4>; /* each number (cell) is a uint32 */
child-node1 {
};
};
};
/ {
node1 {
a-string-property = 「A string」;
a-string-list-property = 「first string」, 「second string」;
a-byte-data-property = [0x01 0x23 0x34 0x56];
child-node1 {
first-child-property;
second-child-property = <1>;
a-string-property = 「Hello, world」;
};
child-node2 {
};
};
node2 {
an-empty-property;
a-cell-property = <1 2 3 4>; /* each number (cell) is a uint32 */
child-node1 {
};
};
};
上述。dts文件並沒有什麼真實的用途,但它基本表徵了一個Device
Tree源文件的結構:
1個root結點「/」;
root結點下面含一系列子結點,本例中為「node1」 和
「node2」;
結點「node1」下又含有一系列子結點,本例中為「child-node1」 和
「child-node2」;
各結點都有一系列屬性。這些屬性可能為空,如「
an-empty-property」;可能為字元串,如「a-string-property」;可能為字元串數組,如「a-string-list-property」;可能為Cells(由u32整數組成),如「second-child-property」,可能為二進制數,如「a-byte-data-property」。
下面以一個最簡單的machine為例來看如何寫一個。dts文件。假設此machine的配置如下:
1個雙核ARM
Cortex-A9 32位處理器;
ARM的local bus上的內存映射區域分布了2個串口(分別位於0x101F1000 和
0x101F2000)、GPIO控制器(位於0x101F3000)、SPI控制器(位於0x10170000)、中斷控制器(位於0x10140000)和一個external
bus橋;
External bus橋上又連接了SMC SMC91111
Ethernet(位於0x10100000)、I2C控制器(位於0x10160000)、64MB NOR
Flash(位於0x30000000);
External bus橋上連接的I2C控制器所對應的I2C匯流排上又連接了Maxim
DS1338實時鍾(I2C地址為0x58)。
其對應的。dts文件為:
[plain] view
plainprint?
/ {
compatible = 「acme,coyotes-revenge」;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = 「arm,cortex-a9」;
reg = <0>;
};
cpu@1 {
compatible = 「arm,cortex-a9」;
reg = <1>;
};
};
serial@101f0000 {
compatible = 「arm,pl011」;
reg = <0x101f0000 0x1000 >;
interrupts = < 1 0 >;
};
serial@101f2000 {
compatible = 「arm,pl011」;
reg = <0x101f2000 0x1000 >;
interrupts = < 2 0 >;
};
gpio@101f3000 {
compatible = 「arm,pl061」;
reg = <0x101f3000 0x1000
0x101f4000 0x0010>;
interrupts = < 3 0 >;
};
intc: interrupt-controller@10140000 {
compatible = 「arm,pl190」;
reg = <0x10140000 0x1000 >;
interrupt-controller;
#interrupt-cells = <2>;
};
spi@10115000 {
compatible = 「arm,pl022」;
reg = <0x10115000 0x1000 >;
interrupts = < 4 0 >;
};
external-bus {
#address-cells = <2>
#size-cells = <1>;
ranges = <0 0 0x10100000 0x10000 // Chipselect 1, Ethernet
1 0 0x10160000 0x10000 // Chipselect 2, i2c controller
2 0 0x30000000 0x1000000>; // Chipselect 3, NOR Flash
ethernet@0,0 {
compatible = 「smc,smc91c111」;
reg = <0 0 0x1000>;
interrupts = < 5 2 >;
};
i2c@1,0 {
compatible = 「acme,a1234-i2c-bus」;
#address-cells = <1>;
#size-cells = <0>;
reg = <1 0 0x1000>;
interrupts = < 6 2 >;
rtc@58 {
compatible = 「maxim,ds1338」;
reg = <58>;
interrupts = < 7 3 >;
};
};
flash@2,0 {
compatible = 「samsung,k8f1315ebm」, 「cfi-flash」;
reg = <2 0 0x4000000>;
};
};
};
/ {
compatible = 「acme,coyotes-revenge」;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = 「arm,cortex-a9」;
reg = <0>;
};
cpu@1 {
compatible = 「arm,cortex-a9」;
reg = <1>;
};
};
serial@101f0000 {
compatible = 「arm,pl011」;
reg = <0x101f0000 0x1000 >;
interrupts = < 1 0 >;
};
serial@101f2000 {
compatible = 「arm,pl011」;
reg = <0x101f2000 0x1000 >;
interrupts = < 2 0 >;
};
gpio@101f3000 {
compatible = 「arm,pl061」;
reg = <0x101f3000 0x1000
0x101f4000 0x0010>;
interrupts = < 3 0 >;
};
intc: interrupt-controller@10140000 {
compatible = 「arm,pl190」;
reg = <0x10140000 0x1000 >;
interrupt-controller;
#interrupt-cells = <2>;
};
spi@10115000 {
compatible = 「arm,pl022」;
reg = <0x10115000 0x1000 >;
interrupts = < 4 0 >;
};
external-bus {
#address-cells = <2>
#size-cells = <1>;
ranges = <0 0 0x10100000 0x10000 // Chipselect 1, Ethernet
1 0 0x10160000 0x10000 // Chipselect 2, i2c controller
2 0 0x30000000 0x1000000>; // Chipselect 3, NOR Flash
ethernet@0,0 {
compatible = 「smc,smc91c111」;
reg = <0 0 0x1000>;
interrupts = < 5 2 >;
};
i2c@1,0 {
compatible = 「acme,a1234-i2c-bus」;
#address-cells = <1>;
#size-cells = <0>;
reg = <1 0 0x1000>;
interrupts = < 6 2 >;
rtc@58 {
compatible = 「maxim,ds1338」;
reg = <58>;
interrupts = < 7 3 >;
};
};
flash@2,0 {
compatible = 「samsung,k8f1315ebm」, 「cfi-flash」;
reg = <2 0 0x4000000>;
};
};
};
上述。dts文件中,root結點「/」的compatible 屬性compatible =
「acme,coyotes-revenge」;定義了系統的名稱,它的組織形式為:<manufacturer>,<model>。Linux內核透過root結點「/」的compatible
屬性即可判斷它啟動的是什麼machine。
在。dts文件的每個設備,都有一個compatible
屬性,compatible屬性用戶驅動和設備的綁定。compatible
屬性是一個字元串的列表,列表中的第一個字元串表徵了結點代表的確切設備,形式為「<manufacturer>,<model>」,其後的字元串表徵可兼容的其他設備。可以說前面的是特指,後面的則涵蓋更廣的范圍。如在arch/arm/boot/dts/vexpress-v2m.dtsi中的Flash結點:
[plain] view
plainprint?
flash@0,00000000 {
compatible = 「arm,vexpress-flash」, 「cfi-flash」;
reg = <0 0x00000000 0x04000000>,
<1 0x00000000 0x04000000>;
bank-width = <4>;
};
flash@0,00000000 {
compatible = 「arm,vexpress-flash」, 「cfi-flash」;
reg = <0 0x00000000 0x04000000>,
<1 0x00000000 0x04000000>;
bank-width = <4>;
};
compatible屬性的第2個字元串「cfi-flash」明顯比第1個字元串「arm,vexpress-flash」涵蓋的范圍更廣。
再比如,Freescale
MPC8349 SoC含一個串口設備,它實現了國家半導體(National Semiconctor)的ns16550
寄存器介面。則MPC8349串口設備的compatible屬性為compatible = 「fsl,mpc8349-uart」,
「ns16550」。其中,fsl,mpc8349-uart指代了確切的設備, ns16550代表該設備與National Semiconctor
的16550
UART保持了寄存器兼容。
接下來root結點「/」的cpus子結點下面又包含2個cpu子結點,描述了此machine上的2個CPU,並且二者的compatible
屬性為「arm,cortex-a9」。
注意cpus和cpus的2個cpu子結點的命名,它們遵循的組織形式為:<name>[@<unit-address>],<>中的內容是必選項,[]中的則為可選項。name是一個ASCII字元串,用於描述結點對應的設備類型,如3com
Ethernet適配器對應的結點name宜為ethernet,而不是3com509。如果一個結點描述的設備有地址,則應該給出@unit-address。多個相同類型設備結點的name可以一樣,只要unit-address不同即可,如本例中含有cpu@0、cpu@1以及serial@101f0000與serial@101f2000這樣的同名結點。設備的unit-address地址也經常在其對應結點的reg屬性中給出。ePAPR標准給出了結點命名的規范。
㈤ 用win7刷入recoery cmd命令怎麼寫急!!!
在開機狀態下:裝好驅動,運行cmd,切到adb命令工具箱的目錄
adbrebootbootloader
以上命令會讓手機進入fastboot模式(有時可能一次進不了),進入fastboot模式後
fastbootdevives
這個是查看fastboot是否進入成功,有的話會顯示你的設備名稱
把recovery.img文件放到adb工具箱目錄,執行以下命令
fastbootflashrecoveryrecovery.img
刷入recovery到recovery分區。(一般只要幾秒,有兩個KO字樣表進成功)
刷完後,執行以下命令重啟
fastbootreboot
如果已經進入fastboot模式,可忽略第一個命令
以下介紹一些其他命令
adb reboot recovery 重啟到recovery模式,我手機重啟10次只有不到5次的成功率,不知道為什麼
adb reboot devices 查看設備,驅動正確情況下會出名一串英文,對應你的cpu型號
各機型可以手動進入各種模式,手動方式最穩定。由於按法不固定,所以在這不介紹
以下練字可以全部復制到txt,另存為bat執行,前提保證驅動安裝正確,recovery.img和adb工具箱和bat文件放同一個目錄
adb devices
adb reboot bootloader
fastboot flash recovery recovery.img && echo 寫入成功 || echo 寫入失敗,請檢查驅動是否正確或一條條執行
echo 按任意鍵重啟手機
pause>nul
fastboot reboot && echo 已重啟 || echo 重啟失敗
ping -n 3 127.1>nul
㈥ bootcmd=setenv bootlinux 'cp 200000 30800000 140000 是什麼意思。
這個是uboot裡面的東西吧。不過我覺得你貼出來的肯定有問題。
setenv 設置環境回變數
cp 就是拷貝, 地址跟硬答件相關, 不是從內存到flash,就是從flash 到 內存
200000 應該是內存地址
30800000 應該是flash地址
140000 是拷貝的長度
㈦ bootcmd怎麼設置從nfs啟動內核
-Boot環境變數的解釋說明
環 境 變 量
解 釋 說 明
bootdelay
定義執行自動啟動的等候秒數
baudrate
定義串口控制台的波特率
netmask
定義乙太網介面的掩碼
ethaddr
定義乙太網介面的MAC地址
bootfile
定義預設的下載文件
bootargs
定義傳遞給Linux內核的命令行參數
bootcmd
定義自動啟動時執行的幾條命令
serverip
定義tftp伺服器端的IP地址
ipaddr
定義本地的IP地址
stdin
定義標准輸入設備,一般是串口
stdout
定義標准輸出設備,一般是串口
stderr
定義標准出錯信息輸出設備,一般是串口
參考U-boot,其環境變數設置如下:
Uboot> printenv
bootdelay=3
baudrate=115200
ethaddr=00:12:34:56:78:9a
ipaddr=192.168.0.9 ①
serverip=192.168.0.1 ②
netmask=255.255.255.0
rootpath=/home/zht/rfsys ③
stdin=serial
stdout=serial
stderr=serial
bootcmd=tftp 21000000 uImage;bootm 21000000 ④
bootargs=root=/dev/nfs rw nfsroot=192.168.0.1:/home/zht/rfsys nfsaddrs=192.168.0.48: 192.168.0.1:192.168.0.1:255.255.255.0 console=ttyS0,115200 mem=32M ⑤
① 設置目標板IP地址
② 設置伺服器IP地址
③ 設置根文件系統在伺服器上的路徑,注意該路徑一定要設定為伺服器上的nfs目錄。
④ bootcmd是u-boot啟動後執行的命令,命令之間用分號分隔。
tftp 21000000 uImage 表示通過tftp 將內核映像下載到RAM中地址為0x21000000;
bootm 21000000 啟動linux操作系統
⑤ 定義u-boot傳送給linux內核的命令行參數,該命令行指定以網路文件系統作為根文件系統。
其中root=/dev/nfs,並非真的設備,而是一個告訴內核經由網路取得根文件系統的旗標。
參數nfsroot這個參數告訴內核以那一台機器,那個目錄以及那個網路文件系統選項作為根文件系統使用。參數的格式如下:
nfsroot=[:][,]
如果指令列上沒有給定 nfsroot 參數,則將使用『/tftpboot/%s』預設值。其它選項如下:
--指定網路文件系統服務端的互聯網地址(IP address)。如果沒有給定此欄位,則使用由 nfsaddrs 變數(見下面)所決定的值。此參數的用途之一是允許使用不同機器作為反向地址解析協議(RARP) 及網路文件系統服務端。通常你可以不管它(設為空白)。
-- 服務端上要作為根掛入的目錄名稱。如果字串中有個『%s』 符記(token),此符記將代換為客戶端互聯網地址之 ASCII 表示法。
-- 標準的網路文件系統選項。所有選項都以逗號分開。如果沒有給定此選項欄位則使用下列的預設值:
port = as given by server portmap daemon
rsize = 1024
wsize = 1024
timeo = 7
retrans = 3
acregmin = 3
acregmax = 60
acdirmin = 30
acdirmax = 60
flags = hard, nointr, noposix, cto, ac
參數nfsaddrs設定網路通訊所需的各種網路介面地址。如果沒有給定這個參數,則內核核會試著使用反向地址解析協議以及/或是啟動協議(BOOTP)以找出這些參數。其格式如下:
nfsaddrs=::::::
-- 客戶端的互聯網地址。如果沒設,此地址將由反向地址解析協議或啟動協議來決定。使用何種協議端視配置核心時打開的選項以及 參數而定。如果設定此參數,就不會使用反向地址解析協議或啟動協議。
-- 網路文件系統服務端之互聯網地址。如果使用反向地址解析協議來決定客戶端地址並且設定此參數,則只接受從指定之服務端傳來的回應。要使用不同的機器作為反向地址解析與網路文件系統服務端的話,在此指定你的反向地址解析協議服務端(保持空白)並在 nfsroot 參數(見上述)中指定你的網路文件系統服務端。如果此項目空白則使用回答反向地址解析協議或啟動協議之服務端的地址。
-- 網關(gateway)之互聯網地址,若服務端位於不同的子網路上時。如果此項目空白則不使用任何網關並假設服務端在本地的(local)網路上,除非由啟動協議接收到值。
-- 本地網路界面的網路掩碼。如果為空白,則網路掩碼由客戶端的互聯網地址導出,除非由啟動協議接收到值。
-- 客戶端的名稱。如果空白,則使用客戶端互聯網地址之 ASCII-標記法,或由啟動協議接收的值。
-- 要使用的網路設備名稱。如果為空白,所有設備都會用來發出反向地址解析請求,啟動協議請求由最先找到的設備發出。網路文件系統使用接收到反向地址解析協議或啟動協議回應的設備。如果你只有一個設備那你可以不管它。
-- 用以作為自動配置的方法。如果是 `rarp' 或是 `bootp' 則使用所指示的協議。如果此值為 `both' 或空白,若配置核心時有打開這兩種協議則都使用。 `none' 表示不使用自動配置。這種情況下你必須指定前述欄位中所有必要的值。
此 參數可以作為 nfsaddrs 的參數單獨使用(前面沒有任何 `:` 字元),這種情況下會使用自動配置。然而,此種情況不能使用 `none'作為值。
說明:這只是網上的一種說法,但是沒有啟動起來。因為我的kernel沒有cs8900網卡驅動,燒錄後可正常啟動,但無法掛載NFS,我在想是否可以通過命令行參數設置,來設置uboot給kernel傳遞的地址參數,這樣間接驅動nfs服務。我先前通過vivi這樣搞過,也是可行的。
現在可以這樣理解就是說,之前的kernel內核已經配置好了各個基本模塊的驅動,這樣就可以用了
㈧ 如何使用dtc編譯設備樹 devicetree
DTS (device tree source)
.dts文件是一種ASCII 文本格式的Device
Tree描述,此文本格式非常人性化,適合人類的閱讀習慣。基本上,在ARM
Linux在,一個.dts文件對應一個ARM的machine,一般放置在內核的arch/arm/boot/dts/目錄。由於一個SoC可能對應多個machine(一個SoC可以對應多個產品和電路板),勢必這些.dts文件需包含許多共同的部分,Linux內核為了簡化,把SoC公用的部分或者多個machine共同的部分一般提煉為.dtsi,類似於C語言的頭文件。其他的machine對應的.dts就include這個.dtsi。譬如,對於VEXPRESS而言,vexpress-v2m.dtsi就被vexpress-v2p-ca9.dts所引用,
vexpress-v2p-ca9.dts有如下一行:
/include/
"vexpress-v2m.dtsi"
當然,和C語言的頭文件類似,.dtsi也可以include其他的.dtsi,譬如幾乎所有的ARM
SoC的.dtsi都引用了skeleton.dtsi。
.dts(或者其include的.dtsi)基本元素即為前文所述的結點和屬性:
[plain] view
plainprint?
/ {
node1 {
a-string-property = "A string";
a-string-list-property = "first string", "second string";
a-byte-data-property = [0x01 0x23 0x34 0x56];
child-node1 {
first-child-property;
second-child-property = <1>;
a-string-property = "Hello, world";
};
child-node2 {
};
};
node2 {
an-empty-property;
a-cell-property = <1 2 3 4>; /* each number (cell) is a uint32 */
child-node1 {
};
};
};
/ {
node1 {
a-string-property = "A string";
a-string-list-property = "first string", "second string";
a-byte-data-property = [0x01 0x23 0x34 0x56];
child-node1 {
first-child-property;
second-child-property = <1>;
a-string-property = "Hello, world";
};
child-node2 {
};
};
node2 {
an-empty-property;
a-cell-property = <1 2 3 4>; /* each number (cell) is a uint32 */
child-node1 {
};
};
};
上述.dts文件並沒有什麼真實的用途,但它基本表徵了一個Device
Tree源文件的結構:
1個root結點"/";
root結點下面含一系列子結點,本例中為"node1" 和
"node2";
結點"node1"下又含有一系列子結點,本例中為"child-node1" 和
"child-node2";
各結點都有一系列屬性。這些屬性可能為空,如"
an-empty-property";可能為字元串,如"a-string-property";可能為字元串數組,如"a-string-list-property";可能為Cells(由u32整數組成),如"second-child-property",可能為二進制數,如"a-byte-data-property"。
下面以一個最簡單的machine為例來看如何寫一個.dts文件。假設此machine的配置如下:
1個雙核ARM
Cortex-A9 32位處理器;
ARM的local bus上的內存映射區域分布了2個串口(分別位於0x101F1000 和
0x101F2000)、GPIO控制器(位於0x101F3000)、SPI控制器(位於0x10170000)、中斷控制器(位於0x10140000)和一個external
bus橋;
External bus橋上又連接了SMC SMC91111
Ethernet(位於0x10100000)、I2C控制器(位於0x10160000)、64MB NOR
Flash(位於0x30000000);
External bus橋上連接的I2C控制器所對應的I2C匯流排上又連接了Maxim
DS1338實時鍾(I2C地址為0x58)。
其對應的.dts文件為:
[plain] view
plainprint?
/ {
compatible = "acme,coyotes-revenge";
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;
};
cpu@1 {
compatible = "arm,cortex-a9";
reg = <1>;
};
};serial@101f0000 {
compatible = "arm,pl011";
reg = <0x101f0000 0x1000 >;
interrupts = < 1 0 >;
};serial@101f2000 {
compatible = "arm,pl011";
reg = <0x101f2000 0x1000 >;
interrupts = < 2 0 >;
};gpio@101f3000 {
compatible = "arm,pl061";
reg = <0x101f3000 0x1000
0x101f4000 0x0010>;
interrupts = < 3 0 >;
};intc: interrupt-controller@10140000 {
compatible = "arm,pl190";
reg = <0x10140000 0x1000 >;
interrupt-controller;
#interrupt-cells = <2>;
};spi@10115000 {
compatible = "arm,pl022";
reg = <0x10115000 0x1000 >;
interrupts = < 4 0 >;
};external-bus {
#address-cells = <2>
#size-cells = <1>;
ranges = <0 0 0x10100000 0x10000 // Chipselect 1, Ethernet
1 0 0x10160000 0x10000 // Chipselect 2, i2c controller
2 0 0x30000000 0x1000000>; // Chipselect 3, NOR Flashethernet@0,0 {
compatible = "smc,smc91c111";
reg = <0 0 0x1000>;
interrupts = < 5 2 >;
};i2c@1,0 {
compatible = "acme,a1234-i2c-bus";
#address-cells = <1>;
#size-cells = <0>;
reg = <1 0 0x1000>;
interrupts = < 6 2 >;
rtc@58 {
compatible = "maxim,ds1338";
reg = <58>;
interrupts = < 7 3 >;
};
};flash@2,0 {
compatible = "samsung,k8f1315ebm", "cfi-flash";
reg = <2 0 0x4000000>;
};
};
};
/ {
compatible = "acme,coyotes-revenge";
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;
};
cpu@1 {
compatible = "arm,cortex-a9";
reg = <1>;
};
};
serial@101f0000 {
compatible = "arm,pl011";
reg = <0x101f0000 0x1000 >;
interrupts = < 1 0 >;
};
serial@101f2000 {
compatible = "arm,pl011";
reg = <0x101f2000 0x1000 >;
interrupts = < 2 0 >;
};
gpio@101f3000 {
compatible = "arm,pl061";
reg = <0x101f3000 0x1000
0x101f4000 0x0010>;
interrupts = < 3 0 >;
};
intc: interrupt-controller@10140000 {
compatible = "arm,pl190";
reg = <0x10140000 0x1000 >;
interrupt-controller;
#interrupt-cells = <2>;
};
spi@10115000 {
compatible = "arm,pl022";
reg = <0x10115000 0x1000 >;
interrupts = < 4 0 >;
};
external-bus {
#address-cells = <2>
#size-cells = <1>;
ranges = <0 0 0x10100000 0x10000 // Chipselect 1, Ethernet
1 0 0x10160000 0x10000 // Chipselect 2, i2c controller
2 0 0x30000000 0x1000000>; // Chipselect 3, NOR Flash
ethernet@0,0 {
compatible = "smc,smc91c111";
reg = <0 0 0x1000>;
interrupts = < 5 2 >;
};
i2c@1,0 {
compatible = "acme,a1234-i2c-bus";
#address-cells = <1>;
#size-cells = <0>;
reg = <1 0 0x1000>;
interrupts = < 6 2 >;
rtc@58 {
compatible = "maxim,ds1338";
reg = <58>;
interrupts = < 7 3 >;
};
};
flash@2,0 {
compatible = "samsung,k8f1315ebm", "cfi-flash";
reg = <2 0 0x4000000>;
};
};
};
上述.dts文件中,root結點"/"的compatible 屬性compatible =
"acme,coyotes-revenge";定義了系統的名稱,它的組織形式為:<manufacturer>,<model>。Linux內核透過root結點"/"的compatible
屬性即可判斷它啟動的是什麼machine。
在.dts文件的每個設備,都有一個compatible
屬性,compatible屬性用戶驅動和設備的綁定。compatible
屬性是一個字元串的列表,列表中的第一個字元串表徵了結點代表的確切設備,形式為"<manufacturer>,<model>",其後的字元串表徵可兼容的其他設備。可以說前面的是特指,後面的則涵蓋更廣的范圍。如在arch/arm/boot/dts/vexpress-v2m.dtsi中的Flash結點:
[plain] view
plainprint?
flash@0,00000000 {
compatible = "arm,vexpress-flash", "cfi-flash";
reg = <0 0x00000000 0x04000000>,
<1 0x00000000 0x04000000>;
bank-width = <4>;
};
flash@0,00000000 {
compatible = "arm,vexpress-flash", "cfi-flash";
reg = <0 0x00000000 0x04000000>,
<1 0x00000000 0x04000000>;
bank-width = <4>;
};
compatible屬性的第2個字元串"cfi-flash"明顯比第1個字元串"arm,vexpress-flash"涵蓋的范圍更廣。
再比如,Freescale
MPC8349 SoC含一個串口設備,它實現了國家半導體(National Semiconctor)的ns16550
寄存器介面。則MPC8349串口設備的compatible屬性為compatible = "fsl,mpc8349-uart",
"ns16550"。其中,fsl,mpc8349-uart指代了確切的設備, ns16550代表該設備與National Semiconctor
的16550
UART保持了寄存器兼容。
接下來root結點"/"的cpus子結點下面又包含2個cpu子結點,描述了此machine上的2個CPU,並且二者的compatible
屬性為"arm,cortex-a9"。
注意cpus和cpus的2個cpu子結點的命名,它們遵循的組織形式為:<name>[@<unit-address>],<>中的內容是必選項,[]中的則為可選項。name是一個ASCII字元串,用於描述結點對應的設備類型,如3com
Ethernet適配器對應的結點name宜為ethernet,而不是3com509。如果一個結點描述的設備有地址,則應該給出@unit-address。多個相同類型設備結點的name可以一樣,只要unit-address不同即可,如本例中含有cpu@0、cpu@1以及serial@101f0000與serial@101f2000這樣的同名結點。設備的unit-address地址也經常在其對應結點的reg屬性中給出。ePAPR標准給出了結點命名的規范。
㈨ uboot中的bootcmd 命令中的movi read是什麼意思
就是從sd/mmc里讀數據到內存里。比如
bootcmd=movi read kernel 30008000;
就是從sd/mmc讀偏移量為kernel的地方版讀權數據到內存30008000中去。
movi read rootfs 30B00000 300000;
同樣是從sd/mmc讀偏移量為 rootfs的地方讀數據到內存30B00000中去。
後面300000是讀數據的多少。
㈩ linux 設備樹 需要更新uboot嗎
一般不需要,但是如果修改過設備樹中跟啟動有關的信息,那就需要修改uboot的
環境變數