aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorReza Arbab <arbab@linux.ibm.com>2019-07-17 15:44:20 -0500
committerOliver O'Halloran <oohall@gmail.com>2019-07-26 15:30:21 +1000
commite7f76b4eb58c6230ce1ffd143f1c8a5a507bdbe9 (patch)
treef811c033294999caf75ba359165e4a48f1e03312 /hw
parent7ff5558c50d38eaf576d3920b6c7f372ff1a741d (diff)
downloadskiboot-e7f76b4eb58c6230ce1ffd143f1c8a5a507bdbe9.zip
skiboot-e7f76b4eb58c6230ce1ffd143f1c8a5a507bdbe9.tar.gz
skiboot-e7f76b4eb58c6230ce1ffd143f1c8a5a507bdbe9.tar.bz2
hw/phys-map: Add pvr argument to phys_map_init()
When new chip types are added, phys_map_init() will need to know which memory map it should use. Instead of directly checking PVR, make it an argument to the function, so that 'make hw-check' can test all the maps. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Acked-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Acked-by: Stewart Smith <stewart@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/phys-map.c2
-rw-r--r--hw/test/phys-map-test.c16
2 files changed, 13 insertions, 5 deletions
diff --git a/hw/phys-map.c b/hw/phys-map.c
index 53b825d..de93bc7 100644
--- a/hw/phys-map.c
+++ b/hw/phys-map.c
@@ -191,7 +191,7 @@ error:
assert(0);
}
-void phys_map_init(void)
+void phys_map_init(unsigned long pvr __unused)
{
const char *name = "unused";
diff --git a/hw/test/phys-map-test.c b/hw/test/phys-map-test.c
index 3356919..8d844ba 100644
--- a/hw/test/phys-map-test.c
+++ b/hw/test/phys-map-test.c
@@ -163,15 +163,23 @@ static void check_map_call(void)
free(tbl);
}
+/* Fake PVR definitions. See include/processor.h */
+unsigned long fake_pvr[] = {
+ 0x004e0200, /* PVR_P9 */
+};
+
int main(void)
{
/* Fake we are POWER9 */
proc_gen = proc_gen_p9;
- phys_map_init();
- /* Run tests */
- check_table_directly();
- check_map_call();
+ for (int i = 0; i < ARRAY_SIZE(fake_pvr); i++) {
+ phys_map_init(fake_pvr[i]);
+
+ /* Run tests */
+ check_table_directly();
+ check_map_call();
+ }
return(0);
}