aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/cavium-octeon/setup.c
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2016-02-22 17:22:57 -0500
committerRalf Baechle <ralf@linux-mips.org>2016-05-13 08:01:42 -0400
commit1a1590ab1a4a0898fe0a6809e5bcd7c225e3b4d6 (patch)
tree1c636d1bb1edbd42f0b2cfc56fe7d47f8d7c90c8 /arch/mips/cavium-octeon/setup.c
parent8f2068bc9e875540b5fb372294095833651ea1e2 (diff)
MIPS: Octeon: Use model string from DTB for unknown board type
Use model string from DTB for board type if the board is unknown. This is more informative, e.g. with EdgeRouter Pro the /proc/cpuinfo will display "ubnt,e200 (CN6120p1.1-1000-NSP)" instead of misleading "Unsupported Board". Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: David Daney <ddaney.cavm@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/12582/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cavium-octeon/setup.c')
-rw-r--r--arch/mips/cavium-octeon/setup.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 09a83cd6bfe8..37ac229bebb6 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -469,8 +469,16 @@ static void __init init_octeon_system_type(void)
469 char const *board_type; 469 char const *board_type;
470 470
471 board_type = cvmx_board_type_to_string(octeon_bootinfo->board_type); 471 board_type = cvmx_board_type_to_string(octeon_bootinfo->board_type);
472 if (board_type == NULL) 472 if (board_type == NULL) {
473 board_type = "Unsupported Board"; 473 struct device_node *root;
474 int ret;
475
476 root = of_find_node_by_path("/");
477 ret = of_property_read_string(root, "model", &board_type);
478 of_node_put(root);
479 if (ret)
480 board_type = "Unsupported Board";
481 }
474 482
475 snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)", 483 snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)",
476 board_type, octeon_model_get_string(read_c0_prid())); 484 board_type, octeon_model_get_string(read_c0_prid()));