diff mbox

[U-Boot,PATCHv3,14/17] arm: socfpga: spl: Add SDRAM check

Message ID 1427752878-18426-15-git-send-email-dinguyen@opensource.altera.com
State Superseded
Delegated to: Marek Vasut
Headers show

Commit Message

Dinh Nguyen March 30, 2015, 10:01 p.m. UTC
From: Dinh Nguyen <dinguyen@opensource.altera.com>

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
v3: Only report the failure
v2: Be a bit more verbose about the fail message
---
 arch/arm/cpu/armv7/socfpga/spl.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Pavel Machek March 31, 2015, 9:11 p.m. UTC | #1
On Mon 2015-03-30 17:01:15, dinguyen@opensource.altera.com wrote:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> ---
> v3: Only report the failure
> v2: Be a bit more verbose about the fail message
> ---
>  arch/arm/cpu/armv7/socfpga/spl.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
> index f2d3f79..dd4d882 100644
> --- a/arch/arm/cpu/armv7/socfpga/spl.c
> +++ b/arch/arm/cpu/armv7/socfpga/spl.c
> @@ -221,4 +221,10 @@ void spl_board_init(void)
>  
>  	sdram_size = sdram_calculate_size();
>  	debug("SDRAM: %ld MiB\n", sdram_size >> 20);
> +
> +	 /* Sanity check ensure correct SDRAM size specified */

There's extra space before /*. Plus.. maybe you want to merge this to
previous patch adding the sdram_size calculation? There's no need to
split 4 line patch to two 2 liners...

Reviewed-by: Pavel Machek <pavel@ucw.cz>
									Pavel
Marek Vasut April 3, 2015, 1:53 a.m. UTC | #2
On Tuesday, March 31, 2015 at 11:11:18 PM, Pavel Machek wrote:
> On Mon 2015-03-30 17:01:15, dinguyen@opensource.altera.com wrote:
> > From: Dinh Nguyen <dinguyen@opensource.altera.com>
> > 
> > Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> > ---
> > v3: Only report the failure
> > v2: Be a bit more verbose about the fail message
> > ---
> > 
> >  arch/arm/cpu/armv7/socfpga/spl.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm/cpu/armv7/socfpga/spl.c
> > b/arch/arm/cpu/armv7/socfpga/spl.c index f2d3f79..dd4d882 100644
> > --- a/arch/arm/cpu/armv7/socfpga/spl.c
> > +++ b/arch/arm/cpu/armv7/socfpga/spl.c
> > @@ -221,4 +221,10 @@ void spl_board_init(void)
> > 
> >  	sdram_size = sdram_calculate_size();
> >  	debug("SDRAM: %ld MiB\n", sdram_size >> 20);
> > 
> > +
> > +	 /* Sanity check ensure correct SDRAM size specified */
> 
> There's extra space before /*. Plus.. maybe you want to merge this to
> previous patch adding the sdram_size calculation? There's no need to
> split 4 line patch to two 2 liners...

Fixed the extra space (nice catch) and applied, thanks!

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index f2d3f79..dd4d882 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -221,4 +221,10 @@  void spl_board_init(void)
 
 	sdram_size = sdram_calculate_size();
 	debug("SDRAM: %ld MiB\n", sdram_size >> 20);
+
+	 /* Sanity check ensure correct SDRAM size specified */
+	if (get_ram_size(0, sdram_size) != sdram_size) {
+		puts("SDRAM size check failed!\n");
+		hang();
+	}
 }