Suneel Garapati | 81526d5 | 2019-10-19 18:35:54 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 |
| 2 | * |
| 3 | * Copyright (C) 2019 Marvell International Ltd. |
| 4 | * |
| 5 | * https://spdx.org/licenses |
| 6 | */ |
| 7 | |
| 8 | #ifndef __SOC_H__ |
| 9 | #define __SOC_H__ |
| 10 | |
| 11 | /* Product PARTNUM */ |
| 12 | #define CN81XX 0xA2 |
| 13 | #define CN83XX 0xA3 |
| 14 | #define CN96XX 0xB2 |
| 15 | #define CN95XX 0xB3 |
| 16 | |
| 17 | /* Register defines */ |
| 18 | |
| 19 | #define otx_is_soc(soc) (read_partnum() == (soc)) |
| 20 | #define otx_is_board(model) (!strcmp(read_board_name(), model)) |
| 21 | #define otx_is_platform(platform) (read_platform() == (platform)) |
| 22 | |
| 23 | enum platform_t { |
| 24 | PLATFORM_HW = 0, |
| 25 | PLATFORM_EMULATOR = 1, |
| 26 | PLATFORM_ASIM = 3, |
| 27 | }; |
| 28 | |
| 29 | int read_platform(void); |
| 30 | u8 read_partnum(void); |
| 31 | const char *read_board_name(void); |
| 32 | |
| 33 | #endif /* __SOC_H */ |