Skip to contentSkip to conversation

common: Display >=4GiB memory bank size

PATCH New Bin Meng 2 participants 3 messages Aug 6, 2015 – Aug 8, 2015 Generic include/asm header files

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v3 1/1 common: Display >=4GiB memory bank size

bd->bi_dram[] has both start address and size defined as 32-bit, which is not the case on some platforms where >=4GiB memory bank is used. Change them to support such memory banks.

---

Changes in v3:
- Use %llx to print the dram start address

Changes in v2:
- Drop patches which are already applied
- Change start to phys_addr_t
- Change debug output to either %016llx or %08lx

 common/board_f.c             | 3 ++-
 include/asm-generic/u-boot.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
common/board_f.c +2 -1
index c7cc67c..8cca4de 100644
@@ -206,7 +206,8 @@ static int show_dram_config(void)
 	debug("\nRAM Configuration:\n");
 	for (i = size = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
 		size += gd->bd->bi_dram[i].size;
-		debug("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
+		debug("Bank #%d: %llx ", i,
+		      (unsigned long long)(gd->bd->bi_dram[i].start));
 #ifdef DEBUG
 		print_size(gd->bd->bi_dram[i].size, "\n");
 #endif
include/asm-generic/u-boot.h +2 -2
index c918049..9f3351d 100644
@@ -130,8 +130,8 @@ typedef struct bd_info {
 	ulong	        bi_boot_params;	/* where this board expects params */
 #ifdef CONFIG_NR_DRAM_BANKS
 	struct {			/* RAM configuration */
-		ulong start;
-		ulong size;
+		phys_addr_t start;
+		phys_size_t size;
 	} bi_dram[CONFIG_NR_DRAM_BANKS];
 #endif /* CONFIG_NR_DRAM_BANKS */
 } bd_t;
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v3 1/1 common: Display >=4GiB memory bank size

Quoted 11 lines · Bin Meng

bd->bi_dram[] has both start address and size defined as 32-bit, which is not the case on some platforms where >=4GiB memory bank is used. Change them to support such memory banks.

---

Changes in v3:
- Use %llx to print the dram start address

Quoted 8 lines

Changes in v2:
- Drop patches which are already applied
- Change start to phys_addr_t
- Change debug output to either %016llx or %08lx

 common/board_f.c             | 3 ++-
 include/asm-generic/u-boot.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
#2 lore raw

PATCH v3 1/1 common: Display >=4GiB memory bank size

Quoted 17 lines · Simon Glass
Quoted 16 lines · Bin Meng

bd->bi_dram[] has both start address and size defined as 32-bit, which is not the case on some platforms where >=4GiB memory bank is used. Change them to support such memory banks.

---

Changes in v3:
- Use %llx to print the dram start address

Changes in v2:
- Drop patches which are already applied
- Change start to phys_addr_t
- Change debug output to either %016llx or %08lx

Quoted 5 lines
Quoted 3 lines
 common/board_f.c             | 3 ++-
 include/asm-generic/u-boot.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Applied to u-boot-x86, thanks!