Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
Stefan Reinauer | 30140a5 | 2009-03-11 16:20:39 +0000 | [diff] [blame] | 7 | * the Free Software Foundation; version 2 of the License. |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | #ifndef RAMINIT_H |
| 16 | #define RAMINIT_H |
| 17 | |
| 18 | #define DIMM_SOCKETS 2 |
| 19 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 20 | #define DIMM_TCO_BASE 0x30 |
| 21 | |
| 22 | /* Burst length is always 8 */ |
| 23 | #define BURSTLENGTH 8 |
| 24 | |
| 25 | struct sys_info { |
| 26 | u16 memory_frequency; /* 400, 533 or 667 */ |
Elyes HAOUAS | d9e6543 | 2016-12-01 19:59:12 +0100 | [diff] [blame] | 27 | u16 fsb_frequency; /* 945GM: 400, 533 or 667 / 945GC: 533, 800, or 1066 */ |
Arthur Heymans | 0ab4904 | 2017-02-06 22:40:14 +0100 | [diff] [blame] | 28 | u32 tclk; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 29 | |
Arthur Heymans | 0ab4904 | 2017-02-06 22:40:14 +0100 | [diff] [blame] | 30 | u8 trp; |
| 31 | u8 trcd; |
| 32 | u8 tras; |
| 33 | u8 trfc; |
| 34 | u8 twr; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 35 | |
| 36 | u8 cas; /* 3, 4 or 5 */ |
| 37 | u8 refresh; /* 0 = 15.6us, 1 = 7.8us */ |
| 38 | |
| 39 | u8 dual_channel; /* 0 or 1 */ |
| 40 | u8 interleaved; |
| 41 | |
| 42 | u8 mvco4x; /* 0 (8x) or 1 (4x) */ |
| 43 | u8 clkcfg_bit7; |
| 44 | u8 boot_path; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 45 | #define BOOT_PATH_NORMAL 0 |
| 46 | #define BOOT_PATH_RESET 1 |
| 47 | #define BOOT_PATH_RESUME 2 |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 48 | |
| 49 | u8 package; /* 0 = planar, 1 = stacked */ |
| 50 | #define SYSINFO_PACKAGE_PLANAR 0x00 |
| 51 | #define SYSINFO_PACKAGE_STACKED 0x01 |
| 52 | u8 dimm[2 * DIMM_SOCKETS]; |
Arthur Heymans | 0ab4904 | 2017-02-06 22:40:14 +0100 | [diff] [blame] | 53 | u8 rows[2 * DIMM_SOCKETS]; |
| 54 | u8 cols[2 * DIMM_SOCKETS]; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 55 | #define SYSINFO_DIMM_X16DS 0x00 |
| 56 | #define SYSINFO_DIMM_X8DS 0x01 |
| 57 | #define SYSINFO_DIMM_X16SS 0x02 |
| 58 | #define SYSINFO_DIMM_X8DDS 0x03 |
| 59 | #define SYSINFO_DIMM_NOT_POPULATED 0x04 |
| 60 | |
| 61 | u8 banks[2 * DIMM_SOCKETS]; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 62 | u8 banksize[2 * 2 * DIMM_SOCKETS]; |
Sven Schnelle | 541269b | 2011-02-21 09:39:17 +0000 | [diff] [blame] | 63 | const u8 *spd_addresses; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 64 | |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 65 | } __packed; |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 66 | |
Stefan Reinauer | de3206a | 2010-02-22 06:09:43 +0000 | [diff] [blame] | 67 | void receive_enable_adjust(struct sys_info *sysinfo); |
Sven Schnelle | 541269b | 2011-02-21 09:39:17 +0000 | [diff] [blame] | 68 | void sdram_initialize(int boot_path, const u8 *sdram_addresses); |
Elyes HAOUAS | 8273e13 | 2020-03-10 22:17:12 +0100 | [diff] [blame] | 69 | int fixup_i945gm_errata(void); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 70 | #endif /* RAMINIT_H */ |