blob: 58c684d98bda12a6babdd2d93b4ab19a5b50acb2 [file] [log] [blame]
Angel Pons60ec3652020-04-03 01:22:13 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbinf6933a62012-10-30 09:09:39 -05002
3#include <stdint.h>
Aaron Durbinc7633f42013-06-13 17:29:36 -07004#include <stddef.h>
Kyösti Mälkkicd7a70f2019-08-17 20:51:08 +03005#include <arch/romstage.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +11006#include <cpu/intel/haswell/haswell.h>
7#include <northbridge/intel/haswell/haswell.h>
8#include <northbridge/intel/haswell/raminit.h>
9#include <southbridge/intel/lynxpoint/pch.h>
Angel Pons279ace62020-07-03 13:43:19 +020010#include <southbridge/intel/common/gpio.h>
Aaron Durbinf6933a62012-10-30 09:09:39 -050011
Angel Pons6e1c4712020-07-03 13:05:10 +020012void mainboard_config_rcba(void)
13{
Aaron Durbinf6933a62012-10-30 09:09:39 -050014 /*
15 * GFX INTA -> PIRQA (MSI)
16 * D28IP_P1IP WLAN INTA -> PIRQB
17 * D28IP_P4IP ETH0 INTB -> PIRQC
18 * D29IP_E1P EHCI1 INTA -> PIRQD
19 * D26IP_E2P EHCI2 INTA -> PIRQE
20 * D31IP_SIP SATA INTA -> PIRQF (MSI)
21 * D31IP_SMIP SMBUS INTB -> PIRQG
22 * D31IP_TTIP THRT INTC -> PIRQH
23 * D27IP_ZIP HDA INTA -> PIRQG (MSI)
24 */
25
26 /* Device interrupt pin register (board specific) */
Angel Pons6e1c4712020-07-03 13:05:10 +020027 RCBA32(D31IP) = (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) |
28 (INTB << D31IP_SMIP) | (INTA << D31IP_SIP);
29 RCBA32(D30IP) = (NOINT << D30IP_PIP);
30 RCBA32(D29IP) = (INTA << D29IP_E1P);
31 RCBA32(D28IP) = (INTA << D28IP_P1IP) | (INTC << D28IP_P3IP) |
32 (INTB << D28IP_P4IP);
33 RCBA32(D27IP) = (INTA << D27IP_ZIP);
34 RCBA32(D26IP) = (INTA << D26IP_E2P);
35 RCBA32(D25IP) = (NOINT << D25IP_LIP);
36 RCBA32(D22IP) = (NOINT << D22IP_MEI1IP);
Aaron Durbinf6933a62012-10-30 09:09:39 -050037
38 /* Device interrupt route registers */
Angel Pons6e1c4712020-07-03 13:05:10 +020039 RCBA32(D31IR) = DIR_ROUTE(PIRQF, PIRQG, PIRQH, PIRQA);
40 RCBA32(D29IR) = DIR_ROUTE(PIRQD, PIRQE, PIRQF, PIRQG);
41 RCBA32(D28IR) = DIR_ROUTE(PIRQB, PIRQC, PIRQD, PIRQE);
42 RCBA32(D27IR) = DIR_ROUTE(PIRQG, PIRQH, PIRQA, PIRQB);
43 RCBA32(D26IR) = DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH);
44 RCBA32(D25IR) = DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD);
45 RCBA32(D22IR) = DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD);
46}
Aaron Durbinf6933a62012-10-30 09:09:39 -050047
Kyösti Mälkki157b1892019-08-16 14:02:25 +030048void mainboard_romstage_entry(void)
Aaron Durbinf6933a62012-10-30 09:09:39 -050049{
Aaron Durbinf6933a62012-10-30 09:09:39 -050050 struct pei_data pei_data = {
Edward O'Callaghanc686c952014-05-24 02:07:18 +100051 .pei_version = PEI_VERSION,
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080052 .mchbar = (uintptr_t)DEFAULT_MCHBAR,
53 .dmibar = (uintptr_t)DEFAULT_DMIBAR,
Edward O'Callaghanc686c952014-05-24 02:07:18 +100054 .epbar = DEFAULT_EPBAR,
Kyösti Mälkki503d3242019-03-05 07:54:28 +020055 .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
Edward O'Callaghanc686c952014-05-24 02:07:18 +100056 .smbusbar = SMBUS_IO_BASE,
Edward O'Callaghanc686c952014-05-24 02:07:18 +100057 .hpet_address = HPET_ADDR,
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080058 .rcba = (uintptr_t)DEFAULT_RCBA,
Edward O'Callaghanc686c952014-05-24 02:07:18 +100059 .pmbase = DEFAULT_PMBASE,
60 .gpiobase = DEFAULT_GPIOBASE,
61 .temp_mmio_base = 0xfed08000,
62 .system_type = 0, // 0 Mobile, 1 Desktop/Server
63 .tseg_size = CONFIG_SMM_TSEG_SIZE,
64 .spd_addresses = { 0xa0, 0xa2, 0xa4, 0xa6 },
65 .ec_present = 0,
Aaron Durbinf6933a62012-10-30 09:09:39 -050066 // 0 = leave channel enabled
67 // 1 = disable dimm 0 on channel
68 // 2 = disable dimm 1 on channel
69 // 3 = disable dimm 0+1 on channel
Edward O'Callaghanc686c952014-05-24 02:07:18 +100070 .dimm_channel0_disabled = 0,
71 .dimm_channel1_disabled = 0,
72 .max_ddr3_freq = 1600,
73 .usb2_ports = {
Duncan Lauriebcfcfa42013-06-03 10:41:12 -070074 /* Length, Enable, OCn#, Location */
75 { 0x0040, 1, 0, /* P0: Back USB3 port (OC0) */
76 USB_PORT_BACK_PANEL },
77 { 0x0040, 1, 0, /* P1: Back USB3 port (OC0) */
78 USB_PORT_BACK_PANEL },
79 { 0x0040, 1, 1, /* P2: Flex Port on bottom (OC1) */
80 USB_PORT_FLEX },
81 { 0x0040, 1, USB_OC_PIN_SKIP, /* P3: Dock connector */
82 USB_PORT_DOCK },
83 { 0x0040, 1, USB_OC_PIN_SKIP, /* P4: Mini PCIE */
84 USB_PORT_MINI_PCIE },
85 { 0x0040, 1, 1, /* P5: USB eSATA header (OC1) */
86 USB_PORT_FLEX },
87 { 0x0040, 1, 3, /* P6: Front Header J8H2 (OC3) */
88 USB_PORT_FRONT_PANEL },
89 { 0x0040, 1, 3, /* P7: Front Header J8H2 (OC3) */
90 USB_PORT_FRONT_PANEL },
91 { 0x0040, 1, 4, /* P8: USB/LAN Jack (OC4) */
92 USB_PORT_FRONT_PANEL },
93 { 0x0040, 1, 4, /* P9: USB/LAN Jack (OC4) */
94 USB_PORT_FRONT_PANEL },
95 { 0x0040, 1, 5, /* P10: Front Header J7H3 (OC5) */
96 USB_PORT_FRONT_PANEL },
97 { 0x0040, 1, 5, /* P11: Front Header J7H3 (OC5) */
98 USB_PORT_FRONT_PANEL },
99 { 0x0040, 1, 6, /* P12: USB/DP Jack (OC6) */
100 USB_PORT_FRONT_PANEL },
101 { 0x0040, 1, 6, /* P13: USB/DP Jack (OC6) */
102 USB_PORT_FRONT_PANEL },
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500103 },
Edward O'Callaghanc686c952014-05-24 02:07:18 +1000104 .usb3_ports = {
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500105 /* Enable, OCn# */
106 { 1, 0 }, /* P1; */
107 { 1, 0 }, /* P2; */
108 { 1, 0 }, /* P3; */
109 { 1, 0 }, /* P4; */
110 { 1, 0 }, /* P6; */
111 { 1, 0 }, /* P6; */
Aaron Durbinf6933a62012-10-30 09:09:39 -0500112 },
113 };
114
Aaron Durbina2671612013-02-06 21:41:01 -0600115 struct romstage_params romstage_params = {
116 .pei_data = &pei_data,
117 .gpio_map = &mainboard_gpio_map,
Aaron Durbinc7633f42013-06-13 17:29:36 -0700118 .copy_spd = NULL,
Aaron Durbina2671612013-02-06 21:41:01 -0600119 };
Aaron Durbinf6933a62012-10-30 09:09:39 -0500120
Aaron Durbina2671612013-02-06 21:41:01 -0600121 /* Call into the real romstage main with this board's attributes. */
122 romstage_common(&romstage_params);
Aaron Durbinf6933a62012-10-30 09:09:39 -0500123}