blob: eae8935163f524b55c773a7fc11e28f8279d8c8d [file] [log] [blame]
Martin Roth5474eb12018-05-26 19:22:33 -06001/*
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 Reinauerb15975b2011-10-21 12:57:59 -070014#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
21struct mem_controller {
Antonello Dettori7ea0fe52016-09-03 10:45:33 +020022 pci_devfn_t d0, d0f1; // PCI bus/device/fcns of E7501 memory controller
Stefan Reinauerb15975b2011-10-21 12:57:59 -070023
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älkki97c064f2012-04-18 20:33:35 +030031void e7505_mch_init(const struct mem_controller *memctrl);
32void e7505_mch_scrub_ecc(unsigned long ret_addr);
33void e7505_mch_done(const struct mem_controller *memctrl);
Kyösti Mälkki93b4ed92012-04-18 21:13:33 +030034int e7505_mch_is_ready(void);
35
36
37/* Mainboard exports this. */
38int spd_read_byte(unsigned device, unsigned address);
Stefan Reinauerb15975b2011-10-21 12:57:59 -070039
40#endif /* RAMINIT_H */