[Skiboot] [PATCH 1/8] Add global physical memory map

Stewart Smith stewart at linux.vnet.ibm.com
Wed May 10 17:47:57 AEST 2017


Michael Neuling <mikey at neuling.org> writes:
> This adds a global map for allocating physical memory address. This
> centralises physical memory space allocations into one location rather
> than spread through, PHB, XIVE, NX etc.
>
> This adds a new call phys_map_get() which takes a chip, type and index
> and returns a address and size for the region to be used.
>
> An error in a call to this function crashes skiboot. This is done
> since bogus calls here are going to be hit by developers not users and
> they need to be fixed.
>
> Currently only P9 is implemented but other chips should be easy to
> add. On P9 BARs are generally set by skiboot. On P8 this was done by
> hostboot so this is not needed there.
>
> This just adds the infrastructure. User (PHB4, XIVE etc) will be
> migrated in subsequent patches.
>
> Suggested-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Signed-off-by: Michael Neuling <mikey at neuling.org>

Series merged to master (with a fixup as discussed on slack) as of
6916c2a0faff1eedbe9138616e460792e50a0b94

Fixup is:

commit 6916c2a0faff1eedbe9138616e460792e50a0b94
Author: Stewart Smith <stewart at linux.vnet.ibm.com>
Date:   Wed May 10 17:42:16 2017 +1000

    test/hdata_to_dt: fix build breakage caused by phys_map_get
    
    Fixes: 5f67c1e253788691d376e4e639d4a6e7785efa55
    Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>

diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c
index 54f376135213..e8b7ed66242e 100644
--- a/hdata/test/hdata_to_dt.c
+++ b/hdata/test/hdata_to_dt.c
@@ -112,6 +112,7 @@ static bool spira_check_ptr(const void *ptr, const char *file, unsigned int line
 #include "../../core/chip.c"
 #include "../../test/dt_common.c"
 #include "../../core/fdt.c"
+#include "../../hw/phys-map.c"
 
 #include <err.h>
 
@@ -267,6 +268,8 @@ int main(int argc, char *argv[])
 		     "Pipe to 'dtc -I dtb -O dts' for human readable\n");
 	}
 
+	phys_map_init();
+
 	/* Copy in spira dump (assumes little has changed!). */
 	if (new_spira) {
 		fd = open(argv[1], O_RDONLY);


-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list