cfi_flash: Fix logical continuations
[oweals/u-boot.git] / drivers / mtd / nand / nand_spl_simple.c
index 60a7607073337954d3e0ea89f38f2fda5f5d2dee..56e86d1760993f592d45294f76dc3ca67fe5167f 100644 (file)
@@ -209,40 +209,6 @@ static int nand_read_page(int block, int page, void *dst)
 }
 #endif
 
-int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
-{
-       unsigned int block, lastblock;
-       unsigned int page;
-
-       /*
-        * offs has to be aligned to a page address!
-        */
-       block = offs / CONFIG_SYS_NAND_BLOCK_SIZE;
-       lastblock = (offs + size - 1) / CONFIG_SYS_NAND_BLOCK_SIZE;
-       page = (offs % CONFIG_SYS_NAND_BLOCK_SIZE) / CONFIG_SYS_NAND_PAGE_SIZE;
-
-       while (block <= lastblock) {
-               if (!nand_is_bad_block(block)) {
-                       /*
-                        * Skip bad blocks
-                        */
-                       while (page < CONFIG_SYS_NAND_PAGE_COUNT) {
-                               nand_read_page(block, page, dst);
-                               dst += CONFIG_SYS_NAND_PAGE_SIZE;
-                               page++;
-                       }
-
-                       page = 0;
-               } else {
-                       lastblock++;
-               }
-
-               block++;
-       }
-
-       return 0;
-}
-
 /* nand_init() - initialize data to make nand usable by SPL */
 void nand_init(void)
 {
@@ -271,3 +237,5 @@ void nand_deselect(void)
        if (nand_chip.select_chip)
                nand_chip.select_chip(mtd, -1);
 }
+
+#include "nand_spl_loaders.c"