diff mbox

[U-Boot,v3] powerpc: mmc: Add corenet devices support in esdhc spl

Message ID 1385613736-2770-1-git-send-email-Priyanka.Jain@freescale.com
State Accepted
Delegated to: Pantelis Antoniou
Headers show

Commit Message

Priyanka Jain Nov. 28, 2013, 4:42 a.m. UTC
Existing eSDHC SPL framework assumes booting from sd-image
with boot_format header which contains final u-boot Image
offset and size. No such header is present in case of
corenet devices like T1040 as corenet deivces use PBI-RCW
based intialization.

So, for corenet deives, SPL bootloader use values provided
at compilation time. These values can be defined in board
specific config file.

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
---
Changes for v3:
	Send as independent patch (not as part of patch set)

Changes for v2:
	Updated description based on Sun York's inputs

 drivers/mmc/fsl_esdhc_spl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Pantelis Antoniou Dec. 8, 2013, 12:16 p.m. UTC | #1
Hi Priyanka,

On Nov 28, 2013, at 6:42 AM, Priyanka Jain wrote:

> Existing eSDHC SPL framework assumes booting from sd-image
> with boot_format header which contains final u-boot Image
> offset and size. No such header is present in case of
> corenet devices like T1040 as corenet deivces use PBI-RCW
> based intialization.
> 
> So, for corenet deives, SPL bootloader use values provided
> at compilation time. These values can be defined in board
> specific config file.
> 
> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
> ---
> Changes for v3:
> 	Send as independent patch (not as part of patch set)
> 
> Changes for v2:
> 	Updated description based on Sun York's inputs
> 
> drivers/mmc/fsl_esdhc_spl.c |    5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
> index 65c52a2..8fc263f 100644
> --- a/drivers/mmc/fsl_esdhc_spl.c
> +++ b/drivers/mmc/fsl_esdhc_spl.c
> @@ -42,6 +42,10 @@ void __noreturn mmc_boot(void)
> 		hang();
> 	}
> 
> +#ifdef CONFIG_FSL_CORENET
> +	offset = CONFIG_SYS_MMC_U_BOOT_OFFS;
> +	code_len = CONFIG_SYS_MMC_U_BOOT_SIZE;
> +#else
> 	blklen = mmc->read_bl_len;
> 	tmp_buf = malloc(blklen);
> 	if (!tmp_buf) {
> @@ -91,6 +95,7 @@ void __noreturn mmc_boot(void)
> 	/*
> 	* Load U-Boot image from mmc into RAM
> 	*/
> +#endif
> 	blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
> 	blk_cnt = ALIGN(code_len, mmc->read_bl_len) / mmc->read_bl_len;
> 	err = mmc->block_dev.block_read(0, blk_start, blk_cnt,
> -- 
> 1.7.4.1
> 


Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>

Thanks.

-- Pantelis
diff mbox

Patch

diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
index 65c52a2..8fc263f 100644
--- a/drivers/mmc/fsl_esdhc_spl.c
+++ b/drivers/mmc/fsl_esdhc_spl.c
@@ -42,6 +42,10 @@  void __noreturn mmc_boot(void)
 		hang();
 	}
 
+#ifdef CONFIG_FSL_CORENET
+	offset = CONFIG_SYS_MMC_U_BOOT_OFFS;
+	code_len = CONFIG_SYS_MMC_U_BOOT_SIZE;
+#else
 	blklen = mmc->read_bl_len;
 	tmp_buf = malloc(blklen);
 	if (!tmp_buf) {
@@ -91,6 +95,7 @@  void __noreturn mmc_boot(void)
 	/*
 	* Load U-Boot image from mmc into RAM
 	*/
+#endif
 	blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
 	blk_cnt = ALIGN(code_len, mmc->read_bl_len) / mmc->read_bl_len;
 	err = mmc->block_dev.block_read(0, blk_start, blk_cnt,