summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbel Vesa <abel.vesa@nxp.com>2018-09-13 11:16:38 +0300
committerAbel Vesa <abel.vesa@nxp.com>2018-09-18 09:47:48 +0300
commitf7587cc9486952698250e7ddaf9bbce2f66efb71 (patch)
treecb17556cef3748485f6164216f1ec19a4373d559
parentc70afc348ee9fae242f00be56cde556822f93156 (diff)
MLK-19183-12 iMX8QXP SPL: Add QSPI support for imx8qxp_mek
Allow iMX8QXP SPL to boot from QSPI. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
-rw-r--r--arch/arm/mach-imx/spl.c2
-rw-r--r--board/freescale/imx8qxp_mek/spl.c20
-rw-r--r--drivers/mtd/spi/Makefile1
-rw-r--r--include/configs/imx8qxp_mek.h5
4 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 1d9f7f02ab..4b72160dda 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -119,6 +119,8 @@ u32 spl_boot_device(void)
return BOOT_DEVICE_MMC2_2;
case SD3_BOOT:
return BOOT_DEVICE_MMC1;
+ case FLEXSPI_BOOT:
+ return BOOT_DEVICE_SPI;
#elif defined(CONFIG_IMX8M)
case SD1_BOOT:
case MMC1_BOOT:
diff --git a/board/freescale/imx8qxp_mek/spl.c b/board/freescale/imx8qxp_mek/spl.c
index 03f92f67ae..37b03af4b6 100644
--- a/board/freescale/imx8qxp_mek/spl.c
+++ b/board/freescale/imx8qxp_mek/spl.c
@@ -173,12 +173,32 @@ int board_mmc_getcd(struct mmc *mmc)
void spl_board_init(void)
{
+#if defined(CONFIG_QSPI_BOOT)
+ sc_ipc_t ipcHndl = 0;
+
+ ipcHndl = gd->arch.ipc_channel_handle;
+ if (sc_pm_set_resource_power_mode(ipcHndl, SC_R_FSPI_0, SC_PM_PW_MODE_ON)) {
+ puts("Warning: failed to initialize FSPI0\n");
+ }
+#endif
/* DDR initialization */
spl_dram_init();
puts("Normal Boot\n");
}
+void spl_board_prepare_for_boot(void)
+{
+#if defined(CONFIG_QSPI_BOOT)
+ sc_ipc_t ipcHndl = 0;
+
+ ipcHndl = gd->arch.ipc_channel_handle;
+ if (sc_pm_set_resource_power_mode(ipcHndl, SC_R_FSPI_0, SC_PM_PW_MODE_OFF)) {
+ puts("Warning: failed to turn off FSPI0\n");
+ }
+#endif
+}
+
void board_init_f(ulong dummy)
{
/* Clear global data */
diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index fcda023412..6e0cfb5539 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -8,6 +8,7 @@
obj-$(CONFIG_DM_SPI_FLASH) += sf-uclass.o
ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += sf_probe.o spi_flash.o spi_flash_ids.o sf.o
obj-$(CONFIG_SPL_SPI_BOOT) += fsl_espi_spl.o
obj-$(CONFIG_SPL_SPI_SUNXI) += sunxi_spi_spl.o
endif
diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
index 181623198b..66ab254998 100644
--- a/include/configs/imx8qxp_mek.h
+++ b/include/configs/imx8qxp_mek.h
@@ -13,6 +13,11 @@
#include "imx_env.h"
#ifdef CONFIG_SPL_BUILD
+
+#ifdef CONFIG_QSPI_BOOT
+#define CONFIG_SPL_SPI_LOAD
+#endif
+
#define CONFIG_SPL_TEXT_BASE 0x0
#define CONFIG_SPL_MAX_SIZE (124 * 1024)
#define CONFIG_SYS_MONITOR_LEN (1024 * 1024)