spi: Move freescale-specific code into a private header
authorSimon Glass <sjg@chromium.org>
Sun, 25 Sep 2016 00:20:10 +0000 (18:20 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 6 Oct 2016 19:07:35 +0000 (15:07 -0400)
At present there are two SPI functions only used by freescale which are
defined in the spi_flash.h header. One function name matches an existing
generic SPL function.

Move these into a private header to avoid confusion.

Arcturus looks like it does not actually support SPI, so drop the SPI code
from that board.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 files changed:
board/Arcturus/ucp1020/spl.c
board/freescale/common/spl.h [new file with mode: 0644]
board/freescale/p1010rdb/spl.c
board/freescale/p1022ds/spl.c
board/freescale/p1_p2_rdb_pc/spl.c
board/freescale/t102xqds/spl.c
board/freescale/t102xrdb/spl.c
board/freescale/t104xrdb/spl.c
board/freescale/t208xqds/spl.c
board/freescale/t208xrdb/spl.c
drivers/mtd/spi/fsl_espi_spl.c
include/spi_flash.h

index 9315bb740120b177fed8a9285531fed1126be17c..9c19c87b7278dc7ff615cf915752f42fff8bd9df 100644 (file)
@@ -119,8 +119,6 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
-#elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
diff --git a/board/freescale/common/spl.h b/board/freescale/common/spl.h
new file mode 100644 (file)
index 0000000..88c987e
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2016 Google, Inc
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __FREESCALE_BOARD_SPL_H
+#define __FREESCALE_BOARD_SPL_H
+
+void fsl_spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst);
+void fsl_spi_boot(void) __noreturn;
+
+#endif
index f8584084ce5cc9b7421736cc249093c060e8e42e..9844194eb58e5487ad0a80953bcec09795a1d8bc 100644 (file)
@@ -12,6 +12,7 @@
 #include <i2c.h>
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -103,7 +104,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index 04db767f9810468e67c2a95fc1a95038e7c7e1e0..6a5fe74343788c355e0adc5a463a79fae471bc3e 100644 (file)
@@ -14,6 +14,7 @@
 #include "../common/ngpixis.h"
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -120,7 +121,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index 76a3cf47cc68ba5be19129f26f94e7f312f1a492..9e8f359d0db53f11827e46436800b2c0c91c5f25 100644 (file)
@@ -13,6 +13,7 @@
 #include <i2c.h>
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -117,7 +118,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index d59d3431ec1fd02cb4b771834c2ca92ef030da42..61bfb295ef1297f6e32b0df6638831bdc03f2b49 100644 (file)
@@ -14,6 +14,7 @@
 #include <spi_flash.h>
 #include "../common/qixis.h"
 #include "t102xqds_qixis.h"
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -132,8 +133,8 @@ void board_init_r(gd_t *gd, ulong dest_addr)
                           (uchar *)CONFIG_ENV_ADDR);
 #endif
 #ifdef CONFIG_SPL_SPI_BOOT
-       spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
+       fsl_spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+                              (uchar *)CONFIG_ENV_ADDR);
 #endif
 
        gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
@@ -146,7 +147,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index bd3cbbf11c97a6c214bb06ad6335479a1f8d9394..6d8866e87d9e0abaa1d48adf541df5df3001903e 100644 (file)
@@ -13,6 +13,7 @@
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
 #include "../common/sleep.h"
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -119,8 +120,8 @@ void board_init_r(gd_t *gd, ulong dest_addr)
                           (uchar *)CONFIG_ENV_ADDR);
 #endif
 #ifdef CONFIG_SPL_SPI_BOOT
-       spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
+       fsl_spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+                              (uchar *)CONFIG_ENV_ADDR);
 #endif
 
        gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
@@ -133,7 +134,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index 4b35af63f65d6f421d88ff910167854889ce8802..1c2023b6a324958b8e7eb7f78b1c15c14dd69a6d 100644 (file)
@@ -13,6 +13,7 @@
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
 #include "../common/sleep.h"
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -114,8 +115,8 @@ void board_init_r(gd_t *gd, ulong dest_addr)
                           (uchar *)CONFIG_ENV_ADDR);
 #endif
 #ifdef CONFIG_SPL_SPI_BOOT
-       spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
+       fsl_spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+                              (uchar *)CONFIG_ENV_ADDR);
 #endif
        gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
        gd->env_valid = 1;
@@ -129,7 +130,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index bb02dab2f1539fdd103aee35c42d5abab37aa2d7..b1e1cf17e7c76c5a96688bf37ed7fc9fad270085 100644 (file)
@@ -14,6 +14,7 @@
 #include <spi_flash.h>
 #include "../common/qixis.h"
 #include "t208xqds_qixis.h"
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -118,8 +119,8 @@ void board_init_r(gd_t *gd, ulong dest_addr)
                           (uchar *)CONFIG_ENV_ADDR);
 #endif
 #ifdef CONFIG_SPL_SPI_BOOT
-       spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
+       fsl_spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+                              (uchar *)CONFIG_ENV_ADDR);
 #endif
 
        gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
@@ -132,7 +133,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index 2ff05a29f507dae081ed7233d209a3bbc6994d1d..bb23865d3beeb0c56b5204a6556a689cdd110f9c 100644 (file)
@@ -12,6 +12,7 @@
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -88,8 +89,8 @@ void board_init_r(gd_t *gd, ulong dest_addr)
                           (uchar *)CONFIG_ENV_ADDR);
 #endif
 #ifdef CONFIG_SPL_SPI_BOOT
-       spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-                          (uchar *)CONFIG_ENV_ADDR);
+       fsl_spi_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+                              (uchar *)CONFIG_ENV_ADDR);
 #endif
 
        gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
@@ -102,7 +103,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #ifdef CONFIG_SPL_MMC_BOOT
        mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
-       spi_boot();
+       fsl_spi_boot();
 #elif defined(CONFIG_SPL_NAND_BOOT)
        nand_boot();
 #endif
index b915469b404adb44adecabaa5ae21b6effb8d238..1dd44e2ca938a39e039eca3625e6ac9a19cb74a7 100644 (file)
@@ -12,7 +12,7 @@
 #define ESPI_BOOT_IMAGE_ADDR   0x50
 #define CONFIG_CFG_DATA_SECTOR 0
 
-void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
+void fsl_spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
 {
        struct spi_flash *flash;
 
@@ -31,7 +31,7 @@ void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst)
  * configured and available since this code loads the main U-Boot image
  * from SPI into SDRAM and starts it from there.
  */
-void spi_boot(void)
+void fsl_spi_boot(void)
 {
        void (*uboot)(void) __noreturn;
        u32 offset, code_len, copy_len = 0;
index d0ce9e721ad0d74ca769c6e19ffd5e167f8e7679..be2fe3f84cb9a85ac49595a581b5d10ae7b0b3b5 100644 (file)
@@ -239,7 +239,4 @@ static inline int spi_flash_protect(struct spi_flash *flash, u32 ofs, u32 len,
                return flash->flash_unlock(flash, ofs, len);
 }
 
-void spi_boot(void) __noreturn;
-void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst);
-
 #endif /* _SPI_FLASH_H_ */