blob: 08943e795e8847b15482bbb21a4fb67e0f9ebaf2 [file] [log] [blame]
Angel Pons4b429832020-04-02 23:48:50 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Stefan Reinauer278534d2008-10-29 04:51:07 +00003
4#ifndef RAMINIT_H
5#define RAMINIT_H
6
7#define DIMM_SOCKETS 2
8
Stefan Reinauer278534d2008-10-29 04:51:07 +00009#define DIMM_TCO_BASE 0x30
10
11/* Burst length is always 8 */
12#define BURSTLENGTH 8
13
14struct sys_info {
15 u16 memory_frequency; /* 400, 533 or 667 */
Elyes HAOUASd9e65432016-12-01 19:59:12 +010016 u16 fsb_frequency; /* 945GM: 400, 533 or 667 / 945GC: 533, 800, or 1066 */
Arthur Heymans0ab49042017-02-06 22:40:14 +010017 u32 tclk;
Stefan Reinauer278534d2008-10-29 04:51:07 +000018
Arthur Heymans0ab49042017-02-06 22:40:14 +010019 u8 trp;
20 u8 trcd;
21 u8 tras;
22 u8 trfc;
23 u8 twr;
Stefan Reinauer278534d2008-10-29 04:51:07 +000024
25 u8 cas; /* 3, 4 or 5 */
26 u8 refresh; /* 0 = 15.6us, 1 = 7.8us */
27
28 u8 dual_channel; /* 0 or 1 */
29 u8 interleaved;
30
31 u8 mvco4x; /* 0 (8x) or 1 (4x) */
32 u8 clkcfg_bit7;
33 u8 boot_path;
Stefan Reinauer71a3d962009-07-21 21:44:24 +000034#define BOOT_PATH_NORMAL 0
35#define BOOT_PATH_RESET 1
36#define BOOT_PATH_RESUME 2
Stefan Reinauer278534d2008-10-29 04:51:07 +000037
38 u8 package; /* 0 = planar, 1 = stacked */
39#define SYSINFO_PACKAGE_PLANAR 0x00
40#define SYSINFO_PACKAGE_STACKED 0x01
41 u8 dimm[2 * DIMM_SOCKETS];
Arthur Heymans0ab49042017-02-06 22:40:14 +010042 u8 rows[2 * DIMM_SOCKETS];
43 u8 cols[2 * DIMM_SOCKETS];
Stefan Reinauer278534d2008-10-29 04:51:07 +000044#define SYSINFO_DIMM_X16DS 0x00
45#define SYSINFO_DIMM_X8DS 0x01
46#define SYSINFO_DIMM_X16SS 0x02
47#define SYSINFO_DIMM_X8DDS 0x03
48#define SYSINFO_DIMM_NOT_POPULATED 0x04
49
50 u8 banks[2 * DIMM_SOCKETS];
Stefan Reinauer278534d2008-10-29 04:51:07 +000051 u8 banksize[2 * 2 * DIMM_SOCKETS];
Sven Schnelle541269b2011-02-21 09:39:17 +000052 const u8 *spd_addresses;
Stefan Reinauer278534d2008-10-29 04:51:07 +000053
Stefan Reinauer6a001132017-07-13 02:20:27 +020054} __packed;
Stefan Reinauer278534d2008-10-29 04:51:07 +000055
Stefan Reinauerde3206a2010-02-22 06:09:43 +000056void receive_enable_adjust(struct sys_info *sysinfo);
Sven Schnelle541269b2011-02-21 09:39:17 +000057void sdram_initialize(int boot_path, const u8 *sdram_addresses);
Elyes HAOUAS8273e132020-03-10 22:17:12 +010058int fixup_i945gm_errata(void);
Stefan Reinauer278534d2008-10-29 04:51:07 +000059#endif /* RAMINIT_H */