Angel Pons | 6e5aabd | 2020-03-23 23:44:42 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 2 | |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame] | 3 | #include <arch/hpet.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 4 | #include <console/console.h> |
| 5 | #include <console/usb.h> |
Elyes HAOUAS | c056729 | 2019-04-28 17:57:47 +0200 | [diff] [blame] | 6 | #include <cf9_reset.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 7 | #include <string.h> |
Nico Huber | 47bf498 | 2019-11-17 02:58:00 +0100 | [diff] [blame] | 8 | #include <device/device.h> |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 9 | #include <device/dram/ddr3.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 10 | #include <device/pci_ops.h> |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 11 | #include <arch/cpu.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 12 | #include <cbmem.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 13 | #include <cbfs.h> |
Julius Werner | de37109 | 2024-01-30 16:51:05 -0800 | [diff] [blame] | 14 | #include <commonlib/bsd/ipchksum.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 15 | #include <pc80/mc146818rtc.h> |
| 16 | #include <device/pci_def.h> |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 17 | #include <lib.h> |
Arthur Heymans | 7539b8c | 2017-12-24 10:42:57 +0100 | [diff] [blame] | 18 | #include <mrc_cache.h> |
Elyes HAOUAS | a233eb4 | 2022-01-26 07:51:28 +0100 | [diff] [blame] | 19 | #include <spd.h> |
Elyes HAOUAS | 62b23c1 | 2022-01-26 07:43:51 +0100 | [diff] [blame] | 20 | #include <smbios.h> |
Elyes HAOUAS | 1d6484a | 2020-07-10 11:18:11 +0200 | [diff] [blame] | 21 | #include <stddef.h> |
| 22 | #include <stdint.h> |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 23 | #include <timestamp.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 24 | #include "raminit.h" |
| 25 | #include "pei_data.h" |
| 26 | #include "sandybridge.h" |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 27 | #include "chip.h" |
Philipp Deppenwiese | fea2429 | 2017-10-17 17:02:29 +0200 | [diff] [blame] | 28 | #include <security/vboot/vboot_common.h> |
Patrick Georgi | 27fbbcf | 2019-04-23 12:33:23 +0200 | [diff] [blame] | 29 | #include <southbridge/intel/bd82x6x/pch.h> |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 30 | #include <memory_info.h> |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 31 | #include <mode_switch.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 32 | |
| 33 | /* Management Engine is in the southbridge */ |
Elyes HAOUAS | 21b71ce6 | 2018-06-16 18:43:52 +0200 | [diff] [blame] | 34 | #include <southbridge/intel/bd82x6x/me.h> |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 35 | |
| 36 | /* |
| 37 | * MRC scrambler seed offsets should be reserved in |
| 38 | * mainboard cmos.layout and not covered by checksum. |
| 39 | */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 40 | #if CONFIG(USE_OPTION_TABLE) |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 41 | #include "option_table.h" |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 42 | #define CMOS_OFFSET_MRC_SEED (CMOS_VSTART_mrc_scrambler_seed >> 3) |
| 43 | #define CMOS_OFFSET_MRC_SEED_S3 (CMOS_VSTART_mrc_scrambler_seed_s3 >> 3) |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 44 | #define CMOS_OFFSET_MRC_SEED_CHK (CMOS_VSTART_mrc_scrambler_seed_chk >> 3) |
| 45 | #else |
| 46 | #define CMOS_OFFSET_MRC_SEED 152 |
| 47 | #define CMOS_OFFSET_MRC_SEED_S3 156 |
| 48 | #define CMOS_OFFSET_MRC_SEED_CHK 160 |
| 49 | #endif |
| 50 | |
Arthur Heymans | 7539b8c | 2017-12-24 10:42:57 +0100 | [diff] [blame] | 51 | #define MRC_CACHE_VERSION 0 |
| 52 | |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 53 | /* Assembly functions: */ |
| 54 | void mrc_wrapper(void *func_ptr, uint32_t arg1); |
Patrick Rudolph | 1d718de | 2023-12-28 19:39:11 +0100 | [diff] [blame] | 55 | void __prot2lm_do_putchar(uint8_t byte); |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 56 | |
Arthur Heymans | 0f89a11 | 2022-04-18 17:14:37 +0200 | [diff] [blame] | 57 | static void save_mrc_data(struct pei_data *pei_data) |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 58 | { |
| 59 | u16 c1, c2, checksum; |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 60 | |
| 61 | /* Save the MRC S3 restore data to cbmem */ |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 62 | mrc_cache_stash_data(MRC_TRAINING_DATA, MRC_CACHE_VERSION, |
| 63 | (void *)(uintptr_t)pei_data->mrc_output_ptr, |
| 64 | pei_data->mrc_output_len); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 65 | |
| 66 | /* Save the MRC seed values to CMOS */ |
Kyösti Mälkki | 2879107 | 2020-01-04 12:58:53 +0200 | [diff] [blame] | 67 | cmos_write32(pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 68 | printk(BIOS_DEBUG, "Save scrambler seed 0x%08x to CMOS 0x%02x\n", |
| 69 | pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); |
| 70 | |
Kyösti Mälkki | 2879107 | 2020-01-04 12:58:53 +0200 | [diff] [blame] | 71 | cmos_write32(pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 72 | printk(BIOS_DEBUG, "Save s3 scrambler seed 0x%08x to CMOS 0x%02x\n", |
| 73 | pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); |
| 74 | |
| 75 | /* Save a simple checksum of the seed values */ |
Julius Werner | de37109 | 2024-01-30 16:51:05 -0800 | [diff] [blame] | 76 | c1 = ipchksum((u8 *)&pei_data->scrambler_seed, sizeof(u32)); |
| 77 | c2 = ipchksum((u8 *)&pei_data->scrambler_seed_s3, sizeof(u32)); |
| 78 | checksum = ipchksum_add(sizeof(u32), c1, c2); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 79 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 80 | cmos_write((checksum >> 0) & 0xff, CMOS_OFFSET_MRC_SEED_CHK); |
| 81 | cmos_write((checksum >> 8) & 0xff, CMOS_OFFSET_MRC_SEED_CHK + 1); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | static void prepare_mrc_cache(struct pei_data *pei_data) |
| 85 | { |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 86 | u16 c1, c2, checksum, seed_checksum; |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 87 | size_t mrc_size; |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 88 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 89 | /* Preset just in case there is an error */ |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 90 | pei_data->mrc_input_ptr = 0; |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 91 | pei_data->mrc_input_len = 0; |
| 92 | |
| 93 | /* Read scrambler seeds from CMOS */ |
| 94 | pei_data->scrambler_seed = cmos_read32(CMOS_OFFSET_MRC_SEED); |
| 95 | printk(BIOS_DEBUG, "Read scrambler seed 0x%08x from CMOS 0x%02x\n", |
| 96 | pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); |
| 97 | |
| 98 | pei_data->scrambler_seed_s3 = cmos_read32(CMOS_OFFSET_MRC_SEED_S3); |
| 99 | printk(BIOS_DEBUG, "Read S3 scrambler seed 0x%08x from CMOS 0x%02x\n", |
| 100 | pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); |
| 101 | |
| 102 | /* Compute seed checksum and compare */ |
Julius Werner | de37109 | 2024-01-30 16:51:05 -0800 | [diff] [blame] | 103 | c1 = ipchksum((u8 *)&pei_data->scrambler_seed, sizeof(u32)); |
| 104 | c2 = ipchksum((u8 *)&pei_data->scrambler_seed_s3, sizeof(u32)); |
| 105 | checksum = ipchksum_add(sizeof(u32), c1, c2); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 106 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 107 | seed_checksum = cmos_read(CMOS_OFFSET_MRC_SEED_CHK); |
| 108 | seed_checksum |= cmos_read(CMOS_OFFSET_MRC_SEED_CHK + 1) << 8; |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 109 | |
| 110 | if (checksum != seed_checksum) { |
| 111 | printk(BIOS_ERR, "%s: invalid seed checksum\n", __func__); |
| 112 | pei_data->scrambler_seed = 0; |
| 113 | pei_data->scrambler_seed_s3 = 0; |
| 114 | return; |
| 115 | } |
| 116 | |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 117 | pei_data->mrc_input_ptr = (uintptr_t)mrc_cache_current_mmap_leak(MRC_TRAINING_DATA, |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 118 | MRC_CACHE_VERSION, |
| 119 | &mrc_size); |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 120 | if (!pei_data->mrc_input_ptr) { |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 121 | /* Error message printed in find_current_mrc_cache */ |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 122 | return; |
| 123 | } |
| 124 | |
Shelley Chen | ad9cd68 | 2020-07-23 16:10:52 -0700 | [diff] [blame] | 125 | pei_data->mrc_input_len = mrc_size; |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 126 | |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 127 | printk(BIOS_DEBUG, "%s: at 0x%x, size %zx\n", __func__, |
| 128 | pei_data->mrc_input_ptr, mrc_size); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 129 | } |
| 130 | |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 131 | /** |
| 132 | * Find PEI executable in coreboot filesystem and execute it. |
| 133 | * |
| 134 | * @param pei_data: configuration data for UEFI PEI reference code |
| 135 | */ |
Arthur Heymans | 0f89a11 | 2022-04-18 17:14:37 +0200 | [diff] [blame] | 136 | static void sdram_initialize(struct pei_data *pei_data) |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 137 | { |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 138 | int (*entry)(struct pei_data *pei_data); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 139 | |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 140 | /* Wait for ME to be ready */ |
| 141 | intel_early_me_init(); |
| 142 | intel_early_me_uma_size(); |
| 143 | |
| 144 | printk(BIOS_DEBUG, "Starting UEFI PEI System Agent\n"); |
| 145 | |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 146 | /* |
Shelley Chen | 6615c6e | 2020-10-27 15:58:31 -0700 | [diff] [blame] | 147 | * Always pass in mrc_cache data. The driver will determine |
| 148 | * whether to use the data or not. |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 149 | */ |
Shelley Chen | 6615c6e | 2020-10-27 15:58:31 -0700 | [diff] [blame] | 150 | prepare_mrc_cache(pei_data); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 151 | |
| 152 | /* If MRC data is not found we cannot continue S3 resume. */ |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 153 | if (pei_data->boot_mode == 2 && !pei_data->mrc_input_ptr) { |
Elyes HAOUAS | 3cd4327 | 2020-03-05 22:01:17 +0100 | [diff] [blame] | 154 | printk(BIOS_DEBUG, "Giving up in %s: No MRC data\n", __func__); |
Elyes HAOUAS | c056729 | 2019-04-28 17:57:47 +0200 | [diff] [blame] | 155 | system_reset(); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 156 | } |
| 157 | |
Patrick Rudolph | 1d718de | 2023-12-28 19:39:11 +0100 | [diff] [blame] | 158 | /* |
| 159 | * Pass console handler in pei_data. On x86_64 provide a wrapper around |
| 160 | * do_putchar that switches to long mode before calling do_putchar. |
| 161 | */ |
| 162 | if (ENV_X86_64) |
| 163 | pei_data->tx_byte_ptr = (uintptr_t)__prot2lm_do_putchar; |
| 164 | else |
| 165 | pei_data->tx_byte_ptr = (uintptr_t)do_putchar; |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 166 | |
| 167 | /* Locate and call UEFI System Agent binary. */ |
Julius Werner | 834b3ec | 2020-03-04 16:52:08 -0800 | [diff] [blame] | 168 | entry = cbfs_map("mrc.bin", NULL); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 169 | if (entry) { |
| 170 | int rv; |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 171 | rv = protected_mode_call_2arg(mrc_wrapper, (uintptr_t)entry, (uintptr_t)pei_data); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 172 | if (rv) { |
| 173 | switch (rv) { |
| 174 | case -1: |
| 175 | printk(BIOS_ERR, "PEI version mismatch.\n"); |
| 176 | break; |
| 177 | case -2: |
| 178 | printk(BIOS_ERR, "Invalid memory frequency.\n"); |
| 179 | break; |
| 180 | default: |
| 181 | printk(BIOS_ERR, "MRC returned %x.\n", rv); |
| 182 | } |
lilacious | 40cb3fe | 2023-06-21 23:24:14 +0200 | [diff] [blame] | 183 | die_with_post_code(POSTCODE_INVALID_VENDOR_BINARY, |
Keith Short | bb41aba | 2019-05-16 14:07:43 -0600 | [diff] [blame] | 184 | "Nonzero MRC return value.\n"); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 185 | } |
| 186 | } else { |
| 187 | die("UEFI PEI System Agent not found.\n"); |
| 188 | } |
| 189 | |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 190 | /* mrc.bin reconfigures USB, so reinit it to have debug */ |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 191 | if (CONFIG(USBDEBUG_IN_PRE_RAM)) |
Kyösti Mälkki | 63649d2 | 2018-12-29 09:40:40 +0200 | [diff] [blame] | 192 | usbdebug_hw_init(true); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 193 | |
Angel Pons | 9f3bc371 | 2020-10-13 23:57:10 +0200 | [diff] [blame] | 194 | /* Print the MRC version after executing the UEFI PEI stage */ |
Angel Pons | 66780a0 | 2021-03-26 13:33:22 +0100 | [diff] [blame] | 195 | u32 version = mchbar_read32(MRC_REVISION); |
Angel Pons | c1328a6 | 2021-06-14 12:43:11 +0200 | [diff] [blame] | 196 | printk(BIOS_DEBUG, "MRC Version %u.%u.%u Build %u\n", |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 197 | (version >> 24) & 0xff, (version >> 16) & 0xff, |
| 198 | (version >> 8) & 0xff, (version >> 0) & 0xff); |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 199 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 200 | /* |
| 201 | * Send ME init done for SandyBridge here. |
| 202 | * This is done inside the SystemAgent binary on IvyBridge. |
| 203 | */ |
| 204 | if (BASE_REV_SNB == (pci_read_config16(PCI_CPU_DEVICE, PCI_DEVICE_ID) & BASE_REV_MASK)) |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 205 | intel_early_me_init_done(ME_INIT_STATUS_SUCCESS); |
| 206 | else |
| 207 | intel_early_me_status(); |
| 208 | |
Alexandru Gagniuc | ecf2eb4 | 2015-09-28 21:39:12 -0700 | [diff] [blame] | 209 | report_memory_config(); |
| 210 | } |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 211 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 212 | /* |
| 213 | * These are the location and structure of MRC_VAR data in CAR. |
| 214 | * The CAR region looks like this: |
| 215 | * +------------------+ -> DCACHE_RAM_BASE |
| 216 | * | | |
| 217 | * | | |
| 218 | * | COREBOOT STACK | |
| 219 | * | | |
| 220 | * | | |
| 221 | * +------------------+ -> DCACHE_RAM_BASE + DCACHE_RAM_SIZE |
| 222 | * | | |
| 223 | * | MRC HEAP | |
| 224 | * | size = 0x5000 | |
| 225 | * | | |
| 226 | * +------------------+ |
| 227 | * | | |
| 228 | * | MRC VAR | |
| 229 | * | size = 0x4000 | |
| 230 | * | | |
| 231 | * +------------------+ -> DACHE_RAM_BASE + DACHE_RAM_SIZE |
| 232 | * + DCACHE_RAM_MRC_VAR_SIZE |
Arthur Heymans | 01c83a2 | 2019-06-05 13:36:55 +0200 | [diff] [blame] | 233 | */ |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 234 | #define DCACHE_RAM_MRC_VAR_BASE (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE \ |
| 235 | + CONFIG_DCACHE_RAM_MRC_VAR_SIZE - 0x4000) |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 236 | |
| 237 | struct mrc_var_data { |
| 238 | u32 acpi_timer_flag; |
| 239 | u32 pool_used; |
| 240 | u32 pool_base; |
| 241 | u32 tx_byte; |
| 242 | u32 reserved[4]; |
| 243 | } __packed; |
| 244 | |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 245 | static void northbridge_fill_pei_data(struct pei_data *pei_data) |
| 246 | { |
Angel Pons | d9e58dc | 2021-01-20 01:22:20 +0100 | [diff] [blame] | 247 | pei_data->mchbar = CONFIG_FIXED_MCHBAR_MMIO_BASE; |
| 248 | pei_data->dmibar = CONFIG_FIXED_DMIBAR_MMIO_BASE; |
| 249 | pei_data->epbar = CONFIG_FIXED_EPBAR_MMIO_BASE; |
Shelley Chen | 4e9bb33 | 2021-10-20 15:43:45 -0700 | [diff] [blame] | 250 | pei_data->pciexbar = CONFIG_ECAM_MMCONF_BASE_ADDRESS; |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame] | 251 | pei_data->hpet_address = HPET_BASE_ADDRESS; |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 252 | pei_data->thermalbase = 0xfed08000; |
| 253 | pei_data->system_type = !(get_platform_type() == PLATFORM_MOBILE); |
| 254 | pei_data->tseg_size = CONFIG_SMM_TSEG_SIZE; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 255 | |
| 256 | if ((cpu_get_cpuid() & 0xffff0) == 0x306a0) { |
| 257 | const struct device *dev = pcidev_on_root(1, 0); |
| 258 | pei_data->pcie_init = dev && dev->enabled; |
| 259 | } else { |
| 260 | pei_data->pcie_init = 0; |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | static void southbridge_fill_pei_data(struct pei_data *pei_data) |
| 265 | { |
| 266 | const struct device *dev = pcidev_on_root(0x19, 0); |
| 267 | |
Angel Pons | b21bffa | 2020-07-03 01:02:28 +0200 | [diff] [blame] | 268 | pei_data->smbusbar = CONFIG_FIXED_SMBUS_IO_BASE; |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 269 | pei_data->wdbbar = 0x04000000; |
| 270 | pei_data->wdbsize = 0x1000; |
Angel Pons | 92717ff | 2020-09-14 16:22:22 +0200 | [diff] [blame] | 271 | pei_data->rcba = (uintptr_t)DEFAULT_RCBA; |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 272 | pei_data->pmbase = DEFAULT_PMBASE; |
| 273 | pei_data->gpiobase = DEFAULT_GPIOBASE; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 274 | pei_data->gbe_enable = dev && dev->enabled; |
| 275 | } |
| 276 | |
| 277 | static void devicetree_fill_pei_data(struct pei_data *pei_data) |
| 278 | { |
Keith Hui | 1e9601c | 2023-07-15 12:08:51 -0400 | [diff] [blame] | 279 | const struct northbridge_intel_sandybridge_config *cfg = config_of_soc(); |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 280 | |
| 281 | switch (cfg->max_mem_clock_mhz) { |
| 282 | /* MRC only supports fixed numbers of frequencies */ |
| 283 | default: |
| 284 | printk(BIOS_WARNING, "RAMINIT: Limiting DDR3 clock to 800 Mhz\n"); |
Arthur Heymans | fff2021 | 2021-03-15 14:56:16 +0100 | [diff] [blame] | 285 | __fallthrough; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 286 | case 400: |
| 287 | pei_data->max_ddr3_freq = 800; |
| 288 | break; |
| 289 | case 533: |
| 290 | pei_data->max_ddr3_freq = 1066; |
| 291 | break; |
| 292 | case 666: |
| 293 | pei_data->max_ddr3_freq = 1333; |
| 294 | break; |
| 295 | case 800: |
| 296 | pei_data->max_ddr3_freq = 1600; |
| 297 | break; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 298 | } |
| 299 | |
Keith Hui | 1e9601c | 2023-07-15 12:08:51 -0400 | [diff] [blame] | 300 | /* |
| 301 | * SPD addresses are listed in devicetree as actual addresses, |
| 302 | * and for MRC need to be shifted left so bit 0 is always zero. |
| 303 | */ |
| 304 | if (!CONFIG(HAVE_SPD_IN_CBFS)) { |
| 305 | for (unsigned int i = 0; i < ARRAY_SIZE(cfg->spd_addresses); i++) { |
| 306 | pei_data->spd_addresses[i] = cfg->spd_addresses[i] << 1; |
| 307 | } |
| 308 | } |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 309 | memcpy(pei_data->ts_addresses, cfg->ts_addresses, sizeof(pei_data->ts_addresses)); |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 310 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 311 | pei_data->ec_present = cfg->ec_present; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 312 | pei_data->ddr3lv_support = cfg->ddr3lv_support; |
| 313 | |
| 314 | pei_data->nmode = cfg->nmode; |
| 315 | pei_data->ddr_refresh_rate_config = cfg->ddr_refresh_rate_config; |
| 316 | |
| 317 | memcpy(pei_data->usb_port_config, cfg->usb_port_config, |
| 318 | sizeof(pei_data->usb_port_config)); |
| 319 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 320 | pei_data->usb3.mode = cfg->usb3.mode; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 321 | pei_data->usb3.hs_port_switch_mask = cfg->usb3.hs_port_switch_mask; |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 322 | pei_data->usb3.preboot_support = cfg->usb3.preboot_support; |
| 323 | pei_data->usb3.xhci_streams = cfg->usb3.xhci_streams; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 324 | } |
| 325 | |
Keith Hui | 1e9601c | 2023-07-15 12:08:51 -0400 | [diff] [blame] | 326 | static void spd_fill_pei_data(struct pei_data *pei_data) |
| 327 | { |
| 328 | struct spd_info spdi = {0}; |
Jeremy Compostella | caa0c0e | 2023-11-16 08:48:23 -0800 | [diff] [blame] | 329 | unsigned int i, have_memory_down = 0; |
Keith Hui | 1e9601c | 2023-07-15 12:08:51 -0400 | [diff] [blame] | 330 | |
| 331 | mb_get_spd_map(&spdi); |
| 332 | |
| 333 | for (i = 0; i < ARRAY_SIZE(spdi.addresses); i++) { |
| 334 | if (spdi.addresses[i] == SPD_MEMORY_DOWN) { |
| 335 | pei_data->spd_addresses[i] = 0; |
| 336 | have_memory_down = 1; |
| 337 | } else { |
| 338 | /* MRC expects left-aligned SMBus addresses. */ |
| 339 | pei_data->spd_addresses[i] = spdi.addresses[i] << 1; |
| 340 | } |
| 341 | } |
| 342 | /* Copy SPD data from CBFS for on-board memory */ |
| 343 | if (have_memory_down) { |
| 344 | printk(BIOS_DEBUG, "SPD index %d\n", spdi.spd_index); |
| 345 | |
| 346 | size_t spd_file_len; |
| 347 | uint8_t *spd_file = cbfs_map("spd.bin", &spd_file_len); |
| 348 | |
| 349 | if (!spd_file) |
| 350 | die("SPD data %s!", "not found"); |
| 351 | |
| 352 | if (spd_file_len < ((spdi.spd_index + 1) * SPD_SIZE_MAX_DDR3)) |
| 353 | die("SPD data %s!", "incomplete"); |
| 354 | |
| 355 | /* MRC only uses index 0... */ |
| 356 | memcpy(pei_data->spd_data[0], spd_file + (spdi.spd_index * SPD_SIZE_MAX_DDR3), SPD_SIZE_MAX_DDR3); |
| 357 | |
| 358 | /* but coreboot uses the other indices */ |
| 359 | for (i = 1; i < ARRAY_SIZE(spdi.addresses); i++) { |
| 360 | if (spdi.addresses[i] == SPD_MEMORY_DOWN) |
| 361 | memcpy(pei_data->spd_data[i], pei_data->spd_data[0], SPD_SIZE_MAX_DDR3); |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | |
Nico Huber | 47bf498 | 2019-11-17 02:58:00 +0100 | [diff] [blame] | 366 | static void disable_p2p(void) |
| 367 | { |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 368 | /* Disable PCI-to-PCI bridge early to prevent probing by MRC */ |
Nico Huber | 47bf498 | 2019-11-17 02:58:00 +0100 | [diff] [blame] | 369 | const struct device *const p2p = pcidev_on_root(0x1e, 0); |
| 370 | if (p2p && p2p->enabled) |
| 371 | return; |
| 372 | |
| 373 | RCBA32(FD) |= PCH_DISABLE_P2P; |
| 374 | } |
| 375 | |
Arthur Heymans | 0f89a11 | 2022-04-18 17:14:37 +0200 | [diff] [blame] | 376 | static void setup_sdram_meminfo(struct pei_data *pei_data); |
| 377 | |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 378 | void perform_raminit(int s3resume) |
| 379 | { |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 380 | struct pei_data pei_data; |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 381 | struct mrc_var_data *mrc_var; |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 382 | |
| 383 | /* Prepare USB controller early in S3 resume */ |
Keith Hui | c5d6af4 | 2023-03-20 02:03:47 -0400 | [diff] [blame] | 384 | if (s3resume) |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 385 | enable_usb_bar(); |
| 386 | |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 387 | memset(&pei_data, 0, sizeof(pei_data)); |
Elyes Haouas | 24f4e97 | 2022-07-13 18:47:27 +0200 | [diff] [blame] | 388 | pei_data.pei_version = PEI_VERSION; |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 389 | |
| 390 | northbridge_fill_pei_data(&pei_data); |
| 391 | southbridge_fill_pei_data(&pei_data); |
| 392 | devicetree_fill_pei_data(&pei_data); |
Keith Hui | 1e9601c | 2023-07-15 12:08:51 -0400 | [diff] [blame] | 393 | if (CONFIG(HAVE_SPD_IN_CBFS)) |
| 394 | spd_fill_pei_data(&pei_data); |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 395 | mainboard_fill_pei_data(&pei_data); |
| 396 | |
| 397 | post_code(0x3a); |
Patrick Rudolph | 59b4255 | 2019-05-08 12:44:15 +0200 | [diff] [blame] | 398 | |
Patrick Rudolph | 5709e03 | 2019-03-25 10:12:14 +0100 | [diff] [blame] | 399 | /* Fill after mainboard_fill_pei_data as it might provide spd_data */ |
| 400 | pei_data.dimm_channel0_disabled = |
| 401 | (!pei_data.spd_addresses[0] && !pei_data.spd_data[0][0]) + |
| 402 | (!pei_data.spd_addresses[1] && !pei_data.spd_data[1][0]) * 2; |
| 403 | |
| 404 | pei_data.dimm_channel1_disabled = |
| 405 | (!pei_data.spd_addresses[2] && !pei_data.spd_data[2][0]) + |
| 406 | (!pei_data.spd_addresses[3] && !pei_data.spd_data[3][0]) * 2; |
| 407 | |
Nico Huber | 47bf498 | 2019-11-17 02:58:00 +0100 | [diff] [blame] | 408 | disable_p2p(); |
| 409 | |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 410 | pei_data.boot_mode = s3resume ? 2 : 0; |
Jakub Czapiga | ad6157e | 2022-02-15 11:50:31 +0100 | [diff] [blame] | 411 | timestamp_add_now(TS_INITRAM_START); |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 412 | sdram_initialize(&pei_data); |
Jakub Czapiga | ad6157e | 2022-02-15 11:50:31 +0100 | [diff] [blame] | 413 | timestamp_add_now(TS_INITRAM_END); |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 414 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 415 | /* Sanity check mrc_var location by verifying a known field */ |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 416 | mrc_var = (void *)DCACHE_RAM_MRC_VAR_BASE; |
Patrick Rudolph | b14b96d | 2023-12-27 10:59:25 +0100 | [diff] [blame] | 417 | if (mrc_var->tx_byte == pei_data.tx_byte_ptr) { |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 418 | printk(BIOS_DEBUG, "MRC_VAR pool occupied [%08x,%08x]\n", |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 419 | mrc_var->pool_base, mrc_var->pool_base + mrc_var->pool_used); |
| 420 | |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 421 | } else { |
| 422 | printk(BIOS_ERR, "Could not parse MRC_VAR data\n"); |
Felix Held | 2a29d45 | 2021-05-25 19:15:11 +0200 | [diff] [blame] | 423 | hexdump(mrc_var, sizeof(*mrc_var)); |
Kyösti Mälkki | b697c90 | 2019-01-30 08:19:49 +0200 | [diff] [blame] | 424 | } |
| 425 | |
Angel Pons | 7c49cb8 | 2020-03-16 23:17:32 +0100 | [diff] [blame] | 426 | const int cbmem_was_initted = !cbmem_recovery(s3resume); |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 427 | if (!s3resume) |
| 428 | save_mrc_data(&pei_data); |
| 429 | |
| 430 | if (s3resume && !cbmem_was_initted) { |
| 431 | /* Failed S3 resume, reset to come up cleanly */ |
Elyes HAOUAS | c056729 | 2019-04-28 17:57:47 +0200 | [diff] [blame] | 432 | system_reset(); |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 433 | } |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 434 | setup_sdram_meminfo(&pei_data); |
| 435 | } |
| 436 | |
Arthur Heymans | 0f89a11 | 2022-04-18 17:14:37 +0200 | [diff] [blame] | 437 | static void setup_sdram_meminfo(struct pei_data *pei_data) |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 438 | { |
Arthur Heymans | 55f116a | 2022-03-24 01:18:02 +0100 | [diff] [blame] | 439 | u32 addr_decode_ch[2]; |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 440 | struct memory_info *mem_info; |
| 441 | struct dimm_info *dimm; |
| 442 | int dimm_size; |
| 443 | int i; |
| 444 | int dimm_cnt = 0; |
| 445 | |
| 446 | mem_info = cbmem_add(CBMEM_ID_MEMINFO, sizeof(struct memory_info)); |
| 447 | memset(mem_info, 0, sizeof(struct memory_info)); |
| 448 | |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 449 | addr_decode_ch[0] = mchbar_read32(MAD_DIMM_CH0); |
| 450 | addr_decode_ch[1] = mchbar_read32(MAD_DIMM_CH1); |
| 451 | |
| 452 | const int refclk = mchbar_read32(MC_BIOS_REQ) & 0x100 ? 100 : 133; |
| 453 | const int ddr_frequency = (mchbar_read32(MC_BIOS_DATA) * refclk * 100 * 2 + 50) / 100; |
| 454 | |
| 455 | for (i = 0; i < ARRAY_SIZE(addr_decode_ch); i++) { |
| 456 | u32 ch_conf = addr_decode_ch[i]; |
| 457 | |
| 458 | /* DIMM-A */ |
| 459 | dimm_size = ((ch_conf >> 0) & 0xff) * 256; |
| 460 | if (dimm_size) { |
| 461 | dimm = &mem_info->dimm[dimm_cnt]; |
| 462 | dimm->dimm_size = dimm_size; |
Elyes HAOUAS | 62b23c1 | 2022-01-26 07:43:51 +0100 | [diff] [blame] | 463 | dimm->ddr_type = MEMORY_TYPE_DDR3; |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 464 | dimm->ddr_frequency = ddr_frequency; |
| 465 | dimm->rank_per_dimm = 1 + ((ch_conf >> 17) & 1); |
| 466 | dimm->channel_num = i; |
| 467 | dimm->dimm_num = 0; |
| 468 | dimm->bank_locator = i * 2; |
| 469 | memcpy(dimm->serial, /* bytes 122-125 */ |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 470 | &pei_data->spd_data[0][SPD_DIMM_SERIAL_NUM], |
| 471 | sizeof(uint8_t) * SPD_DIMM_SERIAL_LEN); |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 472 | memcpy(dimm->module_part_number, /* bytes 128-145 */ |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 473 | &pei_data->spd_data[0][SPD_DIMM_PART_NUM], |
| 474 | sizeof(uint8_t) * SPD_DIMM_PART_LEN); |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 475 | dimm->mod_id = /* bytes 117/118 */ |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 476 | (pei_data->spd_data[0][SPD_DIMM_MOD_ID2] << 8) | |
| 477 | (pei_data->spd_data[0][SPD_DIMM_MOD_ID1] & 0xFF); |
Elyes Haouas | f82e68c | 2022-12-28 12:33:58 +0100 | [diff] [blame] | 478 | dimm->mod_type = SPD_DDR3_DIMM_TYPE_SO_DIMM; |
Elyes HAOUAS | 62b23c1 | 2022-01-26 07:43:51 +0100 | [diff] [blame] | 479 | dimm->bus_width = MEMORY_BUS_WIDTH_64; |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 480 | dimm_cnt++; |
| 481 | } |
| 482 | /* DIMM-B */ |
| 483 | dimm_size = ((ch_conf >> 8) & 0xff) * 256; |
| 484 | if (dimm_size) { |
| 485 | dimm = &mem_info->dimm[dimm_cnt]; |
| 486 | dimm->dimm_size = dimm_size; |
Elyes HAOUAS | 62b23c1 | 2022-01-26 07:43:51 +0100 | [diff] [blame] | 487 | dimm->ddr_type = MEMORY_TYPE_DDR3; |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 488 | dimm->ddr_frequency = ddr_frequency; |
| 489 | dimm->rank_per_dimm = 1 + ((ch_conf >> 18) & 1); |
| 490 | dimm->channel_num = i; |
| 491 | dimm->dimm_num = 1; |
| 492 | dimm->bank_locator = i * 2; |
| 493 | memcpy(dimm->serial, /* bytes 122-125 */ |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 494 | &pei_data->spd_data[0][SPD_DIMM_SERIAL_NUM], |
| 495 | sizeof(uint8_t) * SPD_DIMM_SERIAL_LEN); |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 496 | memcpy(dimm->module_part_number, /* bytes 128-145 */ |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 497 | &pei_data->spd_data[0][SPD_DIMM_PART_NUM], |
| 498 | sizeof(uint8_t) * SPD_DIMM_PART_LEN); |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 499 | dimm->mod_id = /* bytes 117/118 */ |
Elyes HAOUAS | 921b99e | 2022-01-26 08:01:08 +0100 | [diff] [blame] | 500 | (pei_data->spd_data[0][SPD_DIMM_MOD_ID2] << 8) | |
| 501 | (pei_data->spd_data[0][SPD_DIMM_MOD_ID1] & 0xFF); |
Elyes Haouas | f82e68c | 2022-12-28 12:33:58 +0100 | [diff] [blame] | 502 | dimm->mod_type = SPD_DDR3_DIMM_TYPE_SO_DIMM; |
Elyes HAOUAS | 62b23c1 | 2022-01-26 07:43:51 +0100 | [diff] [blame] | 503 | dimm->bus_width = MEMORY_BUS_WIDTH_64; |
Matt DeVillier | ff1ef8d | 2016-12-24 15:36:24 -0600 | [diff] [blame] | 504 | dimm_cnt++; |
| 505 | } |
| 506 | } |
| 507 | mem_info->dimm_cnt = dimm_cnt; |
Vladimir Serbinenko | ffbb3c0 | 2016-02-10 01:36:25 +0100 | [diff] [blame] | 508 | } |