Device Tree and code size

前端 未结 2 1970
猫巷女王i
猫巷女王i 2021-02-11 09:49

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 devic

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-11 10:13

    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.

    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.

    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.

提交回复
热议问题