mbox series

[v2,0/2] dfu: sf: fix flash probe when DM_SPI_FLASH is enabled

Message ID 20241001-uboot-topic-dfu-sf-dt-v2-0-67f7acfa3ff5@linaro.org
Headers show
Series dfu: sf: fix flash probe when DM_SPI_FLASH is enabled | expand

Message

Neil Armstrong Oct. 1, 2024, 4:06 p.m. UTC
With DM_SPI_FLASH is enabled, the code uses the legacy
SPI FLASH code leading to probable errors since it doesn't
use speed and mode provided by DT.

This adds the DM functions as dummy inline functions
to add both legacy and DM support in DFU sf code avoiding
using #if/#else conditionals.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- switch to if(IS_ENABLED())
- add SPI FLASH DM functions as dummy inline functions
- Link to v1: https://lore.kernel.org/r/20240917-uboot-topic-dfu-sf-dt-v1-1-8cf38451eea4@linaro.org

---
Neil Armstrong (2):
      spi: add DM_SPI_FLASH compatibility inline functions
      dfu: sf: rely on DT for spi speed and mode

 drivers/dfu/dfu_sf.c | 16 +++++++++++++++-
 include/spi_flash.h  | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)
---
base-commit: 19dbc09405d3503ce3efef3c2e4b4f0f1a03372d
change-id: 20240917-uboot-topic-dfu-sf-dt-8ae62e5c7d79

Best regards,

Comments

Mattijs Korpershoek Oct. 24, 2024, 7:43 a.m. UTC | #1
Hi,

On Tue, 01 Oct 2024 18:06:10 +0200, Neil Armstrong wrote:
> With DM_SPI_FLASH is enabled, the code uses the legacy
> SPI FLASH code leading to probable errors since it doesn't
> use speed and mode provided by DT.
> 
> This adds the DM functions as dummy inline functions
> to add both legacy and DM support in DFU sf code avoiding
> using #if/#else conditionals.
> 
> [...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)

[1/2] spi: add DM_SPI_FLASH compatibility inline functions
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/0872ac098a400632f02ae442dde65d77cc7eb1cb
[2/2] dfu: sf: rely on DT for spi speed and mode
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/97c29f868dd4e6d8f38d1cfdd964fb6b2b40267c

--
Mattijs