Commit 54122970 authored by Michael Ellerman's avatar Michael Ellerman

powerpc: Add device-tree model to the hardware description

Add the model of the machine we're on to the hardware description, which
is printed at boot and in case of an oops.

eg: Hardware name: IBM,8247-22L
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220930082709.55830-4-mpe@ellerman.id.au
parent 48b7019b
......@@ -715,6 +715,23 @@ static void __init tm_init(void)
static void tm_init(void) { }
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
static int __init
early_init_dt_scan_model(unsigned long node, const char *uname,
int depth, void *data)
{
const char *prop;
if (depth != 0)
return 0;
prop = of_get_flat_dt_prop(node, "model", NULL);
if (prop)
seq_buf_printf(&ppc_hw_desc, "%s ", prop);
/* break now */
return 1;
}
#ifdef CONFIG_PPC64
static void __init save_fscr_to_task(void)
{
......@@ -743,6 +760,8 @@ void __init early_init_devtree(void *params)
if (!early_init_dt_verify(params))
panic("BUG: Failed verifying flat device tree, bad version?");
of_scan_flat_dt(early_init_dt_scan_model, NULL);
#ifdef CONFIG_PPC_RTAS
/* Some machines might need RTAS info for debugging, grab it now. */
of_scan_flat_dt(early_init_dt_scan_rtas, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment