mbox series

[RFC,0/6] improve OF_PLATDATA support

Message ID 20200513201345.26769-1-walter.lozano@collabora.com
Headers show
Series improve OF_PLATDATA support | expand

Message

Walter Lozano May 13, 2020, 8:13 p.m. UTC
When using OF_PLATDATA dtbs are converted to C structs in order to save
space as we can remove both dtbs and libraries from TPL/SPL binaries.

This patchset tries to improve its support by overcoming some limitations
in the current implementation

First, the support for scan and check for valid driver/aliases is added
in order to generate U_BOOT_DEVICE entries with valid driver names.

Secondly, the way information about linked noded (phandle) is generated
in C structs is improved in order to make it easier to get a device
associated to its data.

Lastly the the suport for the property cd-gpios is added, which is used to 
configure the card detection gpio on MMC is added.

This implementation is based in discussion in [1] and [2]

[1] https://patchwork.ozlabs.org/patch/1249198/
[2] https://patchwork.ozlabs.org/project/uboot/list/?series=167495&state=*

Walter Lozano (6):
  dtoc: add support to scan drivers
  core: extend struct driver_info to point to device
  dtoc: extend dtoc to use struct driver_info when linking nodes
  dtoc: update tests to match new platdata
  dtoc: update dtb_platdata to support cd-gpios
  dtoc add test for cd-gpios

 drivers/clk/clk-uclass.c                  |   8 +-
 drivers/core/device.c                     |  25 ++-
 drivers/core/root.c                       |   6 +-
 drivers/misc/irq-uclass.c                 |   4 +-
 drivers/mmc/ftsdc010_mci.c                |   2 +-
 drivers/mmc/rockchip_dw_mmc.c             |   2 +-
 drivers/mmc/rockchip_sdhci.c              |   2 +-
 drivers/ram/rockchip/sdram_rk3399.c       |   2 +-
 drivers/spi/rk_spi.c                      |   2 +-
 include/clk.h                             |   2 +-
 include/dm/device-internal.h              |   2 +-
 include/dm/device.h                       |  19 +++
 include/dm/platdata.h                     |   6 +
 tools/dtoc/dtb_platdata.py                |  83 +++++++--
 tools/dtoc/dtoc_test_phandle_cd_gpios.dts |  42 +++++
 tools/dtoc/test_dtoc.py                   | 197 +++++++++++++++++-----
 16 files changed, 332 insertions(+), 72 deletions(-)
 create mode 100644 tools/dtoc/dtoc_test_phandle_cd_gpios.dts

Comments

Simon Glass May 20, 2020, 3:07 a.m. UTC | #1
Hi Walter,

On Wed, 13 May 2020 at 14:13, Walter Lozano <walter.lozano at collabora.com> wrote:
>
> When using OF_PLATDATA dtbs are converted to C structs in order to save
> space as we can remove both dtbs and libraries from TPL/SPL binaries.
>
> This patchset tries to improve its support by overcoming some limitations
> in the current implementation
>
> First, the support for scan and check for valid driver/aliases is added
> in order to generate U_BOOT_DEVICE entries with valid driver names.
>
> Secondly, the way information about linked noded (phandle) is generated
> in C structs is improved in order to make it easier to get a device
> associated to its data.
>
> Lastly the the suport for the property cd-gpios is added, which is used to
> configure the card detection gpio on MMC is added.
>
> This implementation is based in discussion in [1] and [2]
>
> [1] https://patchwork.ozlabs.org/patch/1249198/
> [2] https://patchwork.ozlabs.org/project/uboot/list/?series=167495&state=*
>
> Walter Lozano (6):
>   dtoc: add support to scan drivers
>   core: extend struct driver_info to point to device
>   dtoc: extend dtoc to use struct driver_info when linking nodes
>   dtoc: update tests to match new platdata
>   dtoc: update dtb_platdata to support cd-gpios
>   dtoc add test for cd-gpios
>
>  drivers/clk/clk-uclass.c                  |   8 +-
>  drivers/core/device.c                     |  25 ++-
>  drivers/core/root.c                       |   6 +-
>  drivers/misc/irq-uclass.c                 |   4 +-
>  drivers/mmc/ftsdc010_mci.c                |   2 +-
>  drivers/mmc/rockchip_dw_mmc.c             |   2 +-
>  drivers/mmc/rockchip_sdhci.c              |   2 +-
>  drivers/ram/rockchip/sdram_rk3399.c       |   2 +-
>  drivers/spi/rk_spi.c                      |   2 +-
>  include/clk.h                             |   2 +-
>  include/dm/device-internal.h              |   2 +-
>  include/dm/device.h                       |  19 +++
>  include/dm/platdata.h                     |   6 +
>  tools/dtoc/dtb_platdata.py                |  83 +++++++--
>  tools/dtoc/dtoc_test_phandle_cd_gpios.dts |  42 +++++
>  tools/dtoc/test_dtoc.py                   | 197 +++++++++++++++++-----
>  16 files changed, 332 insertions(+), 72 deletions(-)
>  create mode 100644 tools/dtoc/dtoc_test_phandle_cd_gpios.dts
>
> --
> 2.20.1
>

This looks really nice. I think you can take off the RFC. Also run
through patman/checkpatch.

Regards,
Simon
Walter Lozano May 21, 2020, 1:15 p.m. UTC | #2
Hi Simon,

On 20/5/20 00:07, Simon Glass wrote:
> Hi Walter,
>
> On Wed, 13 May 2020 at 14:13, Walter Lozano<walter.lozano at collabora.com>  wrote:
>> When using OF_PLATDATA dtbs are converted to C structs in order to save
>> space as we can remove both dtbs and libraries from TPL/SPL binaries.
>>
>> This patchset tries to improve its support by overcoming some limitations
>> in the current implementation
>>
>> First, the support for scan and check for valid driver/aliases is added
>> in order to generate U_BOOT_DEVICE entries with valid driver names.
>>
>> Secondly, the way information about linked noded (phandle) is generated
>> in C structs is improved in order to make it easier to get a device
>> associated to its data.
>>
>> Lastly the the suport for the property cd-gpios is added, which is used to
>> configure the card detection gpio on MMC is added.
>>
>> This implementation is based in discussion in [1] and [2]
>>
>> [1]https://patchwork.ozlabs.org/patch/1249198/
>> [2]https://patchwork.ozlabs.org/project/uboot/list/?series=167495&state=*
>>
>> Walter Lozano (6):
>>    dtoc: add support to scan drivers
>>    core: extend struct driver_info to point to device
>>    dtoc: extend dtoc to use struct driver_info when linking nodes
>>    dtoc: update tests to match new platdata
>>    dtoc: update dtb_platdata to support cd-gpios
>>    dtoc add test for cd-gpios
>>
>>   drivers/clk/clk-uclass.c                  |   8 +-
>>   drivers/core/device.c                     |  25 ++-
>>   drivers/core/root.c                       |   6 +-
>>   drivers/misc/irq-uclass.c                 |   4 +-
>>   drivers/mmc/ftsdc010_mci.c                |   2 +-
>>   drivers/mmc/rockchip_dw_mmc.c             |   2 +-
>>   drivers/mmc/rockchip_sdhci.c              |   2 +-
>>   drivers/ram/rockchip/sdram_rk3399.c       |   2 +-
>>   drivers/spi/rk_spi.c                      |   2 +-
>>   include/clk.h                             |   2 +-
>>   include/dm/device-internal.h              |   2 +-
>>   include/dm/device.h                       |  19 +++
>>   include/dm/platdata.h                     |   6 +
>>   tools/dtoc/dtb_platdata.py                |  83 +++++++--
>>   tools/dtoc/dtoc_test_phandle_cd_gpios.dts |  42 +++++
>>   tools/dtoc/test_dtoc.py                   | 197 +++++++++++++++++-----
>>   16 files changed, 332 insertions(+), 72 deletions(-)
>>   create mode 100644 tools/dtoc/dtoc_test_phandle_cd_gpios.dts
>>
>> --
>> 2.20.1
>>
> This looks really nice. I think you can take off the RFC. Also run
> through patman/checkpatch.
>
Thanks for the deep review and comments.

I thought initially to send a kind of quick RFC in order to check if we 
agree in the general idea, and polish the strange things that this 
series might introduce, as it will change some things I'm not able to 
test. I hope we can come to a clean patch series soon.

Thanks,

Walter