Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
384 views
in Technique[技术] by (71.8m points)

linux kernel - How should I understand the 'less-compatible' names in the compatible list in device tree?

This is part of a device file (linux/arch/arm/boot/dts/versatile-ab.dts)

uart1: uart@101f2000 {
    compatible = "arm,pl011", "arm,primecell";
    reg = <0x101f2000 0x1000>;
    interrupts = <13>;
    clocks = <&xtal24mhz>, <&pclk>;
    clock-names = "uartclk", "apb_pclk";
};

uart2: uart@101f3000 {
    compatible = "arm,pl011", "arm,primecell";
    reg = <0x101f3000 0x1000>;
    interrupts = <14>;
    clocks = <&xtal24mhz>, <&pclk>;
    clock-names = "uartclk", "apb_pclk";
};

smc@10100000 {
    compatible = "arm,primecell";
    reg = <0x10100000 0x1000>;
    clocks = <&pclk>;
    clock-names = "apb_pclk";
};

mpmc@10110000 { 
    compatible = "arm,primecell";
    reg = <0x10110000 0x1000>;
    clocks = <&pclk>;
    clock-names = "apb_pclk";
};

I've read about device tree but could not understand it clearly. I understood the kernel during its initialization searches through the device tree and compares the compatible field of the node with that of the driver. so for the uart1 node, it uses just the driver which has compatible field "arm,pl011". What effect does "arm,primecell" in the uart1 compatible field have? What are the nodes smc and mpmc above which has only "arm,primecell" in the compatible field? Are they common for all the node which have "arm,primecell" in the compatible list? (I found many nodes in arm socs or boards have "arm,primecell" in the compatible list. Does the kernel use the nodes data with less compatible (or generic) field (like "arm,primecell"), and overwrite or add information from the node with more compatible(or special) name?
And smc@10100000 and mpmc@10110000 differ only by the name and address. Do node names have special meaning?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...