summaryrefslogtreecommitdiffstats
path: root/core/init.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2017-03-28 17:14:56 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-03-29 17:26:33 +1100
commit6b464ef731a89664519cfa8986425246dc7766fb (patch)
treed3259c86be6993aa0abac151bc2b653daacbaa98 /core/init.c
parent7a7a1ba30dd1153d623ea021eadec4f561f507d9 (diff)
downloadblackbird-skiboot-6b464ef731a89664519cfa8986425246dc7766fb.tar.gz
blackbird-skiboot-6b464ef731a89664519cfa8986425246dc7766fb.zip
phb3/4: Set max link speed via nvram
This adds an nvram parameter pcie-max-link-speed to configure the max speed of the pcie link. This can be set from the petitboot prompt using: nvram -p ibm,skiboot --update-config pcie-max-link-speed=4 This takes preference over anything set in the device tree and is global to all PHBs. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/init.c')
-rw-r--r--core/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/init.c b/core/init.c
index 983ead5d..d9d62ee9 100644
--- a/core/init.c
+++ b/core/init.c
@@ -49,6 +49,7 @@
#include <libstb/container.h>
enum proc_gen proc_gen;
+unsigned int pcie_max_link_speed;
static uint64_t kernel_entry;
static size_t kernel_size;
@@ -700,6 +701,20 @@ static void per_thread_sanity_checks(void)
assert(cpu->state != cpu_state_no_cpu);
}
+static void pci_nvram_init(void)
+{
+ const char *nvram_speed;
+
+ pcie_max_link_speed = 0;
+
+ nvram_speed = nvram_query("pcie-max-link-speed");
+ if (nvram_speed) {
+ pcie_max_link_speed = atoi(nvram_speed);
+ prlog(PR_NOTICE, "PHB: NVRAM set max link speed to GEN%i\n",
+ pcie_max_link_speed);
+ }
+}
+
/* Called from head.S, thus no prototype. */
void main_cpu_entry(const void *fdt);
@@ -917,6 +932,8 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
op_display(OP_LOG, OP_MOD_INIT, 0x0002);
+ pci_nvram_init();
+
phb3_preload_vpd();
phb3_preload_capp_ucode();
start_preload_kernel();
OpenPOWER on IntegriCloud