diff --git a/arch/mips/ps2/setup.c b/arch/mips/ps2/setup.c index ea77931a923991..edd1636dfe60b5 100644 --- a/arch/mips/ps2/setup.c +++ b/arch/mips/ps2/setup.c @@ -13,6 +13,9 @@ #include #include +#include + +#include const char *get_system_type(void) { @@ -33,10 +36,32 @@ void __init plat_mem_setup(void) set_io_port_base(CKSEG1); /* KSEG1 is uncached */ } +static int __init set_machine_name(void) +{ + const struct scmd_machine_name machine = scmd_read_machine_name(); + + /* + * FIXME: There are issues reading the machine name for + * SCPH-10000 and SCPH-15000. Late SCPH-10000 and all + * SCPH-15000 have the name in rom0:OSDSYS. + */ + + if (!strlen(machine.name)) { + pr_err("%s: scmd_read_machine_name failed\n", __func__); + return -EIO; + } + + mips_set_machine_name(machine.name); + + return 0; +} + static int __init ps2_board_setup(void) { pr_info("PlayStation 2 board setup\n"); + set_machine_name(); + return 0; } arch_initcall(ps2_board_setup);