RE: [PATCH 24/24] mtd: spi: Drop fsl_espi_spl

2020-05-28 Thread Priyanka Jain
>-Original Message-
>From: U-Boot  On Behalf Of Jagan Teki
>Sent: Wednesday, May 27, 2020 10:41 PM
>To: Simon Glass ; Tom Rini 
>Cc: u-boot@lists.denx.de; linux-amar...@amarulasolutions.com; Jagan Teki
>
>Subject: [PATCH 24/24] mtd: spi: Drop fsl_espi_spl
>
>Boards which are using this fsl_espi_spl are already dropped due to lack of dm
>migrations.
>
>So, drop this associated driver.
>
>Signed-off-by: Jagan Teki 
>---
> arch/powerpc/cpu/mpc85xx/fdt.c |  7 ---
> board/Arcturus/ucp1020/spl.c   |  6 ---
> common/spl/Kconfig |  4 --
> drivers/mtd/spi/Makefile   |  1 -
> drivers/mtd/spi/fsl_espi_spl.c | 91 --
> 5 files changed, 109 deletions(-)
> delete mode 100644 drivers/mtd/spi/fsl_espi_spl.c
>

Please don't merge this patch .
The espi series of patches for DM migration were in review since long, but 
could not be merged because of dependency.
NXP engineers are working on rebasing the DM espi migration series.

http://patchwork.ozlabs.org/project/uboot/list/?series=127282=*
http://patchwork.ozlabs.org/project/uboot/list/?series=138873

Nacked-by: Priyanka Jain 


[PATCH 24/24] mtd: spi: Drop fsl_espi_spl

2020-05-27 Thread Jagan Teki
Boards which are using this fsl_espi_spl are already dropped
due to lack of dm migrations.

So, drop this associated driver.

Signed-off-by: Jagan Teki 
---
 arch/powerpc/cpu/mpc85xx/fdt.c |  7 ---
 board/Arcturus/ucp1020/spl.c   |  6 ---
 common/spl/Kconfig |  4 --
 drivers/mtd/spi/Makefile   |  1 -
 drivers/mtd/spi/fsl_espi_spl.c | 91 --
 5 files changed, 109 deletions(-)
 delete mode 100644 drivers/mtd/spi/fsl_espi_spl.c

diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 55f191f202..6255dfa7c0 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -148,13 +148,6 @@ void ft_fixup_cpu(void *blob, u64 memory_limit)
if (off < 0)
printf("Failed to reserve memory for SD deep sleep: %s\n",
   fdt_strerror(off));
-#elif defined(CONFIG_SPL_SPI_BOOT)
-   off = fdt_add_mem_rsv(blob, CONFIG_SYS_SPI_FLASH_U_BOOT_START,
-   CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE);
-   if (off < 0)
-   printf("Failed to reserve memory for SPI deep sleep: %s\n",
-  fdt_strerror(off));
-#endif
 #endif
 }
 #endif
diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c
index 6a17aeb78e..8a1f005ef2 100644
--- a/board/Arcturus/ucp1020/spl.c
+++ b/board/Arcturus/ucp1020/spl.c
@@ -48,10 +48,6 @@ void board_init_f(ulong bootflag)
/* Read back the register to synchronize the write. */
in_be32(>pmuxcr);
 
-#ifdef CONFIG_SPL_SPI_BOOT
-   clrbits_be32(>pmuxcr, MPC85xx_PMUXCR_SD_DATA);
-#endif
-
/* initialize selected port with appropriate baud rate */
plat_ratio = in_be32(>porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
plat_ratio >>= 1;
@@ -62,8 +58,6 @@ void board_init_f(ulong bootflag)
 bus_clk / 16 / CONFIG_BAUDRATE);
 #ifdef CONFIG_SPL_MMC_BOOT
puts("\nSD boot...\n");
-#elif defined(CONFIG_SPL_SPI_BOOT)
-   puts("\nSPI Flash boot...\n");
 #endif
 
/* copy code to RAM and jump to it - this should not return */
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 414b6f396d..9dce9710ce 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -101,10 +101,6 @@ config SPL_MMC_BOOT
bool "Load SPL from SD Card / eMMC"
depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
 
-config SPL_SPI_BOOT
-   bool "Load SPL from SPI flash"
-   depends on PPC && (SUPPORT_SPL && !SPL_FRAMEWORK)
-
 config SPL_FSL_PBL
bool "Create SPL in Freescale PBI format"
depends on (PPC || ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A) && \
diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index b3ae74dbe8..17ed55eee2 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -11,7 +11,6 @@ endif
 spi-nor-y += spi-nor-ids.o
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_SPI_BOOT) += fsl_espi_spl.o
 ifeq ($(CONFIG_SPL_SPI_FLASH_TINY),y)
 spi-nor-y += spi-nor-tiny.o
 else
diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c
deleted file mode 100644
index 5c41d7558c..00
--- a/drivers/mtd/spi/fsl_espi_spl.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define ESPI_BOOT_IMAGE_SIZE   0x48
-#define ESPI_BOOT_IMAGE_ADDR   0x50
-#define CONFIG_CFG_DATA_SECTOR 0
-
-void fsl_spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
-{
-   struct spi_flash *flash;
-
-   flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
-   CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
-   if (flash == NULL) {
-   puts("\nspi_flash_probe failed");
-   hang();
-   }
-
-   spi_flash_read(flash, offs, size, vdst);
-}
-
-/*
- * The main entry for SPI booting. It's necessary that SDRAM is already
- * configured and available since this code loads the main U-Boot image
- * from SPI into SDRAM and starts it from there.
- */
-void fsl_spi_boot(void)
-{
-   void (*uboot)(void) __noreturn;
-   u32 offset, code_len, copy_len = 0;
-#ifndef CONFIG_FSL_CORENET
-   unsigned char *buf = NULL;
-#endif
-   struct spi_flash *flash;
-
-   flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
-   CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
-   if (flash == NULL) {
-   puts("\nspi_flash_probe failed");
-   hang();
-   }
-
-#ifdef CONFIG_FSL_CORENET
-   offset = CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
-   code_len = CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE;
-#else
-   /*
-   * Load U-Boot image from SPI flash into RAM
-   */
-   buf = malloc(flash->page_size);
-   if (buf == NULL) {
-   puts("\nmalloc failed");
-   hang();
-   }
-   memset(buf, 0, flash->page_size);
-
-