blob: 7308712180f5edc8b8c8f6b1152a80d06672ccd4 [file] [log] [blame]
Angel Pons230e4f9d2020-04-05 15:47:14 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lee Leahyd4edacb2016-02-08 07:12:30 -08002
3#ifndef _SOC_CHIP_H_
4#define _SOC_CHIP_H_
5
6#include <stdint.h>
Lee Leahyd76d60b2016-03-03 15:30:48 -08007#include <fsp/util.h>
Lee Leahyd4edacb2016-02-08 07:12:30 -08008#include <soc/pci_devs.h>
9#include <soc/pm.h>
10
Lee Leahydc542702016-06-18 18:52:43 -070011///
12/// MRC Flags bits
13///
14#define MRC_FLAG_ECC_EN BIT0
15#define MRC_FLAG_SCRAMBLE_EN BIT1
16#define MRC_FLAG_MEMTEST_EN BIT2
17
18/* 0b DDR "fly-by" topology else 1b DDR "tree" topology */
19#define MRC_FLAG_TOP_TREE_EN BIT3
20
21/* If set ODR signal is asserted to DRAM devices on writes */
22#define MRC_FLAG_WR_ODT_EN BIT4
23
Lee Leahyd4edacb2016-02-08 07:12:30 -080024struct soc_intel_quark_config {
Lee Leahyd76d60b2016-03-03 15:30:48 -080025 /*
26 * MemoryInit:
27 *
28 * The following fields come from FspUpdVpd.h and are defined as PCDs
Lee Leahy94b971a2017-03-06 08:59:23 -080029 * for the FSP binary. Data for these fields comes from the board's
Lee Leahyd76d60b2016-03-03 15:30:48 -080030 * devicetree.cb file which gets processed into static.c and then
31 * built into the coreboot image. The fields below contain retain
32 * the FSP PCD field name.
33 */
Lee Leahydc542702016-06-18 18:52:43 -070034
Lee Leahy14d09262016-07-21 09:17:10 -070035 uint32_t FspReservedMemoryLength; /* FSP reserved memory in bytes */
Lee Leahydc542702016-06-18 18:52:43 -070036
Lee Leahy14d09262016-07-21 09:17:10 -070037 uint32_t Flags; /* Bitmap of MRC_FLAG_XXX defs above */
38 uint32_t tRAS; /* ACT to PRE command period in picoseconds */
Lee Leahydc542702016-06-18 18:52:43 -070039
40 /* Delay from start of internal write transaction to internal read
41 * command in picoseconds
42 */
Lee Leahy14d09262016-07-21 09:17:10 -070043 uint32_t tWTR;
Lee Leahydc542702016-06-18 18:52:43 -070044
45 /* ACT to ACT command period (JESD79 specific to page size 1K/2K) in
46 * picoseconds
47 */
Lee Leahy14d09262016-07-21 09:17:10 -070048 uint32_t tRRD;
Lee Leahydc542702016-06-18 18:52:43 -070049
50 /* Four activate window (JESD79 specific to page size 1K/2K) in
51 * picoseconds
52 */
Lee Leahy14d09262016-07-21 09:17:10 -070053 uint32_t tFAW;
54 uint8_t DramWidth; /* 0=x8, 1=x16, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070055
56 /* 0=DDRFREQ_800, 1=DDRFREQ_1066, others=RESERVED. Only 533MHz SKU
57 * support 1066 memory
58 */
Lee Leahy14d09262016-07-21 09:17:10 -070059 uint8_t DramSpeed;
60 uint8_t DramType; /* 0=DDR3,1=DDR3L, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070061
62 /* bit[0] RANK0_EN, bit[1] RANK1_EN, others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070063 uint8_t RankMask;
64 uint8_t ChanMask; /* bit[0] CHAN0_EN, others=RESERVED */
65 uint8_t ChanWidth; /* 1=x16, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070066
67 /* 0, 1, 2 (mode 2 forced if ecc enabled), others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070068 uint8_t AddrMode;
Lee Leahydc542702016-06-18 18:52:43 -070069
70 /* 1=1.95us, 2=3.9us, 3=7.8us, others=RESERVED. REFRESH_RATE */
Lee Leahy14d09262016-07-21 09:17:10 -070071 uint8_t SrInt;
72 uint8_t SrTemp; /* 0=normal, 1=extended, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070073
74 /* 0=34ohm, 1=40ohm, others=RESERVED. RON_VALUE Select MRS1.DIC driver
75 * impedance control.
76 */
Lee Leahy14d09262016-07-21 09:17:10 -070077 uint8_t DramRonVal;
Lee Leahy94b971a2017-03-06 08:59:23 -080078 uint8_t DramRttNomVal; /* 0=40ohm, 1=60ohm, 2=120ohm, others=RSVD */
Lee Leahy14d09262016-07-21 09:17:10 -070079 uint8_t DramRttWrVal; /* 0=off others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070080
81 /* 0=off, 1=60ohm, 2=120ohm, 3=180ohm, others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070082 uint8_t SocRdOdtVal;
83 uint8_t SocWrRonVal; /* 0=27ohm, 1=32ohm, 2=40ohm, others=RESERVED */
84 uint8_t SocWrSlewRate; /* 0=2.5V/ns, 1=4V/ns, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070085
86 /* 0=512Mb, 1=1Gb, 2=2Gb, 3=4Gb, others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070087 uint8_t DramDensity;
88 uint8_t tCL; /* DRAM CAS Latency in clocks */
Lee Leahydc542702016-06-18 18:52:43 -070089
Martin Roth26f97f92021-10-01 14:53:22 -060090 /* ECC scrub interval in milliseconds 1..255 (0 works as feature
Lee Leahydc542702016-06-18 18:52:43 -070091 * disable)
92 */
Lee Leahy14d09262016-07-21 09:17:10 -070093 uint8_t EccScrubInterval;
Lee Leahydc542702016-06-18 18:52:43 -070094
95 /* Number of 32B blocks read for ECC scrub 2..16 */
Lee Leahy14d09262016-07-21 09:17:10 -070096 uint8_t EccScrubBlkSize;
Lee Leahydc542702016-06-18 18:52:43 -070097
Lee Leahy14d09262016-07-21 09:17:10 -070098 uint8_t SmmTsegSize; /* SMM size in MiB */
Lee Leahyd4edacb2016-02-08 07:12:30 -080099};
100
Lee Leahyd4edacb2016-02-08 07:12:30 -0800101#endif