[Skiboot] [RFC, PATCH 2/2] hw/homer: Don't re-reserve homer-image and slw-image ranges

Jeremy Kerr jk at ozlabs.org
Tue Jul 21 19:09:49 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 |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/homer.c b/hw/homer.c
index 6d5544e..88f7ae9 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;


More information about the Skiboot mailing list