文档: linux-digilent-digilent-v4.0
文档来源
///////////////////////////////////////////////////////////////////////////////////////////////////////////
好博客
http://www.cnblogs.com/tureno/articles/6399782.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////
/dts-v1/;
#include
#include
#include "s3c6410.dtsi"
//“/”表示根节点
/ {
//model =是根节点下边的属性
//model属性我们是用来描述产品型号的,类型为字符串,
//推荐的格式为“manufacturer,model-number”(非强制的)。
//根节点的model属性描述的是板子的型号或者芯片平台的型号
model = "SAMSUNG SMDK6410 board based on S3C6410";
//“compatible”属性是用来匹配驱动的,此处应该不是匹配驱动,而是进行配置芯片的。
//compatible属性决定软件如何匹配硬件对硬件进行初始化
//samsung是代表厂商, "samsung,s3c6410"是被兼容的
compatible = "samsung,mini6410", "samsung,s3c6410";
memory {
//0x50000000 为address, #address-cells = <1>代表 0x50000000 为32位数
//0x8000000为size #size-cells = <1> 代表0x8000000为32位数
reg = <0x50000000 0x8000000>;
};
//chosen节点也位于根节点下,该节点用来给内核传递参数(不代表实际硬件)
chosen {
bootargs = "console=ttySAC0,115200n8 earlyprintk rootwait root=/dev/mmcblk0p1";
};
clocks {
//compatible实现了原先内核版本3.x之前,platform_device中.name的功能
compatible = "simple-bus";
//规范规定一个32位的长度为一个cell。"#address-cells"属性用来表示总线地址需要几个cell表示,该属性本身是u32类型的
#address-cells = <1>;
//"#size-cells"属性用来表示子总线地址空间的长度(地址范围)需要几个cell表示,属性本身的类型也是u32
#size-cells = <0>;
fin_pll: oscillator@0 {
compatible = "fixed-clock";
reg = <0>;
clock-frequency = <12000000>;
clock-output-names = "fin_pll";
#clock-cells = <0>;
};
xusbxti: oscillator@1 {
compatible = "fixed-clock";
reg = <1>;
clock-output-names = "xusbxti";
clock-frequency = <48000000>;
#clock-cells = <0>;
};
};
srom-cs1@18000000 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x18000000 0x8000000>;
ranges;
ethernet@18000000 {
//SMSC公司的lan9115以太网芯片
//“compatible”属性是用来匹配驱动的
compatible = "smsc,lan9115";
reg = <0x18000000 0x10000>;
interrupt-parent = <&gpn>;
interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
phy-mode = "mii";
reg-io-width = <4>;
smsc,force-internal-phy;
};
};
};
&sdhci0 {
pinctrl-names = "default";
pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
bus-width = <4>;
//'status'属性用来表示节点的状态的,其实就是硬件的状态 "'okay'表示硬件正常工作
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_data>, <&uart0_fctl>;
status = "okay";
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_data>;
status = "okay";
};
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_data>;
status = "okay";
};
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_data>;
status = "okay";
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
设备树将这些共同部分提炼保存在.dtsi文件中,供不同的dts共同使用
///文件里有#include "s3c6410.dtsi"
#include "s3c64xx.dtsi"
/ {
compatible = "samsung,s3c6410";
//aliases node用来定义别名,类似C++中引用
aliases {
i2c1 = &i2c1;
};
};
&vic0 {
valid-mask = <0xffffff7f>;
valid-wakeup-mask = <0x00200004>;
};
&vic1 {
valid-mask = <0xffffffff>;
valid-wakeup-mask = <0x53020000>;
};
&soc {
clocks: clock-controller@7e00f000 {
compatible = "samsung,s3c6410-clock";
reg = <0x7e00f000 0x1000>;
#clock-cells = <1>;
};
//
//struct platform_device s3c_device_i2c1 = { .name = "s3c2410-i2c",
///struct platform_device s3c_device_i2c3 = { .name = "s3c2440-i2c",
//compatible = "samsung,s3c2440-i2c";这句后面s3c2440-i2c是指定了具体的设备驱动名字了。
i2c1: i2c@7f00f000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x7f00f000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <5>;
clock-names = "i2c";
clocks = <&clocks PCLK_IIC1>;
////'status'属性用来表示节点的状态的,其实就是硬件的状态 “disabled”表示硬件当前不可用
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//文件里有#include "s3c64xx.dtsi"
#include "skeleton.dtsi"
#include
/ {
aliases {
i2c0 = &i2c0;
pinctrl0 = &pinctrl0;
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
serial3 = &uart3;
};
父节点的# address-cells和#size-cells决定了子节点的address和size的长度;Reg的组织形式为reg = <address1 size1 [address2 size2] [address3 size3] ... >
#address-cells = <1>; 基地址、片选号等绝对起始地址(address1 )所占字长(32位)
#size-cells = <1>; 长度(地址长度值,也就是size1所占字长)所占字长(32位)
reg = <0x50000000 0x8000000>;
0x50000000 为address, #address-cells = <1>代表 0x50000000 为32位数 0x8000000为size
#size-cells = <1> 代表0x8000000为32位数
cpus {
//#address-cells 设置为 1。这意味着子节点的 reg 值是一个单一的 uint32
#address-cells = <1>;
// #size-cells 为 0 是因为只为每个 cpu 分配一个单独的地址
#size-cells = <0>;
cpu@0 {
//"device_type"属性用来表示设备类型
device_type = "cpu";
//使用于arm1176jzf-s CPU, "arm,arm1176"这个芯片是被兼容的
compatible = "arm,arm1176jzf-s", "arm,arm1176";
reg = <0x0>;
};
};
soc: soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
//中断控制器节点用interrupt-controller属性表示自己是中断控制器,这个属性的类型是空,不用设置值,
//只要存在这个节点就表示该节点是中断控制器
vic0: interrupt-controller@71200000 {
compatible = "arm,pl192-vic";
interrupt-controller;
reg = <0x71200000 0x1000>;
//#interrupt-cells属性的类型是u32,
//假如一个中断源需要2个u32表示(一个表示中断号,另一个表示中断类型),那么#interrupt-cells就设置成2
//#interrupt-cells属性,用来表示该中断控制器直接管理下的interrupt domain用几个u32表示一个中断源(interrupt specifier)
#interrupt-cells = <1>;
};
vic1: interrupt-controller@71300000 {
compatible = "arm,pl192-vic";
interrupt-controller;
reg = <0x71300000 0x1000>;
#interrupt-cells = <1>;
};
sdhci0: sdhci@7c200000 {
compatible = "samsung,s3c6410-sdhci";
reg = <0x7c200000 0x100>;
//用interrupt-parent属性指向他的中断父设备
//他的中断父设备可能是中断控制器,也可能是interrupt nexus节点(如果最底层是中断产生设备,且需要映射)
interrupt-parent = <&vic1>;
interrupts = <24>;
clock-names = "hsmmc", "mmc_busclk.0", "mmc_busclk.2";
clocks = <&clocks HCLK_HSMMC0>, <&clocks HCLK_HSMMC0>,
<&clocks SCLK_MMC0>;
status = "disabled";
};
sdhci1: sdhci@7c300000 {
compatible = "samsung,s3c6410-sdhci";
reg = <0x7c300000 0x100>;
interrupt-parent = <&vic1>;
interrupts = <25>;
clock-names = "hsmmc", "mmc_busclk.0", "mmc_busclk.2";
clocks = <&clocks HCLK_HSMMC1>, <&clocks HCLK_HSMMC1>,
<&clocks SCLK_MMC1>;
status = "disabled";
};
sdhci2: sdhci@7c400000 {
compatible = "samsung,s3c6410-sdhci";
reg = <0x7c400000 0x100>;
interrupt-parent = <&vic1>;
interrupts = <17>;
clock-names = "hsmmc", "mmc_busclk.0", "mmc_busclk.2";
clocks = <&clocks HCLK_HSMMC2>, <&clocks HCLK_HSMMC2>,
<&clocks SCLK_MMC2>;
status = "disabled";
};
watchdog: watchdog@7e004000 {
compatible = "samsung,s3c2410-wdt";
reg = <0x7e004000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <26>;
clock-names = "watchdog";
clocks = <&clocks PCLK_WDT>;
status = "disabled";
};
//
//struct platform_device s3c_device_i2c0 = { .name = "s3c2410-i2c",.resource = s3c_i2c0_resource,
//static struct resource s3c_i2c0_resource[] = { [0] = DEFINE_RES_MEM(S3C_PA_IIC, SZ_4K),
// [1] = DEFINE_RES_IRQ(IRQ_IIC),};
//
//#define S3C_PA_IIC S3C64XX_PA_IIC0
///struct platform_device s3c_device_i2c3 = { .name = "s3c2440-i2c",
//compatible = "samsung,s3c2440-i2c";这句后面s3c2440-i2c是指定了具体的设备驱动名字了。
i2c0: i2c@7f004000 {
compatible = "samsung,s3c2440-i2c";
//0x1000 = 4096 也就是4K
//
//#define S3C64XX_PA_IIC0 (0x7F004000)
//#define S3C64XX_PA_IIC1 (0x7F00F000)
reg = <0x7f004000 0x1000>;
//
//#define IRQ_IIC S3C64XX_IRQ_VIC1(18)
interrupt-parent = <&vic1>; //中断父节点是vic1中断控制器
interrupts = <18>;
clock-names = "i2c";
clocks = <&clocks PCLK_IIC0>;
status = "disabled";
//#address-cells 设置为 1。这意味着子节点的 reg 值是一个单一的 uint32
#address-cells = <1>;
#size-cells = <0>;//??????
};
uart0: serial@7f005000 {
compatible = "samsung,s3c6400-uart";
reg = <0x7f005000 0x100>;
interrupt-parent = <&vic1>;
interrupts = <5>;
clock-names = "uart", "clk_uart_baud2",
"clk_uart_baud3";
clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>,
<&clocks SCLK_UART>;
status = "disabled";
};
uart1: serial@7f005400 {
compatible = "samsung,s3c6400-uart";
reg = <0x7f005400 0x100>;
interrupt-parent = <&vic1>;
interrupts = <6>;
clock-names = "uart", "clk_uart_baud2",
"clk_uart_baud3";
clocks = <&clocks PCLK_UART1>, <&clocks PCLK_UART1>,
<&clocks SCLK_UART>;
status = "disabled";
};
uart2: serial@7f005800 {
compatible = "samsung,s3c6400-uart";
reg = <0x7f005800 0x100>;
interrupt-parent = <&vic1>;
interrupts = <7>;
clock-names = "uart", "clk_uart_baud2",
"clk_uart_baud3";
clocks = <&clocks PCLK_UART2>, <&clocks PCLK_UART2>,
<&clocks SCLK_UART>;
status = "disabled";
};
uart3: serial@7f005c00 {
compatible = "samsung,s3c6400-uart";
reg = <0x7f005c00 0x100>;
interrupt-parent = <&vic1>;
interrupts = <8>;
clock-names = "uart", "clk_uart_baud2",
"clk_uart_baud3";
clocks = <&clocks PCLK_UART3>, <&clocks PCLK_UART3>,
<&clocks SCLK_UART>;
status = "disabled";
};
pwm: pwm@7f006000 {
compatible = "samsung,s3c6400-pwm";
reg = <0x7f006000 0x1000>;
interrupt-parent = <&vic0>;
interrupts = <23>, <24>, <25>, <27>, <28>;
clock-names = "timers";
clocks = <&clocks PCLK_PWM>;
samsung,pwm-outputs = <0>, <1>;
#pwm-cells = <3>;
};
pinctrl0: pinctrl@7f008000 {
compatible = "samsung,s3c64xx-pinctrl";
reg = <0x7f008000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <21>;
pctrl_int_map: pinctrl-interrupt-map {
interrupt-map = <0 &vic0 0>,
<1 &vic0 1>,
<2 &vic1 0>,
<3 &vic1 1>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <1>;
};
wakeup-interrupt-controller {
compatible = "samsung,s3c64xx-wakeup-eint";
interrupts = <0>, <1>, <2>, <3>;
interrupt-parent = <&pctrl_int_map>;
};
};
};
};
//内核里有几处出现在末尾include的情况了。呵呵
#include "s3c64xx-pinctrl.dtsi"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
参考:http://blog.csdn.net/loongembedded/article/details/51453499
阅读(1474) | 评论(0) | 转发(0) |