Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
[oweals/u-boot.git] / drivers / mtd / spi / fsl_espi_spl.c
index 9e216a69405c1102ae5f680ff9c03ad60558330f..e5ac79b9520db5e975575229e74266015f099997 100644 (file)
@@ -1,22 +1,7 @@
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -46,6 +31,10 @@ void spi_boot(void)
                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
        */
@@ -65,6 +54,7 @@ void spi_boot(void)
        code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
        /* Skip spl code */
        code_len = code_len - CONFIG_SPL_MAX_SIZE;
+#endif
        /* copy code to DDR */
        spi_flash_read(flash, offset, code_len,
                       (void *)CONFIG_SYS_SPI_FLASH_U_BOOT_DST);