[U-Boot] [PATCH 3/7] da850evm: sf: Read default speed and mode values from DT

Jagan Teki jagan at amarulasolutions.com
Wed Dec 12 20:02:47 UTC 2018


+ Adam

On Mon, Dec 10, 2018 at 4:23 PM Patrick Delaunay
<patrick.delaunay at st.com> wrote:
>
> In case of DT boot, don't read default speed and mode for SPI from
> CONFIG_*, instead read from DT node.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
>
>  board/davinci/da8xxevm/da850evm.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
> index b0b29b3..4ef454e 100644
> --- a/board/davinci/da8xxevm/da850evm.c
> +++ b/board/davinci/da8xxevm/da850evm.c
> @@ -44,8 +44,15 @@ DECLARE_GLOBAL_DATA_PTR;
>
>  #define CFG_MAC_ADDR_SPI_BUS   0
>  #define CFG_MAC_ADDR_SPI_CS    0
> +
> +#ifdef CONFIG_DM_SPI_FLASH
> +/* In DM mode, speed and mode value will be taken from DT */
> +#define CFG_MAC_ADDR_SPI_MAX_HZ        0
> +#define CFG_MAC_ADDR_SPI_MODE  0
> +#else
>  #define CFG_MAC_ADDR_SPI_MAX_HZ        CONFIG_SF_DEFAULT_SPEED
>  #define CFG_MAC_ADDR_SPI_MODE  SPI_MODE_3
> +#endif

This board support DM_SPI_FLASH even in for SPL, so there is no need
of non-dm if here.


More information about the U-Boot mailing list