Browse Source

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>
Aaro Koskinen 9 years ago
parent
commit
1a1590ab1a
1 changed files with 10 additions and 2 deletions
  1. 10 2
      arch/mips/cavium-octeon/setup.c

+ 10 - 2
arch/mips/cavium-octeon/setup.c

@@ -469,8 +469,16 @@ static void __init init_octeon_system_type(void)
 	char const *board_type;
 	char const *board_type;
 
 
 	board_type = cvmx_board_type_to_string(octeon_bootinfo->board_type);
 	board_type = cvmx_board_type_to_string(octeon_bootinfo->board_type);
-	if (board_type == NULL)
-		board_type = "Unsupported Board";
+	if (board_type == NULL) {
+		struct device_node *root;
+		int ret;
+
+		root = of_find_node_by_path("/");
+		ret = of_property_read_string(root, "model", &board_type);
+		of_node_put(root);
+		if (ret)
+			board_type = "Unsupported Board";
+	}
 
 
 	snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)",
 	snprintf(octeon_system_type, sizeof(octeon_system_type), "%s (%s)",
 		 board_type, octeon_model_get_string(read_c0_prid()));
 		 board_type, octeon_model_get_string(read_c0_prid()));