|
41 | 41 | #include <linux/of_pci.h>
|
42 | 42 | #include <linux/memblock.h>
|
43 | 43 | #include <linux/swiotlb.h>
|
| 44 | +#include <linux/seq_buf.h> |
44 | 45 |
|
45 | 46 | #include <asm/mmu.h>
|
46 | 47 | #include <asm/processor.h>
|
@@ -1011,13 +1012,42 @@ static void __init pSeries_cmo_feature_init(void)
|
1011 | 1012 | pr_debug(" <- fw_cmo_feature_init()\n");
|
1012 | 1013 | }
|
1013 | 1014 |
|
| 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 | + |
1014 | 1042 | /*
|
1015 | 1043 | * Early initialization. Relocation is on but do not reference unbolted pages
|
1016 | 1044 | */
|
1017 | 1045 | static void __init pseries_init(void)
|
1018 | 1046 | {
|
1019 | 1047 | pr_debug(" -> pseries_init()\n");
|
1020 | 1048 |
|
| 1049 | + pseries_add_hw_description(); |
| 1050 | + |
1021 | 1051 | #ifdef CONFIG_HVC_CONSOLE
|
1022 | 1052 | if (firmware_has_feature(FW_FEATURE_LPAR))
|
1023 | 1053 | hvc_vio_init_early();
|
|
0 commit comments