[Skiboot] [PATCH 7/7 v2] hw/homer: Don't re-reserve homer ranges

Jeremy Kerr jk at ozlabs.org
Fri Jul 24 16:50:57 AEST 2015


Hostboot is going to cover these ranges with its own reservations (to
allow access from the HBRT image), so don't overwrite reservations
with our own.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

---
 hw/homer.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/hw/homer.c b/hw/homer.c
index 6d5544e..84eb536 100644
--- a/hw/homer.c
+++ b/hw/homer.c
@@ -72,7 +72,12 @@ static void homer_init_chip(struct proc_chip *chip)
 	if (read_pba_bar(chip, 0, &hbase, &hsize)) {
 		prlog(PR_DEBUG, "  HOMER Image at 0x%llx size %lldMB\n",
 		      hbase, hsize / 0x100000);
-		mem_reserve_hw("ibm,homer-image", hbase, hsize);
+
+		if (!mem_range_is_reserved(hbase, hsize)) {
+			prlog(PR_WARNING,
+				"HOMER image is not reserved! Reserving\n");
+			mem_reserve_hw("ibm,homer-image", hbase, hsize);
+		}
 
 		chip->homer_base = hbase;
 		chip->homer_size = hsize;
@@ -90,9 +95,13 @@ static void homer_init_chip(struct proc_chip *chip)
 		 * Only reserve it if we have no homer image or if it
 		 * doesn't fit in it (only check the base).
 		 */
-		if (sbase < hbase || sbase > (hbase + hsize) ||
-			(hbase == 0 && sbase > 0))
+		if ((sbase < hbase || sbase > (hbase + hsize) ||
+				(hbase == 0 && sbase > 0)) &&
+				!mem_range_is_reserved(sbase, ssize)) {
+			prlog(PR_WARNING,
+				"SLW image is not reserved! Reserving\n");
 			mem_reserve_hw("ibm,slw-image", sbase, ssize);
+		}
 
 		chip->slw_base = sbase;
 		chip->slw_bar_size = ssize;
@@ -132,9 +141,15 @@ void homer_init(void)
 
 	chip = next_chip(NULL);
 	if (chip->homer_base && chip->occ_common_base) {
-		/* Reserve OCC comman area from BAR */
-		mem_reserve_hw("ibm,occ-common-area", chip->occ_common_base,
+		/* Reserve OCC common area from BAR */
+		if (!mem_range_is_reserved(chip->occ_common_base,
+					chip->occ_common_size)) {
+			prlog(PR_WARNING,
+				"OCC common area is not reserved! Reserving\n");
+			mem_reserve_hw("ibm,occ-common-area",
+						chip->occ_common_base,
 						chip->occ_common_size);
+		}
 	} else {
 		/* Allocate memory for HOMER and OCC common area */
 		host_services_occ_base_setup();


More information about the Skiboot mailing list