mbox series

[v6,0/5] of-platdata: Avoid building libfdt

Message ID 20210725161347.457937-1-sjg@chromium.org
Headers show
Series of-platdata: Avoid building libfdt | expand

Message

Simon Glass July 25, 2021, 4:13 p.m. UTC
The original patch of this series was sent in September 2019 but
unfortunately caused build problems on some boards, since they don't
comply with the of-platdata rules.

With of-platdata, the idea is to compile the device tree into C structures
to save space and avoid needing to use libfdt. But some boards use
of-platdata while also using libfdt in a few areas, thus defeating the
purpose of of-platdata.

This series includes the original two patches

   http://patchwork.ozlabs.org/patch/1167420/
   http://patchwork.ozlabs.org/patch/1167367/

as well as a few other patches to fix the build errors. Overall this
reduces code size and provides better error messages when unavailable
functions are used.

Board maintainers should still take a look at the result, adjusting the
of-platdata support as needed.

Note: This series was resent a year ago but not applied. Since then, some
boards have ended up using drivers in SPL which require OF_CONTROL, but
SPL_OF_CONTROL is not enabled. So now we have two problems. This series
fixes that one also.

The problems will keep getting worse if people are not aware that
something is wrong. Therefore I think this patch series should be applied
ASAP.

Changes in v6:
- Add new patch for atheros
- Add new patch for SPI flash
- Rebase to master

Changes in v5:
- Drop rockchip patches as those boards have been fixed

Changes in v4:
- Add new patch for rockchip build errors
- Add new patch for omap MMC build errors
- Add new patch for rockchip chromebook build errors
- Pull out patches into a new series
- Add new patches to handle build failures

Changes in v3:
- Fix eth_dev_get_mac_address() call dev_read...() only when available

Simon Glass (5):
  omap: mmc: Avoid using libfdt with of-platdata
  net: atheros: Add a check for OF_CONTROL
  spi: Add checks for OF_CONTROL
  spl: Allow SPL/TPL to use of-platdata without libfdt
  dm: core: Don't include ofnode functions with of-platdata

 drivers/core/Makefile     |  4 +++-
 drivers/mmc/davinci_mmc.c |  6 ++++++
 drivers/net/phy/atheros.c | 11 +++++++++++
 drivers/spi/spi-uclass.c  | 16 +++++++++++++---
 lib/Kconfig               |  4 ++--
 5 files changed, 35 insertions(+), 6 deletions(-)

Comments

Tom Rini July 25, 2021, 8:32 p.m. UTC | #1
On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:

> The original patch of this series was sent in September 2019 but
> unfortunately caused build problems on some boards, since they don't
> comply with the of-platdata rules.
> 
> With of-platdata, the idea is to compile the device tree into C structures
> to save space and avoid needing to use libfdt. But some boards use
> of-platdata while also using libfdt in a few areas, thus defeating the
> purpose of of-platdata.
> 
> This series includes the original two patches
> 
>    http://patchwork.ozlabs.org/patch/1167420/
>    http://patchwork.ozlabs.org/patch/1167367/
> 
> as well as a few other patches to fix the build errors. Overall this
> reduces code size and provides better error messages when unavailable
> functions are used.
> 
> Board maintainers should still take a look at the result, adjusting the
> of-platdata support as needed.
> 
> Note: This series was resent a year ago but not applied. Since then, some
> boards have ended up using drivers in SPL which require OF_CONTROL, but
> SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> fixes that one also.
> 
> The problems will keep getting worse if people are not aware that
> something is wrong. Therefore I think this patch series should be applied
> ASAP.

OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
now are:
am335x_boneblack_vboot am335x_evm am335x_evm_spiboot

So are all of the other problems still present?  I'm going to look in to
the am335x failures.
Simon Glass July 26, 2021, 3:57 a.m. UTC | #2
Hi Tom,

On Sun, 25 Jul 2021 at 14:32, Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:
>
> > The original patch of this series was sent in September 2019 but
> > unfortunately caused build problems on some boards, since they don't
> > comply with the of-platdata rules.
> >
> > With of-platdata, the idea is to compile the device tree into C structures
> > to save space and avoid needing to use libfdt. But some boards use
> > of-platdata while also using libfdt in a few areas, thus defeating the
> > purpose of of-platdata.
> >
> > This series includes the original two patches
> >
> >    http://patchwork.ozlabs.org/patch/1167420/
> >    http://patchwork.ozlabs.org/patch/1167367/
> >
> > as well as a few other patches to fix the build errors. Overall this
> > reduces code size and provides better error messages when unavailable
> > functions are used.
> >
> > Board maintainers should still take a look at the result, adjusting the
> > of-platdata support as needed.
> >
> > Note: This series was resent a year ago but not applied. Since then, some
> > boards have ended up using drivers in SPL which require OF_CONTROL, but
> > SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> > fixes that one also.
> >
> > The problems will keep getting worse if people are not aware that
> > something is wrong. Therefore I think this patch series should be applied
> > ASAP.
>
> OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
> now are:
> am335x_boneblack_vboot am335x_evm am335x_evm_spiboot
>
> So are all of the other problems still present?  I'm going to look in to
> the am335x failures.

I got a passing build here:

https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/8398

I am wondering if I did something wrong when sending?

Regards,
SImon
Tom Rini July 26, 2021, 12:09 p.m. UTC | #3
On Sun, Jul 25, 2021 at 09:57:25PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Sun, 25 Jul 2021 at 14:32, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:
> >
> > > The original patch of this series was sent in September 2019 but
> > > unfortunately caused build problems on some boards, since they don't
> > > comply with the of-platdata rules.
> > >
> > > With of-platdata, the idea is to compile the device tree into C structures
> > > to save space and avoid needing to use libfdt. But some boards use
> > > of-platdata while also using libfdt in a few areas, thus defeating the
> > > purpose of of-platdata.
> > >
> > > This series includes the original two patches
> > >
> > >    http://patchwork.ozlabs.org/patch/1167420/
> > >    http://patchwork.ozlabs.org/patch/1167367/
> > >
> > > as well as a few other patches to fix the build errors. Overall this
> > > reduces code size and provides better error messages when unavailable
> > > functions are used.
> > >
> > > Board maintainers should still take a look at the result, adjusting the
> > > of-platdata support as needed.
> > >
> > > Note: This series was resent a year ago but not applied. Since then, some
> > > boards have ended up using drivers in SPL which require OF_CONTROL, but
> > > SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> > > fixes that one also.
> > >
> > > The problems will keep getting worse if people are not aware that
> > > something is wrong. Therefore I think this patch series should be applied
> > > ASAP.
> >
> > OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
> > now are:
> > am335x_boneblack_vboot am335x_evm am335x_evm_spiboot
> >
> > So are all of the other problems still present?  I'm going to look in to
> > the am335x failures.
> 
> I got a passing build here:
> 
> https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/8398
> 
> I am wondering if I did something wrong when sending?

I didn't include patches 1-4, in order to get build failures and see
what platforms need fixing.
Simon Glass July 26, 2021, 1:45 p.m. UTC | #4
Hi Tom,

On Mon, 26 Jul 2021 at 06:09, Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Jul 25, 2021 at 09:57:25PM -0600, Simon Glass wrote:
> > Hi Tom,
> >
> > On Sun, 25 Jul 2021 at 14:32, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:
> > >
> > > > The original patch of this series was sent in September 2019 but
> > > > unfortunately caused build problems on some boards, since they don't
> > > > comply with the of-platdata rules.
> > > >
> > > > With of-platdata, the idea is to compile the device tree into C structures
> > > > to save space and avoid needing to use libfdt. But some boards use
> > > > of-platdata while also using libfdt in a few areas, thus defeating the
> > > > purpose of of-platdata.
> > > >
> > > > This series includes the original two patches
> > > >
> > > >    http://patchwork.ozlabs.org/patch/1167420/
> > > >    http://patchwork.ozlabs.org/patch/1167367/
> > > >
> > > > as well as a few other patches to fix the build errors. Overall this
> > > > reduces code size and provides better error messages when unavailable
> > > > functions are used.
> > > >
> > > > Board maintainers should still take a look at the result, adjusting the
> > > > of-platdata support as needed.
> > > >
> > > > Note: This series was resent a year ago but not applied. Since then, some
> > > > boards have ended up using drivers in SPL which require OF_CONTROL, but
> > > > SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> > > > fixes that one also.
> > > >
> > > > The problems will keep getting worse if people are not aware that
> > > > something is wrong. Therefore I think this patch series should be applied
> > > > ASAP.
> > >
> > > OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
> > > now are:
> > > am335x_boneblack_vboot am335x_evm am335x_evm_spiboot
> > >
> > > So are all of the other problems still present?  I'm going to look in to
> > > the am335x failures.
> >
> > I got a passing build here:
> >
> > https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/8398
> >
> > I am wondering if I did something wrong when sending?
>
> I didn't include patches 1-4, in order to get build failures and see
> what platforms need fixing.

OK, I see. Yes I believe all the problems are still present. If you
like i can add the errors/warnings I saw here.

Regards,
SImon
Tom Rini July 26, 2021, 2:43 p.m. UTC | #5
On Mon, Jul 26, 2021 at 07:45:27AM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 26 Jul 2021 at 06:09, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Jul 25, 2021 at 09:57:25PM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Sun, 25 Jul 2021 at 14:32, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:
> > > >
> > > > > The original patch of this series was sent in September 2019 but
> > > > > unfortunately caused build problems on some boards, since they don't
> > > > > comply with the of-platdata rules.
> > > > >
> > > > > With of-platdata, the idea is to compile the device tree into C structures
> > > > > to save space and avoid needing to use libfdt. But some boards use
> > > > > of-platdata while also using libfdt in a few areas, thus defeating the
> > > > > purpose of of-platdata.
> > > > >
> > > > > This series includes the original two patches
> > > > >
> > > > >    http://patchwork.ozlabs.org/patch/1167420/
> > > > >    http://patchwork.ozlabs.org/patch/1167367/
> > > > >
> > > > > as well as a few other patches to fix the build errors. Overall this
> > > > > reduces code size and provides better error messages when unavailable
> > > > > functions are used.
> > > > >
> > > > > Board maintainers should still take a look at the result, adjusting the
> > > > > of-platdata support as needed.
> > > > >
> > > > > Note: This series was resent a year ago but not applied. Since then, some
> > > > > boards have ended up using drivers in SPL which require OF_CONTROL, but
> > > > > SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> > > > > fixes that one also.
> > > > >
> > > > > The problems will keep getting worse if people are not aware that
> > > > > something is wrong. Therefore I think this patch series should be applied
> > > > > ASAP.
> > > >
> > > > OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
> > > > now are:
> > > > am335x_boneblack_vboot am335x_evm am335x_evm_spiboot
> > > >
> > > > So are all of the other problems still present?  I'm going to look in to
> > > > the am335x failures.
> > >
> > > I got a passing build here:
> > >
> > > https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/8398
> > >
> > > I am wondering if I did something wrong when sending?
> >
> > I didn't include patches 1-4, in order to get build failures and see
> > what platforms need fixing.
> 
> OK, I see. Yes I believe all the problems are still present. If you
> like i can add the errors/warnings I saw here.

Please. https://source.denx.de/u-boot/u-boot/-/jobs/298139 are the only
errors I saw at build time when not using the patches to turn build time
in to run time problems.
Simon Glass July 31, 2021, 11:07 p.m. UTC | #6
Hi Tom,

On Mon, 26 Jul 2021 at 08:43, Tom Rini <trini@konsulko.com> wrote:
>
> On Mon, Jul 26, 2021 at 07:45:27AM -0600, Simon Glass wrote:
> > Hi Tom,
> >
> > On Mon, 26 Jul 2021 at 06:09, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Jul 25, 2021 at 09:57:25PM -0600, Simon Glass wrote:
> > > > Hi Tom,
> > > >
> > > > On Sun, 25 Jul 2021 at 14:32, Tom Rini <trini@konsulko.com> wrote:
> > > > >
> > > > > On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:
> > > > >
> > > > > > The original patch of this series was sent in September 2019 but
> > > > > > unfortunately caused build problems on some boards, since they don't
> > > > > > comply with the of-platdata rules.
> > > > > >
> > > > > > With of-platdata, the idea is to compile the device tree into C structures
> > > > > > to save space and avoid needing to use libfdt. But some boards use
> > > > > > of-platdata while also using libfdt in a few areas, thus defeating the
> > > > > > purpose of of-platdata.
> > > > > >
> > > > > > This series includes the original two patches
> > > > > >
> > > > > >    http://patchwork.ozlabs.org/patch/1167420/
> > > > > >    http://patchwork.ozlabs.org/patch/1167367/
> > > > > >
> > > > > > as well as a few other patches to fix the build errors. Overall this
> > > > > > reduces code size and provides better error messages when unavailable
> > > > > > functions are used.
> > > > > >
> > > > > > Board maintainers should still take a look at the result, adjusting the
> > > > > > of-platdata support as needed.
> > > > > >
> > > > > > Note: This series was resent a year ago but not applied. Since then, some
> > > > > > boards have ended up using drivers in SPL which require OF_CONTROL, but
> > > > > > SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> > > > > > fixes that one also.
> > > > > >
> > > > > > The problems will keep getting worse if people are not aware that
> > > > > > something is wrong. Therefore I think this patch series should be applied
> > > > > > ASAP.
> > > > >
> > > > > OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
> > > > > now are:
> > > > > am335x_boneblack_vboot am335x_evm am335x_evm_spiboot
> > > > >
> > > > > So are all of the other problems still present?  I'm going to look in to
> > > > > the am335x failures.
> > > >
> > > > I got a passing build here:
> > > >
> > > > https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/8398
> > > >
> > > > I am wondering if I did something wrong when sending?
> > >
> > > I didn't include patches 1-4, in order to get build failures and see
> > > what platforms need fixing.
> >
> > OK, I see. Yes I believe all the problems are still present. If you
> > like i can add the errors/warnings I saw here.
>
> Please. https://source.denx.de/u-boot/u-boot/-/jobs/298139 are the only
> errors I saw at build time when not using the patches to turn build time
> in to run time problems.

Yes I see the same thing now.

I suspect I didn't have the latest master when I started and some
boards have been removed.

Do you want to just take the patches that make sense from this series?

Regards,
Simon
Tom Rini July 31, 2021, 11:11 p.m. UTC | #7
On Sat, Jul 31, 2021 at 05:07:41PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 26 Jul 2021 at 08:43, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Mon, Jul 26, 2021 at 07:45:27AM -0600, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Mon, 26 Jul 2021 at 06:09, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sun, Jul 25, 2021 at 09:57:25PM -0600, Simon Glass wrote:
> > > > > Hi Tom,
> > > > >
> > > > > On Sun, 25 Jul 2021 at 14:32, Tom Rini <trini@konsulko.com> wrote:
> > > > > >
> > > > > > On Sun, Jul 25, 2021 at 10:13:42AM -0600, Simon Glass wrote:
> > > > > >
> > > > > > > The original patch of this series was sent in September 2019 but
> > > > > > > unfortunately caused build problems on some boards, since they don't
> > > > > > > comply with the of-platdata rules.
> > > > > > >
> > > > > > > With of-platdata, the idea is to compile the device tree into C structures
> > > > > > > to save space and avoid needing to use libfdt. But some boards use
> > > > > > > of-platdata while also using libfdt in a few areas, thus defeating the
> > > > > > > purpose of of-platdata.
> > > > > > >
> > > > > > > This series includes the original two patches
> > > > > > >
> > > > > > >    http://patchwork.ozlabs.org/patch/1167420/
> > > > > > >    http://patchwork.ozlabs.org/patch/1167367/
> > > > > > >
> > > > > > > as well as a few other patches to fix the build errors. Overall this
> > > > > > > reduces code size and provides better error messages when unavailable
> > > > > > > functions are used.
> > > > > > >
> > > > > > > Board maintainers should still take a look at the result, adjusting the
> > > > > > > of-platdata support as needed.
> > > > > > >
> > > > > > > Note: This series was resent a year ago but not applied. Since then, some
> > > > > > > boards have ended up using drivers in SPL which require OF_CONTROL, but
> > > > > > > SPL_OF_CONTROL is not enabled. So now we have two problems. This series
> > > > > > > fixes that one also.
> > > > > > >
> > > > > > > The problems will keep getting worse if people are not aware that
> > > > > > > something is wrong. Therefore I think this patch series should be applied
> > > > > > > ASAP.
> > > > > >
> > > > > > OK, so I took 5/6 and 6/6 and fired off a build.  The only fails-to-link
> > > > > > now are:
> > > > > > am335x_boneblack_vboot am335x_evm am335x_evm_spiboot
> > > > > >
> > > > > > So are all of the other problems still present?  I'm going to look in to
> > > > > > the am335x failures.
> > > > >
> > > > > I got a passing build here:
> > > > >
> > > > > https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/8398
> > > > >
> > > > > I am wondering if I did something wrong when sending?
> > > >
> > > > I didn't include patches 1-4, in order to get build failures and see
> > > > what platforms need fixing.
> > >
> > > OK, I see. Yes I believe all the problems are still present. If you
> > > like i can add the errors/warnings I saw here.
> >
> > Please. https://source.denx.de/u-boot/u-boot/-/jobs/298139 are the only
> > errors I saw at build time when not using the patches to turn build time
> > in to run time problems.
> 
> Yes I see the same thing now.
> 
> I suspect I didn't have the latest master when I started and some
> boards have been removed.
> 
> Do you want to just take the patches that make sense from this series?

It gets back to figuring out something to do for am335x_evm.  I need to
post the fixes for the other two defconfigs as well.