blob: b831244bd5f7994ef684c88a5acd0b8e5b3579f9 [file] [log] [blame]
Duncan Laurieafad0562013-01-14 08:50:03 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2010 coresystems GmbH
5 * Copyright (C) 2011 Google Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <stdint.h>
Aaron Durbinc7633f42013-06-13 17:29:36 -070022#include <stddef.h>
Duncan Laurieafad0562013-01-14 08:50:03 -080023#include <console/console.h>
Aaron Durbin3d0071b2013-01-18 14:32:50 -060024#include "cpu/intel/haswell/haswell.h"
Duncan Laurieafad0562013-01-14 08:50:03 -080025#include "northbridge/intel/haswell/haswell.h"
26#include "northbridge/intel/haswell/raminit.h"
Duncan Laurieafad0562013-01-14 08:50:03 -080027#include "southbridge/intel/lynxpoint/pch.h"
28#include "southbridge/intel/lynxpoint/lp_gpio.h"
Duncan Laurieafad0562013-01-14 08:50:03 -080029#include "gpio.h"
Duncan Laurieafad0562013-01-14 08:50:03 -080030
31const struct rcba_config_instruction rcba_config[] = {
32
33 /*
34 * GFX INTA -> PIRQA (MSI)
35 * D28IP_P1IP WLAN INTA -> PIRQB
36 * D28IP_P4IP ETH0 INTB -> PIRQC
37 * D29IP_E1P EHCI1 INTA -> PIRQD
38 * D20IP_XHCI XHCI INTA -> PIRQA
39 * D31IP_SIP SATA INTA -> PIRQF (MSI)
40 * D31IP_SMIP SMBUS INTB -> PIRQG
41 * D31IP_TTIP THRT INTC -> PIRQH
42 * D27IP_ZIP HDA INTA -> PIRQG (MSI)
43 */
44
45 /* Device interrupt pin register (board specific) */
46 RCBA_SET_REG_32(D31IP, (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) |
47 (INTB << D31IP_SMIP) | (INTA << D31IP_SIP)),
48 RCBA_SET_REG_32(D29IP, (INTA << D29IP_E1P)),
49 RCBA_SET_REG_32(D28IP, (INTA << D28IP_P1IP) | (INTC << D28IP_P3IP) |
50 (INTB << D28IP_P4IP)),
51 RCBA_SET_REG_32(D27IP, (INTA << D27IP_ZIP)),
52 RCBA_SET_REG_32(D26IP, (INTA << D26IP_E2P)),
53 RCBA_SET_REG_32(D25IP, (NOINT << D25IP_LIP)),
54 RCBA_SET_REG_32(D22IP, (NOINT << D22IP_MEI1IP)),
55 RCBA_SET_REG_32(D20IR, (INTA << D20IP_XHCI)),
56
57 /* Device interrupt route registers */
58 RCBA_SET_REG_32(D31IR, DIR_ROUTE(PIRQF, PIRQG, PIRQH, PIRQA)),
59 RCBA_SET_REG_32(D29IR, DIR_ROUTE(PIRQD, PIRQE, PIRQF, PIRQG)),
60 RCBA_SET_REG_32(D28IR, DIR_ROUTE(PIRQB, PIRQC, PIRQD, PIRQE)),
61 RCBA_SET_REG_32(D27IR, DIR_ROUTE(PIRQG, PIRQH, PIRQA, PIRQB)),
62 RCBA_SET_REG_32(D26IR, DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH)),
63 RCBA_SET_REG_32(D25IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),
64 RCBA_SET_REG_32(D22IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),
65 RCBA_SET_REG_32(D21IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),
66 RCBA_SET_REG_32(D20IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),
67 RCBA_SET_REG_32(D23IR, DIR_ROUTE(PIRQA, 0, 0, 0)),
68
69 /* Disable unused devices (board specific) */
70 RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS),
71
72 RCBA_END_CONFIG,
73};
74
Aaron Durbina2671612013-02-06 21:41:01 -060075void mainboard_romstage_entry(unsigned long bist)
Duncan Laurieafad0562013-01-14 08:50:03 -080076{
Duncan Laurieafad0562013-01-14 08:50:03 -080077 struct pei_data pei_data = {
Edward O'Callaghan6aa65092014-05-24 02:06:10 +100078 .pei_version = PEI_VERSION,
79 .mchbar = DEFAULT_MCHBAR,
80 .dmibar = DEFAULT_DMIBAR,
81 .epbar = DEFAULT_EPBAR,
82 .pciexbar = DEFAULT_PCIEXBAR,
83 .smbusbar = SMBUS_IO_BASE,
84 .wdbbar = 0x4000000,
85 .wdbsize = 0x1000,
86 .hpet_address = HPET_ADDR,
87 .rcba = DEFAULT_RCBA,
88 .pmbase = DEFAULT_PMBASE,
89 .gpiobase = DEFAULT_GPIOBASE,
90 .temp_mmio_base = 0xfed08000,
91 .system_type = 5, /* ULT */
92 .tseg_size = CONFIG_SMM_TSEG_SIZE,
93 .spd_addresses = { 0xa2, 0x00, 0xa2, 0x00 },
94 .ec_present = 1,
Duncan Laurieafad0562013-01-14 08:50:03 -080095 // 0 = leave channel enabled
96 // 1 = disable dimm 0 on channel
97 // 2 = disable dimm 1 on channel
98 // 3 = disable dimm 0+1 on channel
Edward O'Callaghan6aa65092014-05-24 02:06:10 +100099 .dimm_channel0_disabled = 2,
100 .dimm_channel1_disabled = 2,
101 .max_ddr3_freq = 1600,
102 .usb2_ports = {
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500103 /* Length, Enable, OCn# */
Duncan Lauriebcfcfa42013-06-03 10:41:12 -0700104 { 0x40, 1, USB_OC_PIN_SKIP, /* P0: */
105 USB_PORT_FRONT_PANEL },
106 { 0x40, 1, USB_OC_PIN_SKIP, /* P1: */
107 USB_PORT_FRONT_PANEL },
108 { 0x40, 1, USB_OC_PIN_SKIP, /* P2: */
109 USB_PORT_FRONT_PANEL },
110 { 0x40, 1, USB_OC_PIN_SKIP, /* P3: */
111 USB_PORT_FRONT_PANEL },
112 { 0x40, 1, USB_OC_PIN_SKIP, /* P4: */
113 USB_PORT_FRONT_PANEL },
114 { 0x40, 1, USB_OC_PIN_SKIP, /* P5: */
115 USB_PORT_FRONT_PANEL },
116 { 0x40, 1, USB_OC_PIN_SKIP, /* P6: */
117 USB_PORT_FRONT_PANEL },
Duncan Laurie8818b9d2013-08-12 14:11:39 -0700118 { 0x40, 0, USB_OC_PIN_SKIP, /* P7: */
Duncan Lauriebcfcfa42013-06-03 10:41:12 -0700119 USB_PORT_FRONT_PANEL },
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500120 },
Edward O'Callaghan6aa65092014-05-24 02:06:10 +1000121 .usb3_ports = {
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500122 /* Enable, OCn# */
123 { 1, USB_OC_PIN_SKIP }, /* P1; */
124 { 1, USB_OC_PIN_SKIP }, /* P2; */
125 { 1, USB_OC_PIN_SKIP }, /* P3; */
126 { 1, USB_OC_PIN_SKIP }, /* P4; */
Duncan Laurieafad0562013-01-14 08:50:03 -0800127 },
128 };
129
Aaron Durbina2671612013-02-06 21:41:01 -0600130 struct romstage_params romstage_params = {
131 .pei_data = &pei_data,
132 .gpio_map = &mainboard_gpio_map,
133 .rcba_config = &rcba_config[0],
134 .bist = bist,
Aaron Durbinc7633f42013-06-13 17:29:36 -0700135 .copy_spd = NULL,
Aaron Durbina2671612013-02-06 21:41:01 -0600136 };
Duncan Laurieafad0562013-01-14 08:50:03 -0800137
Aaron Durbina2671612013-02-06 21:41:01 -0600138 /* Call into the real romstage main with this board's attributes. */
139 romstage_common(&romstage_params);
Duncan Laurieafad0562013-01-14 08:50:03 -0800140}