blob: 25d734a7dfdee35670941a8611a471aa20124984 [file] [log] [blame]
Lee Leahyd4edacb2016-02-08 07:12:30 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2008 coresystems GmbH
5 * Copyright (C) 2014 Google Inc.
Lee Leahy94b971a2017-03-06 08:59:23 -08006 * Copyright (C) 2015-2017 Intel Corporation.
Lee Leahyd4edacb2016-02-08 07:12:30 -08007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#ifndef _SOC_CHIP_H_
19#define _SOC_CHIP_H_
20
21#include <stdint.h>
Lee Leahyd76d60b2016-03-03 15:30:48 -080022#include <fsp/util.h>
Lee Leahyd4edacb2016-02-08 07:12:30 -080023#include <soc/pci_devs.h>
24#include <soc/pm.h>
25
Lee Leahydc542702016-06-18 18:52:43 -070026///
27/// MRC Flags bits
28///
29#define MRC_FLAG_ECC_EN BIT0
30#define MRC_FLAG_SCRAMBLE_EN BIT1
31#define MRC_FLAG_MEMTEST_EN BIT2
32
33/* 0b DDR "fly-by" topology else 1b DDR "tree" topology */
34#define MRC_FLAG_TOP_TREE_EN BIT3
35
36/* If set ODR signal is asserted to DRAM devices on writes */
37#define MRC_FLAG_WR_ODT_EN BIT4
38
Lee Leahyd4edacb2016-02-08 07:12:30 -080039struct soc_intel_quark_config {
Lee Leahyd76d60b2016-03-03 15:30:48 -080040 /*
41 * MemoryInit:
42 *
43 * The following fields come from FspUpdVpd.h and are defined as PCDs
Lee Leahy94b971a2017-03-06 08:59:23 -080044 * for the FSP binary. Data for these fields comes from the board's
Lee Leahyd76d60b2016-03-03 15:30:48 -080045 * devicetree.cb file which gets processed into static.c and then
46 * built into the coreboot image. The fields below contain retain
47 * the FSP PCD field name.
48 */
Lee Leahydc542702016-06-18 18:52:43 -070049
Lee Leahy14d09262016-07-21 09:17:10 -070050 uint32_t FspReservedMemoryLength; /* FSP reserved memory in bytes */
Lee Leahydc542702016-06-18 18:52:43 -070051
Lee Leahy14d09262016-07-21 09:17:10 -070052 uint32_t Flags; /* Bitmap of MRC_FLAG_XXX defs above */
53 uint32_t tRAS; /* ACT to PRE command period in picoseconds */
Lee Leahydc542702016-06-18 18:52:43 -070054
55 /* Delay from start of internal write transaction to internal read
56 * command in picoseconds
57 */
Lee Leahy14d09262016-07-21 09:17:10 -070058 uint32_t tWTR;
Lee Leahydc542702016-06-18 18:52:43 -070059
60 /* ACT to ACT command period (JESD79 specific to page size 1K/2K) in
61 * picoseconds
62 */
Lee Leahy14d09262016-07-21 09:17:10 -070063 uint32_t tRRD;
Lee Leahydc542702016-06-18 18:52:43 -070064
65 /* Four activate window (JESD79 specific to page size 1K/2K) in
66 * picoseconds
67 */
Lee Leahy14d09262016-07-21 09:17:10 -070068 uint32_t tFAW;
69 uint8_t DramWidth; /* 0=x8, 1=x16, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070070
71 /* 0=DDRFREQ_800, 1=DDRFREQ_1066, others=RESERVED. Only 533MHz SKU
72 * support 1066 memory
73 */
Lee Leahy14d09262016-07-21 09:17:10 -070074 uint8_t DramSpeed;
75 uint8_t DramType; /* 0=DDR3,1=DDR3L, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070076
77 /* bit[0] RANK0_EN, bit[1] RANK1_EN, others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070078 uint8_t RankMask;
79 uint8_t ChanMask; /* bit[0] CHAN0_EN, others=RESERVED */
80 uint8_t ChanWidth; /* 1=x16, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070081
82 /* 0, 1, 2 (mode 2 forced if ecc enabled), others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070083 uint8_t AddrMode;
Lee Leahydc542702016-06-18 18:52:43 -070084
85 /* 1=1.95us, 2=3.9us, 3=7.8us, others=RESERVED. REFRESH_RATE */
Lee Leahy14d09262016-07-21 09:17:10 -070086 uint8_t SrInt;
87 uint8_t SrTemp; /* 0=normal, 1=extended, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070088
89 /* 0=34ohm, 1=40ohm, others=RESERVED. RON_VALUE Select MRS1.DIC driver
90 * impedance control.
91 */
Lee Leahy14d09262016-07-21 09:17:10 -070092 uint8_t DramRonVal;
Lee Leahy94b971a2017-03-06 08:59:23 -080093 uint8_t DramRttNomVal; /* 0=40ohm, 1=60ohm, 2=120ohm, others=RSVD */
Lee Leahy14d09262016-07-21 09:17:10 -070094 uint8_t DramRttWrVal; /* 0=off others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -070095
96 /* 0=off, 1=60ohm, 2=120ohm, 3=180ohm, others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -070097 uint8_t SocRdOdtVal;
98 uint8_t SocWrRonVal; /* 0=27ohm, 1=32ohm, 2=40ohm, others=RESERVED */
99 uint8_t SocWrSlewRate; /* 0=2.5V/ns, 1=4V/ns, others=RESERVED */
Lee Leahydc542702016-06-18 18:52:43 -0700100
101 /* 0=512Mb, 1=1Gb, 2=2Gb, 3=4Gb, others=RESERVED */
Lee Leahy14d09262016-07-21 09:17:10 -0700102 uint8_t DramDensity;
103 uint8_t tCL; /* DRAM CAS Latency in clocks */
Lee Leahydc542702016-06-18 18:52:43 -0700104
105 /* ECC scrub interval in miliseconds 1..255 (0 works as feature
106 * disable)
107 */
Lee Leahy14d09262016-07-21 09:17:10 -0700108 uint8_t EccScrubInterval;
Lee Leahydc542702016-06-18 18:52:43 -0700109
110 /* Number of 32B blocks read for ECC scrub 2..16 */
Lee Leahy14d09262016-07-21 09:17:10 -0700111 uint8_t EccScrubBlkSize;
Lee Leahydc542702016-06-18 18:52:43 -0700112
Lee Leahy14d09262016-07-21 09:17:10 -0700113 uint8_t SmmTsegSize; /* SMM size in MiB */
Lee Leahyd4edacb2016-02-08 07:12:30 -0800114};
115
116extern struct chip_operations soc_ops;
117
118#endif