* Compressed DTB - builtin DTB
@ 2016-10-13 10:32 Daniel Krüger
2016-10-14 9:52 ` Sascha Hauer
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Krüger @ 2016-10-13 10:32 UTC (permalink / raw)
To: barebox
Hello,
I'm currently porting our board support to device tree. Currently, I
don't use multi-PBL, but include the device tree via CONFIG_BUILTIN_DTB.
This works, but the DTB seems to be included twice in the image: once as
plain DTB and once as compressed DTB. I think this isn't intended this way.
Extract from System.map:
87e82b80 R __dtb_imx35_systec_hmi_start
87e82b80 R __dtb_start
87e8501c R __dtb_imx35_systec_hmi_end
87e85020 R __dtb_z_imx35_systec_hmi_start
87e85ad0 R __dtb_z_imx35_systec_hmi_end
87e85b00 B __bss_start
87e85b00 R __dtb_end
Just using the compressed DTB would be really good. Because it makes the
image much smaller. However, how should that be done? The extract code
might be simple. But I don't have an idea how to let the linker select
the right version.
Thanks for any kind of support,
Daniel
--
SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Telefon : +49 (0) 3765 38600-0
Fax : +49 (0) 3765 38600-4100
Email : daniel.krueger@systec-electronic.com
Website : http://www.systec-electronic.com
Managing Directors :
Dipl.-Phys. Siegmar Schmidt, Dipl. Ing. (FH) Armin von Collrepp
Commercial registry : Amtsgericht Chemnitz, HRB 28082
USt.-Id Nr. : DE150534010
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compressed DTB - builtin DTB
2016-10-13 10:32 Compressed DTB - builtin DTB Daniel Krüger
@ 2016-10-14 9:52 ` Sascha Hauer
2016-10-21 8:16 ` Daniel Krüger
0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2016-10-14 9:52 UTC (permalink / raw)
To: Daniel Krüger; +Cc: barebox
Hi Daniel,
On Thu, Oct 13, 2016 at 12:32:31PM +0200, Daniel Krüger wrote:
> Hello,
>
> I'm currently porting our board support to device tree. Currently, I don't
> use multi-PBL, but include the device tree via CONFIG_BUILTIN_DTB. This
> works, but the DTB seems to be included twice in the image: once as plain
> DTB and once as compressed DTB. I think this isn't intended this way.
>
> Extract from System.map:
> 87e82b80 R __dtb_imx35_systec_hmi_start
> 87e82b80 R __dtb_start
> 87e8501c R __dtb_imx35_systec_hmi_end
> 87e85020 R __dtb_z_imx35_systec_hmi_start
> 87e85ad0 R __dtb_z_imx35_systec_hmi_end
> 87e85b00 B __bss_start
> 87e85b00 R __dtb_end
No, indeed that's not intended. Could you test the appended patch? It
should solve this.
>
> Just using the compressed DTB would be really good. Because it makes the
> image much smaller. However, how should that be done? The extract code might
> be simple. But I don't have an idea how to let the linker select the right
> version.
If you are using uncompressed binary you should switch to PBL support to
get a compressed binary. Then, if you are using PBL the dtb is
compressed already as part of the whole binary.
Sascha
------------------------------------8<--------------------------------
From c24a6bd6eabc3f73375080e6fc500aa955795a27 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Fri, 14 Oct 2016 11:42:00 +0200
Subject: [PATCH] gen-dtb-s: Put compressed dtb in different section
For builtin dtbs all compiled dtbs matching section .dtb.rodata.*
are collected in a single section. Since every dtb is compiled as
uncompressed and also as compressed binary each dtb ends up twice
in the section. Let's put the compressed variants in .dtbz.rodata.*
sections rather than .dtb.rodata.*.z so they end up in the binary
only once.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
scripts/gen-dtb-s | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
index 40c6085..4215461 100755
--- a/scripts/gen-dtb-s
+++ b/scripts/gen-dtb-s
@@ -58,7 +58,7 @@ fi
compressed=$(stat $dtb.lzo -c "%s")
uncompressed=$(stat $dtb -c "%s")
-echo ".section .dtb.rodata.${name}.z,\"a\""
+echo ".section .dtbz.rodata.${name},\"a\""
echo ".balign STRUCT_ALIGNMENT"
echo ".global __dtb_z_${name}_start"
echo "__dtb_z_${name}_start:"
--
2.9.3
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compressed DTB - builtin DTB
2016-10-14 9:52 ` Sascha Hauer
@ 2016-10-21 8:16 ` Daniel Krüger
2016-10-24 5:51 ` Sascha Hauer
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Krüger @ 2016-10-21 8:16 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Hi Sascha,
Am 14.10.2016 um 11:52 schrieb Sascha Hauer:
>
> No, indeed that's not intended. Could you test the appended patch? It
> should solve this.
Thanks. The patch works for me.
>> Just using the compressed DTB would be really good. Because it makes the
>> image much smaller. However, how should that be done? The extract code might
>> be simple. But I don't have an idea how to let the linker select the right
>> version.
>
> If you are using uncompressed binary you should switch to PBL support to
> get a compressed binary. Then, if you are using PBL the dtb is
> compressed already as part of the whole binary.
I will try that.
Best regards,
Daniel
--
SYS TEC electronic GmbH
Am Windrad 2
08468 Heinsdorfergrund
Telefon : +49 (0) 3765 38600-0
Fax : +49 (0) 3765 38600-4100
Email : daniel.krueger@systec-electronic.com
Website : http://www.systec-electronic.com
Managing Directors :
Dipl.-Phys. Siegmar Schmidt, Dipl. Ing. (FH) Armin von Collrepp
Commercial registry : Amtsgericht Chemnitz, HRB 28082
USt.-Id Nr. : DE150534010
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Compressed DTB - builtin DTB
2016-10-21 8:16 ` Daniel Krüger
@ 2016-10-24 5:51 ` Sascha Hauer
0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2016-10-24 5:51 UTC (permalink / raw)
To: Daniel Krüger; +Cc: barebox
On Fri, Oct 21, 2016 at 10:16:53AM +0200, Daniel Krüger wrote:
> Hi Sascha,
>
> Am 14.10.2016 um 11:52 schrieb Sascha Hauer:
> >
> > No, indeed that's not intended. Could you test the appended patch? It
> > should solve this.
>
> Thanks. The patch works for me.
Ok, applied that with your tested-by.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-24 5:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-13 10:32 Compressed DTB - builtin DTB Daniel Krüger
2016-10-14 9:52 ` Sascha Hauer
2016-10-21 8:16 ` Daniel Krüger
2016-10-24 5:51 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox