设备树和code尺寸 [英] Device Tree and code size

查看:197
本文介绍了设备树和code尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按我的设备树的理解,主要用途之一是从驱动程序删除特定于平台的code支持多种平台。如何设备树处理多个配置一个外设?

As per my understanding of device trees, one of main uses is to remove platform specific code from drivers to support multiple platforms. How does device tree handle multiple configuration for a single peripheral?

例如,如果我想在B平台使用LCD面板在平台A和液晶面板的B,做我需要保持两个液晶显示屏A和B组相关code在最终的二进制?如果是这样的话,有多个外设与一个以上的选项,这似乎会有二进制巨大额外code

For example if I want to use LCD Panel A in Platform A and LCD Panel B in Platform B, do I need to keep both LCD Panel A and Panel B related code in the final binary? If that is the case and there are multiple peripherals with more than one option, it seems there will be huge additional code in the binary.

推荐答案

假设考虑,如果你有5个液晶面板和5个平台(机),保持5 DTSI文件的每个每个小组,并有不同的DTSI文件为每个平台/机。

Suppose consider if you have 5 LCD panels and 5 platform(machines), keep 5 dtsi files each for each panel and have different dtsi files for each platform/machine.

对于单配置:
包括特定的平台/机器感兴趣的DTSI文件中特别DTSI面板文件。
结果:
   - 通过这种方式,您不必传递你的板子文件中的所有面板配置和开关液晶屏选项。在简单,你不必创建单独的电路板文件到您的新机器,而是有多个设备树中的文件,包括构建过程中你感兴趣的任何一个。

For single configuration: Include particular dtsi panel file inside dtsi file of particular platform/machine of your interest. Outcome: - By this way you don't have to pass all the panel configurations and on-off LCD options in your board file. In simple you don't have to create separate board files for your new machine,instead have multiple device tree files and include any one of your interest during build.

多个配置:
你可以添加感兴趣的你的机器DTSI文件中ň面板DTSI文件。
通过启用/在defconfig文件中禁用特定的液晶面板,你可以在运行时启用的任何LCD面板驱动。
结果:
  - 通过这种方式,您避免在单板文件(你知道它是多么凌乱)加1000面板的配置,取而代之的有1000 DTSI文件,并添加机内DT文件1000 DT头盘文件,并在defconfig提高特定面板标志。这将缓解工作。
在简单 - 单板文件和DTB包含的所有文件。降低了整体内核的大小。

For multiple configuration: you can add n panel dtsi files inside your machine dtsi file of interest. and by enabling/disabling particular lcd panel in defconfig file you can have any LCD panel driver enabled at run-time. Outcome: - By this way , you avoid 1000 panel configurations added in single board file(you know how messy it is), Instead have 1000 dtsi files and add 1000 dt header panel files inside machine dt file and raise particular panel flag in defconfig. this will ease the job. In simple- single board file and dtb containing all the files. reduces overall kernel size.

这篇关于设备树和code尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆