1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2019 Marvell International Ltd.
5 * https://spdx.org/licenses
13 #include <linux/compiler.h>
14 #include <asm/arch/soc.h>
15 #include <asm/arch/board.h>
18 int read_platform(void)
20 int plat = PLATFORM_HW;
22 const char *model = fdt_get_board_model();
24 if (model && !strncmp(model, "ASIM-", 5))
26 if (model && !strncmp(model, "EMUL-", 5))
27 plat = PLATFORM_EMULATOR;
32 static inline u64 read_midr(void)
36 asm ("mrs %[rd],MIDR_EL1" : [rd] "=r" (result));
42 return ((read_midr() >> 4) & 0xFF);
45 const char *read_board_name(void)
47 return fdt_get_board_model();