summaryrefslogtreecommitdiffstats
path: root/core/init.c
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>2017-06-22 17:45:21 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-27 18:43:30 +1000
commitf98d59958db19f85154dfa36db8f5c7322148294 (patch)
treeef9adcbe4258b84759771867fcd8530bc6799395 /core/init.c
parentc3aad53b91d2295dc7950c1d064d63a314f7b98a (diff)
downloadtalos-skiboot-f98d59958db19f85154dfa36db8f5c7322148294.tar.gz
talos-skiboot-f98d59958db19f85154dfa36db8f5c7322148294.zip
skiboot: Find the IMC DTB
IMC (In Memory Collection) catalog is a repository of information about the Performance Monitoring Units (PMUs) and their events under the IMC infrastructure. The information include : - The PMU names - Event names - Event description - Event offsets - Event scale - Event unit The catalog is provided as a flattened device tree (dtb). Processors with different PVR values may have different PMU or event names. Hence, for each processor, there can be multiple device tree binaries (dtbs) containing the IMC information. Each of the dtb is compressed and forms a sub-partition inside the PNOR partition "IMA_CATALOG". Here is a link to the commit adding this partition to PNOR : https://github.com/open-power/pnor/commit/c940142c6dc64dd176096dc648f433c889919e84 So, each compressed dtb forms a sub-partition inside the IMC pnor partition and can be accessed/loaded through a sub-partition id which is nothing but the PVR id. Based on the current processor's PVR, the appropriate sub-partion will be loaded. Note however, that the catalog information is in the form of a dtb and the dtb is compressed too. So, the sub-partition loaded must be decompressed first before we can actually use it. It is important to mention here that while a PNOR image built for one processor is specific to only that processor and isn't portable, a single system generation (Processor version) may have multiple revisions and these revisions may have some changes in their IMC PMUs and events, and hence, the need for multiple IMC DTBs. The sub-partition that we obtain from the IMC pnor partition is a compressed device tree binary. We uncompress it using the libxz's functions. After uncompressing it, we link the device tree binary to the system's device tree. The kernel can now access the device tree and get the IMC PMUs and their events' information. Not all the IMC PMUs listed in the device tree may be available. This is indicated by imc availability vector (which is a part of the IMC control block structure). We need to check this vector and make sure to remove the IMC device nodes which are unavailable. Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: use pr_fmt, fix failure path for resource load] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/init.c')
-rw-r--r--core/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/init.c b/core/init.c
index 9ffbc72f..02bd30cb 100644
--- a/core/init.c
+++ b/core/init.c
@@ -48,6 +48,7 @@
#include <libstb/stb.h>
#include <libstb/container.h>
#include <phys-map.h>
+#include <imc.h>
enum proc_gen proc_gen;
unsigned int pcie_max_link_speed;
@@ -977,6 +978,9 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
/* Read in NVRAM and set it up */
nvram_init();
+ /* preload the IMC catalog dtb */
+ imc_catalog_preload();
+
/* Set the console level */
console_log_level();
@@ -1000,6 +1004,9 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
/* NX init */
nx_init();
+ /* Init In-Memory Collection related stuff (load the IMC dtb into memory) */
+ imc_init();
+
/* Probe IO hubs */
probe_p7ioc();
OpenPOWER on IntegriCloud