[U-Boot] [PATCH v3 0/1] Read default speed and mode values from DT

Patrick Delaunay patrick.delaunay at st.com
Mon Jan 28 09:06:45 UTC 2019


This patch-set finish the previous serie:
http://patchwork.ozlabs.org/project/uboot/list/?series=76834

and also replace the serie:
"Remove defines for SPI default speed and mode "
http://patchwork.ozlabs.org/project/uboot/list/?series=80769&state=*

This new version is a complete rework after several remarks
and regression for these 2 patchset, mainly when SPI node
configuration is not in DT, when platdata is used.

I take some time to check the code and this 3rd proposal
is a rework of commit
96907c0fe50a ("dm: spi: Read default speed and mode values from DT")

This patch avoid spi_get_bus_and_cs() callers to force value of
parameter speed to 0 for some board (without DT node)
and regression for other board (as i was the case in my previous
Series V2).

I see this kind of problem in file env/sf.c with first commit
96907c0fe50a ("dm: spi: Read default speed and mode values from DT")
and come-back to the previous behavior with CONFIG_ in the commit
25a17652c9c2 ("fix: env: Fix the SPI flash device setup for DM mode")

So I decide to don't remove the defines used for default value
of speed and mode but they are no more used when platdata
is available.

That avoid regression when spi_get_bus_and_cs is directly called.

NB: I don't sure that the behavior of 'compatibility' function
    spi_setup_slave() will be still is still the correct on
    (in some case speed and mode will parameter will be not used).

Tested on my board only for the boot from SPI NOR
so when spl_spi_load_image() is called in SPL.


Changes in v3:
    - complete rework of the patch-set to avoid regression

Changes in v2:
    - use variables to avoid duplicated code

Patrick Delaunay (1):
  dm: spi: Read default speed and mode values from DT

 README                   | 3 +++
 cmd/sf.c                 | 3 +--
 common/spl/spl_spi.c     | 2 ++
 drivers/spi/spi-uclass.c | 4 +++-
 include/spi.h            | 9 +++++----
 5 files changed, 14 insertions(+), 7 deletions(-)

-- 
2.7.4



More information about the U-Boot mailing list