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