Message ID | 1544439166-5749-4-git-send-email-patrick.delaunay@st.com |
---|---|
State | Changes Requested |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show |
Series | Remove defines for SPI default speed and mode | expand |
Hi Patrick, > 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@st.com> Reviewed-by: Petr Vorel <petr.vorel@gmail.com> Kind regards, Petr
+ Adam On Mon, Dec 10, 2018 at 4:23 PM Patrick Delaunay <patrick.delaunay@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@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.
Thanks Jagan for the reviews. > From: Jagan Teki <jagan@amarulasolutions.com> > Sent: mercredi 12 décembre 2018 21:03 > > --- a/board/davinci/da8xxevm/da850evm.c > > +++ b/board/davinci/da8xxevm/da850evm.c > > This board support DM_SPI_FLASH even in for SPL, so there is no need of non- > dm if here. I will do the update in v3 Patrick.
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 #define CFG_MAC_ADDR_OFFSET (flash->size - SZ_64K)
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@st.com> --- board/davinci/da8xxevm/da850evm.c | 7 +++++++ 1 file changed, 7 insertions(+)