Raymond Mao | 8fe0731 | 2024-12-06 14:54:21 -0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (c) 2024 Linaro Limited |
| 4 | * Author: Raymond Mao <raymond.mao@linaro.org> |
| 5 | */ |
| 6 | #ifndef __SMBIOS_PLAT_H |
| 7 | #define __SMBIOS_PLAT_H |
| 8 | |
| 9 | #include <smbios.h> |
| 10 | |
| 11 | struct cache_info { |
| 12 | union cache_config config; |
| 13 | union cache_sram_type supp_sram_type; |
| 14 | union cache_sram_type curr_sram_type; |
| 15 | u32 line_size; |
| 16 | u32 associativity; |
| 17 | u32 max_size; |
| 18 | u32 inst_size; |
| 19 | u8 cache_type; |
| 20 | u8 speed; |
| 21 | u8 err_corr_type; |
| 22 | char *socket_design; |
| 23 | }; |
| 24 | |
| 25 | struct processor_info { |
| 26 | u32 id[2]; |
| 27 | u16 ext_clock; |
| 28 | u16 max_speed; |
| 29 | u16 curr_speed; |
| 30 | u16 characteristics; |
| 31 | u16 family2; |
| 32 | u16 core_count2; |
| 33 | u16 core_enabled2; |
| 34 | u16 thread_count2; |
| 35 | u16 thread_enabled; |
| 36 | u8 type; |
| 37 | u8 family; |
| 38 | u8 voltage; |
| 39 | u8 status; |
| 40 | u8 upgrade; |
| 41 | u8 core_count; |
| 42 | u8 core_enabled; |
| 43 | u8 thread_count; |
| 44 | char *socket_design; |
| 45 | char *manufacturer; |
| 46 | char *version; |
| 47 | char *sn; |
| 48 | char *asset_tag; |
| 49 | char *pn; |
| 50 | }; |
| 51 | |
| 52 | struct sysinfo_plat { |
| 53 | struct processor_info *processor; |
| 54 | struct cache_info *cache; |
| 55 | /* add other sysinfo structure here */ |
| 56 | }; |
| 57 | |
| 58 | #if defined CONFIG_SYSINFO_SMBIOS |
| 59 | int sysinfo_get_cache_info(u8 level, struct cache_info *cache_info); |
| 60 | void sysinfo_cache_info_default(struct cache_info *ci); |
| 61 | int sysinfo_get_processor_info(struct processor_info *pinfo); |
| 62 | #else |
| 63 | static inline int sysinfo_get_cache_info(u8 level, |
| 64 | struct cache_info *cache_info) |
| 65 | { |
| 66 | return -ENOSYS; |
| 67 | } |
| 68 | |
| 69 | static inline void sysinfo_cache_info_default(struct cache_info *ci) |
| 70 | { |
| 71 | } |
| 72 | |
| 73 | static inline int sysinfo_get_processor_info(struct processor_info *pinfo) |
| 74 | { |
| 75 | return -ENOSYS; |
| 76 | } |
| 77 | #endif |
| 78 | |
| 79 | #endif /* __SMBIOS_PLAT_H */ |