[v2,1/7] kbuild: Allow DTB overlays to built from .dtso named source files

Message ID 20221024173434.32518-2-afd@ti.com
State New
Headers
Series Rename DTB overlay source files |

Commit Message

Andrew Davis Oct. 24, 2022, 5:34 p.m. UTC
  Currently DTB Overlays (.dtbo) are build from source files with the same
extension (.dts) as the base DTs (.dtb). This may become confusing and
even lead to wrong results. For example, a composite DTB (created from a
base DTB and a set of overlays) might have the same name as one of the
overlays that create it.

Different files should be generated from differently named sources.
 .dtb  <-> .dts
 .dtbo <-> .dtso

We do not remove the ability to compile DTBO files from .dts files here,
only add a new rule allowing the .dtso file name. The current .dts named
overlays can be renamed with time. After all have been renamed we can
remove the other rule.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 scripts/Makefile.lib | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Frank Rowand Oct. 24, 2022, 10:01 p.m. UTC | #1
On 10/24/22 12:34, Andrew Davis wrote:
> Currently DTB Overlays (.dtbo) are build from source files with the same
> extension (.dts) as the base DTs (.dtb). This may become confusing and
> even lead to wrong results. For example, a composite DTB (created from a
> base DTB and a set of overlays) might have the same name as one of the
> overlays that create it.
> 
> Different files should be generated from differently named sources.
>  .dtb  <-> .dts
>  .dtbo <-> .dtso
> 
> We do not remove the ability to compile DTBO files from .dts files here,
> only add a new rule allowing the .dtso file name. The current .dts named
> overlays can be renamed with time. After all have been renamed we can
> remove the other rule.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Tested-by: Frank Rowand <frowand.list@gmail.com>

-Frank


>  scripts/Makefile.lib | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 3aa384cec76b8..0376a6f18bfb1 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -408,6 +408,9 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
>  $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
>  	$(call if_changed_dep,dtc)
>  
> +$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
> +	$(call if_changed_dep,dtc)
> +
>  dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
>  
>  # Bzip2
  

Patch

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 3aa384cec76b8..0376a6f18bfb1 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -408,6 +408,9 @@  $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
 $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
 	$(call if_changed_dep,dtc)
 
+$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
+	$(call if_changed_dep,dtc)
+
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
 
 # Bzip2