Skip to contentSkip to conversation

common: Display >=4GiB memory bank size

PATCH Superseded Bin Meng 2 participants 9 messages Aug 3, 2015 – Aug 5, 2015

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v2 1/3 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 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             | 9 ++++++++-
 include/asm-generic/u-boot.h | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)
common/board_f.c +8 -1
index 6d922b8..eb24f6c 100644
@@ -206,7 +206,14 @@ 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);
+
+		if (gd->bd->bi_dram[i].start >= 0x100000000ULL) {
+			debug("Bank #%d: %016llx ", i,
+			      (unsigned long long)(gd->bd->bi_dram[i].start));
+		} else {
+			debug("Bank #%d: %08lx ", i,
+			      (unsigned 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
author
#1 lore raw

PATCH v2 2/3 pci: Remove DEBUG from pci_compat.c

Remove DEBUG in drivers/pci/pci_compat.c.

---

Changes in v2:
- New patch to remove DEBUG from pci_compat.c

 drivers/pci/pci_compat.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/pci_compat.c +0 -1
index 05c3510..712c48f 100644
@@ -5,7 +5,6 @@
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
-#define DEBUG
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
Signature · 1 line
1.8.2.1
#3 lore raw

PATCH v2 2/3 pci: Remove DEBUG from pci_compat.c

Quoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng

Remove DEBUG in drivers/pci/pci_compat.c.

---

Quoted 7 lines
Quoted 5 lines

Changes in v2:
- New patch to remove DEBUG from pci_compat.c

 drivers/pci/pci_compat.c | 1 -
 1 file changed, 1 deletion(-)

Applied to u-boot-x86, thanks!

author
#4 lore raw

PATCH v2 3/3 x86: Document how to write PIRQ information in the device tree

In reply to Bin Meng

Document the development flow on figuring out PIRQ information during the U-Boot porting.

---

Changes in v2:
- New patch to document how to write PIRQ information in the device tree

 doc/README.x86 | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
doc/README.x86 +41 -0
index 00b3ed0..af2459c 100644
@@ -668,6 +668,46 @@ boot progress. This can be good for debugging.
 If not, you can try to get serial working as early as possible. The early
 debug serial port may be useful here. See setup_early_uart() for an example.
 
+During the U-Boot porting, one of the important steps is to write correct PIRQ
+routing information in the board device tree. Without it, device drivers in the
+Linux kernel won't function correctly due to interrupt is not working. Please
+refer to U-Boot doc [14] for the device tree bindings of Intel interrupt router.
+Here we have more details on the intel,pirq-routing property below.
+
+	intel,pirq-routing = <
+		PCI_BDF(0, 2, 0) INTA PIRQA
+		...
+	>;
+
+As you see each entry has 3 cells. For the first one, we need describe all pci
+devices mounted on the board. For SoC devices, normally there is a chapter on
+the chipset datasheet which lists all the available PCI devices. For example on
+Bay Trail, this is chapter 4.3 (PCI configuration space). For the second one, we
+can get the interrupt pin either from datasheet or hardware via U-Boot shell.
+The reliable source is the hardware as sometimes chipset datasheet is not 100%
+up-to-date. Type 'pci header' plus the device's pci bus/device/function number
+from U-Boot shell below.
+
+  => pci header 0.1e.1
+    vendor ID =			0x8086
+    device ID =			0x0f08
+    ...
+    interrupt line =		0x09
+    interrupt pin =		0x04
+    ...
+
+It shows this PCI device is using INTD pin as it reports 4 in the interrupt pin
+register. Repeat this until you get interrupt pins for all the devices. The last
+cell is the PIRQ line which a particular interrupt pin is mapped to. On Intel
+chipset, the power-up default mapping is INTA/B/C/D maps to PIRQA/B/C/D. This
+can be changed by registers in LPC bridge. So far Intel FSP does not touch those
+registers so we can write down the PIRQ according to the default mapping rule.
+
+Once we get the PIRQ routing information in the device tree, the interrupt
+allocation and assignment will be done by U-Boot automatically. Now you can
+enable CONFIG_GENERATE_PIRQ_TABLE for testing Linux kernel using i8259 PIC and
+CONFIG_GENERATE_MP_TABLE for testing Linux kernel using local APIC and I/O APIC.
+
 TODO List
 ---------
 - Audio
@@ -689,3 +729,4 @@ References
 [11] https://en.wikipedia.org/wiki/GUID_Partition_Table
 [12] http://events.linuxfoundation.org/sites/events/files/slides/chromeos_and_diy_vboot_0.pdf
 [13] http://events.linuxfoundation.org/sites/events/files/slides/elce-2014.pdf
+[14] doc/device-tree-bindings/misc/intel,irq-router.txt
Signature · 1 line
1.8.2.1
#5 lore raw

PATCH v2 3/3 x86: Document how to write PIRQ information in the device tree

Quoted 5 lines · Bin Meng

Document the development flow on figuring out PIRQ information during the U-Boot porting.

Quoted 7 lines

---

Changes in v2:
- New patch to document how to write PIRQ information in the device tree

 doc/README.x86 | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

Excellent. Thanks.

#6 lore raw

PATCH v2 3/3 x86: Document how to write PIRQ information in the device tree

Quoted 11 lines · Simon Glass
Quoted 10 lines · Bin Meng

Document the development flow on figuring out PIRQ information during the U-Boot porting.

---

Changes in v2:
- New patch to document how to write PIRQ information in the device tree

Quoted 6 lines
Quoted 2 lines
 doc/README.x86 | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

Excellent. Thanks.

Applied to u-boot-x86, thanks!

#7 lore raw

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

In reply to Bin Meng
Quoted 8 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.

---

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             | 9 ++++++++-
 include/asm-generic/u-boot.h | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)
#8 lore raw

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

Hi Bin,

Quoted 15 lines · Simon Glass
Quoted 13 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 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             | 9 ++++++++-
 include/asm-generic/u-boot.h | 4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

Unfortunately this one gives an error with grasshopper:

buildman grasshopper
boards.cfg is up to date. Nothing to do.
Building current source for 1 boards (1 thread, 32 jobs per thread)
avr32: + grasshopper
+common/board_f.c: In function 'show_dram_config':
+common/board_f.c:211: warning: comparison is always false due to limited range of data type

Can you please take a look?

Regards,
Simon