Martin Roth | 5474eb1 | 2018-05-26 19:22:33 -0600 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; version 2 of the License. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
Stefan Reinauer | b15975b | 2011-10-21 12:57:59 -0700 | [diff] [blame] | 14 | #ifndef RAMINIT_H |
| 15 | #define RAMINIT_H |
| 16 | |
| 17 | #define MAX_DIMM_SOCKETS_PER_CHANNEL 4 |
| 18 | #define MAX_NUM_CHANNELS 2 |
| 19 | #define MAX_DIMM_SOCKETS (MAX_NUM_CHANNELS * MAX_DIMM_SOCKETS_PER_CHANNEL) |
| 20 | |
| 21 | struct mem_controller { |
Antonello Dettori | 7ea0fe5 | 2016-09-03 10:45:33 +0200 | [diff] [blame] | 22 | pci_devfn_t d0, d0f1; // PCI bus/device/fcns of E7501 memory controller |
Stefan Reinauer | b15975b | 2011-10-21 12:57:59 -0700 | [diff] [blame] | 23 | |
| 24 | // SMBus addresses of DIMM slots for each channel, |
| 25 | // in order from closest to MCH to furthest away |
| 26 | // 0 == not present |
| 27 | uint16_t channel0[MAX_DIMM_SOCKETS_PER_CHANNEL]; |
| 28 | uint16_t channel1[MAX_DIMM_SOCKETS_PER_CHANNEL]; |
| 29 | }; |
| 30 | |
Kyösti Mälkki | 97c064f | 2012-04-18 20:33:35 +0300 | [diff] [blame] | 31 | void e7505_mch_init(const struct mem_controller *memctrl); |
| 32 | void e7505_mch_scrub_ecc(unsigned long ret_addr); |
| 33 | void e7505_mch_done(const struct mem_controller *memctrl); |
Kyösti Mälkki | 93b4ed9 | 2012-04-18 21:13:33 +0300 | [diff] [blame] | 34 | int e7505_mch_is_ready(void); |
| 35 | |
| 36 | |
| 37 | /* Mainboard exports this. */ |
| 38 | int spd_read_byte(unsigned device, unsigned address); |
Stefan Reinauer | b15975b | 2011-10-21 12:57:59 -0700 | [diff] [blame] | 39 | |
| 40 | #endif /* RAMINIT_H */ |