Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Memory information |
| 3 | * |
| 4 | * Copyright (C) 2014, Intel Corporation. All rights reserved. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License version |
| 8 | * 2 as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef _MEMORY_INFO_H_ |
| 17 | #define _MEMORY_INFO_H_ |
| 18 | |
Barnali Sarkar | c16d389 | 2017-02-23 16:56:54 +0530 | [diff] [blame] | 19 | #include <stdint.h> |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 20 | #include <compiler.h> |
Barnali Sarkar | c16d389 | 2017-02-23 16:56:54 +0530 | [diff] [blame] | 21 | |
Richard Spiegel | bd65480 | 2018-02-22 10:03:39 -0700 | [diff] [blame^] | 22 | #define DIMM_INFO_SERIAL_SIZE 5 |
| 23 | #define DIMM_INFO_PART_NUMBER_SIZE 19 |
| 24 | #define DIMM_INFO_TOTAL 8 /* Maximum num of dimm is 8 */ |
| 25 | |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 26 | /* |
| 27 | * If this table is filled and put in CBMEM, |
| 28 | * then these info in CBMEM will be used to generate smbios type 17 table |
| 29 | */ |
| 30 | struct dimm_info { |
| 31 | uint32_t dimm_size; |
| 32 | uint16_t ddr_type; |
| 33 | uint16_t ddr_frequency; |
| 34 | uint8_t rank_per_dimm; |
| 35 | uint8_t channel_num; |
| 36 | uint8_t dimm_num; |
| 37 | uint8_t bank_locator; |
Richard Spiegel | bd65480 | 2018-02-22 10:03:39 -0700 | [diff] [blame^] | 38 | /* The last byte is '\0' for the end of string */ |
| 39 | uint8_t serial[DIMM_INFO_SERIAL_SIZE]; |
| 40 | /* The last byte is '\0' for the end of string */ |
| 41 | uint8_t module_part_number[DIMM_INFO_PART_NUMBER_SIZE]; |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 42 | uint16_t mod_id; |
| 43 | uint8_t mod_type; |
| 44 | uint8_t bus_width; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 45 | } __packed; |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 46 | |
| 47 | struct memory_info { |
| 48 | uint8_t dimm_cnt; |
Richard Spiegel | bd65480 | 2018-02-22 10:03:39 -0700 | [diff] [blame^] | 49 | struct dimm_info dimm[DIMM_INFO_TOTAL]; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 50 | } __packed; |
Kane Chen | 33faac6 | 2014-07-27 12:54:44 -0700 | [diff] [blame] | 51 | |
| 52 | #endif |