aboutsummaryrefslogtreecommitdiff
path: root/core
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
parentc3aad53b91d2295dc7950c1d064d63a314f7b98a (diff)
downloadskiboot-f98d59958db19f85154dfa36db8f5c7322148294.zip
skiboot-f98d59958db19f85154dfa36db8f5c7322148294.tar.gz
skiboot-f98d59958db19f85154dfa36db8f5c7322148294.tar.bz2
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')
-rw-r--r--core/flash.c1
-rw-r--r--core/init.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/core/flash.c b/core/flash.c
index 756fba1..8a908e5 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -421,6 +421,7 @@ static struct {
{ RESOURCE_ID_KERNEL, RESOURCE_SUBID_NONE, "BOOTKERNEL" },
{ RESOURCE_ID_INITRAMFS,RESOURCE_SUBID_NONE, "ROOTFS" },
{ RESOURCE_ID_CAPP, RESOURCE_SUBID_SUPPORTED, "CAPP" },
+ { RESOURCE_ID_IMA_CATALOG, RESOURCE_SUBID_SUPPORTED, "IMA_CATALOG" },
};
diff --git a/core/init.c b/core/init.c
index 9ffbc72..02bd30c 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();