Skip to content

Commit 5412297

Browse files
committed
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: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220930082709.55830-4-mpe@ellerman.id.au
1 parent 48b7019 commit 5412297

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

arch/powerpc/kernel/prom.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,23 @@ static void __init tm_init(void)
715715
static void tm_init(void) { }
716716
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
717717

718+
static int __init
719+
early_init_dt_scan_model(unsigned long node, const char *uname,
720+
int depth, void *data)
721+
{
722+
const char *prop;
723+
724+
if (depth != 0)
725+
return 0;
726+
727+
prop = of_get_flat_dt_prop(node, "model", NULL);
728+
if (prop)
729+
seq_buf_printf(&ppc_hw_desc, "%s ", prop);
730+
731+
/* break now */
732+
return 1;
733+
}
734+
718735
#ifdef CONFIG_PPC64
719736
static void __init save_fscr_to_task(void)
720737
{
@@ -743,6 +760,8 @@ void __init early_init_devtree(void *params)
743760
if (!early_init_dt_verify(params))
744761
panic("BUG: Failed verifying flat device tree, bad version?");
745762

763+
of_scan_flat_dt(early_init_dt_scan_model, NULL);
764+
746765
#ifdef CONFIG_PPC_RTAS
747766
/* Some machines might need RTAS info for debugging, grab it now. */
748767
of_scan_flat_dt(early_init_dt_scan_rtas, NULL);

0 commit comments

Comments
 (0)