diff mbox series

[RFC,05/13] ARM: dts: ti: add support for building .dtb files containing symbols

Message ID 1523956215-28154-6-git-send-email-t-kristo@ti.com
State New
Headers show
Series ARM: dts: DT overlay support infra + some data | expand

Commit Message

Tero Kristo April 17, 2018, 9:10 a.m. UTC
Symbols in the DTB files are needed so that overlays can be applied
properly. Add support for building TI SoC specific .dtb files, the
source is fetched from parent directory.

Signed-off-by: Tero Kristo <t-kristo@ti.com>

---
 arch/arm/boot/dts/ti/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Geert Uytterhoeven April 18, 2018, 2:20 p.m. UTC | #1
Hi Tero,

On Tue, Apr 17, 2018 at 11:10 AM, Tero Kristo <t-kristo@ti.com> wrote:
> Symbols in the DTB files are needed so that overlays can be applied

> properly. Add support for building TI SoC specific .dtb files, the

> source is fetched from parent directory.

>

> Signed-off-by: Tero Kristo <t-kristo@ti.com>


Thanks for your patch!

> ---

>  arch/arm/boot/dts/ti/Makefile | 5 +++++

>  1 file changed, 5 insertions(+)

>

> diff --git a/arch/arm/boot/dts/ti/Makefile b/arch/arm/boot/dts/ti/Makefile

> index b26328b..7d2d411 100644

> --- a/arch/arm/boot/dts/ti/Makefile

> +++ b/arch/arm/boot/dts/ti/Makefile

> @@ -1 +1,6 @@

> +DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size


Why the -W options?

> +

> +$(obj)/%.dtb: $(src)/../%.dts FORCE


I guess you want a dependency on $(DTC), too?

> +       $(call if_changed_dep,dtc)

> +

>  clean-files    += *.dtbo


Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tero Kristo April 18, 2018, 7:07 p.m. UTC | #2
On 18/04/18 17:20, Geert Uytterhoeven wrote:
> Hi Tero,

> 

> On Tue, Apr 17, 2018 at 11:10 AM, Tero Kristo <t-kristo@ti.com> wrote:

>> Symbols in the DTB files are needed so that overlays can be applied

>> properly. Add support for building TI SoC specific .dtb files, the

>> source is fetched from parent directory.

>>

>> Signed-off-by: Tero Kristo <t-kristo@ti.com>

> 

> Thanks for your patch!

> 

>> ---

>>   arch/arm/boot/dts/ti/Makefile | 5 +++++

>>   1 file changed, 5 insertions(+)

>>

>> diff --git a/arch/arm/boot/dts/ti/Makefile b/arch/arm/boot/dts/ti/Makefile

>> index b26328b..7d2d411 100644

>> --- a/arch/arm/boot/dts/ti/Makefile

>> +++ b/arch/arm/boot/dts/ti/Makefile

>> @@ -1 +1,6 @@

>> +DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size

> 

> Why the -W options?


The overlay files typically contain declarations that miss these bits, 
and will lead to build time warnings. Mostly, because we are working 
with fragments / references only, and don't have the base declaration 
available at all.

> 

>> +

>> +$(obj)/%.dtb: $(src)/../%.dts FORCE

> 

> I guess you want a dependency on $(DTC), too?


Yeah, that should be added actually.

> 

>> +       $(call if_changed_dep,dtc)

>> +

>>   clean-files    += *.dtbo

> 

> Gr{oetje,eeting}s,

> 

>                          Geert

> 


--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring April 18, 2018, 10:43 p.m. UTC | #3
On Wed, Apr 18, 2018 at 9:20 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Hi Tero,

>

> On Tue, Apr 17, 2018 at 11:10 AM, Tero Kristo <t-kristo@ti.com> wrote:

>> Symbols in the DTB files are needed so that overlays can be applied

>> properly. Add support for building TI SoC specific .dtb files, the

>> source is fetched from parent directory.

>>

>> Signed-off-by: Tero Kristo <t-kristo@ti.com>

>

> Thanks for your patch!

>

>> ---

>>  arch/arm/boot/dts/ti/Makefile | 5 +++++

>>  1 file changed, 5 insertions(+)

>>

>> diff --git a/arch/arm/boot/dts/ti/Makefile b/arch/arm/boot/dts/ti/Makefile

>> index b26328b..7d2d411 100644

>> --- a/arch/arm/boot/dts/ti/Makefile

>> +++ b/arch/arm/boot/dts/ti/Makefile

>> @@ -1 +1,6 @@

>> +DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size

>

> Why the -W options?

>

>> +

>> +$(obj)/%.dtb: $(src)/../%.dts FORCE

>

> I guess you want a dependency on $(DTC), too?


I think that is handled globally already. I did a fix not to long ago.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tero Kristo April 19, 2018, 6:36 a.m. UTC | #4
On 19/04/18 01:43, Rob Herring wrote:
> On Wed, Apr 18, 2018 at 9:20 AM, Geert Uytterhoeven

> <geert@linux-m68k.org> wrote:

>> Hi Tero,

>>

>> On Tue, Apr 17, 2018 at 11:10 AM, Tero Kristo <t-kristo@ti.com> wrote:

>>> Symbols in the DTB files are needed so that overlays can be applied

>>> properly. Add support for building TI SoC specific .dtb files, the

>>> source is fetched from parent directory.

>>>

>>> Signed-off-by: Tero Kristo <t-kristo@ti.com>

>>

>> Thanks for your patch!

>>

>>> ---

>>>   arch/arm/boot/dts/ti/Makefile | 5 +++++

>>>   1 file changed, 5 insertions(+)

>>>

>>> diff --git a/arch/arm/boot/dts/ti/Makefile b/arch/arm/boot/dts/ti/Makefile

>>> index b26328b..7d2d411 100644

>>> --- a/arch/arm/boot/dts/ti/Makefile

>>> +++ b/arch/arm/boot/dts/ti/Makefile

>>> @@ -1 +1,6 @@

>>> +DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size

>>

>> Why the -W options?

>>

>>> +

>>> +$(obj)/%.dtb: $(src)/../%.dts FORCE

>>

>> I guess you want a dependency on $(DTC), too?

> 

> I think that is handled globally already. I did a fix not to long ago.


Globally it is handled, but as you see this is a special rule under the 
TI SoC specific makefile. This is building the .dts files under 
arch/arm/boot/dts/* into arch/arm/boot/dts/ti/ containing the symbol 
info (-@ flag for DTC.)

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring April 19, 2018, 3:26 p.m. UTC | #5
On Thu, Apr 19, 2018 at 1:36 AM, Tero Kristo <t-kristo@ti.com> wrote:
> On 19/04/18 01:43, Rob Herring wrote:

>>

>> On Wed, Apr 18, 2018 at 9:20 AM, Geert Uytterhoeven

>> <geert@linux-m68k.org> wrote:

>>>

>>> Hi Tero,

>>>

>>> On Tue, Apr 17, 2018 at 11:10 AM, Tero Kristo <t-kristo@ti.com> wrote:

>>>>

>>>> Symbols in the DTB files are needed so that overlays can be applied

>>>> properly. Add support for building TI SoC specific .dtb files, the

>>>> source is fetched from parent directory.

>>>>

>>>> Signed-off-by: Tero Kristo <t-kristo@ti.com>

>>>

>>>

>>> Thanks for your patch!

>>>

>>>> ---

>>>>   arch/arm/boot/dts/ti/Makefile | 5 +++++

>>>>   1 file changed, 5 insertions(+)

>>>>

>>>> diff --git a/arch/arm/boot/dts/ti/Makefile

>>>> b/arch/arm/boot/dts/ti/Makefile

>>>> index b26328b..7d2d411 100644

>>>> --- a/arch/arm/boot/dts/ti/Makefile

>>>> +++ b/arch/arm/boot/dts/ti/Makefile

>>>> @@ -1 +1,6 @@

>>>> +DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size

>>>

>>>

>>> Why the -W options?

>>>

>>>> +

>>>> +$(obj)/%.dtb: $(src)/../%.dts FORCE

>>>

>>>

>>> I guess you want a dependency on $(DTC), too?

>>

>>

>> I think that is handled globally already. I did a fix not to long ago.

>

>

> Globally it is handled, but as you see this is a special rule under the TI

> SoC specific makefile. This is building the .dts files under

> arch/arm/boot/dts/* into arch/arm/boot/dts/ti/ containing the symbol info

> (-@ flag for DTC.)


Ah, I see. That means we end up with 2 builds of the base dtbs, right?
We need to not do that. Either we need to be able to set per dtb flags
or set per directory flags and move the TI base dts files to /ti
directory.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tero Kristo April 19, 2018, 6 p.m. UTC | #6
On 19/04/18 18:26, Rob Herring wrote:
> On Thu, Apr 19, 2018 at 1:36 AM, Tero Kristo <t-kristo@ti.com> wrote:

>> On 19/04/18 01:43, Rob Herring wrote:

>>>

>>> On Wed, Apr 18, 2018 at 9:20 AM, Geert Uytterhoeven

>>> <geert@linux-m68k.org> wrote:

>>>>

>>>> Hi Tero,

>>>>

>>>> On Tue, Apr 17, 2018 at 11:10 AM, Tero Kristo <t-kristo@ti.com> wrote:

>>>>>

>>>>> Symbols in the DTB files are needed so that overlays can be applied

>>>>> properly. Add support for building TI SoC specific .dtb files, the

>>>>> source is fetched from parent directory.

>>>>>

>>>>> Signed-off-by: Tero Kristo <t-kristo@ti.com>

>>>>

>>>>

>>>> Thanks for your patch!

>>>>

>>>>> ---

>>>>>    arch/arm/boot/dts/ti/Makefile | 5 +++++

>>>>>    1 file changed, 5 insertions(+)

>>>>>

>>>>> diff --git a/arch/arm/boot/dts/ti/Makefile

>>>>> b/arch/arm/boot/dts/ti/Makefile

>>>>> index b26328b..7d2d411 100644

>>>>> --- a/arch/arm/boot/dts/ti/Makefile

>>>>> +++ b/arch/arm/boot/dts/ti/Makefile

>>>>> @@ -1 +1,6 @@

>>>>> +DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size

>>>>

>>>>

>>>> Why the -W options?

>>>>

>>>>> +

>>>>> +$(obj)/%.dtb: $(src)/../%.dts FORCE

>>>>

>>>>

>>>> I guess you want a dependency on $(DTC), too?

>>>

>>>

>>> I think that is handled globally already. I did a fix not to long ago.

>>

>>

>> Globally it is handled, but as you see this is a special rule under the TI

>> SoC specific makefile. This is building the .dts files under

>> arch/arm/boot/dts/* into arch/arm/boot/dts/ti/ containing the symbol info

>> (-@ flag for DTC.)

> 

> Ah, I see. That means we end up with 2 builds of the base dtbs, right?


Yes, thats intentional in this series.

> We need to not do that. Either we need to be able to set per dtb flags

> or set per directory flags and move the TI base dts files to /ti

> directory.


Well, actually we kind of need two builds of the same file. One is for 
the base beagle-x15 board, which doesn't need any overlays, and as such, 
does not need the symbol info either. The other one needs symbol info, 
as it is used with applying overlays. The application of overlays can't 
be done without the symbol info.

If we force both builds to use symbols, then the resulting beagle-x15 
DTB file is unnecessarily large (the size delta might be irrelevant in 
practice, but it is there; ~40 kilobytes in this case, or +50% increase 
in size.)

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/ti/Makefile b/arch/arm/boot/dts/ti/Makefile
index b26328b..7d2d411 100644
--- a/arch/arm/boot/dts/ti/Makefile
+++ b/arch/arm/boot/dts/ti/Makefile
@@ -1 +1,6 @@ 
+DTC_FLAGS += -@ -Wno-reg_format -Wno-avoid_default_addr_size
+
+$(obj)/%.dtb: $(src)/../%.dts FORCE
+	$(call if_changed_dep,dtc)
+
 clean-files	+= *.dtbo