diff mbox series

dtc: Allow overlays to have .dtbo extension

Message ID 30fd0e5f2156665c713cf191c5fea9a5548360c0.1609926856.git.viresh.kumar@linaro.org
State New
Headers show
Series dtc: Allow overlays to have .dtbo extension | expand

Commit Message

Viresh Kumar Jan. 6, 2021, 9:56 a.m. UTC
Allow the overlays to have .dtbo extension instead of just .dtb. This
allows them to be identified easily by tools as well as humans.

Allow the dtbo outform in dtc.c for the same.

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


---
Hello,

This was earlier posted for the Linux Kernel and here is the thread
where Rob gave his feedback:

https://lore.kernel.org/lkml/CAL_Jsq+0dL=LHo8r9mY_weBP_bQ97UOBnt596J3JoVHwGNinHA@mail.gmail.com/
---
 dtc.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.25.0.rc1.19.g042ed3e048af

Comments

David Gibson Jan. 11, 2021, 10:56 a.m. UTC | #1
On Wed, Jan 06, 2021 at 03:26:08PM +0530, Viresh Kumar wrote:
> Allow the overlays to have .dtbo extension instead of just .dtb. This

> allows them to be identified easily by tools as well as humans.

> 

> Allow the dtbo outform in dtc.c for the same.

> 

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


Seems reasonable.  Applied.

> 

> ---

> Hello,

> 

> This was earlier posted for the Linux Kernel and here is the thread

> where Rob gave his feedback:

> 

> https://lore.kernel.org/lkml/CAL_Jsq+0dL=LHo8r9mY_weBP_bQ97UOBnt596J3JoVHwGNinHA@mail.gmail.com/

> ---

>  dtc.c | 4 ++++

>  1 file changed, 4 insertions(+)

> 

> diff --git a/dtc.c b/dtc.c

> index bdb3f5945699..838c5df96c00 100644

> --- a/dtc.c

> +++ b/dtc.c

> @@ -122,6 +122,8 @@ static const char *guess_type_by_name(const char *fname, const char *fallback)

>  		return "dts";

>  	if (!strcasecmp(s, ".yaml"))

>  		return "yaml";

> +	if (!strcasecmp(s, ".dtbo"))

> +		return "dtb";

>  	if (!strcasecmp(s, ".dtb"))

>  		return "dtb";

>  	return fallback;

> @@ -357,6 +359,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")) {


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
diff mbox series

Patch

diff --git a/dtc.c b/dtc.c
index bdb3f5945699..838c5df96c00 100644
--- a/dtc.c
+++ b/dtc.c
@@ -122,6 +122,8 @@  static const char *guess_type_by_name(const char *fname, const char *fallback)
 		return "dts";
 	if (!strcasecmp(s, ".yaml"))
 		return "yaml";
+	if (!strcasecmp(s, ".dtbo"))
+		return "dtb";
 	if (!strcasecmp(s, ".dtb"))
 		return "dtb";
 	return fallback;
@@ -357,6 +359,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")) {