Skip to content

Commit

Permalink
MIPS: PS2: Set machine field for /proc/cpuinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
frno7 committed May 13, 2019
1 parent 02cc773 commit a84cf79
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions arch/mips/ps2/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include <linux/platform_device.h>

#include <asm/bootinfo.h>
#include <asm/prom.h>

#include <asm/mach-ps2/scmd.h>

const char *get_system_type(void)
{
Expand All @@ -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);
Expand Down

0 comments on commit a84cf79

Please sign in to comment.