diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2015-06-04 09:28:11 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-06-05 11:43:24 +1000 |
commit | 9ea274ef840bc90fc6df40bf884325cdb565b689 (patch) | |
tree | e86df6ee4cf253bf50ce927d1241fa59b8758ef9 | |
parent | 417333aa73103b3cc05b27df5e4b328fe71dab5f (diff) | |
download | skiboot-skiboot-5.0.3.zip skiboot-skiboot-5.0.3.tar.gz skiboot-skiboot-5.0.3.tar.bz2 |
core/mem_region: Create reservations of type REGION_HW_RESERVEDskiboot-5.0.3
All current users of mem_reserve are actually wanting HW_RESERVED
memory; these reservations are for memory initialised pre-skiboot.
This change marks these regions as REGION_HW_RESERVED instead of
REGION_RESERVED. We also rename mem_reserve to mem_reserve_hw to reflect
this change.
This fixes an issue where the PRD daemon cannot find reserved ranges
(eg, the homer image) that have been created by skiboot itself.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/mem_region.c | 4 | ||||
-rw-r--r-- | core/test/run-mem_region_reservations.c | 3 | ||||
-rw-r--r-- | hw/homer.c | 6 | ||||
-rw-r--r-- | include/mem_region.h | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/core/mem_region.c b/core/mem_region.c index f6d5a7a..21c48bc 100644 --- a/core/mem_region.c +++ b/core/mem_region.c @@ -664,13 +664,13 @@ static bool add_region(struct mem_region *region) return true; } -void mem_reserve(const char *name, uint64_t start, uint64_t len) +void mem_reserve_hw(const char *name, uint64_t start, uint64_t len) { struct mem_region *region; bool added; lock(&mem_region_lock); - region = new_region(name, start, len, NULL, REGION_RESERVED); + region = new_region(name, start, len, NULL, REGION_HW_RESERVED); assert(region); added = add_region(region); assert(added); diff --git a/core/test/run-mem_region_reservations.c b/core/test/run-mem_region_reservations.c index fcde110..59b6e06 100644 --- a/core/test/run-mem_region_reservations.c +++ b/core/test/run-mem_region_reservations.c @@ -208,7 +208,8 @@ int main(void) /* create our reservations */ for (i = 0; i < ARRAY_SIZE(test_regions); i++) - mem_reserve(test_regions[i].name, test_regions[i].addr, 0x1000); + mem_reserve_hw(test_regions[i].name, + test_regions[i].addr, 0x1000); /* release unused */ mem_region_release_unused(); @@ -72,7 +72,7 @@ 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("ibm,homer-image", hbase, hsize); + mem_reserve_hw("ibm,homer-image", hbase, hsize); chip->homer_base = hbase; chip->homer_size = hsize; @@ -92,7 +92,7 @@ static void homer_init_chip(struct proc_chip *chip) */ if (sbase < hbase || sbase > (hbase + hsize) || (hbase == 0 && sbase > 0)) - mem_reserve("ibm,slw-image", sbase, ssize); + mem_reserve_hw("ibm,slw-image", sbase, ssize); chip->slw_base = sbase; chip->slw_bar_size = ssize; @@ -133,7 +133,7 @@ void homer_init(void) chip = next_chip(NULL); if (chip->homer_base && chip->occ_common_base) { /* Reserve OCC comman area from BAR */ - mem_reserve("ibm,occ-common-area", chip->occ_common_base, + mem_reserve_hw("ibm,occ-common-area", chip->occ_common_base, chip->occ_common_size); } else { /* Allocate memory for HOMER and OCC common area */ diff --git a/include/mem_region.h b/include/mem_region.h index e2827c3..d1da02a 100644 --- a/include/mem_region.h +++ b/include/mem_region.h @@ -70,7 +70,7 @@ void mem_region_init(void); void mem_region_add_dt_reserved(void); /* Mark memory as reserved */ -void mem_reserve(const char *name, uint64_t start, uint64_t len); +void mem_reserve_hw(const char *name, uint64_t start, uint64_t len); struct mem_region *find_mem_region(const char *name); |