Skip to content

Commit 8535a1a

Browse files
committed
powerpc/pseries: Add firmware details to the hardware description
Add firmware version details to the hardware description, which is printed at boot and in case of an oops. Use /hypervisor if we find it, though currently it only exists if we're running under qemu. Look for "ibm,powervm-partition" which is specified in PAPR+ v2.11 and tells us we're running under PowerVM. Failing that look for "ibm,fw-net-version" which is seen on PowerVM going back to at least Power6. eg: Hardware name: ... of:IBM,FW860.42 (SV860_138) hv:phyp Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 37576cb commit 8535a1a

File tree

1 file changed

+30
-0
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+30
-0
lines changed

arch/powerpc/platforms/pseries/setup.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <linux/of_pci.h>
4242
#include <linux/memblock.h>
4343
#include <linux/swiotlb.h>
44+
#include <linux/seq_buf.h>
4445

4546
#include <asm/mmu.h>
4647
#include <asm/processor.h>
@@ -1011,13 +1012,42 @@ static void __init pSeries_cmo_feature_init(void)
10111012
pr_debug(" <- fw_cmo_feature_init()\n");
10121013
}
10131014

1015+
static void __init pseries_add_hw_description(void)
1016+
{
1017+
struct device_node *dn;
1018+
const char *s;
1019+
1020+
dn = of_find_node_by_path("/openprom");
1021+
if (dn) {
1022+
if (of_property_read_string(dn, "model", &s) == 0)
1023+
seq_buf_printf(&ppc_hw_desc, "of:%s ", s);
1024+
1025+
of_node_put(dn);
1026+
}
1027+
1028+
dn = of_find_node_by_path("/hypervisor");
1029+
if (dn) {
1030+
if (of_property_read_string(dn, "compatible", &s) == 0)
1031+
seq_buf_printf(&ppc_hw_desc, "hv:%s ", s);
1032+
1033+
of_node_put(dn);
1034+
return;
1035+
}
1036+
1037+
if (of_property_read_bool(of_root, "ibm,powervm-partition") ||
1038+
of_property_read_bool(of_root, "ibm,fw-net-version"))
1039+
seq_buf_printf(&ppc_hw_desc, "hv:phyp ");
1040+
}
1041+
10141042
/*
10151043
* Early initialization. Relocation is on but do not reference unbolted pages
10161044
*/
10171045
static void __init pseries_init(void)
10181046
{
10191047
pr_debug(" -> pseries_init()\n");
10201048

1049+
pseries_add_hw_description();
1050+
10211051
#ifdef CONFIG_HVC_CONSOLE
10221052
if (firmware_has_feature(FW_FEATURE_LPAR))
10231053
hvc_vio_init_early();

0 commit comments

Comments
 (0)