mbox series

[00/10] improve OF_PLATDATA support

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

Message

Walter Lozano May 29, 2020, 6:15 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], [2] and [3]

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

Walter Lozano (10):
  dtoc: add support to scan drivers
  dtoc: add option to disable warnings
  dm: doc: update of-plat with the suppor for driver aliases
  core: drop const for struct driver_info
  core: extend struct driver_info to point to device
  dtoc: extend dtoc to use struct driver_info when linking nodes
  dm: doc: update of-plat with new phandle support
  dtoc: update tests to match new platdata
  dtoc: update dtb_platdata to support cd-gpios
  dtoc add test for cd-gpios

 doc/driver-model/of-plat.rst              |  38 +++-
 drivers/clk/clk-uclass.c                  |  11 +-
 drivers/core/device.c                     |  28 ++-
 drivers/core/root.c                       |   6 +-
 drivers/misc/irq-uclass.c                 |  10 +-
 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                             |   4 +-
 include/dm/device-internal.h              |   2 +-
 include/dm/device.h                       |  21 +++
 include/dm/platdata.h                     |  14 ++
 tools/dtoc/dtb_platdata.py                | 129 +++++++++++--
 tools/dtoc/dtoc_test_phandle_cd_gpios.dts |  42 +++++
 tools/dtoc/test_dtoc.py                   | 218 +++++++++++++++-------
 17 files changed, 415 insertions(+), 118 deletions(-)
 create mode 100644 tools/dtoc/dtoc_test_phandle_cd_gpios.dts

Comments

Jagan Teki May 29, 2020, 6:25 p.m. UTC | #1
Hi Walter,

On Fri, May 29, 2020 at 11:45 PM Walter Lozano
<walter.lozano@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.

Does it impact the footprint?  If yes any statistic about how much
space has been reduced with respect to current platdata?

Jagan.
Walter Lozano May 29, 2020, 7:15 p.m. UTC | #2
Hi Jagan

On 29/5/20 15:25, Jagan Teki wrote:
> Hi Walter,
>
> On Fri, May 29, 2020 at 11:45 PM Walter Lozano
> <walter.lozano@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.
> Does it impact the footprint?  If yes any statistic about how much
> space has been reduced with respect to current platdata?
>
This series tries to overcome some of the limitations of the OF_PLATDATA 
support, it does not provide an improvement to the footprint.

Mainly it makes it easier to implement OF_PLATDATA, by improving the 
better support to match compatible strings with a driver name and rising 
warning in case some driver name is not found. Additionally, it 
implements a way to access the device pointed by a phandle.

However, Simon Glass is working on footprint improvements with the 
support of tiny DM based on this work.

https://patchwork.ozlabs.org/project/uboot/patch/20200525093539.1.Ibf2d19439cde35e39192a9d4a8dad23539fae2e6@changeid/

Regards,

Walter