Re: [U-Boot] [PATCH 1/5] fix: env: Fix the SPI flash device setup for DM mode

2018-11-20 Thread Adam Ford
On Wed, Aug 29, 2018 at 8:37 AM  wrote:
>
> From: Konstantin Porotchkin 
>
> For some reason the spi_flash_probe_bus_cs() is called
> inside the setup_flash_device() with zero values in place
> of configurated SPI flash mode and maximum flash speed.
> This code causes HALT error during startup environment
> relocation on some platforms - namely Armada-38x-GP board.
> Fix the function call by replacing zeros with the appropriate
> values - CONFIG_ENV_SPI_MAX_HZ and CONFIG_ENV_SPI_MODE.
>

This patch appears to be causing some issues with DA850 EVM in that
make it fail the CRC check and the environmental variables go to
defaults.

Reading the comment, "speed and mode will be read from DT", however
this patch explicitly uses CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE
which are not defined in the DT, but setup by either Kconfig or
include/configs.

I can create a patch that fixes the da850 by hard coding these two
values to 0 to make them match what was originally happening, but it
seems like we have the DT case and the non-DT case, but we're treating
them the same, so I thought I'd point that out here.

adam

> Signed-off-by: Konstantin Porotchkin 
> Cc: Igal Liberman 
> Cc: Stefan Roese 
> ---
>  env/sf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/env/sf.c b/env/sf.c
> index 4945105..2e3c600 100644
> --- a/env/sf.c
> +++ b/env/sf.c
> @@ -58,7 +58,8 @@ static int setup_flash_device(void)
>
> /* speed and mode will be read from DT */
> ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
> -0, 0, );
> +CONFIG_ENV_SPI_MAX_HZ, 
> CONFIG_ENV_SPI_MODE,
> +);
> if (ret) {
> set_default_env("spi_flash_probe_bus_cs() failed", 0);
> return ret;
> --
> 2.7.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] fix: env: Fix the SPI flash device setup for DM mode

2018-09-19 Thread Stefan Roese

On 29.08.2018 15:34, kos...@marvell.com wrote:

From: Konstantin Porotchkin 

For some reason the spi_flash_probe_bus_cs() is called
inside the setup_flash_device() with zero values in place
of configurated SPI flash mode and maximum flash speed.
This code causes HALT error during startup environment
relocation on some platforms - namely Armada-38x-GP board.
Fix the function call by replacing zeros with the appropriate
values - CONFIG_ENV_SPI_MAX_HZ and CONFIG_ENV_SPI_MODE.

Signed-off-by: Konstantin Porotchkin 
Cc: Igal Liberman 
Cc: Stefan Roese 
---
  env/sf.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/env/sf.c b/env/sf.c
index 4945105..2e3c600 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -58,7 +58,8 @@ static int setup_flash_device(void)
  
  	/* speed and mode will be read from DT */

ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
-0, 0, );
+CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE,
+);
if (ret) {
set_default_env("spi_flash_probe_bus_cs() failed", 0);
return ret;



Applied to u-boot-marvell/master

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


[U-Boot] [PATCH 1/5] fix: env: Fix the SPI flash device setup for DM mode

2018-08-29 Thread kostap
From: Konstantin Porotchkin 

For some reason the spi_flash_probe_bus_cs() is called
inside the setup_flash_device() with zero values in place
of configurated SPI flash mode and maximum flash speed.
This code causes HALT error during startup environment
relocation on some platforms - namely Armada-38x-GP board.
Fix the function call by replacing zeros with the appropriate
values - CONFIG_ENV_SPI_MAX_HZ and CONFIG_ENV_SPI_MODE.

Signed-off-by: Konstantin Porotchkin 
Cc: Igal Liberman 
Cc: Stefan Roese 
---
 env/sf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/env/sf.c b/env/sf.c
index 4945105..2e3c600 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -58,7 +58,8 @@ static int setup_flash_device(void)
 
/* speed and mode will be read from DT */
ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
-0, 0, );
+CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE,
+);
if (ret) {
set_default_env("spi_flash_probe_bus_cs() failed", 0);
return ret;
-- 
2.7.4

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