Hi Simon,

On 23/6/20 09:28, Simon Glass wrote:
Hi Walter,

On Fri, 19 Jun 2020 at 08:56, Walter Lozano <walter.loz...@collabora.com> wrote:
Currently dtoc scans dtbs to convert them to struct platdata and
to generate U_BOOT_DEVICE entries. These entries need to be filled
with the driver name, but at this moment the information used is the
compatible name present in the dtb. This causes that only nodes with
a compatible name that matches a driver name generate a working
entry.

In order to improve this behaviour, this patch adds to dtoc the
capability of scan drivers source code to generate a list of valid driver
names. This allows to rise a warning in the case that an U_BOOT_DEVICE
entry will try to use a name not valid.

Additionally, in order to add more flexibility to the solution, adds the
U_BOOT_DRIVER_ALIAS macro, which generates no code at all, but allows an
easy way to declare driver name aliases. Thanks to this, dtoc can look
for the driver name based on its alias when it populates the U_BOOT_DEVICE
entry.

Signed-off-by: Walter Lozano <walter.loz...@collabora.com>
---
  drivers/clk/at91/pmc.c                |  2 +
  drivers/gpio/mxs_gpio.c               |  2 +
  drivers/gpio/sandbox.c                |  2 +
  drivers/i2c/rk_i2c.c                  |  2 +
  drivers/mmc/mxsmmc.c                  |  1 +
  drivers/mmc/rockchip_dw_mmc.c         |  3 +
  drivers/mtd/spi/sf_probe.c            |  2 +
  drivers/pinctrl/nxp/pinctrl-mxs.c     |  2 +
  drivers/pinctrl/pinctrl-at91.c        |  2 +
  drivers/power/pmic/rk8xx.c            |  2 +
  drivers/serial/ns16550.c              |  4 ++
  drivers/spi/mxs_spi.c                 |  2 +
  drivers/spi/rk_spi.c                  |  2 +
  include/dm/device.h                   |  7 +++
  tools/dtoc/dtb_platdata.py            | 89 +++++++++++++++++++++++++--
  tools/dtoc/dtoc_test_driver_alias.dts | 20 ++++++
  tools/dtoc/test_dtoc.py               | 33 ++++++++++
  17 files changed, 173 insertions(+), 4 deletions(-)
  create mode 100644 tools/dtoc/dtoc_test_driver_alias.dts

Reviewed-by: Simon Glass <s...@chromium.org>

But please can you split out the changes to drivers and device.h into
a separate, earlier patch? I'd like to keep tools changes separate
where possible.


Sure, thanks for your suggestion.

Regards,

Walter

Reply via email to