From 37189a19589794f8482a1c64dcebca2d6fbe96a5 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 14 Aug 2012 09:19:44 -0700 Subject: ARM: SPL: Rename omap_boot_mode to spl_boot_mode() Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index 8cf55c9a1c..ea7cc8a9d8 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -35,7 +35,7 @@ void spl_nand_load_image(void) int *src __attribute__((unused)); int *dst __attribute__((unused)); - switch (omap_boot_mode()) { + switch (spl_boot_mode()) { case NAND_MODE_HW_ECC: debug("spl: nand - using hw ecc\n"); gpmc_init(); -- cgit v1.2.1 From 8082fda9fc6d6fb6ba1bc467fb117af3dbed928a Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 13 Aug 2012 14:11:06 -0700 Subject: ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c This detection code doesn't (and can't) do anything currently, so remove. Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index ea7cc8a9d8..39221d5e7a 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -35,16 +35,9 @@ void spl_nand_load_image(void) int *src __attribute__((unused)); int *dst __attribute__((unused)); - switch (spl_boot_mode()) { - case NAND_MODE_HW_ECC: - debug("spl: nand - using hw ecc\n"); - gpmc_init(); - nand_init(); - break; - default: - puts("spl: ERROR: This bootmode is not implemented - hanging"); - hang(); - } + debug("spl: nand - using hw ecc\n"); + gpmc_init(); + nand_init(); /*use CONFIG_SYS_TEXT_BASE as temporary storage area */ header = (struct image_header *)(CONFIG_SYS_TEXT_BASE); -- cgit v1.2.1 From 55cdbb8d4e8508dcdb95400f6dfcb928220ffc70 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 14 Aug 2012 08:50:58 -0700 Subject: ARM: SPL: Add and Move the SPL prototypes from into and add for arch specific portions of CONFIG_SPL_FRAMEWORK. Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index 39221d5e7a..6552a5dfde 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -21,13 +21,13 @@ * MA 02111-1307 USA */ #include +#include #include #include #include #include #include #include -#include void spl_nand_load_image(void) { -- cgit v1.2.1 From 026b2fe32c3d5658befb54521dcfed46444e6bf8 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 14 Aug 2012 12:06:43 -0700 Subject: ARM: SPL: Clean up spl.c / spl_nand.c slightly - Remove includes we don't need - Switch some printf statements to puts - Convert some printf statements to debug, introduce new puts statements - In most cases saying just "No mkimage signature, assuming u-boot.bin" or similar is sufficient. This also means the non-DEBUG case doesn't need printf, in the core of SPL. - The other case here is that PLAIN_VERSION provided what we wanted already, so just use it. Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index 6552a5dfde..3e2f3590e6 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.1 From d7cb93b28a41237b689c9d84230d7d72a2048021 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 14 Aug 2012 12:26:08 -0700 Subject: ARM: SPL: Move gpmc_init() to spl_board_init() This is an OMAP/related-specific function, move calling it to spl_board_init() and turn on CONFIG_SPL_BOARD_INIT on the boards that enabled NAND and didn't enable this already. Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index 3e2f3590e6..1e6b5f0db9 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -35,7 +35,6 @@ void spl_nand_load_image(void) int *dst __attribute__((unused)); debug("spl: nand - using hw ecc\n"); - gpmc_init(); nand_init(); /*use CONFIG_SYS_TEXT_BASE as temporary storage area */ -- cgit v1.2.1 From 47f7bcae8c0de8b2a8af7ca309744f041a6d1424 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 13 Aug 2012 12:03:19 -0700 Subject: SPL: Move the omap SPL framework to common/spl Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the common/spl SPL framework, enable on all of the previously using boards. We move the spl_ymodem.c portion to common/ and spl_mmc.c to drivers/mmc/. We leave the NAND one in-place as we plan to replace it later in this series. We use common/spl to avoid linker problems with respect to merging constant strings in objects. Otherwise all strings in common/ will be linked in and kept which grows SPL in size too much. Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index 1e6b5f0db9..9e9206ce3b 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -21,7 +21,7 @@ * MA 02111-1307 USA */ #include -#include +#include #include #include #include -- cgit v1.2.1 From d97b4ce8056ff01ca8f1a63a7c69fa5316d33830 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 14 Aug 2012 14:33:02 -0700 Subject: SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/spl We move the spl_nand_load_image function to common/spl. This will allow for easier integration of SPL-boots-Linux code on other arches. Signed-off-by: Tom Rini --- arch/arm/cpu/armv7/omap-common/spl_nand.c | 102 ------------------------------ 1 file changed, 102 deletions(-) delete mode 100644 arch/arm/cpu/armv7/omap-common/spl_nand.c (limited to 'arch/arm/cpu/armv7/omap-common/spl_nand.c') diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c deleted file mode 100644 index 9e9206ce3b..0000000000 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2011 - * Corscience GmbH & Co. KG - Simon Schwarz - * - * See file CREDITS for list of people who contributed to this - * project. - * - * 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 - */ -#include -#include -#include -#include -#include -#include -#include - -void spl_nand_load_image(void) -{ - struct image_header *header; - int *src __attribute__((unused)); - int *dst __attribute__((unused)); - - debug("spl: nand - using hw ecc\n"); - nand_init(); - - /*use CONFIG_SYS_TEXT_BASE as temporary storage area */ - header = (struct image_header *)(CONFIG_SYS_TEXT_BASE); -#ifdef CONFIG_SPL_OS_BOOT - if (!spl_start_uboot()) { - /* - * load parameter image - * load to temp position since nand_spl_load_image reads - * a whole block which is typically larger than - * CONFIG_CMD_SPL_WRITE_SIZE therefore may overwrite - * following sections like BSS - */ - nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS, - CONFIG_CMD_SPL_WRITE_SIZE, - (void *)CONFIG_SYS_TEXT_BASE); - /* copy to destintion */ - for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR, - src = (int *)CONFIG_SYS_TEXT_BASE; - src < (int *)(CONFIG_SYS_TEXT_BASE + - CONFIG_CMD_SPL_WRITE_SIZE); - src++, dst++) { - writel(readl(src), dst); - } - - /* load linux */ - nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS, - CONFIG_SYS_NAND_PAGE_SIZE, (void *)header); - spl_parse_image_header(header); - if (header->ih_os == IH_OS_LINUX) { - /* happy - was a linux */ - nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS, - spl_image.size, (void *)spl_image.load_addr); - nand_deselect(); - return; - } else { - printf("The Expected Linux image was not" - "found. Please check your NAND" - "configuration.\n"); - printf("Trying to start u-boot now...\n"); - } - } -#endif -#ifdef CONFIG_NAND_ENV_DST - nand_spl_load_image(CONFIG_ENV_OFFSET, - CONFIG_SYS_NAND_PAGE_SIZE, (void *)header); - spl_parse_image_header(header); - nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size, - (void *)spl_image.load_addr); -#ifdef CONFIG_ENV_OFFSET_REDUND - nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, - CONFIG_SYS_NAND_PAGE_SIZE, (void *)header); - spl_parse_image_header(header); - nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size, - (void *)spl_image.load_addr); -#endif -#endif - /* Load u-boot */ - nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, - CONFIG_SYS_NAND_PAGE_SIZE, (void *)header); - spl_parse_image_header(header); - nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, - spl_image.size, (void *)spl_image.load_addr); - nand_deselect(); -} -- cgit v1.2.1