blob: a1b3553a7775767e23baefe55d3aff289bc55d41 [file] [log] [blame]
Kane Chen33faac62014-07-27 12:54:44 -07001/*
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 Sarkarc16d3892017-02-23 16:56:54 +053019#include <stdint.h>
Stefan Reinauer6a001132017-07-13 02:20:27 +020020#include <compiler.h>
Barnali Sarkarc16d3892017-02-23 16:56:54 +053021
Richard Spiegelbd654802018-02-22 10:03:39 -070022#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 Chen33faac62014-07-27 12:54:44 -070026/*
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 */
30struct 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 Spiegelbd654802018-02-22 10:03:39 -070038 /* 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 Chen33faac62014-07-27 12:54:44 -070042 uint16_t mod_id;
43 uint8_t mod_type;
44 uint8_t bus_width;
Stefan Reinauer6a001132017-07-13 02:20:27 +020045} __packed;
Kane Chen33faac62014-07-27 12:54:44 -070046
47struct memory_info {
48 uint8_t dimm_cnt;
Richard Spiegelbd654802018-02-22 10:03:39 -070049 struct dimm_info dimm[DIMM_INFO_TOTAL];
Stefan Reinauer6a001132017-07-13 02:20:27 +020050} __packed;
Kane Chen33faac62014-07-27 12:54:44 -070051
52#endif