Skip to content

Commit 37576cb

Browse files
committed
powerpc/powernv: Add opal details to the hardware description
Add OPAL version details to the hardware description, which is printed at boot and in case of an oops. eg: Hardware name: ... opal:v6.2 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220930082709.55830-5-mpe@ellerman.id.au
1 parent 5412297 commit 37576cb

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • arch/powerpc/platforms/powernv

arch/powerpc/platforms/powernv/setup.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/console.h>
1818
#include <linux/delay.h>
1919
#include <linux/irq.h>
20+
#include <linux/seq_buf.h>
2021
#include <linux/seq_file.h>
2122
#include <linux/of.h>
2223
#include <linux/of_fdt.h>
@@ -207,8 +208,29 @@ static void __init pnv_setup_arch(void)
207208
pnv_rng_init();
208209
}
209210

211+
static void __init pnv_add_hw_description(void)
212+
{
213+
struct device_node *dn;
214+
const char *s;
215+
216+
dn = of_find_node_by_path("/ibm,opal/firmware");
217+
if (!dn)
218+
return;
219+
220+
if (of_property_read_string(dn, "version", &s) == 0 ||
221+
of_property_read_string(dn, "git-id", &s) == 0)
222+
seq_buf_printf(&ppc_hw_desc, "opal:%s ", s);
223+
224+
if (of_property_read_string(dn, "mi-version", &s) == 0)
225+
seq_buf_printf(&ppc_hw_desc, "mi:%s ", s);
226+
227+
of_node_put(dn);
228+
}
229+
210230
static void __init pnv_init(void)
211231
{
232+
pnv_add_hw_description();
233+
212234
/*
213235
* Initialize the LPC bus now so that legacy serial
214236
* ports can be found on it

0 commit comments

Comments
 (0)