blob: 078e87c85065a61069fcb6eb49897cf3a3000691 [file] [log] [blame]
Angel Pons09481b12020-04-03 01:21:13 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Tristan Corrick36932942018-10-31 03:02:11 +13002
3#include <stdint.h>
Kyösti Mälkkicd7a70f2019-08-17 20:51:08 +03004#include <arch/romstage.h>
Tristan Corrick36932942018-10-31 03:02:11 +13005#include <cpu/intel/haswell/haswell.h>
Kyösti Mälkki3855c012019-03-03 08:45:19 +02006#include <device/pnp_ops.h>
Tristan Corrick36932942018-10-31 03:02:11 +13007#include <northbridge/intel/haswell/haswell.h>
8#include <northbridge/intel/haswell/pei_data.h>
Tristan Corrick09a53232018-12-30 00:59:04 +13009#include <southbridge/intel/common/gpio.h>
Tristan Corrick36932942018-10-31 03:02:11 +130010#include <southbridge/intel/lynxpoint/pch.h>
Tristan Corrick36932942018-10-31 03:02:11 +130011
Angel Pons6e1c4712020-07-03 13:05:10 +020012void mainboard_config_rcba(void)
13{
14 RCBA16(D31IR) = DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQA);
15 RCBA16(D29IR) = DIR_ROUTE(PIRQH, PIRQD, PIRQA, PIRQC);
16 RCBA16(D28IR) = DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD);
17 RCBA16(D27IR) = DIR_ROUTE(PIRQG, PIRQB, PIRQC, PIRQD);
18 RCBA16(D26IR) = DIR_ROUTE(PIRQA, PIRQF, PIRQC, PIRQD);
19 RCBA16(D25IR) = DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH);
20 RCBA16(D22IR) = DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQB);
21 RCBA16(D20IR) = DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD);
22}
Tristan Corrick36932942018-10-31 03:02:11 +130023
Kyösti Mälkki157b1892019-08-16 14:02:25 +030024void mainboard_romstage_entry(void)
Tristan Corrick36932942018-10-31 03:02:11 +130025{
26 struct pei_data pei_data = {
27 .pei_version = PEI_VERSION,
28 .mchbar = (uintptr_t)DEFAULT_MCHBAR,
29 .dmibar = (uintptr_t)DEFAULT_DMIBAR,
30 .epbar = DEFAULT_EPBAR,
Kyösti Mälkki503d3242019-03-05 07:54:28 +020031 .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
Tristan Corrick36932942018-10-31 03:02:11 +130032 .smbusbar = SMBUS_IO_BASE,
Tristan Corrick36932942018-10-31 03:02:11 +130033 .hpet_address = HPET_ADDR,
34 .rcba = (uintptr_t)DEFAULT_RCBA,
35 .pmbase = DEFAULT_PMBASE,
36 .gpiobase = DEFAULT_GPIOBASE,
37 .temp_mmio_base = 0xfed08000,
38 .system_type = 1, /* desktop/server */
39 .tseg_size = CONFIG_SMM_TSEG_SIZE,
40 .spd_addresses = { 0xa0, 0x00, 0xa4, 0x00 },
41 .ec_present = 0,
42 .dimm_channel0_disabled = 2, /* Disable DIMM 1 on channel 0. */
43 .dimm_channel1_disabled = 2, /* Disable DIMM 1 on channel 1. */
44 .max_ddr3_freq = 1600,
45 .usb2_ports = {
46 /* Length, Enable, OCn#, Location */
47 { 0x0040, 1, 0, USB_PORT_BACK_PANEL },
48 { 0x0040, 1, 0, USB_PORT_BACK_PANEL },
49 { 0x0040, 1, 1, USB_PORT_BACK_PANEL },
50 { 0x0040, 1, 1, USB_PORT_BACK_PANEL },
51 { 0x0040, 1, 2, USB_PORT_BACK_PANEL },
52 { 0x0040, 1, 2, USB_PORT_BACK_PANEL },
53 { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
54 { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
55 { 0x0040, 1, 4, USB_PORT_BACK_PANEL },
56 { 0x0040, 1, 4, USB_PORT_BACK_PANEL },
57 { 0x0040, 1, 5, USB_PORT_BACK_PANEL },
58 { 0x0040, 1, 5, USB_PORT_BACK_PANEL },
59 { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
60 { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
61 },
62 .usb3_ports = {
63 /* Enable, OCn# */
64 { 1, 0 },
65 { 1, 0 },
66 { 0, USB_OC_PIN_SKIP },
67 { 0, USB_OC_PIN_SKIP },
68 { 0, USB_OC_PIN_SKIP },
69 { 0, USB_OC_PIN_SKIP },
70 },
71 };
72
73 struct romstage_params romstage_params = {
74 .pei_data = &pei_data,
75 .gpio_map = &mainboard_gpio_map,
Tristan Corrick36932942018-10-31 03:02:11 +130076 };
77
78 romstage_common(&romstage_params);
79}