Patchwork [U-Boot,4/4] sf: Warn to use BAR for > 16MiB flashes

login
register
mail settings
Submitter Jagannadha Sutradharudu Teki
Date June 14, 2013, 8:18 p.m.
Message ID <b70911ec-ffe1-4fdd-8bbd-fa5e5968acff@CO9EHSMHS021.ehs.local>
Download mbox | patch
Permalink /patch/251523/
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Comments

Jagannadha Sutradharudu Teki - June 14, 2013, 8:18 p.m.
Warning for > 16MiB flashes to #define CONFIG_SPI_FLASH_BAR

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
---
 drivers/mtd/spi/spi_flash.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Simon Glass - June 19, 2013, 4:32 a.m.
Hi Jagan,

On Fri, Jun 14, 2013 at 1:18 PM, Jagannadha Sutradharudu Teki <
jagannadha.sutradharudu-teki@xilinx.com> wrote:

> Warning for > 16MiB flashes to #define CONFIG_SPI_FLASH_BAR
>
> Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
> ---
>  drivers/mtd/spi/spi_flash.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index f3245a4..911c5e8 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -563,7 +563,12 @@ struct spi_flash *spi_flash_probe(unsigned int bus,
> unsigned int cs,
>         if (flash->memory_map)
>                 printf(", mapped at %p", flash->memory_map);
>         puts("\n");
> -
> +#ifndef CONFIG_SPI_FLASH_BAR
> +       if (flash->size > SPI_FLASH_16MB_BOUN) {
> +               puts("SF: Warning - Only lower 16MiB accessible,");
> +               puts(" Full access #define CONFIG_SPI_FLASH_BAR\n");
>

Perhaps you can shorten this to fit on one line?

Warning: CONFIG_SPI_FLASH_BAR provides full access to >16MiB devices

Anyway you should not split strings across lines.

+       }
> +#endif
>         spi_release_bus(spi);
>
>         return flash;
> --
> 1.8.3
>
>
>
Regards,
Simon

Patch

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index f3245a4..911c5e8 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -563,7 +563,12 @@  struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 	if (flash->memory_map)
 		printf(", mapped at %p", flash->memory_map);
 	puts("\n");
-
+#ifndef CONFIG_SPI_FLASH_BAR
+	if (flash->size > SPI_FLASH_16MB_BOUN) {
+		puts("SF: Warning - Only lower 16MiB accessible,");
+		puts(" Full access #define CONFIG_SPI_FLASH_BAR\n");
+	}
+#endif
 	spi_release_bus(spi);
 
 	return flash;