diff mbox

[U-Boot,PATCHv2,17/20] arm: socfpga: spl: Add SDRAM check

Message ID 1425313688-23595-18-git-send-email-dinguyen@opensource.altera.com
State Superseded
Delegated to: Marek Vasut
Headers show

Commit Message

Dinh Nguyen March 2, 2015, 4:28 p.m. UTC
From: Dinh Nguyen <dinguyen@opensource.altera.com>

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
 arch/arm/cpu/armv7/socfpga/spl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Marek Vasut March 4, 2015, 1:21 p.m. UTC | #1
On Monday, March 02, 2015 at 05:28:05 PM, dinguyen@opensource.altera.com wrote:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> ---
>  arch/arm/cpu/armv7/socfpga/spl.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/socfpga/spl.c
> b/arch/arm/cpu/armv7/socfpga/spl.c index ea4a1fb..31ac789 100644
> --- a/arch/arm/cpu/armv7/socfpga/spl.c
> +++ b/arch/arm/cpu/armv7/socfpga/spl.c
> @@ -191,4 +191,12 @@ 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 */
> +	puts("SDRAM: Ensuring specified SDRAM size is correct ...");
> +	if (get_ram_size(0, sdram_size) != sdram_size) {
> +		puts("failed\n");

Hi!

Maybe just report a failure, the positive state is not interesting
to the user and just polutes the console with messages which noone
cares about (unless this would be a debug build maybe).

What do you think please ?

> +		hang();
> +	}
> +	puts("passed\n");
>  }

Best regards,
Marek Vasut
Dinh Nguyen March 9, 2015, 9:59 p.m. UTC | #2
On 3/4/15 7:21 AM, Marek Vasut wrote:
> On Monday, March 02, 2015 at 05:28:05 PM, dinguyen@opensource.altera.com wrote:
>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>> ---
>>  arch/arm/cpu/armv7/socfpga/spl.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arm/cpu/armv7/socfpga/spl.c
>> b/arch/arm/cpu/armv7/socfpga/spl.c index ea4a1fb..31ac789 100644
>> --- a/arch/arm/cpu/armv7/socfpga/spl.c
>> +++ b/arch/arm/cpu/armv7/socfpga/spl.c
>> @@ -191,4 +191,12 @@ 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 */
>> +	puts("SDRAM: Ensuring specified SDRAM size is correct ...");
>> +	if (get_ram_size(0, sdram_size) != sdram_size) {
>> +		puts("failed\n");
> 
> Hi!
> 
> Maybe just report a failure, the positive state is not interesting
> to the user and just polutes the console with messages which noone
> cares about (unless this would be a debug build maybe).
> 
> What do you think please ?
> 

Yeah, I think that's fine.

Dinh
Marek Vasut March 10, 2015, 1:39 p.m. UTC | #3
On Monday, March 09, 2015 at 10:59:34 PM, Dinh Nguyen wrote:
> On 3/4/15 7:21 AM, Marek Vasut wrote:
> > On Monday, March 02, 2015 at 05:28:05 PM, dinguyen@opensource.altera.com 
wrote:
> >> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> >> 
> >> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> >> ---
> >> 
> >>  arch/arm/cpu/armv7/socfpga/spl.c | 8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >> 
> >> diff --git a/arch/arm/cpu/armv7/socfpga/spl.c
> >> b/arch/arm/cpu/armv7/socfpga/spl.c index ea4a1fb..31ac789 100644
> >> --- a/arch/arm/cpu/armv7/socfpga/spl.c
> >> +++ b/arch/arm/cpu/armv7/socfpga/spl.c
> >> @@ -191,4 +191,12 @@ 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 */
> >> +	puts("SDRAM: Ensuring specified SDRAM size is correct ...");
> >> +	if (get_ram_size(0, sdram_size) != sdram_size) {
> >> +		puts("failed\n");
> > 
> > Hi!
> > 
> > Maybe just report a failure, the positive state is not interesting
> > to the user and just polutes the console with messages which noone
> > cares about (unless this would be a debug build maybe).
> > 
> > What do you think please ?
> 
> Yeah, I think that's fine.

Cool, 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 ea4a1fb..31ac789 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -191,4 +191,12 @@  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 */
+	puts("SDRAM: Ensuring specified SDRAM size is correct ...");
+	if (get_ram_size(0, sdram_size) != sdram_size) {
+		puts("failed\n");
+		hang();
+	}
+	puts("passed\n");
 }