All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nios2: add memory to board info
@ 2015-10-26  9:19 Thomas Chou
  2015-10-26 20:24 ` Marek Vasut
  2015-10-27  2:23 ` [U-Boot] [PATCH v2] nios2: use dram bank in " Thomas Chou
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Chou @ 2015-10-26  9:19 UTC (permalink / raw)
  To: u-boot

Run setup_board_part1/2 and add memory information to board info
structure. So that it can display correct values in bdinfo command.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 common/board_f.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index d88ada3..6ab74d9 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -551,7 +551,7 @@ static int display_new_sp(void)
 	return 0;
 }
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_NIOS2)
 static int setup_board_part1(void)
 {
 	bd_t *bd = gd->bd;
@@ -933,7 +933,7 @@ static init_fnc_t init_sequence_f[] = {
 	reserve_stacks,
 	setup_dram_config,
 	show_dram_config,
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_NIOS2)
 	setup_board_part1,
 	INIT_FUNC_WATCHDOG_RESET
 	setup_board_part2,
-- 
2.1.4

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

* [U-Boot] [PATCH] nios2: add memory to board info
  2015-10-26  9:19 [U-Boot] [PATCH] nios2: add memory to board info Thomas Chou
@ 2015-10-26 20:24 ` Marek Vasut
  2015-10-27  0:43   ` Thomas Chou
  2015-10-27  2:23 ` [U-Boot] [PATCH v2] nios2: use dram bank in " Thomas Chou
  1 sibling, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2015-10-26 20:24 UTC (permalink / raw)
  To: u-boot

On Monday, October 26, 2015 at 10:19:32 AM, Thomas Chou wrote:
> Run setup_board_part1/2 and add memory information to board info
> structure. So that it can display correct values in bdinfo command.
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>  common/board_f.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/board_f.c b/common/board_f.c
> index d88ada3..6ab74d9 100644
> --- a/common/board_f.c
> +++ b/common/board_f.c
> @@ -551,7 +551,7 @@ static int display_new_sp(void)
>  	return 0;
>  }
> 
> -#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
> +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_NIOS2)

This looks like some ancient code, due to the fact that it's used on
PPC and M68K only, but not on ARM for example.

>  static int setup_board_part1(void)
>  {
>  	bd_t *bd = gd->bd;
> @@ -933,7 +933,7 @@ static init_fnc_t init_sequence_f[] = {
>  	reserve_stacks,
>  	setup_dram_config,
>  	show_dram_config,
> -#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
> +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_NIOS2)
>  	setup_board_part1,
>  	INIT_FUNC_WATCHDOG_RESET
>  	setup_board_part2,

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] nios2: add memory to board info
  2015-10-26 20:24 ` Marek Vasut
@ 2015-10-27  0:43   ` Thomas Chou
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Chou @ 2015-10-27  0:43 UTC (permalink / raw)
  To: u-boot

Hi Marek,

On 10/27/2015 04:24 AM, Marek Vasut wrote:
> On Monday, October 26, 2015 at 10:19:32 AM, Thomas Chou wrote:
>> Run setup_board_part1/2 and add memory information to board info
>> structure. So that it can display correct values in bdinfo command.
>>
>> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
>> ---
>>   common/board_f.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/board_f.c b/common/board_f.c
>> index d88ada3..6ab74d9 100644
>> --- a/common/board_f.c
>> +++ b/common/board_f.c
>> @@ -551,7 +551,7 @@ static int display_new_sp(void)
>>   	return 0;
>>   }
>>
>> -#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
>> +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_NIOS2)
>
> This looks like some ancient code, due to the fact that it's used on
> PPC and M68K only, but not on ARM for example.
>

Thanks for the review. I will try to follow ARM's.

Best regards,
Thomas

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

* [U-Boot] [PATCH v2] nios2: use dram bank in board info
  2015-10-26  9:19 [U-Boot] [PATCH] nios2: add memory to board info Thomas Chou
  2015-10-26 20:24 ` Marek Vasut
@ 2015-10-27  2:23 ` Thomas Chou
  2015-10-27  9:19   ` Marek Vasut
  2015-11-03  5:15   ` Thomas Chou
  1 sibling, 2 replies; 6+ messages in thread
From: Thomas Chou @ 2015-10-27  2:23 UTC (permalink / raw)
  To: u-boot

Use dram bank in board info, so that it displays correct
memory values in bdinfo command.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
v2
  change to use dram bank.

 common/cmd_bdinfo.c             | 9 +++++++--
 include/configs/nios2-generic.h | 1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index ed3b935..adda55a 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -157,10 +157,15 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
+	int i;
 	bd_t *bd = gd->bd;
 
-	print_num("mem start",		(ulong)bd->bi_memstart);
-	print_lnum("mem size",		(u64)bd->bi_memsize);
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+		print_num("DRAM bank",	i);
+		print_num("-> start",	bd->bi_dram[i].start);
+		print_num("-> size",	bd->bi_dram[i].size);
+	}
+
 	print_num("flash start",	(ulong)bd->bi_flashstart);
 	print_num("flash size",		(ulong)bd->bi_flashsize);
 	print_num("flash offset",	(ulong)bd->bi_flashoffset);
diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index b38513e..53a9f10 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -77,6 +77,7 @@
  */
 #define CONFIG_SYS_SDRAM_BASE		0xD0000000
 #define CONFIG_SYS_SDRAM_SIZE		0x08000000
+#define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_MONITOR_IS_IN_RAM
 #define CONFIG_SYS_MONITOR_LEN		0x40000	/* Reserve 256k */
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
-- 
2.1.4

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

* [U-Boot] [PATCH v2] nios2: use dram bank in board info
  2015-10-27  2:23 ` [U-Boot] [PATCH v2] nios2: use dram bank in " Thomas Chou
@ 2015-10-27  9:19   ` Marek Vasut
  2015-11-03  5:15   ` Thomas Chou
  1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-10-27  9:19 UTC (permalink / raw)
  To: u-boot

On Tuesday, October 27, 2015 at 03:23:42 AM, Thomas Chou wrote:
> Use dram bank in board info, so that it displays correct
> memory values in bdinfo command.
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

Acked-by: Marek Vasut <marex@denx.de>

btw. eventually, these fragments of code might have to be unified
into some common code, but that's for some other time.

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH v2] nios2: use dram bank in board info
  2015-10-27  2:23 ` [U-Boot] [PATCH v2] nios2: use dram bank in " Thomas Chou
  2015-10-27  9:19   ` Marek Vasut
@ 2015-11-03  5:15   ` Thomas Chou
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Chou @ 2015-11-03  5:15 UTC (permalink / raw)
  To: u-boot



On 2015?10?27? 10:23, Thomas Chou wrote:
> Use dram bank in board info, so that it displays correct
> memory values in bdinfo command.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> v2
>    change to use dram bank.
>
>   common/cmd_bdinfo.c             | 9 +++++++--
>   include/configs/nios2-generic.h | 1 +
>   2 files changed, 8 insertions(+), 2 deletions(-)
>

Applied to u-boot-nios.

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

end of thread, other threads:[~2015-11-03  5:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26  9:19 [U-Boot] [PATCH] nios2: add memory to board info Thomas Chou
2015-10-26 20:24 ` Marek Vasut
2015-10-27  0:43   ` Thomas Chou
2015-10-27  2:23 ` [U-Boot] [PATCH v2] nios2: use dram bank in " Thomas Chou
2015-10-27  9:19   ` Marek Vasut
2015-11-03  5:15   ` Thomas Chou

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.