当前位置: 首页 > ds >正文

arm设备树基础知识

文章目录

  • 前言
  • dts片段
  • 通用属性介绍
    • 地址大小
    • 中断
    • phandle
    • compatible
  • mmc节点介绍

前言

arm开发,早晚要了解设备树

dts片段

interrupt-parent = <0x8005>;
model = "linux,dummy-virt";
#size-cells = <0x02>;
#address-cells = <0x02>;
compatible = "linux,dummy-virt";vmmc_supply: regulator {compatible = "regulator-fixed";regulator-name = "3V3";regulator-min-microvolt = <3300000>;regulator-max-microvolt = <3300000>;regulator-always-on;
};mmc@80000000 {compatible = "arm,pl181", "arm,primecell";reg = <0x00 0x80000000 0x00 0x1000>;interrupts = <0x00 0x0a 0x04>, <0x00 0x0b 0x04>;clocks = <0x8000>;clock-names = "apb_pclk";bus-width = <4>;max-frequency = <5000000>;vmmc-supply = <&vmmc_supply>;wp-gpios = <0x8007 6 0>;cd-gpios = <0x8007 7 1>;
};intc@8000000 {phandle = <0x8005>;reg = <0x00 0x8000000 0x00 0x10000 0x00 0x8010000 0x00 0x10000>;compatible = "arm,cortex-a15-gic";ranges;#size-cells = <0x02>;#address-cells = <0x02>;interrupt-controller;#interrupt-cells = <0x03>;v2m@8020000 {phandle = <0x8006>;reg = <0x00 0x8020000 0x00 0x1000>;msi-controller;compatible = "arm,gic-v2m-frame";};
};pl061@9030000 {phandle = <0x8007>;clock-names = "apb_pclk";clocks = <0x8000>;interrupts = <0x00 0x07 0x04>;gpio-controller;#gpio-cells = <0x02>;compatible = "arm,pl061\0arm,primecell";reg = <0x00 0x9030000 0x00 0x1000>;
};apb-pclk {phandle = <0x8000>;clock-output-names = "clk24mhz";clock-frequency = <0x16e3600>;#clock-cells = <0x00>;compatible = "fixed-clock";
};chosen {linux,initrd-end = <0x00 0x49543a83>;linux,initrd-start = <0x00 0x48000000>;bootargs = "root=/dev/ram0 console=ttyAMA0 init=/linuxrc ignore_loglevel nokaslr";stdout-path = "/pl011@9000000";rng-seed = <0x7970a02d 0x64c75176 0xfe4a335f 0xdade1615 0x97ff89ee 0x6f4b3574 0x15a3ce06 0x15c5d6f8>;kaslr-seed = <0x898db457 0x75d6280>;
};

通用属性介绍

地址大小

#size-cells = <0x02>;
#address-cells = <0x02>;

这个的意思是,地址和大小需要两个cell来表示,一个cell是32位
reg = <0x80000000 0x1000>;
这是cell=1的写法, 0x80000000开始,往后0x1000字节
cell=2时,每个值分成了64位的高低位, 应该是:
reg = <0x00 0x80000000 0x00 0x1000>;

中断

interrupt-parent = <0x8005>;
interrupts = <0x00 0x07 0x04>;
interrupts-extended = <0x00 0x07 0x04>;

interrupts参数:中断类型(SGI PPI SPI LPI), 中断号, 触发类型(上升/下降沿、高/低电平)
如果指定了interrupt-parent, 那使用interrupts的时候就不用再指定phandle了, 而且所有interrupt都使用那个中断控制器
如果想为不同的中断指定不同的控制器, 可以用interrupt-extended, 这个可以指定phandle

phandle

phandle = <0x8000>;
clocks = <0x8000>;
vmmc-supply = <&vmmc_supply>;

引用其他节点,可以通过标签,也可以通过显式声明的phandle引用 (反编译dtb得到的估计都是值

compatible

compatible = "arm,pl061\0arm,primecell";

兼容性,驱动代码里会读设备树的这个属性,看自己适不适配

mmc节点介绍

cell=1,32位;cell=2,64位
reg = <0x80000000 0x1000>;
这是cell=1的写法
cell=2时,每个值分成了64位的高低位
cell=2时,应该是:
reg = <0x00 0x80000000 0x00 0x1000>;

http://www.xdnf.cn/news/2954.html

相关文章:

  • “专精特新”中小企业数字化转型呈现 4 大转型特征
  • 同步时钟与异步时钟
  • 1.24g 雨晨 19045.5796 Windows 10 企业版 x64 极速版
  • pymsql(SQL注入与防SQL注入)
  • Spring反射机制
  • Dijkstra算法的学习
  • cmake qt 项目编译
  • 开源 Agent 框架对比:LangChain vs AutoGen vs CrewAI
  • 牛客:AB1 【模板】栈
  • 天猫TP代运营服务商-品融电商:助力品牌破局增长的专业推手
  • 【HCIA】4种NAT的配置方式
  • AI专题(二)----由浅入深初识LLM
  • 大模型性能测试
  • 数据要素如何驱动的新质IDC一体化运营体系发展?
  • Jtti:nginx服务器如何限制访问频率
  • 在android 系统上qnn sdk转换,运行模型示例
  • MCU低功耗运行模式与唤醒机制解析
  • 数据结构每日一题day12(链表)★★★★★
  • 【AI论文】PHYBench:大型语言模型中物理感知与推理能力的全面评估
  • Redis 常见问题深度剖析与全方位解决方案指南
  • 基于STM32、HAL库的DS2411R安全验证及加密芯片驱动程序设计
  • RPO与RTO
  • 代码随想录第30天:动态规划3
  • Foreign Trade Process
  • 9.Excel:条件格式
  • torch.nn.Parameter 与 torch.Tensor
  • 微机控制电液伺服钢轨滚动疲劳试验机
  • 17:00开始面试,17:08就出来了,问的问题有点变态。。。
  • TransactionTemplate 与@Transactional 注解的使用
  • python22-元组、列表、字典、集合推导式