@@ -986,7 +986,7 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
opal_table_init();
/* Init the physical map table so we can start mapping things */
- phys_map_init();
+ phys_map_init(mfspr(SPR_PVR));
/*
* If we are coming in with a flat device-tree, we expand it
@@ -353,7 +353,7 @@ int main(int argc, char *argv[])
"Pipe to 'dtc -I dtb -O dts' for human readable output\n");
}
- phys_map_init();
+ phys_map_init(fake_pvr);
/* Copy in spira dump (assumes little has changed!). */
if (new_spira) {
@@ -200,7 +200,7 @@ error:
assert(0);
}
-void phys_map_init(void)
+void phys_map_init(unsigned long pvr)
{
const char *name = "unused";
@@ -172,15 +172,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);
}
@@ -59,7 +59,7 @@ enum phys_map_type {
extern void phys_map_get(uint64_t gcid, enum phys_map_type type,
int index, uint64_t *addr, uint64_t *size);
-extern void phys_map_init(void);
+extern void phys_map_init(unsigned long pvr);
#endif /* __PHYS_MAP_H */