blob: 092b417657d44c86c2d3ca3a9bb0417e662a83ab [file] [log] [blame]
Angel Pons09481b12020-04-03 01:21:13 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Tristan Corrick36932942018-10-31 03:02:11 +13003
4#include <stdint.h>
Kyösti Mälkkicd7a70f2019-08-17 20:51:08 +03005#include <arch/romstage.h>
Tristan Corrick36932942018-10-31 03:02:11 +13006#include <cpu/intel/haswell/haswell.h>
Kyösti Mälkki3855c012019-03-03 08:45:19 +02007#include <device/pnp_ops.h>
Tristan Corrick36932942018-10-31 03:02:11 +13008#include <northbridge/intel/haswell/haswell.h>
9#include <northbridge/intel/haswell/pei_data.h>
Tristan Corrick09a53232018-12-30 00:59:04 +130010#include <southbridge/intel/common/gpio.h>
Tristan Corrick36932942018-10-31 03:02:11 +130011#include <southbridge/intel/lynxpoint/pch.h>
Tristan Corrick36932942018-10-31 03:02:11 +130012
13static const struct rcba_config_instruction rcba_config[] = {
14 RCBA_SET_REG_16(D31IR, DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQA)),
15 RCBA_SET_REG_16(D29IR, DIR_ROUTE(PIRQH, PIRQD, PIRQA, PIRQC)),
16 RCBA_SET_REG_16(D28IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),
17 RCBA_SET_REG_16(D27IR, DIR_ROUTE(PIRQG, PIRQB, PIRQC, PIRQD)),
18 RCBA_SET_REG_16(D26IR, DIR_ROUTE(PIRQA, PIRQF, PIRQC, PIRQD)),
19 RCBA_SET_REG_16(D25IR, DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH)),
20 RCBA_SET_REG_16(D22IR, DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQB)),
21 RCBA_SET_REG_16(D20IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)),
22
23 RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS),
24
25 RCBA_END_CONFIG,
26};
27
Kyösti Mälkki157b1892019-08-16 14:02:25 +030028void mainboard_romstage_entry(void)
Tristan Corrick36932942018-10-31 03:02:11 +130029{
30 struct pei_data pei_data = {
31 .pei_version = PEI_VERSION,
32 .mchbar = (uintptr_t)DEFAULT_MCHBAR,
33 .dmibar = (uintptr_t)DEFAULT_DMIBAR,
34 .epbar = DEFAULT_EPBAR,
Kyösti Mälkki503d3242019-03-05 07:54:28 +020035 .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
Tristan Corrick36932942018-10-31 03:02:11 +130036 .smbusbar = SMBUS_IO_BASE,
37 .wdbbar = 0x4000000,
38 .wdbsize = 0x1000,
39 .hpet_address = HPET_ADDR,
40 .rcba = (uintptr_t)DEFAULT_RCBA,
41 .pmbase = DEFAULT_PMBASE,
42 .gpiobase = DEFAULT_GPIOBASE,
43 .temp_mmio_base = 0xfed08000,
44 .system_type = 1, /* desktop/server */
45 .tseg_size = CONFIG_SMM_TSEG_SIZE,
46 .spd_addresses = { 0xa0, 0x00, 0xa4, 0x00 },
47 .ec_present = 0,
48 .dimm_channel0_disabled = 2, /* Disable DIMM 1 on channel 0. */
49 .dimm_channel1_disabled = 2, /* Disable DIMM 1 on channel 1. */
50 .max_ddr3_freq = 1600,
51 .usb2_ports = {
52 /* Length, Enable, OCn#, Location */
53 { 0x0040, 1, 0, USB_PORT_BACK_PANEL },
54 { 0x0040, 1, 0, USB_PORT_BACK_PANEL },
55 { 0x0040, 1, 1, USB_PORT_BACK_PANEL },
56 { 0x0040, 1, 1, USB_PORT_BACK_PANEL },
57 { 0x0040, 1, 2, USB_PORT_BACK_PANEL },
58 { 0x0040, 1, 2, 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 { 0x0040, 1, 4, USB_PORT_BACK_PANEL },
62 { 0x0040, 1, 4, USB_PORT_BACK_PANEL },
63 { 0x0040, 1, 5, USB_PORT_BACK_PANEL },
64 { 0x0040, 1, 5, USB_PORT_BACK_PANEL },
65 { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
66 { 0x0040, 0, USB_OC_PIN_SKIP, USB_PORT_SKIP },
67 },
68 .usb3_ports = {
69 /* Enable, OCn# */
70 { 1, 0 },
71 { 1, 0 },
72 { 0, USB_OC_PIN_SKIP },
73 { 0, USB_OC_PIN_SKIP },
74 { 0, USB_OC_PIN_SKIP },
75 { 0, USB_OC_PIN_SKIP },
76 },
77 };
78
79 struct romstage_params romstage_params = {
80 .pei_data = &pei_data,
81 .gpio_map = &mainboard_gpio_map,
82 .rcba_config = &rcba_config[0],
Tristan Corrick36932942018-10-31 03:02:11 +130083 };
84
85 romstage_common(&romstage_params);
86}