[24/24] mtd: spi: Drop fsl_espi_spl

Message ID 20200527171048.178430-4-jagan@amarulasolutions.com
State New
Headers show
Series
  • Untitled series #198
Related show

Commit Message

Jagan Teki May 27, 2020, 5:10 p.m. UTC
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 <jagan@amarulasolutions.com>
---
 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

Comments

Priyanka Jain May 28, 2020, 7:16 a.m. UTC | #1
>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Jagan Teki
>Sent: Wednesday, May 27, 2020 10:41 PM
>To: Simon Glass <sjg@chromium.org>; Tom Rini <trini@konsulko.com>
>Cc: u-boot@lists.denx.de; linux-amarula@amarulasolutions.com; Jagan Teki
><jagan@amarulasolutions.com>
>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 <jagan@amarulasolutions.com>
>---
> 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
>
<snip>
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&state=*
http://patchwork.ozlabs.org/project/uboot/list/?series=138873

Nacked-by: Priyanka Jain <priyanka.jain@nxp.com>

Patch

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(&gur->pmuxcr);
 
-#ifdef CONFIG_SPL_SPI_BOOT
-	clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_SD_DATA);
-#endif
-
 	/* initialize selected port with appropriate baud rate */
 	plat_ratio = in_be32(&gur->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..0000000000
--- 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 <common.h>
-#include <cpu_func.h>
-#include <hang.h>
-#include <spi_flash.h>
-#include <malloc.h>
-
-#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);
-
-	spi_flash_read(flash, CONFIG_CFG_DATA_SECTOR,
-		       flash->page_size, (void *)buf);
-	offset = *(u32 *)(buf + ESPI_BOOT_IMAGE_ADDR);
-	/* Skip spl code */
-	offset += CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
-	/* Get the code size from offset 0x48 */
-	code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
-	/* Skip spl code */
-	code_len = code_len - CONFIG_SPL_MAX_SIZE;
-#endif
-	/* copy code to DDR */
-	printf("Loading second stage boot loader ");
-	while (copy_len <= code_len) {
-		spi_flash_read(flash, offset + copy_len, 0x2000,
-			       (void *)(CONFIG_SYS_SPI_FLASH_U_BOOT_DST
-			       + copy_len));
-		copy_len = copy_len + 0x2000;
-		putc('.');
-	}
-
-	/*
-	* Jump to U-Boot image
-	*/
-	flush_cache(CONFIG_SYS_SPI_FLASH_U_BOOT_DST, code_len);
-	uboot = (void *)CONFIG_SYS_SPI_FLASH_U_BOOT_START;
-	(*uboot)();
-}