Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 2 | |
| 3 | #include <console/console.h> |
Iru Cai | 3364203 | 2019-06-11 14:24:43 +0800 | [diff] [blame] | 4 | #include <console/usb.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 5 | #include <string.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 6 | #include <cbmem.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 7 | #include <cbfs.h> |
Elyes HAOUAS | 82d4642 | 2019-04-28 18:01:48 +0200 | [diff] [blame] | 8 | #include <cf9_reset.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 9 | #include <ip_checksum.h> |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 10 | #include <memory_info.h> |
Arthur Heymans | f300f36 | 2018-01-27 13:39:12 +0100 | [diff] [blame] | 11 | #include <mrc_cache.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 12 | #include <device/pci_def.h> |
Patrick Rudolph | 42609d8 | 2020-07-27 16:23:36 +0200 | [diff] [blame] | 13 | #include <device/pci_ops.h> |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 14 | #include <device/dram/ddr3.h> |
| 15 | #include <smbios.h> |
| 16 | #include <spd.h> |
Philipp Deppenwiese | fea2429 | 2017-10-17 17:02:29 +0200 | [diff] [blame] | 17 | #include <security/vboot/vboot_common.h> |
Arthur Heymans | f300f36 | 2018-01-27 13:39:12 +0100 | [diff] [blame] | 18 | #include <commonlib/region.h> |
Elyes HAOUAS | 030d338 | 2021-02-12 08:17:35 +0100 | [diff] [blame^] | 19 | #include <types.h> |
| 20 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 21 | #include "raminit.h" |
| 22 | #include "pei_data.h" |
| 23 | #include "haswell.h" |
| 24 | |
Arthur Heymans | f300f36 | 2018-01-27 13:39:12 +0100 | [diff] [blame] | 25 | #define MRC_CACHE_VERSION 1 |
| 26 | |
Aaron Durbin | 2ad1dba | 2013-02-07 00:51:18 -0600 | [diff] [blame] | 27 | void save_mrc_data(struct pei_data *pei_data) |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 28 | { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 29 | /* Save the MRC S3 restore data to cbmem */ |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 30 | mrc_cache_stash_data(MRC_TRAINING_DATA, MRC_CACHE_VERSION, pei_data->mrc_output, |
| 31 | pei_data->mrc_output_len); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | static void prepare_mrc_cache(struct pei_data *pei_data) |
| 35 | { |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 36 | size_t mrc_size; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 37 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 38 | /* Preset just in case there is an error */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 39 | pei_data->mrc_input = NULL; |
| 40 | pei_data->mrc_input_len = 0; |
| 41 | |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 42 | pei_data->mrc_input = |
| 43 | mrc_cache_current_mmap_leak(MRC_TRAINING_DATA, |
| 44 | MRC_CACHE_VERSION, |
| 45 | &mrc_size); |
| 46 | if (!pei_data->mrc_input) |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 47 | /* Error message printed in find_current_mrc_cache */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 48 | return; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 49 | |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 50 | pei_data->mrc_input_len = mrc_size; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 51 | |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 52 | printk(BIOS_DEBUG, "%s: at %p, size %zx\n", __func__, |
| 53 | pei_data->mrc_input, mrc_size); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 54 | } |
| 55 | |
Angel Pons | 0117e4e | 2020-10-13 23:34:27 +0200 | [diff] [blame] | 56 | static const char *const ecc_decoder[] = { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 57 | "inactive", |
| 58 | "active on IO", |
| 59 | "disabled on IO", |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 60 | "active", |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 61 | }; |
| 62 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 63 | /* Print out the memory controller configuration, as per the values in its registers. */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 64 | static void report_memory_config(void) |
| 65 | { |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 66 | int i; |
| 67 | |
Angel Pons | 82654b3 | 2020-10-13 21:45:45 +0200 | [diff] [blame] | 68 | const u32 addr_decoder_common = MCHBAR32(MAD_CHNL); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 69 | |
| 70 | printk(BIOS_DEBUG, "memcfg DDR3 clock %d MHz\n", |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 71 | (MCHBAR32(MC_BIOS_DATA) * 13333 * 2 + 50) / 100); |
| 72 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 73 | printk(BIOS_DEBUG, "memcfg channel assignment: A: %d, B % d, C % d\n", |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 74 | (addr_decoder_common >> 0) & 3, |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 75 | (addr_decoder_common >> 2) & 3, |
| 76 | (addr_decoder_common >> 4) & 3); |
| 77 | |
Angel Pons | 82654b3 | 2020-10-13 21:45:45 +0200 | [diff] [blame] | 78 | for (i = 0; i < NUM_CHANNELS; i++) { |
| 79 | const u32 ch_conf = MCHBAR32(MAD_DIMM(i)); |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 80 | |
| 81 | printk(BIOS_DEBUG, "memcfg channel[%d] config (%8.8x):\n", i, ch_conf); |
| 82 | printk(BIOS_DEBUG, " ECC %s\n", ecc_decoder[(ch_conf >> 24) & 3]); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 83 | printk(BIOS_DEBUG, " enhanced interleave mode %s\n", |
| 84 | ((ch_conf >> 22) & 1) ? "on" : "off"); |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 85 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 86 | printk(BIOS_DEBUG, " rank interleave %s\n", |
| 87 | ((ch_conf >> 21) & 1) ? "on" : "off"); |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 88 | |
Duncan Laurie | 8d77402 | 2013-10-22 16:32:49 -0700 | [diff] [blame] | 89 | printk(BIOS_DEBUG, " DIMMA %d MB width %s %s rank%s\n", |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 90 | ((ch_conf >> 0) & 0xff) * 256, |
Duncan Laurie | 8d77402 | 2013-10-22 16:32:49 -0700 | [diff] [blame] | 91 | ((ch_conf >> 19) & 1) ? "x16" : "x8 or x32", |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 92 | ((ch_conf >> 17) & 1) ? "dual" : "single", |
| 93 | ((ch_conf >> 16) & 1) ? "" : ", selected"); |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 94 | |
Duncan Laurie | 8d77402 | 2013-10-22 16:32:49 -0700 | [diff] [blame] | 95 | printk(BIOS_DEBUG, " DIMMB %d MB width %s %s rank%s\n", |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 96 | ((ch_conf >> 8) & 0xff) * 256, |
Ryan Salsamendi | dab81a4 | 2017-06-30 17:36:41 -0700 | [diff] [blame] | 97 | ((ch_conf >> 20) & 1) ? "x16" : "x8 or x32", |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 98 | ((ch_conf >> 18) & 1) ? "dual" : "single", |
| 99 | ((ch_conf >> 16) & 1) ? ", selected" : ""); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Find PEI executable in coreboot filesystem and execute it. |
| 105 | * |
| 106 | * @param pei_data: configuration data for UEFI PEI reference code |
| 107 | */ |
| 108 | void sdram_initialize(struct pei_data *pei_data) |
| 109 | { |
Angel Pons | 1ca6b53 | 2020-10-13 23:43:00 +0200 | [diff] [blame] | 110 | int (*entry)(struct pei_data *pei_data) __attribute__((regparm(1))); |
| 111 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 112 | printk(BIOS_DEBUG, "Starting UEFI PEI System Agent\n"); |
| 113 | |
Shelley Chen | 6615c6e | 2020-10-27 15:58:31 -0700 | [diff] [blame] | 114 | /* |
| 115 | * Always pass in mrc_cache data. The driver will determine |
| 116 | * whether to use the data or not. |
| 117 | */ |
| 118 | prepare_mrc_cache(pei_data); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 119 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 120 | /* If MRC data is not found, we cannot continue S3 resume */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 121 | if (pei_data->boot_mode == 2 && !pei_data->mrc_input) { |
Duncan Laurie | 727b545 | 2013-08-08 16:28:41 -0700 | [diff] [blame] | 122 | post_code(POST_RESUME_FAILURE); |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 123 | printk(BIOS_DEBUG, "Giving up in %s: No MRC data\n", __func__); |
Elyes HAOUAS | 82d4642 | 2019-04-28 18:01:48 +0200 | [diff] [blame] | 124 | system_reset(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | /* Pass console handler in pei_data */ |
Kyösti Mälkki | 657e0be | 2014-02-04 19:03:57 +0200 | [diff] [blame] | 128 | pei_data->tx_byte = do_putchar; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 129 | |
Arthur Heymans | 8da2fa0 | 2018-06-06 10:35:45 +0200 | [diff] [blame] | 130 | /* |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 131 | * Locate and call UEFI System Agent binary. The binary needs to be at a fixed offset |
Julius Werner | 9d0cc2a | 2020-01-22 18:00:18 -0800 | [diff] [blame] | 132 | * in the flash and can therefore only reside in the COREBOOT fmap region. We don't care |
| 133 | * about leaking the mapping. |
Arthur Heymans | 8da2fa0 | 2018-06-06 10:35:45 +0200 | [diff] [blame] | 134 | */ |
Julius Werner | 9d0cc2a | 2020-01-22 18:00:18 -0800 | [diff] [blame] | 135 | entry = cbfs_ro_map("mrc.bin", NULL); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 136 | if (entry) { |
Angel Pons | 1ca6b53 | 2020-10-13 23:43:00 +0200 | [diff] [blame] | 137 | int rv = entry(pei_data); |
Iru Cai | 3364203 | 2019-06-11 14:24:43 +0800 | [diff] [blame] | 138 | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 139 | /* The mrc.bin reconfigures USB, so usbdebug needs to be reinitialized */ |
Iru Cai | 3364203 | 2019-06-11 14:24:43 +0800 | [diff] [blame] | 140 | if (CONFIG(USBDEBUG_IN_PRE_RAM)) |
| 141 | usbdebug_hw_init(true); |
| 142 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 143 | if (rv) { |
| 144 | switch (rv) { |
| 145 | case -1: |
| 146 | printk(BIOS_ERR, "PEI version mismatch.\n"); |
| 147 | break; |
| 148 | case -2: |
| 149 | printk(BIOS_ERR, "Invalid memory frequency.\n"); |
| 150 | break; |
| 151 | default: |
| 152 | printk(BIOS_ERR, "MRC returned %x.\n", rv); |
| 153 | } |
Keith Short | bb41aba | 2019-05-16 14:07:43 -0600 | [diff] [blame] | 154 | die_with_post_code(POST_INVALID_VENDOR_BINARY, |
| 155 | "Nonzero MRC return value.\n"); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 156 | } |
| 157 | } else { |
| 158 | die("UEFI PEI System Agent not found.\n"); |
| 159 | } |
| 160 | |
Angel Pons | 7f454e4 | 2020-10-13 23:49:03 +0200 | [diff] [blame] | 161 | /* Print the MRC version after executing the UEFI PEI stage */ |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 162 | u32 version = MCHBAR32(MRC_REVISION); |
Angel Pons | 7f454e4 | 2020-10-13 23:49:03 +0200 | [diff] [blame] | 163 | printk(BIOS_DEBUG, "MRC Version %d.%d.%d Build %d\n", |
| 164 | (version >> 24) & 0xff, (version >> 16) & 0xff, |
| 165 | (version >> 8) & 0xff, (version >> 0) & 0xff); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 166 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 167 | report_memory_config(); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 168 | } |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 169 | |
Patrick Rudolph | 42609d8 | 2020-07-27 16:23:36 +0200 | [diff] [blame] | 170 | static bool nb_supports_ecc(const uint32_t capid0_a) |
| 171 | { |
| 172 | return !(capid0_a & CAPID_ECCDIS); |
| 173 | } |
| 174 | |
| 175 | static uint16_t nb_slots_per_channel(const uint32_t capid0_a) |
| 176 | { |
| 177 | return !(capid0_a & CAPID_DDPCD) + 1; |
| 178 | } |
| 179 | |
| 180 | static uint16_t nb_number_of_channels(const uint32_t capid0_a) |
| 181 | { |
| 182 | return !(capid0_a & CAPID_PDCD) + 1; |
| 183 | } |
| 184 | |
| 185 | static uint32_t nb_max_chan_capacity_mib(const uint32_t capid0_a) |
| 186 | { |
| 187 | uint32_t ddrsz; |
| 188 | |
| 189 | /* Values from documentation, which assume two DIMMs per channel */ |
| 190 | switch (CAPID_DDRSZ(capid0_a)) { |
| 191 | case 1: |
| 192 | ddrsz = 8192; |
| 193 | break; |
| 194 | case 2: |
| 195 | ddrsz = 2048; |
| 196 | break; |
| 197 | case 3: |
| 198 | ddrsz = 512; |
| 199 | break; |
| 200 | default: |
| 201 | ddrsz = 16384; |
| 202 | break; |
| 203 | } |
| 204 | |
| 205 | /* Account for the maximum number of DIMMs per channel */ |
| 206 | return (ddrsz / 2) * nb_slots_per_channel(capid0_a); |
| 207 | } |
| 208 | |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 209 | void setup_sdram_meminfo(struct pei_data *pei_data) |
| 210 | { |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 211 | struct memory_info *mem_info; |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 212 | struct dimm_info *dimm; |
Angel Pons | 82654b3 | 2020-10-13 21:45:45 +0200 | [diff] [blame] | 213 | int ch, d_num; |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 214 | int dimm_cnt = 0; |
| 215 | |
| 216 | mem_info = cbmem_add(CBMEM_ID_MEMINFO, sizeof(struct memory_info)); |
Nico Huber | acac02d | 2017-06-20 14:49:04 +0200 | [diff] [blame] | 217 | if (!mem_info) |
| 218 | die("Failed to add memory info to CBMEM.\n"); |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 219 | |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 220 | memset(mem_info, 0, sizeof(struct memory_info)); |
| 221 | |
Angel Pons | 82654b3 | 2020-10-13 21:45:45 +0200 | [diff] [blame] | 222 | const u32 ddr_frequency = (MCHBAR32(MC_BIOS_DATA) * 13333 * 2 + 50) / 100; |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 223 | |
Angel Pons | 82654b3 | 2020-10-13 21:45:45 +0200 | [diff] [blame] | 224 | for (ch = 0; ch < NUM_CHANNELS; ch++) { |
| 225 | const u32 ch_conf = MCHBAR32(MAD_DIMM(ch)); |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 226 | /* DIMMs A/B */ |
Angel Pons | 82654b3 | 2020-10-13 21:45:45 +0200 | [diff] [blame] | 227 | for (d_num = 0; d_num < NUM_SLOTS; d_num++) { |
| 228 | const u32 dimm_size = ((ch_conf >> (d_num * 8)) & 0xff) * 256; |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 229 | if (dimm_size) { |
| 230 | dimm = &mem_info->dimm[dimm_cnt]; |
| 231 | dimm->dimm_size = dimm_size; |
| 232 | dimm->ddr_type = MEMORY_TYPE_DDR3; |
| 233 | dimm->ddr_frequency = ddr_frequency; |
| 234 | dimm->rank_per_dimm = 1 + ((ch_conf >> (17 + d_num)) & 1); |
| 235 | dimm->channel_num = ch; |
| 236 | dimm->dimm_num = d_num; |
| 237 | dimm->bank_locator = ch * 2; |
| 238 | memcpy(dimm->serial, |
| 239 | &pei_data->spd_data[dimm_cnt][SPD_DIMM_SERIAL_NUM], |
| 240 | SPD_DIMM_SERIAL_LEN); |
| 241 | memcpy(dimm->module_part_number, |
| 242 | &pei_data->spd_data[dimm_cnt][SPD_DIMM_PART_NUM], |
| 243 | SPD_DIMM_PART_LEN); |
| 244 | dimm->mod_id = |
| 245 | (pei_data->spd_data[dimm_cnt][SPD_DIMM_MOD_ID2] << 8) | |
Angel Pons | 1db5bc7 | 2020-01-15 00:49:03 +0100 | [diff] [blame] | 246 | (pei_data->spd_data[dimm_cnt][SPD_DIMM_MOD_ID1] & 0xff); |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 247 | dimm->mod_type = SPD_SODIMM; |
Elyes HAOUAS | 7d964ae | 2020-07-19 09:19:59 +0200 | [diff] [blame] | 248 | dimm->bus_width = MEMORY_BUS_WIDTH_64; |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 249 | dimm_cnt++; |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | mem_info->dimm_cnt = dimm_cnt; |
Patrick Rudolph | 42609d8 | 2020-07-27 16:23:36 +0200 | [diff] [blame] | 254 | |
| 255 | const uint32_t capid0_a = pci_read_config32(HOST_BRIDGE, CAPID0_A); |
| 256 | |
| 257 | const uint16_t channels = nb_number_of_channels(capid0_a); |
| 258 | |
| 259 | mem_info->ecc_capable = nb_supports_ecc(capid0_a); |
| 260 | mem_info->max_capacity_mib = channels * nb_max_chan_capacity_mib(capid0_a); |
| 261 | mem_info->number_of_devices = channels * nb_slots_per_channel(capid0_a); |
Matt DeVillier | 5aaa8ce | 2016-09-02 13:29:17 -0500 | [diff] [blame] | 262 | } |