Re: [U-Boot] [PATCH 4/7] dfu: sf: Read default speed and mode values from DT

2018-12-10 Thread Petr Vorel
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 
Reviewed-by: Petr Vorel 


Kind regards,
Petr
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/7] dfu: sf: Read default speed and mode values from DT

2018-12-10 Thread Lukasz Majewski
On Mon, 10 Dec 2018 11:52:43 +0100
Patrick Delaunay  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 
> ---
> 
>  drivers/dfu/dfu_sf.c | 10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
> index 066e767..5e32f80 100644
> --- a/drivers/dfu/dfu_sf.c
> +++ b/drivers/dfu/dfu_sf.c
> @@ -69,11 +69,17 @@ static struct spi_flash *parse_dev(char *devstr)
>  {
>   unsigned int bus;
>   unsigned int cs;
> - unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
> - unsigned int mode = CONFIG_SF_DEFAULT_MODE;
> + /* In DM mode, defaults will be taken from DT */
> + unsigned int speed = 0;
> + unsigned int mode = 0;
>   char *s, *endp;
>   struct spi_flash *dev;
>  
> +#ifndef CONFIG_DM_SPI_FLASH
> + speed = CONFIG_SF_DEFAULT_SPEED;
> + mode = CONFIG_SF_DEFAULT_MODE;
> +#endif
> +
>   s = strsep(, ":");
>   if (!s || !*s || (bus = simple_strtoul(s, , 0), *endp))
> { printf("Invalid SPI bus %s\n", s);

Reviewed-by: Lukasz Majewski 


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


pgp_YmfBnrVK3.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2018-12-10 Thread Patrick Delaunay
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 
---

 drivers/dfu/dfu_sf.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
index 066e767..5e32f80 100644
--- a/drivers/dfu/dfu_sf.c
+++ b/drivers/dfu/dfu_sf.c
@@ -69,11 +69,17 @@ static struct spi_flash *parse_dev(char *devstr)
 {
unsigned int bus;
unsigned int cs;
-   unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
-   unsigned int mode = CONFIG_SF_DEFAULT_MODE;
+   /* In DM mode, defaults will be taken from DT */
+   unsigned int speed = 0;
+   unsigned int mode = 0;
char *s, *endp;
struct spi_flash *dev;
 
+#ifndef CONFIG_DM_SPI_FLASH
+   speed = CONFIG_SF_DEFAULT_SPEED;
+   mode = CONFIG_SF_DEFAULT_MODE;
+#endif
+
s = strsep(, ":");
if (!s || !*s || (bus = simple_strtoul(s, , 0), *endp)) {
printf("Invalid SPI bus %s\n", s);
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot