soc/intel/denverton_ns: Use cpulib in cpu.c
[coreboot.git] / src / include / memory_info.h
blob93c7b6bfc9774dd28489db4bae208525a2a00bfc
1 /*
2 * Memory information
4 * Copyright (C) 2014, Intel Corporation. All rights reserved.
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.
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.
16 #ifndef _MEMORY_INFO_H_
17 #define _MEMORY_INFO_H_
19 #include <stdint.h>
21 #define DIMM_INFO_SERIAL_SIZE 4
22 #define DIMM_INFO_PART_NUMBER_SIZE 33
23 #define DIMM_INFO_TOTAL 8 /* Maximum num of dimm is 8 */
25 /**
26 * If this table is filled and put in CBMEM,
27 * then these info in CBMEM will be used to generate smbios type 17 table
29 * Values are specified according to the JEDEC SPD Standard.
31 struct dimm_info {
33 * Size of the module in MiB.
35 uint32_t dimm_size;
37 * SMBIOS (not SPD) device type.
39 * See the smbios.h smbios_memory_type enum.
41 uint16_t ddr_type;
42 uint16_t ddr_frequency;
43 uint8_t rank_per_dimm;
44 uint8_t channel_num;
45 uint8_t dimm_num;
46 uint8_t bank_locator;
48 * SPD serial number.
50 uint8_t serial[DIMM_INFO_SERIAL_SIZE];
52 * The last byte is '\0' for the end of string
54 * Must contain only printable ASCII.
56 uint8_t module_part_number[DIMM_INFO_PART_NUMBER_SIZE];
58 * SPD Manufacturer ID
60 uint16_t mod_id;
62 * SPD Module Type.
64 * See spd.h for valid values.
66 * e.g., SPD_RDIMM, SPD_SODIMM, SPD_MICRO_DIMM
68 uint8_t mod_type;
70 * SPD bus width.
72 * Bits 0 - 2 encode the primary bus width:
73 * 0b000 = 8 bit width
74 * 0b001 = 16 bit width
75 * 0b010 = 32 bit width
76 * 0b011 = 64 bit width
78 * Bits 3 - 4 encode the extension bits (ECC):
79 * 0b00 = 0 extension bits
80 * 0b01 = 8 bit of ECC
82 * e.g.,
83 * 64 bit bus with 8 bits of ECC (72 bits total): 0b1011
84 * 64 bit bus with 0 bits of ECC (64 bits total): 0b0011
86 * See the smbios.h smbios_memory_bus_width enum.
88 uint8_t bus_width;
89 } __packed;
91 struct memory_info {
92 uint8_t dimm_cnt;
93 struct dimm_info dimm[DIMM_INFO_TOTAL];
94 } __packed;
96 #endif