Skip to contentSkip to conversation

common: board_f: fix to display wrong memory information

PATCH New Jaehoon Chung 2 participants 4 messages Dec 29, 2020 – Jan 27, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20201229232343epcas1p22ea9e7e1d919cd50717d38edc2a01285@epcas1p2.samsung.com

#1 lore raw

PATCH 1/1 common: board_f: fix to display wrong memory information

When run meminfo command, it's displayed wrong memory information. Because it's using gd->ram_size what didn't configure ram size.

On 4G RPI4 target
- Before
U-Boot> meminfo
DRAM: 948MiB
- After
U-Boot> meminfo
DRAM: 3.9GiB

---
 common/board_f.c | 1 +
 1 file changed, 1 insertion(+)
common/board_f.c +1 -0
index 9f441c44f176..96c675ea28e4 100644
@@ -228,6 +228,7 @@ static int show_dram_config(void)
 	}
 	debug("\nDRAM:  ");
 
+	gd->ram_size = size;
 	print_size(size, "");
 	board_add_ram_info(0);
 	putc('\n');
Signature · 1 line
2.29.0
#2 lore raw

PATCH 1/1 common: board_f: fix to display wrong memory information

Quoted 2 lines · Jaehoon Chung

When run meminfo command, it's displayed wrong memory information. Because it's using gd->ram_size what didn't configure ram size.

what -> which?

Quoted 19 lines

On 4G RPI4 target
- Before

    U-Boot> meminfo
    DRAM: 948MiB
- After
    U-Boot> meminfo
    DRAM: 3.9GiB
---
  common/board_f.c | 1 +
  1 file changed, 1 insertion(+)
common/board_f.c +0 -0
index 9f441c44f176..96c675ea28e4 100644

common/board_f.c static int show_dram_config(void) · line 231

Quoted 4 lines
common/board_f.c +1 -0
@@ -228,6 +228,7 @@ static int show_dram_config(void)
  	}
  	debug("\nDRAM:  ");
 
+	gd->ram_size = size;

Shouldn't this be set by dram_init?

--Sean

Quoted 4 lines
common/board_f.c +0 -0
  	print_size(size, "");
  	board_add_ram_info(0);
  	putc('\n');
#3 lore raw

PATCH 1/1 common: board_f: fix to display wrong memory information

Quoted 5 lines · Sean Anderson
Quoted 2 lines · Jaehoon Chung

When run meminfo command, it's displayed wrong memory information. Because it's using gd->ram_size what didn't configure ram size.

what -> which?

Will update

Quoted 15 lines
Quoted 15 lines

On 4G RPI4 target
- Before
??? U-Boot> meminfo
??? DRAM: 948MiB
- After
??? U-Boot> meminfo
??? DRAM: 3.9GiB

---
? common/board_f.c | 1 +
? 1 file changed, 1 insertion(+)

Quoted 10 lines

common/board_f.c static int show_dram_config(void) · line 230

Quoted 8 lines
common/board_f.c +0 -0
index 9f441c44f176..96c675ea28e4 100644
@@ -228,6 +228,7 @@ static int show_dram_config(void)
 ????? }
 ????? debug("\nDRAM:? ");
 ? +??? gd->ram_size = size;

Shouldn't this be set by dram_init?

Yes, it's set by dram_init(), I didn't think about only rpi's problem. I will check other target. (I have checked only RPI..) Thanks for pointing out.

Best Regards,
Jaehoon Chung

Quoted 9 lines

--Sean

Quoted 4 lines
common/board_f.c +0 -0
 ????? print_size(size, "");
 ????? board_add_ram_info(0);
 ????? putc('\n');
#4 lore raw

PATCH 1/1 common: board_f: fix to display wrong memory information

Hi,

Quoted 35 lines · Jaehoon Chung
Quoted 5 lines · Sean Anderson
Quoted 2 lines · Jaehoon Chung

When run meminfo command, it's displayed wrong memory information. Because it's using gd->ram_size what didn't configure ram size.

what -> which?

Will update

Quoted 15 lines
Quoted 15 lines

On 4G RPI4 target
- Before
??? U-Boot> meminfo
??? DRAM: 948MiB
- After
??? U-Boot> meminfo
??? DRAM: 3.9GiB

---
? common/board_f.c | 1 +
? 1 file changed, 1 insertion(+)

Quoted 10 lines

common/board_f.c static int show_dram_config(void) · line 230

Quoted 8 lines
common/board_f.c +0 -0
index 9f441c44f176..96c675ea28e4 100644
@@ -228,6 +228,7 @@ static int show_dram_config(void)
 ????? }
 ????? debug("\nDRAM:? ");
 ? +??? gd->ram_size = size;

Shouldn't this be set by dram_init?

Quoted 2 lines

Yes, it's set by dram_init(), I didn't think about only rpi's problem. I will check other target. (I have checked only RPI..) Thanks for pointing out.

Sorry for late checking. I have checked other boards with meminfo command.

In VIM3 4G

Model: Khadas VIM3
SoC:   Amlogic Meson G12B (A311D) Revision 29:b (10:2)
DRAM:  3.8 GiB

..[snip]..

Quoted 1 line

meminfo

DRAM: 1.9 GiB

There is a bug to display information. I will resend patch v2.

Best Regards,
Jaehoon Chung

Quoted 15 lines

Best Regards,
Jaehoon Chung

Quoted 9 lines

--Sean

Quoted 4 lines
common/board_f.c +0 -0
 ????? print_size(size, "");
 ????? board_add_ram_info(0);
 ????? putc('\n');