All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS
@ 2013-06-07  9:25 ying.zhang at freescale.com
  2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: ying.zhang at freescale.com @ 2013-06-07  9:25 UTC (permalink / raw)
  To: u-boot

From: Ying Zhang <b40530@freescale.com>

There will clear the BSS in the function clear_bss(), the reset address of
the BSS started from the __bss_start, and increased by four-byte increments,
finally stoped depending on the address is equal to the _bss_end. If the end
address __bss_end is not alignment to 4byte, it will be an infinite loop.

1. The reset action stoped depending on the reset address is greater
than or equal the end address of the BSS.
2. The end address of the BSS should be 4byte aligned. Because the reset unit
is 4 Bytes.

This patch is on top of the patch "powerpc/mpc85xx: support application
without resetvec segment in the linker script".

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
Compared with the previous version, add explicit alignment of the BSS start
address.

 arch/powerpc/cpu/mpc85xx/start.S        |    2 +-
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 4f0480b..2657982 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -1795,7 +1795,7 @@ clear_bss:
 	stw	r0,0(r3)
 	addi	r3,r3,4
 	cmplw	0,r3,r4
-	bne	5b
+	blt	5b
 6:
 
 	mr	r3,r9		/* Init Data pointer		*/
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index c613e58..5c7c598 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -89,10 +89,12 @@ SECTIONS
 	 */
 	. |= 0x10;
 
+	. = ALIGN(4);
 	__bss_start = .;
 	.bss : {
 		*(.sbss*)
 		*(.bss*)
 	}
+	. = ALIGN(4);
 	__bss_end = .;
 }
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
  2013-06-07  9:25 [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS ying.zhang at freescale.com
@ 2013-06-07  9:25 ` ying.zhang at freescale.com
  2013-06-07 17:20   ` Scott Wood
  2013-06-07  9:25 ` [U-Boot] [PATCH 6/8 v2] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import ying.zhang at freescale.com
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: ying.zhang at freescale.com @ 2013-06-07  9:25 UTC (permalink / raw)
  To: u-boot

From: Ying Zhang <b40530@freescale.com>

1. The symbol CONFIG_SPL_NAND_MINIMAL is unused, so deleted it.
2. Introduced a new symbol CONFIG_SPL_MINIMAL:
	It is different from the common SPL. If set, only a
tiny part code of the SPL is built and to avoid unreferenced
functions. For example: mpc85xx nand SPL. It belongs to
minimal SPL, it's size is less than 4K.

	Now, some functions were unused in the minimal SPL,
but it is useful in the common SPL. They can be avoid by
defining CONFIG_SPL_MINIMAL in minimal SPL.

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
This patch is split from the previous patch "spl: Make CONFIG_SPL_BUILD
contain more functionality"

 README                         |    5 +++++
 arch/powerpc/cpu/mpc85xx/tlb.c |    2 +-
 arch/powerpc/cpu/mpc8xxx/law.c |    4 ++--
 include/configs/MPC8313ERDB.h  |    2 +-
 include/configs/P1022DS.h      |    4 +++-
 include/configs/p1_p2_rdb_pc.h |    4 +++-
 6 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/README b/README
index e30e787..fbb50fb 100644
--- a/README
+++ b/README
@@ -2911,6 +2911,11 @@ FIT uImage format:
 		CONFIG_SPL_INIT_MINIMAL
 		Arch init code should be built for a very small image
 
+		CONFIG_SPL_MINIMAL
+		It is different from common SPL. if set, the SPL image
+		as small as possible, only a tiny part of the SPL code
+		is built.
+
 		CONFIG_SPL_LIBCOMMON_SUPPORT
 		Support for common/libcommon.o in SPL binary
 
diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c
index 0dff37f..8d08b53 100644
--- a/arch/powerpc/cpu/mpc85xx/tlb.c
+++ b/arch/powerpc/cpu/mpc85xx/tlb.c
@@ -55,7 +55,7 @@ void init_tlbs(void)
 	return ;
 }
 
-#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_MINIMAL)
 void read_tlbcam_entry(int idx, u32 *valid, u32 *tsize, unsigned long *epn,
 		       phys_addr_t *rpn)
 {
diff --git a/arch/powerpc/cpu/mpc8xxx/law.c b/arch/powerpc/cpu/mpc8xxx/law.c
index 6f9d568..b6d5554 100644
--- a/arch/powerpc/cpu/mpc8xxx/law.c
+++ b/arch/powerpc/cpu/mpc8xxx/law.c
@@ -92,7 +92,7 @@ void disable_law(u8 idx)
 	return;
 }
 
-#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_MINIMAL)
 static int get_law_entry(u8 i, struct law_entry *e)
 {
 	u32 lawar;
@@ -122,7 +122,7 @@ int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 	return idx;
 }
 
-#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_SPL_MINIMAL)
 int set_last_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 {
 	u32 idx;
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index c28dfe0..934f7ac 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -40,13 +40,13 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"
 #define CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
 
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_NS16550_MIN_FUNCTIONS
+#define CONFIG_SPL_MINIMAL
 #endif
 
 #define CONFIG_SYS_TEXT_BASE	0x00100000 /* CONFIG_SYS_NAND_U_BOOT_DST */
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 69412e4..238aa77 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -41,7 +41,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
 
@@ -55,6 +54,9 @@
 #define CONFIG_SYS_NAND_U_BOOT_START   0x00200000
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0
 #define CONFIG_SYS_LDSCRIPT            "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds"
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_MINIMAL
+#endif
 #endif
 
 /* High Level Configuration Options */
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 7ed634b..99a55fb 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -159,7 +159,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"
 
@@ -187,6 +186,9 @@
 #define CONFIG_SYS_NAND_U_BOOT_SIZE	((512 << 10) - 0x2000)
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0
 #define CONFIG_SYS_LDSCRIPT		"arch/powerpc/cpu/mpc85xx/u-boot-nand.lds"
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_MINIMAL
+#endif
 #endif
 
 #ifndef CONFIG_SYS_TEXT_BASE
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 6/8 v2] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import
  2013-06-07  9:25 [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS ying.zhang at freescale.com
  2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
@ 2013-06-07  9:25 ` ying.zhang at freescale.com
  2013-06-07  9:25 ` [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL ying.zhang at freescale.com
  2013-06-21 20:48 ` [U-Boot] [U-Boot, 2/8, v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS Andy Fleming
  3 siblings, 0 replies; 11+ messages in thread
From: ying.zhang at freescale.com @ 2013-06-07  9:25 UTC (permalink / raw)
  To: u-boot

From: Ying Zhang <b40530@freescale.com>

The functionality env_import will be used in the SPL. They
had been excluded by ifndef CONFIG_SPL_BUILD. Now, put it
into the SPL.

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
Compared with the previous version, split into two separate patches.
this pactch only enables function env_import in SPL.

 common/env_common.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/common/env_common.c b/common/env_common.c
index 906b41f..8cb81e9 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -156,7 +156,6 @@ int set_default_vars(int nvars, char * const vars[])
 				H_NOCLEAR | H_INTERACTIVE, nvars, vars);
 }
 
-#ifndef CONFIG_SPL_BUILD
 /*
  * Check if CRC is valid and (if yes) import the environment.
  * Note that "buf" may or may not be aligned.
@@ -188,7 +187,6 @@ int env_import(const char *buf, int check)
 
 	return 0;
 }
-#endif
 
 void env_relocate(void)
 {
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL
  2013-06-07  9:25 [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS ying.zhang at freescale.com
  2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
  2013-06-07  9:25 ` [U-Boot] [PATCH 6/8 v2] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import ying.zhang at freescale.com
@ 2013-06-07  9:25 ` ying.zhang at freescale.com
  2013-06-19 16:36   ` Andy Fleming
  2013-06-21 20:48 ` [U-Boot] [U-Boot, 2/8, v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS Andy Fleming
  3 siblings, 1 reply; 11+ messages in thread
From: ying.zhang at freescale.com @ 2013-06-07  9:25 UTC (permalink / raw)
  To: u-boot

From: Ying Zhang <b40530@freescale.com>

Support to boot from spi flash.

This patch is on top of the patch:
powerpc/p1022ds: boot from SD Card with SPL

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
 board/freescale/p1022ds/spl.c  |   12 +++++-
 drivers/mtd/spi/Makefile       |    1 +
 drivers/mtd/spi/fsl_espi_spl.c |   79 ++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/spi/spi_flash.c    |    2 +
 include/configs/P1022DS.h      |   36 +++++++++++++++----
 5 files changed, 121 insertions(+), 9 deletions(-)
 create mode 100644 drivers/mtd/spi/fsl_espi_spl.c

diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index 40f000f..1dd9050 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -21,13 +21,12 @@
 
 #include <common.h>
 #include <ns16550.h>
-#include <asm/fsl_law.h>
-#include <asm/fsl_ddr_sdram.h>
 #include <malloc.h>
 #include <mmc.h>
 #include <i2c.h>
 #include "../common/ngpixis.h"
 #include <fsl_esdhc.h>
+#include <spi_flash.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -54,6 +53,11 @@ void board_init_f(ulong bootflag)
 	setbits_be32(&gur->pmuxcr,
 		in_be32(&gur->pmuxcr) | MPC85xx_PMUXCR_SD_DATA);
 
+#ifdef CONFIG_SPL_SPI_BOOT
+	/* Enable the SPI */
+	clrsetbits_8(&pixis->brdcfg0, PIXIS_ELBC_SPI_MASK, PIXIS_SPI);
+#endif
+
 	/* Read back the register to synchronize the write. */
 	in_be32(&gur->pmuxcr);
 
@@ -67,6 +71,8 @@ void board_init_f(ulong bootflag)
 			bus_clk / 16 / CONFIG_BAUDRATE);
 #ifdef CONFIG_SPL_MMC_BOOT
 	puts("\nSD boot...\n");
+#elif defined(CONFIG_SPL_SPI_BOOT)
+       puts("\nSPI Flash boot...\n");
 #endif
 
 	/* copy code to RAM and jump to it - this should not return */
@@ -108,5 +114,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();
 #endif
 }
diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 90f8392..5f130d5 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -27,6 +27,7 @@ LIB	:= $(obj)libspi_flash.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_SPL_SPI_LOAD)	+= spi_spl_load.o
+COBJS-$(CONFIG_SPL_SPI_BOOT)	+= fsl_espi_spl.o
 endif
 
 COBJS-$(CONFIG_SPI_FLASH)	+= spi_flash.o
diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c
new file mode 100644
index 0000000..75ffc8a
--- /dev/null
+++ b/drivers/mtd/spi/fsl_espi_spl.c
@@ -0,0 +1,79 @@
+/*
+ * 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
+ *
+ */
+
+#include <common.h>
+#include <spi_flash.h>
+#include <malloc.h>
+
+#define ESPI_BOOT_IMAGE_SIZE	0x48
+#define ESPI_BOOT_IMAGE_ADDR	0x50
+#define CONFIG_CFG_DATA_SECTOR	0
+
+/*
+ * The main entry for SPI booting. It's necessary that SDRAM is already
+ * 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 (*uboot)(void) __noreturn;
+	u32 offset, code_len, i;
+	unsigned char *buf = NULL;
+	struct spi_flash *flash;
+
+	flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
+			CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
+	if (flash == NULL) {
+		puts("\nspi_flash_probe failed");
+		hang();
+	}
+
+	/*
+	* Load U-Boot image from SPI flash into RAM
+	*/
+	buf = malloc(flash->page_size);
+	if (buf == NULL) {
+		puts("\nmalloc failed");
+		hang();
+	}
+	memset(buf, 0, flash->page_size);
+
+	spi_flash_read(flash, CONFIG_CFG_DATA_SECTOR, \
+			flash->page_size, (void *)buf);
+	offset = *(u32 *)(buf + ESPI_BOOT_IMAGE_ADDR);
+	/* Skip spl code */
+	offset += CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
+	/* Get the code size from offset 0x48 */
+	code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
+	/* Skip spl code */
+	code_len = code_len - CONFIG_SPL_MAX_SIZE;
+	/* copy code to DDR */
+	spi_flash_read(flash, offset, code_len, \
+			(void *)CONFIG_SYS_SPI_FLASH_U_BOOT_DST);
+	/*
+	* Jump to U-Boot image
+	*/
+	flush_cache(CONFIG_SYS_SPI_FLASH_U_BOOT_DST, \
+			code_len);
+	uboot = (void *) CONFIG_SYS_SPI_FLASH_U_BOOT_START;
+	(*uboot)();
+}
+
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 111185a..8cac488 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -432,12 +432,14 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 		goto err_manufacturer_probe;
 	}
 #endif
+#ifndef CONFIG_SPL_BUILD
 	printf("SF: Detected %s with page size ", flash->name);
 	print_size(flash->sector_size, ", total ");
 	print_size(flash->size, "");
 	if (flash->memory_map)
 		printf(", mapped at %p", flash->memory_map);
 	puts("\n");
+#endif
 
 	spi_release_bus(spi);
 
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index b881bad..8fd9e53 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -48,11 +48,33 @@
 #endif
 
 #ifdef CONFIG_SPIFLASH
-#define CONFIG_RAMBOOT_SPIFLASH
-#define CONFIG_SYS_RAMBOOT
-#define CONFIG_SYS_EXTRA_ENV_RELOC
-#define CONFIG_SYS_TEXT_BASE		0x11000000
-#define CONFIG_RESET_VECTOR_ADDRESS	0x1107fffc
+#define CONFIG_SPL
+#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_MINIMAL
+#define CONFIG_SPL_FLUSH_IMAGE
+#define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_FSL_LAW                 /* Use common FSL init code */
+#define CONFIG_SYS_TEXT_BASE		0x11001000
+#define CONFIG_SPL_TEXT_BASE		0xf8f81000
+#define CONFIG_SPL_PAD_TO		0x18000
+#define CONFIG_SPL_MAX_SIZE		(96 * 1024)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE	(512 << 10)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST		(0x11000000)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_START	(0x11000000)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS	(96 << 10)
+#define CONFIG_SYS_MPC85XX_NO_RESETVEC
+#define CONFIG_SYS_LDSCRIPT	"arch/powerpc/cpu/mpc85xx/u-boot.lds"
+#define CONFIG_SPL_SPI_BOOT
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_COMMON_INIT_DDR
+#endif
 #endif
 
 #define CONFIG_NAND_FSL_ELBC
@@ -321,7 +343,7 @@
  * Config the L2 Cache as L2 SRAM
 */
 #if defined(CONFIG_SPL_BUILD)
-#if defined(CONFIG_SDCARD)
+#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
 #define CONFIG_SYS_INIT_L2_ADDR		0xf8f80000
 #define CONFIG_SYS_INIT_L2_ADDR_PHYS	CONFIG_SYS_INIT_L2_ADDR
 #define CONFIG_SYS_L2_SIZE		(256 << 10)
@@ -565,7 +587,7 @@
 /*
  * Environment
  */
-#ifdef CONFIG_RAMBOOT_SPIFLASH
+#ifdef CONFIG_SPIFLASH
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_SPI_BUS	0
 #define CONFIG_ENV_SPI_CS	0
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
  2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
@ 2013-06-07 17:20   ` Scott Wood
  2013-06-08  2:14     ` Zhang Ying-B40530
  0 siblings, 1 reply; 11+ messages in thread
From: Scott Wood @ 2013-06-07 17:20 UTC (permalink / raw)
  To: u-boot

On 06/07/2013 04:25:17 AM, ying.zhang at freescale.com wrote:
> diff --git a/README b/README
> index e30e787..fbb50fb 100644
> --- a/README
> +++ b/README
> @@ -2911,6 +2911,11 @@ FIT uImage format:
>  		CONFIG_SPL_INIT_MINIMAL
>  		Arch init code should be built for a very small image
> 
> +		CONFIG_SPL_MINIMAL
> +		It is different from common SPL. if set, the SPL image
> +		as small as possible, only a tiny part of the SPL code
> +		is built.

How is this different from CONFIG_SPL_INIT_MINIMAL?

-Scott

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
  2013-06-07 17:20   ` Scott Wood
@ 2013-06-08  2:14     ` Zhang Ying-B40530
  2013-06-10 18:32       ` Scott Wood
  0 siblings, 1 reply; 11+ messages in thread
From: Zhang Ying-B40530 @ 2013-06-08  2:14 UTC (permalink / raw)
  To: u-boot



-----Original Message-----
From: Wood Scott-B07421 
Sent: Saturday, June 08, 2013 1:21 AM
To: Zhang Ying-B40530
Cc: u-boot at lists.denx.de; afleming at gmail.com; Xie Xiaobo-R63061; Zhang Ying-B40530
Subject: Re: [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL

On 06/07/2013 04:25:17 AM, ying.zhang at freescale.com wrote:
> diff --git a/README b/README
> index e30e787..fbb50fb 100644
> --- a/README
> +++ b/README
> @@ -2911,6 +2911,11 @@ FIT uImage format:
>  		CONFIG_SPL_INIT_MINIMAL
>  		Arch init code should be built for a very small image
> 
> +		CONFIG_SPL_MINIMAL
> +		It is different from common SPL. if set, the SPL image
> +		as small as possible, only a tiny part of the SPL code
> +		is built.

How is this different from CONFIG_SPL_INIT_MINIMAL?
[Zhang Ying] 

It is really some confusion. So, we have two options:

1.  CONFIG_SPL_INIT_MINIMAL coexist with CONFIG_SPL_MINIMAL, I can increase the description for the difference
between both:
CONFIG_SPL_INIT_MINIMAL expressed support for minimal SPL. But it cannot be used independently, it must be
applied with CONFIG_SPL_BUILD. It mainly used in Makefiles.

CONFIG_SPL_MINIMAL equals to CONFIG_SPL_BUILD && CONFIG_SPL_INIT_MINIMAL. It is applied to C files. 

Just as you said: it would be nice to limit SPL symbols to only be defined for the SPL part of the build, so
we don't have to add checks for CONFIG_SPL_BUILD all over the place.  Currently this won't work for symbols
that makefiles look at, if "SPL: Makefile: Build a separate autoconf.mk for SPL" gets merged, we could just
define CONFIG_SPL_MINIMAL in the SPL build case.

2. No longer adds the new symbol CONFIG_SPL_MINIMAL:
We can use CONFIG_SPL_BUILD && CONFIG_SPL_INIT_MINIMAL to replace it in the C files.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
  2013-06-08  2:14     ` Zhang Ying-B40530
@ 2013-06-10 18:32       ` Scott Wood
  2013-06-10 22:40         ` Zhang Ying-B40530
  0 siblings, 1 reply; 11+ messages in thread
From: Scott Wood @ 2013-06-10 18:32 UTC (permalink / raw)
  To: u-boot

On 06/07/2013 09:14:56 PM, Zhang Ying-B40530 wrote:
> 
> 
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Saturday, June 08, 2013 1:21 AM
> To: Zhang Ying-B40530
> Cc: u-boot at lists.denx.de; afleming at gmail.com; Xie Xiaobo-R63061;  
> Zhang Ying-B40530
> Subject: Re: [PATCH 5/8] powerpc: spl: deleted unused symbol  
> CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
> 
> On 06/07/2013 04:25:17 AM, ying.zhang at freescale.com wrote:
> > diff --git a/README b/README
> > index e30e787..fbb50fb 100644
> > --- a/README
> > +++ b/README
> > @@ -2911,6 +2911,11 @@ FIT uImage format:
> >  		CONFIG_SPL_INIT_MINIMAL
> >  		Arch init code should be built for a very small image
> >
> > +		CONFIG_SPL_MINIMAL
> > +		It is different from common SPL. if set, the SPL image
> > +		as small as possible, only a tiny part of the SPL code
> > +		is built.
> 
> How is this different from CONFIG_SPL_INIT_MINIMAL?
> [Zhang Ying]
> 
> It is really some confusion. So, we have two options:
> 
> 1.  CONFIG_SPL_INIT_MINIMAL coexist with CONFIG_SPL_MINIMAL, I can  
> increase the description for the difference
> between both:
> CONFIG_SPL_INIT_MINIMAL expressed support for minimal SPL. But it  
> cannot be used independently, it must be
> applied with CONFIG_SPL_BUILD. It mainly used in Makefiles.
> 
> CONFIG_SPL_MINIMAL equals to CONFIG_SPL_BUILD &&  
> CONFIG_SPL_INIT_MINIMAL. It is applied to C files.

For now just use

#if !defined(CONFIG_SPL_INIT_MINIMAL) || !defined(CONFIG_SPL_BUILD)

...and once the patch for the separate SPL autoconf.mk gets merged, we  
can change all the SPL symbols to be only defined with CONFIG_SPL_BUILD  
(unless there's a specific reason not to for a particular symbol), and  
clean up the ifdefs.

-Scott

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
  2013-06-10 18:32       ` Scott Wood
@ 2013-06-10 22:40         ` Zhang Ying-B40530
  0 siblings, 0 replies; 11+ messages in thread
From: Zhang Ying-B40530 @ 2013-06-10 22:40 UTC (permalink / raw)
  To: u-boot


________________________________________
From: Wood Scott-B07421
Sent: Monday, June 10, 2013 6:32 PM
To: Zhang Ying-B40530
Cc: Wood Scott-B07421; u-boot at lists.denx.de; afleming at gmail.com; Xie Xiaobo-R63061
Subject: Re: [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL

On 06/07/2013 09:14:56 PM, Zhang Ying-B40530 wrote:
>
>
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Saturday, June 08, 2013 1:21 AM
> To: Zhang Ying-B40530
> Cc: u-boot at lists.denx.de; afleming at gmail.com; Xie Xiaobo-R63061;
> Zhang Ying-B40530
> Subject: Re: [PATCH 5/8] powerpc: spl: deleted unused symbol
> CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL
>
> On 06/07/2013 04:25:17 AM, ying.zhang at freescale.com wrote:
> > diff --git a/README b/README
> > index e30e787..fbb50fb 100644
> > --- a/README
> > +++ b/README
> > @@ -2911,6 +2911,11 @@ FIT uImage format:
> >             CONFIG_SPL_INIT_MINIMAL
> >             Arch init code should be built for a very small image
> >
> > +           CONFIG_SPL_MINIMAL
> > +           It is different from common SPL. if set, the SPL image
> > +           as small as possible, only a tiny part of the SPL code
> > +           is built.
>
> How is this different from CONFIG_SPL_INIT_MINIMAL?
> [Zhang Ying]
>
> It is really some confusion. So, we have two options:
>
> 1.  CONFIG_SPL_INIT_MINIMAL coexist with CONFIG_SPL_MINIMAL, I can
> increase the description for the difference
> between both:
> CONFIG_SPL_INIT_MINIMAL expressed support for minimal SPL. But it
> cannot be used independently, it must be
> applied with CONFIG_SPL_BUILD. It mainly used in Makefiles.
>
> CONFIG_SPL_MINIMAL equals to CONFIG_SPL_BUILD &&
> CONFIG_SPL_INIT_MINIMAL. It is applied to C files.

For now just use

#if !defined(CONFIG_SPL_INIT_MINIMAL) || !defined(CONFIG_SPL_BUILD)

...and once the patch for the separate SPL autoconf.mk gets merged, we
can change all the SPL symbols to be only defined with CONFIG_SPL_BUILD
(unless there's a specific reason not to for a particular symbol), and
clean up the ifdefs.

OK. 

-ZhangYing

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL
  2013-06-07  9:25 ` [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL ying.zhang at freescale.com
@ 2013-06-19 16:36   ` Andy Fleming
  2013-06-21 10:12     ` Zhang Ying-B40530
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Fleming @ 2013-06-19 16:36 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 7, 2013 at 4:25 AM, <ying.zhang@freescale.com> wrote:

> From: Ying Zhang <b40530@freescale.com>
>
> Support to boot from spi flash.
>
> This patch is on top of the patch:
> powerpc/p1022ds: boot from SD Card with SPL
>
> Signed-off-by: Ying Zhang <b40530@freescale.com>
> ---
>  board/freescale/p1022ds/spl.c  |   12 +++++-
>  drivers/mtd/spi/Makefile       |    1 +
>  drivers/mtd/spi/fsl_espi_spl.c |   79
> ++++++++++++++++++++++++++++++++++++++++
>  drivers/mtd/spi/spi_flash.c    |    2 +
>  include/configs/P1022DS.h      |   36 +++++++++++++++----
>


These should probably be divided into two patches. One to add the
capability (in drivers/mtd), and one to enable the capability (in the
p1022-specific files).

I'd like jagan's ack before applying this, but if you split this patch, and
he agrees, I'd be happy to take this in through my tree.

Andy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL
  2013-06-19 16:36   ` Andy Fleming
@ 2013-06-21 10:12     ` Zhang Ying-B40530
  0 siblings, 0 replies; 11+ messages in thread
From: Zhang Ying-B40530 @ 2013-06-21 10:12 UTC (permalink / raw)
  To: u-boot



From: Andy Fleming [mailto:afleming at gmail.com]
Sent: Thursday, June 20, 2013 12:37 AM
To: Zhang Ying-B40530; jagannadha.sutradharudu-teki at xilinx.com
Cc: U-Boot list; Wood Scott-B07421; Xie Xiaobo-R63061; Zhang Ying-B40530
Subject: Re: [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL



On Fri, Jun 7, 2013 at 4:25 AM, <ying.zhang at freescale.com<mailto:ying.zhang@freescale.com>> wrote:
From: Ying Zhang <b40530 at freescale.com<mailto:b40530@freescale.com>>

Support to boot from spi flash.

This patch is on top of the patch:
powerpc/p1022ds: boot from SD Card with SPL

Signed-off-by: Ying Zhang <b40530 at freescale.com<mailto:b40530@freescale.com>>
---
 board/freescale/p1022ds/spl.c  |   12 +++++-
 drivers/mtd/spi/Makefile       |    1 +
 drivers/mtd/spi/fsl_espi_spl.c |   79 ++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/spi/spi_flash.c    |    2 +
 include/configs/P1022DS.h      |   36 +++++++++++++++----


These should probably be divided into two patches. One to add the capability (in drivers/mtd), and one to enable the capability (in the p1022-specific files).

I'd like jagan's ack before applying this, but if you split this patch, and he agrees, I'd be happy to take this in through my tree.
[Zhang Ying]
This should be no problem. It will be modified with other review comment in the next version(v6).
Now the most important is the patch "[PATCH 07/10 v5] powerpc/p1022ds: boot from SD Card with SPL",
Please review as soon as possible,  I had waiting long.
Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [U-Boot, 2/8, v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS
  2013-06-07  9:25 [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS ying.zhang at freescale.com
                   ` (2 preceding siblings ...)
  2013-06-07  9:25 ` [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL ying.zhang at freescale.com
@ 2013-06-21 20:48 ` Andy Fleming
  3 siblings, 0 replies; 11+ messages in thread
From: Andy Fleming @ 2013-06-21 20:48 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 07, 2013 at 05:25:16PM +0800, ying.zhang at freescale.com wrote:
> From: Ying Zhang <b40530@freescale.com>
> 
> There will clear the BSS in the function clear_bss(), the reset address of
> the BSS started from the __bss_start, and increased by four-byte increments,
> finally stoped depending on the address is equal to the _bss_end. If the end
> address __bss_end is not alignment to 4byte, it will be an infinite loop.
> 
> 1. The reset action stoped depending on the reset address is greater
> than or equal the end address of the BSS.
> 2. The end address of the BSS should be 4byte aligned. Because the reset unit
> is 4 Bytes.
> 
> This patch is on top of the patch "powerpc/mpc85xx: support application
> without resetvec segment in the linker script".
> 
> Signed-off-by: Ying Zhang <b40530@freescale.com>

Applied, thanks!

Andy

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-06-21 20:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07  9:25 [U-Boot] [PATCH 2/8 v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS ying.zhang at freescale.com
2013-06-07  9:25 ` [U-Boot] [PATCH 5/8] powerpc: spl: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and introduced new symbol CONFIG_SPL_MINIMAL ying.zhang at freescale.com
2013-06-07 17:20   ` Scott Wood
2013-06-08  2:14     ` Zhang Ying-B40530
2013-06-10 18:32       ` Scott Wood
2013-06-10 22:40         ` Zhang Ying-B40530
2013-06-07  9:25 ` [U-Boot] [PATCH 6/8 v2] spl: env_common.c: make CONFIG_SPL_BUILD contain function env_import ying.zhang at freescale.com
2013-06-07  9:25 ` [U-Boot] [PATCH 8/8] powerpc/p1022ds: boot from spi flash with SPL ying.zhang at freescale.com
2013-06-19 16:36   ` Andy Fleming
2013-06-21 10:12     ` Zhang Ying-B40530
2013-06-21 20:48 ` [U-Boot] [U-Boot, 2/8, v2] powerpc/mpc85xx: modify the functionality clear_bss and aligning the end address of the BSS Andy Fleming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.