@@ -756,13 +756,13 @@ static bool add_region(struct mem_region *region)
return true;
}
-void mem_reserve_hw(const char *name, uint64_t start, uint64_t len)
+void mem_reserve_fw(const char *name, uint64_t start, uint64_t len)
{
struct mem_region *region;
bool added = true;
lock(&mem_region_lock);
- region = new_region(name, start, len, NULL, REGION_HW_RESERVED);
+ region = new_region(name, start, len, NULL, REGION_FW_RESERVED);
assert(region);
if (!mem_region_init_done)
@@ -935,7 +935,7 @@ static void mem_region_parse_reserved_properties(void)
region = new_region(name,
dt_get_number(range, 2),
dt_get_number(range + 1, 2),
- NULL, REGION_HW_RESERVED);
+ NULL, REGION_FW_RESERVED);
add_region(region);
}
} else if (names || ranges) {
@@ -974,7 +974,7 @@ static bool mem_region_parse_reserved_nodes(const char *path)
region = new_region(strdup(node->name),
dt_get_number(reg->prop, 2),
dt_get_number(reg->prop + sizeof(u64), 2),
- node, REGION_HW_RESERVED);
+ node, REGION_FW_RESERVED);
add_region(region);
}
@@ -1151,7 +1151,7 @@ static void mem_region_add_dt_reserved_node(struct dt_node *parent,
* update regions' device-tree nodes, and we want those updates to
* apply to the nodes in /reserved-memory/.
*/
- if (region->type == REGION_HW_RESERVED && region->node) {
+ if (region->type == REGION_FW_RESERVED && region->node) {
if (region->node->parent != parent)
region->node = dt_copy(region->node, parent);
return;
@@ -165,7 +165,7 @@ static void run_test(struct test *test)
/* create our reservations */
for (r = test->regions; r->start; r++)
- mem_reserve_hw("r", r->start, r->end - r->start);
+ mem_reserve_fw("r", r->start, r->end - r->start);
reserved = mem_range_is_reserved(0x1000, 0x1000);
@@ -205,14 +205,14 @@ int main(void)
/* add pre-init reservations */
for (i = 0; i < ARRAY_SIZE(test_regions); i++)
- mem_reserve_hw(test_regions[i].name,
+ mem_reserve_fw(test_regions[i].name,
test_regions[i].addr, 0x1000);
/* Now convert. */
mem_region_init();
/* add a post-init reservation */
- mem_reserve_hw("test.4", 0x5000, 0x1000);
+ mem_reserve_fw("test.4", 0x5000, 0x1000);
/* release unused */
mem_region_release_unused();
@@ -470,7 +470,7 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
prlog(PR_DEBUG, "MEM: Reserve '%s' %#" PRIx64 "-%#" PRIx64 " (type/inst=0x%08x)\n",
label, start_addr, end_addr, be32_to_cpu(hb_resv_mem->type_instance));
- mem_reserve_hw(label, start_addr, end_addr - start_addr + 1);
+ mem_reserve_fw(label, start_addr, end_addr - start_addr + 1);
}
}
@@ -99,7 +99,6 @@ STUB(op_display);
STUB(fsp_preload_lid);
STUB(fsp_wait_lid_loaded);
STUB(fsp_adjust_lid_side);
-STUB(backtrace);
/* Add HW specific stubs here */
static void noop_function(void) {}
@@ -107,4 +106,4 @@ static void noop_function(void) {}
void fnname(void) __attribute__((weak, alias ("noop_function")))
NOOP_STUB(early_uart_init);
-NOOP_STUB(mem_reserve_hw);
+NOOP_STUB(mem_reserve_fw);
@@ -116,7 +116,7 @@ static void homer_init_chip(struct proc_chip *chip)
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);
+ mem_reserve_fw("ibm,homer-image", hbase, hsize);
}
chip->homer_base = hbase;
@@ -141,7 +141,7 @@ static void homer_init_chip(struct proc_chip *chip)
!mem_range_is_reserved(sbase, ssize)) {
prlog(PR_WARNING,
"SLW image is not reserved! Reserving\n");
- mem_reserve_hw("ibm,slw-image", sbase, ssize);
+ mem_reserve_fw("ibm,slw-image", sbase, ssize);
}
chip->slw_base = sbase;
@@ -206,7 +206,7 @@ void homer_init(void)
chip->occ_common_size)) {
prlog(PR_WARNING,
"OCC common area is not reserved! Reserving\n");
- mem_reserve_hw("ibm,occ-common-area",
+ mem_reserve_fw("ibm,occ-common-area",
chip->occ_common_base,
chip->occ_common_size);
}
@@ -397,7 +397,7 @@ void prd_register_reserved_memory(void)
for (region = mem_region_next(NULL); region;
region = mem_region_next(region)) {
- if (region->type != REGION_HW_RESERVED)
+ if (region->type != REGION_FW_RESERVED)
continue;
if (!region->node)
@@ -32,7 +32,7 @@ enum mem_region_type {
REGION_SKIBOOT_FIRMWARE,
/* ranges reserved before skiboot init, eg HBRT memory */
- REGION_HW_RESERVED,
+ REGION_FW_RESERVED,
/* ranges reserved, eg HW framebuffer */
REGION_RESERVED,
@@ -73,7 +73,7 @@ void adjust_cpu_stacks_alloc(void);
void mem_region_add_dt_reserved(void);
/* Mark memory as reserved */
-void mem_reserve_hw(const char *name, uint64_t start, uint64_t len);
+void mem_reserve_fw(const char *name, uint64_t start, uint64_t len);
struct mem_region *find_mem_region(const char *name);
Currently all existing reservations are made by hostboot itself or on behalf of some other part of system firmware (e.g. the OCCs). We want to add a "true" hardware reservation type that should not be touched by the host OS. To prepare for that this patch renames the existing reservation type to refect it's actual usage. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- core/mem_region.c | 10 +++++----- core/test/run-mem_range_is_reserved.c | 2 +- core/test/run-mem_region_reservations.c | 4 ++-- hdata/memory.c | 2 +- hdata/test/stubs.c | 3 +-- hw/homer.c | 6 +++--- hw/prd.c | 2 +- include/mem_region.h | 4 ++-- 8 files changed, 16 insertions(+), 17 deletions(-)