openWRT的DTS檔案配置--MT7620A
原文地址:http://blog.chinaunix.net/uid-29616823-id-4390033.html
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
接上xx路由器的串列埠後有輸出但無法輸入,用示波器量下訊號-----可能是uboot裡面把RX引腳給配置了。
1.屬性的定義採用property = value的形式,“”字串、<>32或64位值、[]二進位制[0x01 0x02]
2.用=賦值的才是節點屬性,其他是子節點。
3.root節點的compitable屬性供核心選擇匹配機器碼machinetype,其他節點的compitable屬性供核心選擇匹配對應的驅動
(如三星2416的lcd控制器節點,核心裡面lcd的驅動有很多)
4.DTB檔案頭boot_paras_header,其中的magic欄位用來標誌Uboot傳來的啟動引數是DTB還是taglist(bootargs)
,xx_offset標誌DTB在記憶體中的地址。
compatible:相容的,相容的
/ {---------------------"/"表示根節點的名稱,一個裝置樹只能有一個根節點多個檔案中的根節點在編譯時會被合併。
#address-cells = <1>;---------------表示地址空間的個數,如系統有兩片記憶體,那就需要<a b c d>兩組資料來表示,ab表示記憶體1的空間 cd表示記憶體2空間。
#size-cells = <1>;------------------表示地址空間所需位元組數,如表示64位的GPIO控制暫存器組就需要<0x00000001 0x000000002 0x00000001 0x000000006
表示的空間是0x00000001000000002到00000001000000006
compatible = "ralink,mtk7620a-soc";----“compatible”屬性表示CPU所述系列,如mips架構ralink,mtk7620a系列
、arm架構stm32,cortex-M3系列。
cpus {
[email protected] {---------節點名稱@節點暫存器偏移地址或節點裝置編號,若該節點無reg屬性則不寫定義成空節點即可。
compatible = "mips,mips24KEc";
};
};
chosen {
bootargs = "console=ttyS0,57600";-----通過dts給核心傳遞uboot的bootargs引數,uboot省事了
};
cpuintc:
為了方便引用[email protected]。
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
compatible = "mti,cpu-interrupt-controller";
};
[email protected] {------palmbus類似arm的AMBA,屬於片內匯流排。
compatible = "palmbus";
reg = <0x10000000 0x200000>;---reg屬性表示該控制器的reg地址及總長度
ranges = <0x0 0x10000000 0x1FFFFF>;
#address-cells = <1>;----若節點的子節點有控制暫存器,則必須定義這兩個屬性。
#size-cells = <1>;
compatible = "ralink,mt7620a-sysc", "ralink,rt3050-sysc";
reg = <0x0 0x100>;
};
[email protected] {
compatible = "ralink,mt7620a-timer", "ralink,rt2880-timer";
reg = <0x100 0x20>;
interrupt-parent = <&intc>;
interrupts = <1>;
};
[email protected] {
compatible = "ralink,mt7620a-wdt", "ralink,rt2880-wdt";
reg = <0x120 0x10>;
resets = <&rstctrl 8>;
reset-names = "wdt";
interrupt-parent = <&intc>;
interrupts = <1>;
};
intc: [email protected] {-----intc為標籤(為方便被其他節點引用)
compatible = "ralink,mt7620a-intc", "ralink,rt2880-intc";
reg = <0x200 0x100>;
resets = <&rstctrl 19>;
reset-names = "intc";
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&cpuintc>;--------引用節點cpuintc
interrupts = <2>;
};
[email protected] {----------描述系統記憶體的節點,為根節點的子節點
compatible = "ralink,mt7620a-memc", "ralink,rt3050-memc";
reg = <0x300 0x100>;
resets = <&rstctrl 20>;
reset-names = "mc";
interrupt-parent = <&intc>;
interrupts = <3>;
};
gpio0: [email protected] {
compatible = "ralink,mt7620a-gpio", "ralink,rt2880-gpio";
reg = <0x600 0x34>;
resets = <&rstctrl 13>;
reset-names = "pio";
interrupt-parent = <&intc>;
interrupts = <6>;---------表示其在中斷控制器中的硬體中斷編號,分系統異常中斷/systick中斷/兩個外部中斷。。。等
gpio-controller;
#gpio-cells = <2>;-----表示gpio控制暫存器是64位的
ralink,gpio-base = <0>;----該組gpio從GPIO0開始
ralink,num-gpios = <24>;-------到GPIO24結束
ralink,register-map = [ 00 04 08 0c
20 24 28 2c
30 34 ];
};
gpio1: [email protected] {
compatible = "ralink,mt7620a-gpio", "ralink,rt2880-gpio";
reg = <0x638 0x24>;
interrupt-parent = <&intc>;
interrupts = <6>;
gpio-controller;
#gpio-cells = <2>;
ralink,gpio-base = <24>;
ralink,num-gpios = <16>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];-----執行cat /proc/iomem顯示的數值?
status = "disabled";
};
gpio2: [email protected] {
compatible = "ralink,mt7620a-gpio", "ralink,rt2880-gpio";
reg = <0x660 0x24>;
interrupt-parent = <&intc>;
interrupts = <6>;
gpio-controller;
#gpio-cells = <2>;
ralink,gpio-base = <40>;
ralink,num-gpios = <32>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
status = "disabled";
};
gpio3: [email protected] {
compatible = "ralink,mt7620a-gpio", "ralink,rt2880-gpio";
reg = <0x688 0x24>;
interrupt-parent = <&intc>;
interrupts = <6>;
gpio-controller;
#gpio-cells = <2>;
ralink,gpio-base = <72>;
ralink,num-gpios = <1>;
ralink,register-map = [ 00 04 08 0c
10 14 18 1c
20 24 ];
status = "disabled";
};
[email protected] {
compatible = "link,mt7620a-i2c", "ralink,rt2880-i2c";
reg = <0x900 0x100>;
resets = <&rstctrl 16>;
reset-names = "i2c";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
pinctrl-names = "default";----i2c除了對i2c控制器暫存器定義外,還要對i2c所用的gpio管腳定義
pinctrl-0 = <&i2c_pins>;
};
[email protected] {
compatible = "ralink,mt7620a-i2s";
reg = <0xa00 0x100>;
resets = <&rstctrl 17>;
reset-names = "i2s";
interrupt-parent = <&intc>;
interrupts = <10>;
dmas = <&gdma 4>,
<&gdma 5>;
dma-names = "tx", "rx";
status = "disabled";
};
[email protected] {
compatible = "ralink,mt7620a-spi", "ralink,rt2880-spi";
reg = <0xb00 0x100>;
resets = <&rstctrl 18>;
reset-names = "spi";
#address-cells = <1>;
#size-cells = <1>;
status = "disabled";
pinctrl-names = "default";
pinctrl-0 = <&spi_pins>;-----spi_pins不在dts檔案中定義?
};
[email protected] {
compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0xc00 0x100>;
resets = <&rstctrl 19>;
reset-names = "uartl";
interrupt-parent = <&intc>;
interrupts = <12>;
reg-shift = <2>;
pinctrl-names = "default";
pinctrl-0 = <&uartlite_pins>;
};
[email protected] {
compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
resets = <&rstctrl 12>;
reset-names = "uart";
interrupt-parent = <&intc>;
interrupts = <5>;
reg-shift = <2>;
pinctrl-names = "default";
pinctrl-0 = <&pcm_uartf_pins>;
};
[email protected] {
compatible = "ralink,mt7620a-systick", "ralink,cevt-systick";
reg = <0xd00 0x10>;
resets = <&rstctrl 28>;
reset-names = "intc";
interrupt-parent = <&cpuintc>;
interrupts = <7>;
};
[email protected] {
compatible = "ralink,mt7620a-pcm";
reg = <0x2000 0x800>;
resets = <&rstctrl 11>;--------resets屬性含義?
reset-names = "pcm";
interrupt-parent = <&intc>;
interrupts = <4>;
status = "disabled";
};
gdma: [email protected] {
compatible = "ralink,mt7620a-gdma", "ralink,rt2880-gdma";
reg = <0x2800 0x800>;
resets = <&rstctrl 14>;
reset-names = "dma";
interrupt-parent = <&intc>;
interrupts = <7>;
#dma-cells = <1>;
#dma-channels = <16>;
#dma-requests = <16>;
status = "disabled";
};
};
pinctrl {
compatible = "ralink,rt2880-pinmux";
pinctrl-names = "default";
pinctrl-0 = <&state_default>;
state_default: pinctrl0 {
};
pcm_uartf_pins: pcm_uartf {
pcm_uartf {
ralink,group = "uartf";
ralink,function = "pcm uartf";
};
};
spi_pins: spi {
spi {
ralink,group = "spi";
ralink,function = "spi";
};
};
i2c_pins: i2c {
i2c {
lantiq,group = "i2c";
lantiq,function = "i2c";
};
};
uartlite_pins: uartlite {
uart {
ralink,group = "uartlite";
ralink,function = "uartlite";
};
};
mdio_pins: mdio {
mdio {
ralink,group = "mdio";
ralink,function = "mdio";
};
};
ephy_pins: ephy {
ephy {
ralink,group = "ephy";
ralink,function = "ephy";
};
};
wled_pins: wled {
wled {
ralink,group = "wled";
ralink,function = "wled";
};
};
rgmii1_pins: rgmii1 {
rgmii1 {
ralink,group = "rgmii1";
ralink,function = "rgmii1";
};
};
rgmii2_pins: rgmii2 {
rgmii2 {
ralink,group = "rgmii2";
ralink,function = "rgmii2";
};
};
};
rstctrl: rstctrl {
compatible = "ralink,mt7620a-reset", "ralink,rt2880-reset";
#reset-cells = <1>;
};
ubsphy {
compatible = "ralink,mt7620a-usbphy";
resets = <&rstctrl 22 &rstctrl 25>;
reset-names = "host", "device";
};
[email protected] {
compatible = "ralink,mt7620a-eth";
reg = <0x10100000 10000>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&cpuintc>;
interrupts = <5>;
resets = <&rstctrl 21 &rstctrl 23>;----當<>內出現多個數據時,一般兩個資料一組。。。
reset-names = "fe", "esw";
[email protected] {
compatible = "ralink,mt7620a-gsw-port", "ralink,eth-port";
reg = <4>;
status = "disabled";
};
[email protected] {
compatible = "ralink,mt7620a-gsw-port", "ralink,eth-port";
reg = <5>;
status = "disabled";
};
mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
};
[email protected] {
compatible = "ralink,mt7620a-gsw";
reg = <0x10110000 8000>;
interrupt-parent = <&intc>;
interrupts = <17>;
};
[email protected] {
compatible = "ralink,mt7620a-sdhci";
reg = <0x10130000 4000>;
interrupt-parent = <&intc>;
interrupts = <14>;
status = "disabled";
};
[email protected] {
compatible = "ralink,rt3xxx-ehci";
reg = <0x101c0000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <18>;
status = "disabled";
};
[email protected] {
compatible = "ralink,rt3xxx-ohci";
reg = <0x101c1000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <18>;
status = "disabled";
};
[email protected] {
compatible = "ralink,mt7620a-pci";
reg = <0x10140000 0x100
0x10142000 0x100>;
resets = <&rstctrl 26>;
reset-names = "pcie0";
interrupt-parent = <&cpuintc>;
interrupts = <4>;
status = "disabled";
};
};
==============================================================================
例如一個在.dts檔案中關於gpio資源的描述:
gpio: [email protected] {
#gpio-cells = <2>;
compatible = "cavium,octeon-3860-gpio";
reg = <0x10700 0x00000800 0x0 0x100>;
gpio-controller;
........
根據其描述, 可知道gpio控制器的IO記憶體起始地址為:0x107900000800, 長度為0x100.
即從 0x107900000800 到 0x1079000008ff.
在目標板裡使用 cat /proc/iomem 可以看到:
1070000000800-10700000008ff : /[email protected]/[email protected]
====================================================================================
/dts-v1/;
/include/ "xxe.dtsi"
/ {
compatible = "xxx0", "ralink,mt7620a-soc";
model = "xxxxx";------model屬性表示my board name。
[email protected] {
gpio1: [email protected] {
status = "okay";
};
gpio2: [email protected] {
status = "okay";
};
[email protected] {
status = "okay";
[email protected] {
#address-cells = <1>;
#size-cells = <1>;
compatible = "en25q64";
reg = <0 0>;
linux,modalias = "m25p80", "w25p128";
spi-max-frequency = <10000000>;
[email protected] {[email protected]後面為該節點暫存器的偏移地址或裝置編號
label = "u-boot";
reg = <0x0 0x30000>;---reg屬性表示暫存器偏移地址和長度,
還能表示flash分割槽的便宜地址和長度
read-only;
};
[email protected] {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: [email protected] {
label = "factory";
reg = <0x40000 0x10000>;
};
[email protected] {
label = "firmware";
reg = <0x50000 0xfb0000>;
};
};
};
};
pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "i2c", "rgmii1", "rgmii2";
ralink,function = "gpio";
};
};
};
[email protected] {
mtd-mac-address = <&factory 0x28>;
ralink,port-map = "llllw";
};
[email protected] {
ralink,port4 = "ephy";
};
[email protected] {
status = "okay";
};
[email protected] {
status = "okay";
};
gpio-leds {
compatible = "gpio-leds";
sys {
label = "xxx:blue:sys";
gpios = <&gpio2 20 1>;---用gpio2組的GPIO管腳,偏移地址是20即該組的第20個管腳,預設輸出高電平。
};
wan {
label = "xxx:blue:wan";
gpios = <&gpio2 24 1>;
};
wireless {
label = "xxx:blue:wireless";
gpios = <&gpio2 21 1>;
};
};
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <20>;
zigbee {
label = "zigbee";
gpios = <&gpio2 23 1>;-------按此按鍵後開啟zigbee模組業務?
linux,code = <0x197>;
};
reset {
label = "reset";
gpios = <&gpio2 22 1>;
linux,code = <0x198>;-------該屬性的含義?
};
};
i2c-gpio {
compatible = "i2c-gpio";
gpios = <&gpio0 1 0 &gpio0 2 0>;-------i2c匯流排配置兩個GPIO管腳
i2c-gpio,delay-us = <100>; /*10KHz */
#address-cells = <1>;
#size-cells = <0>;
[email protected] {-----------------pcf8563為掛在該i2c匯流排的rtc晶片型號
compatible = "nxp,pcf8563";
reg = <0x51>;
};
};
};
相關推薦
openWRT的DTS檔案配置--MT7620A
原文地址:http://blog.chinaunix.net/uid-29616823-id-4390033.html +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
nginx、thinkphp3.2、linux配置檔案配置
nginx.conf配置檔案: server { listen 9001; server_name 127
連線mysql資料庫連線報錯,是pom檔案配置mysql連線驅動版本號問題
前一段時間安裝了最新的mysql 8.0.11,然後啟動一個專案的時候報錯資訊如下: [ERROR] 2018-08-14 17:28:21,246 method:com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:6
Spring配置檔案中如何使用外部配置檔案配置資料庫連線
版權宣告:本文為博主原創文章,歡迎指正或者轉載。 https://blog.csdn.net/qq_38663729/article/details/78821258 直接在spring的配置檔案中applicationContext.xml檔案中配置資料庫連線也可以,但是有個問題,需要在url
006---Django靜態檔案配置
靜態檔案:Js、Css、Fonts、Image等 這個不難、在setting.py檔案加一行 1 # 別名 使用者在url位址列輸入127.0.0.1:8000/static/檔案 可以直接訪問static下的檔案 叫什麼無所謂 但是我們一般起名'/static/' 2
Springboot的pom檔案配置
Springboot 提供的jar中封裝了相關的常用jar,使得配置更加簡單,引用關係更加清晰。下面就說明下 Springboot 的 pom 配置。 先來看下專案的結構: (這個專案是用來實現SSO和許可權認證的,但是許可權部分還不全,之後
Spring MVC配置檔案配置檢視解析器
spring mvc配置檔案 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="ht
靜態檔案與模板檔案配置
STATIC_URL = '/static/' # 設定靜態檔案路徑,這裡改變的是使用者請求靜態檔案的網址路徑 #這是配置伺服器靜態檔案放置的位置 STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'shop/static'),
nginx使用手冊--nginx.conf檔案配置詳解
#執行使用者 user nobody; #啟動程序,通常設定成和cpu的數量相等 worker_processes 1; #全域性錯誤日誌及PID檔案 #error_log logs/error.log; #error_log logs/error.log notice; #error_log
iOS Debug環境下生成dSYM檔案配置
Build Setting Debug Information Format -> DWARF with dSYM File Generate Debug Symbols -> YES 在 Products 資料夾內 Show In Finder
Django框架(二)—— 基本配置:app註冊、模板配置、靜態檔案配置、資料庫連線配置post和get
app註冊、模板配置、靜態檔案配置、資料庫連線配置post和get 一、app 在Django中,APP可以用以下類比 大學 --------------------專案 計算機學院------------app01 土木學院 ------------ app02 1、app建立 方
SpringMVC 學習 十 SSM環境搭建(三)springMVC檔案配置 springMVC學習三 註解開發環境搭建
SpringMVC檔案配置的詳細過程,可以檢視springMVC環境搭建的註解配置篇《springMVC學習三 註解開發環境搭建》 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2
mybatis學習筆記之——mybatis的Mapper XML對映檔案配置資訊
sql對映檔案對應的增刪改查都有自己的標籤: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
Springboot中配置檔案配置大全
前言 今天下午,無意中翻到之前整理的Springboot的配置檔案相關配置,才想起自己很早之前還整理過這樣的東西,時間長了自己都給忘了。。。今天,就正好給大家分享下 配置 #############################################################
Mybatis通過properties檔案配置資料庫名
問題:由於需要跨資料庫查詢,sql中需要使用,資料庫名.表名,但是如果寫死,測試庫和生成庫切換不方便 解決方法如下: 1、dataSource.properties檔案 內容如下: #產品庫 #測試庫 #product_db=pro
高效能Redis快取伺服器-redis.conf檔案配置埠號、授權IP、Redis後臺啟動、Redis日誌、Redis密碼
Redis的強大功能依賴於Redis的配置檔案,比如密碼驗證,授權機器訪問,埠號配置,叢集配置等,我們可以通過配置檔案非常方便的對Redis進行配置。Redis的核心配置檔案只有一個,就是redis.conf。在發行包中就有提供。在啟動Redis伺服器的時候我們可以通過redis-server
Geotools專案pom檔案配置示例
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apach
django處理上傳檔案配置
1.sttings中配置 'django.template.context_processors.media' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates',
struts-config.xml檔案配置
原文地址連結:http://blog.csdn.net/huozhicheng/article/details/5426356 <struts-config>是struts的根元素,它主要有8個子元素,DTD定義如下: [xhtml]&n
Webpack 4.X webpack.config.js 檔案配置(一)
通過上一篇文章,我們明白了webpack的兩個配置引數入口與出口,webpack會找到入口檔案的地址,進去後一頓蹂躪,再通過你給的輸出地址就把編譯後的檔案給你了。這篇文章接著去豐富webpack.config.js的內容,說一個引數叫plugins plugins plugins裡面放的是外掛,在webp