Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2008 coresystems GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * 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] | 8 | * the Free Software Foundation; version 2 of the License. |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef RAMINIT_H |
| 21 | #define RAMINIT_H |
| 22 | |
| 23 | #define DIMM_SOCKETS 2 |
| 24 | |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 25 | #define DIMM_TCO_BASE 0x30 |
| 26 | |
| 27 | /* Burst length is always 8 */ |
| 28 | #define BURSTLENGTH 8 |
| 29 | |
| 30 | struct sys_info { |
| 31 | u16 memory_frequency; /* 400, 533 or 667 */ |
| 32 | u16 fsb_frequency; /* 400, 533 or 667 */ |
| 33 | |
| 34 | u8 trp; /* calculated by sdram_detect_smallest_tRP() */ |
| 35 | u8 trcd; /* calculated by sdram_detect_smallest_tRCD() */ |
| 36 | u8 tras; /* calculated by sdram_detect_smallest_tRAS() */ |
| 37 | u8 trfc; /* calculated by sdram_detect_smallest_tRFC() */ |
| 38 | u8 twr; /* calculated by sdram_detect_smallest_tWR() */ |
| 39 | |
| 40 | u8 cas; /* 3, 4 or 5 */ |
| 41 | u8 refresh; /* 0 = 15.6us, 1 = 7.8us */ |
| 42 | |
| 43 | u8 dual_channel; /* 0 or 1 */ |
| 44 | u8 interleaved; |
| 45 | |
| 46 | u8 mvco4x; /* 0 (8x) or 1 (4x) */ |
| 47 | u8 clkcfg_bit7; |
| 48 | u8 boot_path; |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 49 | #define BOOT_PATH_NORMAL 0 |
| 50 | #define BOOT_PATH_RESET 1 |
| 51 | #define BOOT_PATH_RESUME 2 |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 52 | |
| 53 | u8 package; /* 0 = planar, 1 = stacked */ |
| 54 | #define SYSINFO_PACKAGE_PLANAR 0x00 |
| 55 | #define SYSINFO_PACKAGE_STACKED 0x01 |
| 56 | u8 dimm[2 * DIMM_SOCKETS]; |
| 57 | #define SYSINFO_DIMM_X16DS 0x00 |
| 58 | #define SYSINFO_DIMM_X8DS 0x01 |
| 59 | #define SYSINFO_DIMM_X16SS 0x02 |
| 60 | #define SYSINFO_DIMM_X8DDS 0x03 |
| 61 | #define SYSINFO_DIMM_NOT_POPULATED 0x04 |
| 62 | |
| 63 | u8 banks[2 * DIMM_SOCKETS]; |
| 64 | |
| 65 | u8 banksize[2 * 2 * DIMM_SOCKETS]; |
| 66 | |
| 67 | } __attribute__ ((packed)); |
| 68 | |
Stefan Reinauer | de3206a | 2010-02-22 06:09:43 +0000 | [diff] [blame] | 69 | void receive_enable_adjust(struct sys_info *sysinfo); |
Stefan Reinauer | 53b0ea4 | 2010-03-22 11:50:52 +0000 | [diff] [blame] | 70 | void sdram_initialize(int boot_path); |
| 71 | unsigned long get_top_of_ram(void); |
| 72 | int fixup_i945_errata(void); |
Patrick Georgi | d083595 | 2010-10-05 09:07:10 +0000 | [diff] [blame] | 73 | void udelay(u32 us); |
Stefan Reinauer | 278534d | 2008-10-29 04:51:07 +0000 | [diff] [blame] | 74 | #endif /* RAMINIT_H */ |