Angel Pons | 09481b1 | 2020-04-03 01:21:13 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 3 | |
| 4 | #include <stdint.h> |
Kyösti Mälkki | cd7a70f | 2019-08-17 20:51:08 +0300 | [diff] [blame] | 5 | #include <arch/romstage.h> |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 6 | #include <cpu/intel/haswell/haswell.h> |
Kyösti Mälkki | 3855c01 | 2019-03-03 08:45:19 +0200 | [diff] [blame] | 7 | #include <device/pnp_ops.h> |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 8 | #include <northbridge/intel/haswell/haswell.h> |
| 9 | #include <northbridge/intel/haswell/pei_data.h> |
Tristan Corrick | 09a5323 | 2018-12-30 00:59:04 +1300 | [diff] [blame] | 10 | #include <southbridge/intel/common/gpio.h> |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 11 | #include <southbridge/intel/lynxpoint/pch.h> |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 12 | |
| 13 | static 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älkki | 157b189 | 2019-08-16 14:02:25 +0300 | [diff] [blame] | 28 | void mainboard_romstage_entry(void) |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 29 | { |
| 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älkki | 503d324 | 2019-03-05 07:54:28 +0200 | [diff] [blame] | 35 | .pciexbar = CONFIG_MMCONF_BASE_ADDRESS, |
Tristan Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 36 | .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 Corrick | 3693294 | 2018-10-31 03:02:11 +1300 | [diff] [blame] | 83 | }; |
| 84 | |
| 85 | romstage_common(&romstage_params); |
| 86 | } |