diff mbox

[U-Boot,PATCHv2,6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat) and nand

Message ID 1368040196-21987-7-git-send-email-peter.korsgaard@barco.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Peter Korsgaard May 8, 2013, 7:09 p.m. UTC
Jump into full u-boot mode if a 'c' character is received on the uart.

We need to adjust the spl bss/malloc area to not overlap with the
loadaddr of the kernel (sdram + 32k), so move it past u-boot instead.

For raw mmc, we store the kernel parameter area in the free space after
the MBR (if used). For nand, we use the last sector of the partition
reserved for u-boot.

This also enables the spl command in the full u-boot so the kernel
parameter area snapshot can be created.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
---
 board/ti/am335x/board.c      |    9 +++++++++
 include/configs/am335x_evm.h |   27 +++++++++++++++++++++++++--
 2 files changed, 34 insertions(+), 2 deletions(-)

Comments

Tom Rini May 8, 2013, 8:09 p.m. UTC | #1
On Wed, May 08, 2013 at 09:09:56PM +0200, Peter Korsgaard wrote:

> Jump into full u-boot mode if a 'c' character is received on the uart.
> 
> We need to adjust the spl bss/malloc area to not overlap with the
> loadaddr of the kernel (sdram + 32k), so move it past u-boot instead.
> 
> For raw mmc, we store the kernel parameter area in the free space after
> the MBR (if used). For nand, we use the last sector of the partition
> reserved for u-boot.
> 
> This also enables the spl command in the full u-boot so the kernel
> parameter area snapshot can be created.
> 
> Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>

You forgot to drop the RFC part :)

> +/* nand */
> +#define CONFIG_CMD_SPL_NAND_OFS			0x240000 /* end of u-boot */

This is fine but please update MTDPARTS_DEFAULT with this change as
well (call it u-boot-spl-os).  Thanks!
Peter Korsgaard May 8, 2013, 8:21 p.m. UTC | #2
>>>>> "Tom" == Tom Rini <trini@ti.com> writes:

Hi,

 >> This also enables the spl command in the full u-boot so the kernel
 >> parameter area snapshot can be created.
 >> 
 >> Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>

 Tom> You forgot to drop the RFC part :)

Argh, indeed.

 >> +/* nand */
 >> +#define CONFIG_CMD_SPL_NAND_OFS			0x240000 /* end of u-boot */

 Tom> This is fine but please update MTDPARTS_DEFAULT with this change
 Tom> as well (call it u-boot-spl-os).  Thanks!

Ok, I will give it a day or two to see if there's more feedback and then
send a v3 with this fixed.

Thanks for the review.
diff mbox

Patch

diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index b371376..23fe188 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -297,6 +297,15 @@  static struct emif_regs ddr3_evm_emif_reg_data = {
 	.emif_ddr_phy_ctlr_1 = MT41J512M8RH125_EMIF_READ_LATENCY |
 				PHY_EN_DYN_PWRDN,
 };
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+	/* break into full u-boot on 'c' */
+	return (serial_tstc() && serial_getc() == 'c');
+}
+#endif
+
 #endif
 
 /*
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index ef00306..3b90211 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -307,13 +307,36 @@ 
 #define CONFIG_SPL_MAX_SIZE		(101 * 1024)
 #define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
 
-#define CONFIG_SPL_BSS_START_ADDR	0x80000000
+#define CONFIG_SPL_OS_BOOT
+
+#define CONFIG_SPL_BSS_START_ADDR	0x80a00000
 #define CONFIG_SPL_BSS_MAX_SIZE		0x80000		/* 512 KB */
 
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x300 /* address 0x60000 */
 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS	0x200 /* 256 KB */
 #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION	1
 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME	"u-boot.img"
+
+#ifdef CONFIG_SPL_OS_BOOT
+/* fat */
+#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME		"uImage"
+#define CONFIG_SPL_FAT_LOAD_ARGS_NAME		"args"
+#define CONFIG_SYS_SPL_ARGS_ADDR		(PHYS_DRAM_1 + 0x100)
+
+/* raw mmc */
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR	0x500 /* address 0xa0000 */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR	0x8   /* address 0x1000 */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS	8     /* 4KB */
+
+/* nand */
+#define CONFIG_CMD_SPL_NAND_OFS			0x240000 /* end of u-boot */
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS		0x280000
+#define CONFIG_CMD_SPL_WRITE_SIZE		0x1000
+
+/* spl export command */
+#define CONFIG_CMD_SPL
+#endif
+
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SPL_FAT_SUPPORT
 #define CONFIG_SPL_I2C_SUPPORT
@@ -375,7 +398,7 @@ 
  * other needs.
  */
 #define CONFIG_SYS_TEXT_BASE		0x80800000
-#define CONFIG_SYS_SPL_MALLOC_START	0x80208000
+#define CONFIG_SYS_SPL_MALLOC_START	0x80a08000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000
 
 /* Since SPL did pll and ddr initialization for us,