mbox series

[V11,0/5] dt: Add fdtoverlay rule and statically build unittest

Message ID cover.1615354376.git.viresh.kumar@linaro.org
Headers show
Series dt: Add fdtoverlay rule and statically build unittest | expand

Message

Viresh Kumar March 10, 2021, 5:35 a.m. UTC
Hi,

This patchset adds a generic rule for applying overlays using fdtoverlay
tool and then updates unittests to get built statically using the same.

V10->V11:
- Update patch 4/5 to fix checkpatch warning on spaces and tabs.
- Added Acked-by from Masahiro for patch 2/5.

V9->V10:
- Add a new patch to allow .dtso files.
- Update 2/5 to be more efficient and also generate symbols for base
  files automatically.
- No need to add lines like DTC_FLAGS_foo_base += -@ in patch 5/5.
- Add Ack by Masahiro for 1/5.

V8->V9:
- Added some comment in patch 3/4 based on Frank's suggestions.

V7->V8:
- Patch 1 is new.
- Platforms need to use dtb-y += foo.dtb instead of overlay-y +=
  foo.dtb.
- Use multi_depend instead of .SECONDEXPANSION.
- Use dtb-y for unittest instead of overlay-y.
- Rename the commented dtb filess in unittest Makefile as .dtbo.
- Improved Makefile code (I am learning a lot every day :)

V6->V7:
- Dropped the first 4 patches, already merged.
- Patch 1/3 is new, suggested by Rob and slightly modified by me.
- Adapt Patch 3/3 to the new rule and name the overlay dtbs as .dtbo.

--
Viresh

Rob Herring (1):
  kbuild: Add generic rule to apply fdtoverlay

Viresh Kumar (4):
  kbuild: Simplify builds with CONFIG_OF_ALL_DTBS
  kbuild: Allow .dtso format for overlay source files
  of: unittest: Create overlay_common.dtsi and testcases_common.dtsi
  of: unittest: Statically apply overlays using fdtoverlay

 drivers/of/unittest-data/Makefile             | 48 ++++++++++
 drivers/of/unittest-data/overlay_base.dts     | 90 +-----------------
 drivers/of/unittest-data/overlay_common.dtsi  | 91 +++++++++++++++++++
 drivers/of/unittest-data/static_base_1.dts    |  4 +
 drivers/of/unittest-data/static_base_2.dts    |  4 +
 drivers/of/unittest-data/testcases.dts        | 23 ++---
 .../of/unittest-data/testcases_common.dtsi    | 19 ++++
 .../of/unittest-data/tests-interrupts.dtsi    | 11 +--
 scripts/Makefile.lib                          | 40 ++++++--
 9 files changed, 218 insertions(+), 112 deletions(-)
 create mode 100644 drivers/of/unittest-data/overlay_common.dtsi
 create mode 100644 drivers/of/unittest-data/static_base_1.dts
 create mode 100644 drivers/of/unittest-data/static_base_2.dts
 create mode 100644 drivers/of/unittest-data/testcases_common.dtsi


base-commit: a38fd8748464831584a19438cbb3082b5a2dab15
-- 
2.25.0.rc1.19.g042ed3e048af

Comments

Frank Rowand March 11, 2021, 11:27 p.m. UTC | #1
On 3/9/21 11:35 PM, Viresh Kumar wrote:
> Hi,

> 

> This patchset adds a generic rule for applying overlays using fdtoverlay

> tool and then updates unittests to get built statically using the same.

> 

> V10->V11:

> - Update patch 4/5 to fix checkpatch warning on spaces and tabs.

> - Added Acked-by from Masahiro for patch 2/5.

> 

> V9->V10:

> - Add a new patch to allow .dtso files.

> - Update 2/5 to be more efficient and also generate symbols for base

>   files automatically.

> - No need to add lines like DTC_FLAGS_foo_base += -@ in patch 5/5.

> - Add Ack by Masahiro for 1/5.

> 

> V8->V9:

> - Added some comment in patch 3/4 based on Frank's suggestions.

> 

> V7->V8:

> - Patch 1 is new.

> - Platforms need to use dtb-y += foo.dtb instead of overlay-y +=

>   foo.dtb.

> - Use multi_depend instead of .SECONDEXPANSION.

> - Use dtb-y for unittest instead of overlay-y.

> - Rename the commented dtb filess in unittest Makefile as .dtbo.

> - Improved Makefile code (I am learning a lot every day :)

> 

> V6->V7:

> - Dropped the first 4 patches, already merged.

> - Patch 1/3 is new, suggested by Rob and slightly modified by me.

> - Adapt Patch 3/3 to the new rule and name the overlay dtbs as .dtbo.

> 

> --

> Viresh

> 

> Rob Herring (1):

>   kbuild: Add generic rule to apply fdtoverlay

> 

> Viresh Kumar (4):

>   kbuild: Simplify builds with CONFIG_OF_ALL_DTBS

>   kbuild: Allow .dtso format for overlay source files

>   of: unittest: Create overlay_common.dtsi and testcases_common.dtsi

>   of: unittest: Statically apply overlays using fdtoverlay

> 

>  drivers/of/unittest-data/Makefile             | 48 ++++++++++

>  drivers/of/unittest-data/overlay_base.dts     | 90 +-----------------

>  drivers/of/unittest-data/overlay_common.dtsi  | 91 +++++++++++++++++++

>  drivers/of/unittest-data/static_base_1.dts    |  4 +

>  drivers/of/unittest-data/static_base_2.dts    |  4 +

>  drivers/of/unittest-data/testcases.dts        | 23 ++---

>  .../of/unittest-data/testcases_common.dtsi    | 19 ++++

>  .../of/unittest-data/tests-interrupts.dtsi    | 11 +--

>  scripts/Makefile.lib                          | 40 ++++++--

>  9 files changed, 218 insertions(+), 112 deletions(-)

>  create mode 100644 drivers/of/unittest-data/overlay_common.dtsi

>  create mode 100644 drivers/of/unittest-data/static_base_1.dts

>  create mode 100644 drivers/of/unittest-data/static_base_2.dts

>  create mode 100644 drivers/of/unittest-data/testcases_common.dtsi

> 

> 

> base-commit: a38fd8748464831584a19438cbb3082b5a2dab15

> 


Does not apply to 5.12-rc2 because of a dependency on a patch to
scripts/Makefile.lib.  That patch has been merged by Linus
somewhere between -rc2 and -rc3.  I had a working version
between -rc2 and -rc3 at commit e6f197677b2e that does have
the required patch, so that is the version I used to test
this series.

There is still confusion caused by the contortions that unittest
goes through to mis-use base DTBs vs overlay DTBs, so _after_
this series is merged by Rob, I will poke around and see if
I can change unittest so that it does not look like it is
mis-using DTBs and overlay DTBs.


Reviewed-by: Frank Rowand <frank.rowand@sony.com>

Tested-by: Frank Rowand <frank.rowand@sony.com>
Viresh Kumar March 12, 2021, 4:31 a.m. UTC | #2
On 11-03-21, 17:27, Frank Rowand wrote:
> On 3/9/21 11:35 PM, Viresh Kumar wrote:

> > Viresh Kumar (4):

> >   kbuild: Simplify builds with CONFIG_OF_ALL_DTBS

> >   kbuild: Allow .dtso format for overlay source files

> >   of: unittest: Create overlay_common.dtsi and testcases_common.dtsi

> >   of: unittest: Statically apply overlays using fdtoverlay

> > 

> >  drivers/of/unittest-data/Makefile             | 48 ++++++++++

> >  drivers/of/unittest-data/overlay_base.dts     | 90 +-----------------

> >  drivers/of/unittest-data/overlay_common.dtsi  | 91 +++++++++++++++++++

> >  drivers/of/unittest-data/static_base_1.dts    |  4 +

> >  drivers/of/unittest-data/static_base_2.dts    |  4 +

> >  drivers/of/unittest-data/testcases.dts        | 23 ++---

> >  .../of/unittest-data/testcases_common.dtsi    | 19 ++++

> >  .../of/unittest-data/tests-interrupts.dtsi    | 11 +--

> >  scripts/Makefile.lib                          | 40 ++++++--

> >  9 files changed, 218 insertions(+), 112 deletions(-)

> >  create mode 100644 drivers/of/unittest-data/overlay_common.dtsi

> >  create mode 100644 drivers/of/unittest-data/static_base_1.dts

> >  create mode 100644 drivers/of/unittest-data/static_base_2.dts

> >  create mode 100644 drivers/of/unittest-data/testcases_common.dtsi

> > 

> > 

> > base-commit: a38fd8748464831584a19438cbb3082b5a2dab15

> > 

> 

> Does not apply to 5.12-rc2


I was based right over the 5.12-rc2 tag.

> because of a dependency on a patch to

> scripts/Makefile.lib.  That patch has been merged by Linus

> somewhere between -rc2 and -rc3.


git log --oneline v5.12-rc2..origin/master -- scripts/Makefile.lib

gives no results to me.

> I had a working version

> between -rc2 and -rc3 at commit e6f197677b2e


I have tried both Linus' tree and linux-next, and I don't see this
commit.

> that does have

> the required patch, so that is the version I used to test

> this series.

> 

> There is still confusion caused by the contortions that unittest

> goes through to mis-use base DTBs vs overlay DTBs, so _after_

> this series is merged by Rob, I will poke around and see if

> I can change unittest so that it does not look like it is

> mis-using DTBs and overlay DTBs.

> 

> 

> Reviewed-by: Frank Rowand <frank.rowand@sony.com>

> Tested-by: Frank Rowand <frank.rowand@sony.com>


Thanks.

-- 
viresh
Viresh Kumar March 12, 2021, 4:32 a.m. UTC | #3
On 10-03-21, 11:05, Viresh Kumar wrote:
> Hi,

> 

> This patchset adds a generic rule for applying overlays using fdtoverlay

> tool and then updates unittests to get built statically using the same.

> 

> V10->V11:

> - Update patch 4/5 to fix checkpatch warning on spaces and tabs.

> - Added Acked-by from Masahiro for patch 2/5.

> 

> 

> Rob Herring (1):

>   kbuild: Add generic rule to apply fdtoverlay

> 

> Viresh Kumar (4):

>   kbuild: Simplify builds with CONFIG_OF_ALL_DTBS

>   kbuild: Allow .dtso format for overlay source files

>   of: unittest: Create overlay_common.dtsi and testcases_common.dtsi

>   of: unittest: Statically apply overlays using fdtoverlay


Rob, can you please apply patch 1-2,4-5 from this series ? I will send
a new version of the patch 3/5 (related to .dtso) separately.

-- 
viresh
Frank Rowand March 12, 2021, 6:46 a.m. UTC | #4
On 3/11/21 10:31 PM, Viresh Kumar wrote:
> On 11-03-21, 17:27, Frank Rowand wrote:

>> On 3/9/21 11:35 PM, Viresh Kumar wrote:

>>> Viresh Kumar (4):

>>>   kbuild: Simplify builds with CONFIG_OF_ALL_DTBS

>>>   kbuild: Allow .dtso format for overlay source files

>>>   of: unittest: Create overlay_common.dtsi and testcases_common.dtsi

>>>   of: unittest: Statically apply overlays using fdtoverlay

>>>

>>>  drivers/of/unittest-data/Makefile             | 48 ++++++++++

>>>  drivers/of/unittest-data/overlay_base.dts     | 90 +-----------------

>>>  drivers/of/unittest-data/overlay_common.dtsi  | 91 +++++++++++++++++++

>>>  drivers/of/unittest-data/static_base_1.dts    |  4 +

>>>  drivers/of/unittest-data/static_base_2.dts    |  4 +

>>>  drivers/of/unittest-data/testcases.dts        | 23 ++---

>>>  .../of/unittest-data/testcases_common.dtsi    | 19 ++++

>>>  .../of/unittest-data/tests-interrupts.dtsi    | 11 +--

>>>  scripts/Makefile.lib                          | 40 ++++++--

>>>  9 files changed, 218 insertions(+), 112 deletions(-)

>>>  create mode 100644 drivers/of/unittest-data/overlay_common.dtsi

>>>  create mode 100644 drivers/of/unittest-data/static_base_1.dts

>>>  create mode 100644 drivers/of/unittest-data/static_base_2.dts

>>>  create mode 100644 drivers/of/unittest-data/testcases_common.dtsi

>>>

>>>

>>> base-commit: a38fd8748464831584a19438cbb3082b5a2dab15

>>>

>>

>> Does not apply to 5.12-rc2

> 

> I was based right over the 5.12-rc2 tag.


I don't know why I failed.  Given your report, I went back to
v5.12-rc2 and the patch series applies fine.

Either way, my tags are ok.

> 

>> because of a dependency on a patch to

>> scripts/Makefile.lib.  That patch has been merged by Linus

>> somewhere between -rc2 and -rc3.

> 

> git log --oneline v5.12-rc2..origin/master -- scripts/Makefile.lib

> 

> gives no results to me.

> 

>> I had a working version

>> between -rc2 and -rc3 at commit e6f197677b2e

> 

> I have tried both Linus' tree and linux-next, and I don't see this

> commit.


Sorry about that, the commit id I gave was after applying the patch
series.  The commit id I should have reported is 144c79ef3353.

-Frank

> 

>> that does have

>> the required patch, so that is the version I used to test

>> this series.

>>

>> There is still confusion caused by the contortions that unittest

>> goes through to mis-use base DTBs vs overlay DTBs, so _after_

>> this series is merged by Rob, I will poke around and see if

>> I can change unittest so that it does not look like it is

>> mis-using DTBs and overlay DTBs.

>>

>>

>> Reviewed-by: Frank Rowand <frank.rowand@sony.com>

>> Tested-by: Frank Rowand <frank.rowand@sony.com>

> 

> Thanks.

>
Rob Herring March 15, 2021, 5:13 p.m. UTC | #5
On Wed, 10 Mar 2021 11:05:28 +0530, Viresh Kumar wrote:
> Hi,

> 

> This patchset adds a generic rule for applying overlays using fdtoverlay

> tool and then updates unittests to get built statically using the same.

> 

> V10->V11:

> - Update patch 4/5 to fix checkpatch warning on spaces and tabs.

> - Added Acked-by from Masahiro for patch 2/5.

> 

> V9->V10:

> - Add a new patch to allow .dtso files.

> - Update 2/5 to be more efficient and also generate symbols for base

>   files automatically.

> - No need to add lines like DTC_FLAGS_foo_base += -@ in patch 5/5.

> - Add Ack by Masahiro for 1/5.

> 

> V8->V9:

> - Added some comment in patch 3/4 based on Frank's suggestions.

> 

> V7->V8:

> - Patch 1 is new.

> - Platforms need to use dtb-y += foo.dtb instead of overlay-y +=

>   foo.dtb.

> - Use multi_depend instead of .SECONDEXPANSION.

> - Use dtb-y for unittest instead of overlay-y.

> - Rename the commented dtb filess in unittest Makefile as .dtbo.

> - Improved Makefile code (I am learning a lot every day :)

> 

> V6->V7:

> - Dropped the first 4 patches, already merged.

> - Patch 1/3 is new, suggested by Rob and slightly modified by me.

> - Adapt Patch 3/3 to the new rule and name the overlay dtbs as .dtbo.

> 

> --

> Viresh

> 

> Rob Herring (1):

>   kbuild: Add generic rule to apply fdtoverlay

> 

> Viresh Kumar (4):

>   kbuild: Simplify builds with CONFIG_OF_ALL_DTBS

>   kbuild: Allow .dtso format for overlay source files

>   of: unittest: Create overlay_common.dtsi and testcases_common.dtsi

>   of: unittest: Statically apply overlays using fdtoverlay

> 

>  drivers/of/unittest-data/Makefile             | 48 ++++++++++

>  drivers/of/unittest-data/overlay_base.dts     | 90 +-----------------

>  drivers/of/unittest-data/overlay_common.dtsi  | 91 +++++++++++++++++++

>  drivers/of/unittest-data/static_base_1.dts    |  4 +

>  drivers/of/unittest-data/static_base_2.dts    |  4 +

>  drivers/of/unittest-data/testcases.dts        | 23 ++---

>  .../of/unittest-data/testcases_common.dtsi    | 19 ++++

>  .../of/unittest-data/tests-interrupts.dtsi    | 11 +--

>  scripts/Makefile.lib                          | 40 ++++++--

>  9 files changed, 218 insertions(+), 112 deletions(-)

>  create mode 100644 drivers/of/unittest-data/overlay_common.dtsi

>  create mode 100644 drivers/of/unittest-data/static_base_1.dts

>  create mode 100644 drivers/of/unittest-data/static_base_2.dts

>  create mode 100644 drivers/of/unittest-data/testcases_common.dtsi

> 

> 

> base-commit: a38fd8748464831584a19438cbb3082b5a2dab15

> --

> 2.25.0.rc1.19.g042ed3e048af

> 

> 

> 


Applied patches 1,2,4,5, thanks!