diff mbox series

[RFC,2/2] scripts: dtc: Handle outform dtbo

Message ID 7aa70809eff3f32d821761d2a763e4fb72ecc8fb.1609844956.git.viresh.kumar@linaro.org (mailing list archive)
State New, archived
Headers show
Series kbuild: Add support to build overlays (%.dtbo) | expand

Commit Message

Viresh Kumar Jan. 5, 2021, 11:24 a.m. UTC
Update dtc compiler to accept dtbo as an outform.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
I feel that this needs to go directly to
https://git.kernel.org/pub/scm/utils/dtc/dtc.git

Right ? I will send it separately if the idea is accepted here.
---
 scripts/dtc/dtc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Rob Herring Jan. 5, 2021, 3:37 p.m. UTC | #1
On Tue, Jan 5, 2021 at 4:24 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> Update dtc compiler to accept dtbo as an outform.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> ---
> I feel that this needs to go directly to
> https://git.kernel.org/pub/scm/utils/dtc/dtc.git
>
> Right ? I will send it separately if the idea is accepted here.

Yes, needs to go to devicetree-compiler list. I think this came up
before and IIRC David wasn't completely in agreement. I looked briefly
and couldn't find the thread though...

We really don't need a different extension because we could just
examine the dtb to determine if it is an overlay or not. That's less
obvious. We could also add meta-data to overlays defining what base
they apply to. If we had that, a tool could just list all overlays
that should apply to a base and we could use that info for build time
applying overlays. Of course, that and a dtbo extension/format are not
mutually exclusive.

> ---
>  scripts/dtc/dtc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
> index bdb3f5945699..40fa7128b3d6 100644
> --- a/scripts/dtc/dtc.c
> +++ b/scripts/dtc/dtc.c
> @@ -357,6 +357,8 @@ int main(int argc, char *argv[])
>  #endif
>         } else if (streq(outform, "dtb")) {
>                 dt_to_blob(outf, dti, outversion);
> +       } else if (streq(outform, "dtbo")) {
> +               dt_to_blob(outf, dti, outversion);
>         } else if (streq(outform, "asm")) {
>                 dt_to_asm(outf, dti, outversion);
>         } else if (streq(outform, "null")) {

You also need to extend guess_type_by_name().


Rob
Frank Rowand Jan. 12, 2021, 12:18 a.m. UTC | #2
On 1/5/21 9:37 AM, Rob Herring wrote:
> On Tue, Jan 5, 2021 at 4:24 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>>
>> Update dtc compiler to accept dtbo as an outform.
>>
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>>
>> ---
>> I feel that this needs to go directly to
>> https://git.kernel.org/pub/scm/utils/dtc/dtc.git
>>
>> Right ? I will send it separately if the idea is accepted here.
> 
> Yes, needs to go to devicetree-compiler list. I think this came up
> before and IIRC David wasn't completely in agreement. I looked briefly
> and couldn't find the thread though...
> 
> We really don't need a different extension because we could just
> examine the dtb to determine if it is an overlay or not. That's less
> obvious. We could also add meta-data to overlays defining what base
> they apply to. If we had that, a tool could just list all overlays

It may be valid to apply an overlay may be valid to more than one base FDT.

And for connector nodes and plugin overlays (which do not exist yet, I'm
way behind on bringing that concept forward), a single overlay may be
applied to more than one connector node in the base FDT.

> that should apply to a base and we could use that info for build time
> applying overlays. Of course, that and a dtbo extension/format are not
> mutually exclusive.
> 
>> ---
>>  scripts/dtc/dtc.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
>> index bdb3f5945699..40fa7128b3d6 100644
>> --- a/scripts/dtc/dtc.c
>> +++ b/scripts/dtc/dtc.c
>> @@ -357,6 +357,8 @@ int main(int argc, char *argv[])
>>  #endif
>>         } else if (streq(outform, "dtb")) {
>>                 dt_to_blob(outf, dti, outversion);
>> +       } else if (streq(outform, "dtbo")) {
>> +               dt_to_blob(outf, dti, outversion);
>>         } else if (streq(outform, "asm")) {
>>                 dt_to_asm(outf, dti, outversion);
>>         } else if (streq(outform, "null")) {
> 
> You also need to extend guess_type_by_name().
> 
> 
> Rob
>
diff mbox series

Patch

diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
index bdb3f5945699..40fa7128b3d6 100644
--- a/scripts/dtc/dtc.c
+++ b/scripts/dtc/dtc.c
@@ -357,6 +357,8 @@  int main(int argc, char *argv[])
 #endif
 	} else if (streq(outform, "dtb")) {
 		dt_to_blob(outf, dti, outversion);
+	} else if (streq(outform, "dtbo")) {
+		dt_to_blob(outf, dti, outversion);
 	} else if (streq(outform, "asm")) {
 		dt_to_asm(outf, dti, outversion);
 	} else if (streq(outform, "null")) {