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

Patrick Delaunay patrick.delaunay at st.com
Wed Feb 27 14:36:43 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 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 v4:
    - rebase on v2019.04-rc2
    - after Jagan review depends on Migrate SPI defines to Kconfig
      http://patchwork.ozlabs.org/project/uboot/list/?series=94485
    - remove no more supported configuration:
      CONFIG_ENV_SPI_MAX_HZ=0 or CONFIG_ENV_SPI_MODE=0

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

 cmd/sf.c                          | 3 +--
 common/spl/spl_spi.c              | 2 ++
 configs/da850_am18xxevm_defconfig | 4 ----
 configs/da850evm_defconfig        | 4 ----
 configs/mscc_jr2_defconfig        | 4 ----
 configs/mscc_luton_defconfig      | 4 ----
 configs/mscc_ocelot_defconfig     | 4 ----
 configs/mscc_serval_defconfig     | 4 ----
 configs/mscc_servalt_defconfig    | 4 ----
 drivers/mtd/spi/Kconfig           | 6 ++++++
 drivers/spi/spi-uclass.c          | 4 +++-
 include/spi.h                     | 9 +++++----
 12 files changed, 17 insertions(+), 35 deletions(-)

-- 
2.7.4



More information about the U-Boot mailing list