David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Imagination Technologies |
| 4 | * Author: Paul Burton <paul.burton@mips.com> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <linux/of.h> |
| 8 | |
| 9 | #include <asm/bootinfo.h> |
| 10 | |
| 11 | const char *get_system_type(void) |
| 12 | { |
| 13 | const char *str; |
| 14 | int err; |
| 15 | |
| 16 | err = of_property_read_string(of_root, "model", &str); |
| 17 | if (!err) |
| 18 | return str; |
| 19 | |
| 20 | err = of_property_read_string_index(of_root, "compatible", 0, &str); |
| 21 | if (!err) |
| 22 | return str; |
| 23 | |
| 24 | return "Unknown"; |
| 25 | } |