Re: [U-Boot] [PATCH] treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)

2019-07-01 Thread Schrempf Frieder
On 20.02.19 12:20, Marek Vasut wrote:
> On 2/20/19 12:18 PM, Schrempf Frieder wrote:
>> On 19.02.19 06:07, Marek Vasut wrote:
>>> Perform the replacement to allow platforms use non-DM SPI flash access
>>> in SPL/TPL. This is thus far needed on platforms with size constraints.
>>>
>>> Signed-off-by: Marek Vasut 
>>> Cc: Jagan Teki 
>>> Cc: Vignesh R 
>>
>> I stumbled upon this issue when trying to build a non-DM SPL for imx
>> with SPI flash access. This fixes the build.
>>
>> Reviewed-by: Frieder Schrempf 
>> Tested-by: Frieder Schrempf 
> 
> This patch breaks x86 at least, so NAK.
> 
It seems, that there's still no solution for this upstream. I tried to 
build Marek's patch with a fixup on current master [1], but still the 
build breaks for some configurations [2].

Can someone have a look, how to fix the failing boards?

Thanks,
Frieder

[1] https://github.com/fschrempf/u-boot/commits/non_dm_spi_flash_in_spl
[2] https://travis-ci.org/fschrempf/u-boot/builds/551244482
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)

2019-02-20 Thread Marek Vasut
On 2/20/19 12:18 PM, Schrempf Frieder wrote:
> On 19.02.19 06:07, Marek Vasut wrote:
>> Perform the replacement to allow platforms use non-DM SPI flash access
>> in SPL/TPL. This is thus far needed on platforms with size constraints.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Jagan Teki 
>> Cc: Vignesh R 
> 
> I stumbled upon this issue when trying to build a non-DM SPL for imx 
> with SPI flash access. This fixes the build.
> 
> Reviewed-by: Frieder Schrempf 
> Tested-by: Frieder Schrempf 

This patch breaks x86 at least, so NAK.

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)

2019-02-20 Thread Schrempf Frieder
On 19.02.19 06:07, Marek Vasut wrote:
> Perform the replacement to allow platforms use non-DM SPI flash access
> in SPL/TPL. This is thus far needed on platforms with size constraints.
> 
> Signed-off-by: Marek Vasut 
> Cc: Jagan Teki 
> Cc: Vignesh R 

I stumbled upon this issue when trying to build a non-DM SPL for imx 
with SPI flash access. This fixes the build.

Reviewed-by: Frieder Schrempf 
Tested-by: Frieder Schrempf 

> ---
>   cmd/sf.c   | 4 ++--
>   drivers/mtd/spi/sf_probe.c | 2 +-
>   drivers/net/fm/fm.c| 4 ++--
>   env/sf.c   | 2 +-
>   include/spi_flash.h| 2 +-
>   5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/cmd/sf.c b/cmd/sf.c
> index 738ef0e46d..7e92a43b2c 100644
> --- a/cmd/sf.c
> +++ b/cmd/sf.c
> @@ -84,7 +84,7 @@ static int do_spi_flash_probe(int argc, char * const argv[])
>   unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
>   unsigned int mode = CONFIG_SF_DEFAULT_MODE;
>   char *endp;
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new, *bus_dev;
>   int ret;
>   /* In DM mode defaults will be taken from DT */
> @@ -119,7 +119,7 @@ static int do_spi_flash_probe(int argc, char * const 
> argv[])
>   return -1;
>   }
>   
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   /* Remove the old device, otherwise probe will just be a nop */
>   ret = spi_find_bus_and_cs(bus, cs, _dev, );
>   if (!ret) {
> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
> index 7f1378f494..4282d48f26 100644
> --- a/drivers/mtd/spi/sf_probe.c
> +++ b/drivers/mtd/spi/sf_probe.c
> @@ -53,7 +53,7 @@ err_read_id:
>   return ret;
>   }
>   
> -#ifndef CONFIG_DM_SPI_FLASH
> +#if !CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct spi_flash *spi_flash_probe(unsigned int busnum, unsigned int cs,
> unsigned int max_hz, unsigned int spi_mode)
>   {
> diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
> index e19ddc..6a5c9bbc9d 100644
> --- a/drivers/net/fm/fm.c
> +++ b/drivers/net/fm/fm.c
> @@ -377,7 +377,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
>   addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
>   int ret = 0;
>   
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new;
>   
>   /* speed and mode will be read from DT */
> @@ -464,7 +464,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
>   void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
>   int ret = 0;
>   
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new;
>   
>   /* speed and mode will be read from DT */
> diff --git a/env/sf.c b/env/sf.c
> index b3dec82c35..ee639b90fc 100644
> --- a/env/sf.c
> +++ b/env/sf.c
> @@ -52,7 +52,7 @@ static struct spi_flash *env_flash;
>   
>   static int setup_flash_device(void)
>   {
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new;
>   int ret;
>   
> diff --git a/include/spi_flash.h b/include/spi_flash.h
> index 7f691e8559..09f3896fb9 100644
> --- a/include/spi_flash.h
> +++ b/include/spi_flash.h
> @@ -51,7 +51,7 @@ struct dm_spi_flash_ops {
>   /* Access the serial operations for a device */
>   #define sf_get_ops(dev) ((struct dm_spi_flash_ops *)(dev)->driver->ops)
>   
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   /**
>* spi_flash_read_dm() - Read data from SPI flash
>*
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)

2019-02-20 Thread Marek Vasut
On 2/20/19 6:05 AM, Vignesh R wrote:
> 
> 
> On 19/02/19 10:37 AM, Marek Vasut wrote:
>> Perform the replacement to allow platforms use non-DM SPI flash access
>> in SPL/TPL. This is thus far needed on platforms with size constraints.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Jagan Teki 
>> Cc: Vignesh R 
>> ---
> 
> I have a similar patch, but you beat me to it :)
> 
> Reviewed-by: Vignesh R 

Except this one breaks a few platforms, so feel free to drop this one
and send yours , or merge them into one.

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)

2019-02-19 Thread Vignesh R


On 19/02/19 10:37 AM, Marek Vasut wrote:
> Perform the replacement to allow platforms use non-DM SPI flash access
> in SPL/TPL. This is thus far needed on platforms with size constraints.
> 
> Signed-off-by: Marek Vasut 
> Cc: Jagan Teki 
> Cc: Vignesh R 
> ---

I have a similar patch, but you beat me to it :)

Reviewed-by: Vignesh R 


Regards
Vignesh

>  cmd/sf.c   | 4 ++--
>  drivers/mtd/spi/sf_probe.c | 2 +-
>  drivers/net/fm/fm.c| 4 ++--
>  env/sf.c   | 2 +-
>  include/spi_flash.h| 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/cmd/sf.c b/cmd/sf.c
> index 738ef0e46d..7e92a43b2c 100644
> --- a/cmd/sf.c
> +++ b/cmd/sf.c
> @@ -84,7 +84,7 @@ static int do_spi_flash_probe(int argc, char * const argv[])
>   unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
>   unsigned int mode = CONFIG_SF_DEFAULT_MODE;
>   char *endp;
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new, *bus_dev;
>   int ret;
>   /* In DM mode defaults will be taken from DT */
> @@ -119,7 +119,7 @@ static int do_spi_flash_probe(int argc, char * const 
> argv[])
>   return -1;
>   }
>  
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   /* Remove the old device, otherwise probe will just be a nop */
>   ret = spi_find_bus_and_cs(bus, cs, _dev, );
>   if (!ret) {
> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
> index 7f1378f494..4282d48f26 100644
> --- a/drivers/mtd/spi/sf_probe.c
> +++ b/drivers/mtd/spi/sf_probe.c
> @@ -53,7 +53,7 @@ err_read_id:
>   return ret;
>  }
>  
> -#ifndef CONFIG_DM_SPI_FLASH
> +#if !CONFIG_IS_ENABLED(DM_SPI_FLASH)
>  struct spi_flash *spi_flash_probe(unsigned int busnum, unsigned int cs,
> unsigned int max_hz, unsigned int spi_mode)
>  {
> diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
> index e19ddc..6a5c9bbc9d 100644
> --- a/drivers/net/fm/fm.c
> +++ b/drivers/net/fm/fm.c
> @@ -377,7 +377,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
>   addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
>   int ret = 0;
>  
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new;
>  
>   /* speed and mode will be read from DT */
> @@ -464,7 +464,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
>   void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
>   int ret = 0;
>  
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new;
>  
>   /* speed and mode will be read from DT */
> diff --git a/env/sf.c b/env/sf.c
> index b3dec82c35..ee639b90fc 100644
> --- a/env/sf.c
> +++ b/env/sf.c
> @@ -52,7 +52,7 @@ static struct spi_flash *env_flash;
>  
>  static int setup_flash_device(void)
>  {
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>   struct udevice *new;
>   int ret;
>  
> diff --git a/include/spi_flash.h b/include/spi_flash.h
> index 7f691e8559..09f3896fb9 100644
> --- a/include/spi_flash.h
> +++ b/include/spi_flash.h
> @@ -51,7 +51,7 @@ struct dm_spi_flash_ops {
>  /* Access the serial operations for a device */
>  #define sf_get_ops(dev) ((struct dm_spi_flash_ops *)(dev)->driver->ops)
>  
> -#ifdef CONFIG_DM_SPI_FLASH
> +#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
>  /**
>   * spi_flash_read_dm() - Read data from SPI flash
>   *
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot