From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] imx: dts: tbs2910: add u-boot dtsi to shrink image size
Date: Fri, 6 Dec 2019 23:03:17 +0100 [thread overview]
Message-ID: <76710ffd-20ce-e515-7e0b-3d7e6afcb91c@gmx.de> (raw)
In-Reply-To: <de71dd88-4b86-e3c4-7f83-12fa4f6e02d3@web.de>
On 12/6/19 8:26 PM, Soeren Moch wrote:
>
>
> On 06.12.19 19:43, Tom Rini wrote:
>> On Fri, Dec 06, 2019 at 07:30:47PM +0100, Anatolij Gustschin wrote:
>>
>>> Use U-Boot specific board dtsi to remove some not used nodes and
>>> properties. With this change applied considerable size reduction
>>> has been observed:
>>>
>>> $ ./tools/buildman/buildman -b tbs2910 -f tbs2910 || \
>>> ./tools/buildman/buildman -b tbs2910 -sS tbs2910
>>> ...
>>> Summary of 2 commits for 1 boards (1 thread, 12 jobs per thread)
>>> 01: Merge branch '2019-12-05-master-imports'
>>> arm: w+ tbs2910
>>> 02: imx: dts: tbs2910: add u-boot dtsi to shrink image size
>>> arm: (for 1/1 boards) all -24448.0 text -24448.0
>>>
>>> Signed-off-by: Anatolij Gustschin <agust@denx.de>
>>> ---
>>> This patch was only build-tested, maybe this removes to much
>>> and needs some tweaking. I'd appreciate if someone could test
>>> it on actual hardware and finish the work, so we hopefully
>>> can solve frequent CI build breakage caused by this target.
>>>
>>> arch/arm/dts/imx6q-tbs2910-u-boot.dtsi | 219 +++++++++++++++++++++++++
>>> 1 file changed, 219 insertions(+)
>>> create mode 100644 arch/arm/dts/imx6q-tbs2910-u-boot.dtsi
>>>
>>> diff --git a/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi b/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi
>>> new file mode 100644
>>> index 0000000000..3e9307f17f
>>> --- /dev/null
>>> +++ b/arch/arm/dts/imx6q-tbs2910-u-boot.dtsi
>>> @@ -0,0 +1,219 @@
>>> +// SPDX-License-Identifier: GPL-2.0+
>>> +/*
>>> + * U-Boot specific modifications for original tbs2910 DTS.
>>> + * This drops not used nodes/properties to reduce the image size.
>>> + */
>>> +
>>> +/ {
>>> + /delete-property/ model;
>>> + /delete-property/ compatible;
>>> +
>>> + aliases {
>>> + /delete-property/ can0;
>>> + /delete-property/ can1;
>>> + /delete-property/ gpio3;
>>> + /delete-property/ gpio4;
>>> + /delete-property/ gpio5;
>>> + /delete-property/ ipu1;
>>> + /delete-property/ mmc3;
>>> + /delete-property/ spi0;
>>> + /delete-property/ spi1;
>>> + /delete-property/ spi2;
>>> + /delete-property/ spi3;
>>> + /delete-property/ spi4;
>>> + /delete-property/ serial2;
>>> + /delete-property/ serial3;
>>> + /delete-property/ serial4;
>>> + /delete-property/ video1;
>>> + };
>>> +
>>> + /delete-node/ cpus;
>>> + /delete-node/ capture-subsystem;
>>> + /delete-node/ chosen;
>>> + /delete-node/ display-subsystem;
>>> + /delete-node/ fan;
>>> + /delete-node/ ir_recv;
>>> + /delete-node/ leds;
>>> + /delete-node/ memory;
>>> + /delete-node/ sound-sgtl5000;
>>> + /delete-node/ sound-spdif;
>>> +
>>> + soc {
>>> + u-boot,dm-pre-reloc;
>>> + /delete-property/ ranges;
>>> + /delete-node/ timer at a00600;
>>> +
>>> + aips-bus at 2000000 {
>>> + /delete-property/ ranges;
>>> + /delete-node/ aipstz at 207c000;
>>> + spba-bus at 2000000 {
>>> + /delete-property/ ranges;
>>> + /delete-node/ spba at 203c000;
>>> + };
>>> + };
>>> +
>>> + aips-bus at 2100000 {
>>> + /delete-property/ ranges;
>>> + /delete-node/ aipstz at 217c000;
>>> + /delete-node/ mlb at 218c000;
>>> + /delete-node/ romcp at 21ac000;
>>> + /delete-node/ tzasc at 21d0000;
>>> + /delete-node/ tzasc at 21d4000;
>>> + /delete-node/ vdoa at 21e4000;
>>> + };
>>> + };
>>> +};
>>> +
>>> +&anatop {
>>> + /delete-node/ regulator-1p1;
>>> + /delete-node/ regulator-2p5;
>>> + /delete-node/ regulator-3p0;
>>> + /delete-node/ regulator-vddcore;
>>> + /delete-node/ regulator-vddpu;
>>> + /delete-node/ regulator-vddsoc;
>>> +};
>>> +
>>> +&sata {
>>> + /delete-property/ clocks;
>>> + /delete-property/ clock-names;
>>> + /delete-property/ interrupts;
>>> + /delete-property/ interrupts;
>>> + /delete-property/ fsl,transmit-level-mV;
>>> + /delete-property/ fsl,transmit-boost-mdB;
>>> + /delete-property/ fsl,transmit-atten-16ths;
>>> + /delete-property/ fsl,receive-eq-mdB;
>>> +};
>>> +
>>> +&pcie {
>>> + /delete-property/ reg-names;
>>> + /delete-property/ device_type;
>>> + /delete-property/ bus-range;
>>> + /delete-property/ ranges;
>>> + /delete-property/ num-lanes;
>>> + /delete-property/ interrupts;
>>> + /delete-property/ interrupt-names;
>>> + /delete-property/ #interrupt-cells;
>>> + /delete-property/ interrupt-map-mask;
>>> + /delete-property/ interrupt-map;
>>> + /delete-property/ clocks;
>>> + /delete-property/ clock-names;
>>> +};
>>> +
>>> +&uart1 {
>>> + /delete-property/ interrupts;
>>> + /delete-property/ clocks;
>>> + /delete-property/ clock-names;
>>> + /delete-property/ dmas;
>>> + /delete-property/ dma-names;
>>> +};
>>> +
>>> +&uart2 {
>>> + /delete-property/ interrupts;
>>> + /delete-property/ clocks;
>>> + /delete-property/ clock-names;
>>> + /delete-property/ dmas;
>>> + /delete-property/ dma-names;
>>> +};
>>> +
>>> +/delete-node/ &L2;
>>> +/delete-node/ &asrc;
>>> +/delete-node/ &audmux;
>>> +/delete-node/ &can1;
>>> +/delete-node/ &can2;
>>> +/delete-node/ &crypto;
>>> +/delete-node/ &dcic1;
>>> +/delete-node/ &dcic2;
>>> +/delete-node/ &dma_apbh;
>>> +/delete-node/ &ecspi1;
>>> +/delete-node/ &ecspi2;
>>> +/delete-node/ &ecspi3;
>>> +/delete-node/ &ecspi4;
>>> +/delete-node/ &ecspi5;
>>> +/delete-node/ &epit1;
>>> +/delete-node/ &epit2;
>>> +/delete-node/ &esai;
>>> +/delete-node/ &gpt;
>>> +/delete-node/ &gpio4;
>>> +/delete-node/ &gpio5;
>>> +/delete-node/ &gpio6;
>>> +/delete-node/ &gpu_3d;
>>> +/delete-node/ &gpu_2d;
>>> +/delete-node/ &gpu_vg;
>>> +/delete-node/ &gpmi;
>>> +/delete-node/ &ipu2;
>>> +/delete-node/ &kpp;
>>> +/delete-node/ &ldb;
>>> +/delete-node/ &mipi_csi;
>>> +/delete-node/ &mmdc0;
>>> +/delete-node/ &mmdc1;
>>> +/delete-node/ &ocotp;
>>> +/delete-node/ &ocram;
>>> +/delete-node/ &pinctrl_gpio_fan;
>>> +/delete-node/ &pinctrl_ir;
>>> +/delete-node/ &pinctrl_gpio_leds;
>>> +/delete-node/ &pinctrl_sgtl5000;
>>> +/delete-node/ &pinctrl_spdif;
>>> +/delete-node/ &pmu;
>>> +/delete-node/ &pwm1;
>>> +/delete-node/ &pwm2;
>>> +/delete-node/ &pwm3;
>>> +/delete-node/ &pwm4;
>>> +/delete-node/ &sdma;
>>> +/delete-node/ ®_2p5v;
>>> +/delete-node/ &sgtl5000;
>>> +/delete-node/ &snvs;
>>> +/delete-node/ &spdif;
>>> +/delete-node/ &src;
>>> +/delete-node/ &ssi1;
>>> +/delete-node/ &ssi2;
>>> +/delete-node/ &ssi3;
>>> +/delete-node/ &tempmon;
>>> +/delete-node/ &uart3;
>>> +/delete-node/ &uart4;
>>> +/delete-node/ &uart5;
>>> +/delete-node/ &usbh2;
>>> +/delete-node/ &usbh3;
>>> +/delete-node/ &usdhc1;
>>> +/delete-node/ &vpu;
>>> +/delete-node/ &wdog2;
>>> +/delete-node/ &weim;
>>> +
>>> +&gpr {
>>> + /delete-node/ ipu1_csi0_mux;
>>> + /delete-node/ ipu2_csi1_mux;
>>> +};
>>> +
>>> +&gpc {
>>> + /delete-node/ pgc;
>>> +};
>>> +
>>> +&hdmi {
>>> + /delete-node/ port at 2;
>>> + /delete-node/ port at 3;
>>> +};
>>> +
>>> +&mipi_dsi {
>>> + ports {
>>> + /delete-node/ port at 2;
>>> + /delete-node/ port at 3;
>>> + };
>>> +};
>>> +
>>> +&ipu1 {
>>> + u-boot,dm-pre-reloc;
>>> + /delete-property/ interrupts;
>>> + /delete-property/ clocks;
>>> + /delete-property/ clock-names;
>>> + /delete-property/ resets;
>>> + /delete-node/ port at 0;
>>> + /delete-node/ port at 1;
>>> +
>>> + port at 2 {
>>> + /delete-node/ endpoint at 3;
>>> + /delete-node/ endpoint at 4;
>>> + };
>>> + port at 3 {
>>> + /delete-node/ endpoint at 3;
>>> + /delete-node/ endpoint at 4;
>>> + };
>>> +};
> Oh, most of the deleted properties and nodes are not defined in the
> board dts, but in the soc dtsi instead.
> So for me it would make more sense to also split the "delete dtsi" in a
> board and soc part, if this really is the way to go.
>> This gets an important conversation started. Perhaps we should expand
>> OF_SPL_REMOVE_PROPS for full U-Boot, with some gating symbol for the
>> platforms that do want to pass through the full DT to the OS?
>>
> I also already looked at OF_SPL_REMOVE_PROPS, would make much sense to
> have this for full u-boot. To duplicate each device tree with an almost
> identical "delete dtsi" looks like a huge maintenance burden for me.
>
> Maybe the build system can at least automatically remove disabled nodes
> and nodes without compatible in enabled DM drivers. This would not help
> for unneeded properties in enabled nodes, but probably automatically
> give the biggest part of size reduction.
>
In an ideal world the firmware and not the operating system would supply
the device tree for booting the operating system. Currently for many
boards the U-Boot supplied device tree is enough to boot Linux. Deleting
nodes not used by U-Boot would not be helpful in this context.
Best regards
Heinrich
next prev parent reply other threads:[~2019-12-06 22:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 18:30 [PATCH] imx: dts: tbs2910: add u-boot dtsi to shrink image size Anatolij Gustschin
2019-12-06 18:43 ` Tom Rini
2019-12-06 19:26 ` Soeren Moch
2019-12-06 22:03 ` Heinrich Schuchardt [this message]
2019-12-06 22:08 ` Tom Rini
2020-01-08 21:42 ` Anatolij Gustschin
2020-01-09 12:01 ` Soeren Moch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76710ffd-20ce-e515-7e0b-3d7e6afcb91c@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox