treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
Subsystems (2)
PATCH 1/1 treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
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.
--- 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(-)
cmd/sf.c +2 -2
@@ -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, &bus_dev, &new);if (!ret) {
drivers/mtd/spi/sf_probe.c +1 -1
@@ -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) {
drivers/net/fm/fm.c +2 -2
@@ -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 */
env/sf.c +1 -1
@@ -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;
include/spi_flash.h +1 -1
@@ -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 *
Signature · 1 line
2.19.2
Vignesh R
maintainerPATCH 1/1 treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
Quoted 7 lines · Marek Vasut
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 <[email protected]>Cc Jagan Teki <[email protected]>Cc Vignesh R <[email protected]>---
I have a similar patch, but you beat me to it :)
Regards
Vignesh
Quoted 91 lines
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(-)cmd/sf.c +2
-2@@ -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, &bus_dev, &new);if (!ret) {drivers/mtd/spi/sf_probe.c +1
-1@@ -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) {drivers/net/fm/fm.c +2
-2@@ -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 */ env/sf.c +1
-1@@ -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;include/spi_flash.h +1
-1@@ -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 *
PATCH 1/1 treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
Quoted 6 lines · Vignesh R
Quoted 3 lines · Marek Vasut
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.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Marek Vasut <[email protected]>Cc Jagan Teki <[email protected]>Cc Vignesh R <[email protected]>---
I have a similar patch, but you beat me to it :)
Reviewed-by Vignesh R <[email protected]>
Except this one breaks a few platforms, so feel free to drop this one and send yours , or merge them into one.
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
In reply to Marek VasutQuoted 6 lines · Marek Vasut
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 <[email protected]>Cc Jagan Teki <[email protected]>Cc Vignesh R <[email protected]>
I stumbled upon this issue when trying to build a non-DM SPL for imx with SPI flash access. This fixes the build.
Quoted 92 lines
--- 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(-)cmd/sf.c +2
-2@@ -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, &bus_dev, &new);if (!ret) {drivers/mtd/spi/sf_probe.c +1
-1@@ -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) {drivers/net/fm/fm.c +2
-2@@ -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 */ env/sf.c +1
-1@@ -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;include/spi_flash.h +1
-1@@ -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 *
PATCH 1/1 treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
Quoted 8 lines · Schrempf Frieder
Quoted 6 lines · Marek Vasut
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 <[email protected]>Cc Jagan Teki <[email protected]>Cc Vignesh R <[email protected]>
Quoted 5 lines
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 <[email protected]>Tested-by Frieder Schrempf <[email protected]>
This patch breaks x86 at least, so NAK.
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 treewide: Replace CONFIG_DM_SPI_FLASH with CONFIG_IS_ENABLED(DM_SPI_FLASH)
Quoted 9 lines · Marek Vasut
Quoted 8 lines · Schrempf Frieder
Quoted 6 lines · Marek Vasut
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 <[email protected]>Cc Jagan Teki <[email protected]>Cc Vignesh R <[email protected]>
Quoted 8 lines
Quoted 5 lines
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 <[email protected]>Tested-by Frieder Schrempf <[email protected]>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