Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2010 coresystems GmbH |
| 5 | * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <stdint.h> |
Aaron Durbin | c7633f4 | 2013-06-13 17:29:36 -0700 | [diff] [blame] | 18 | #include <stddef.h> |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 19 | #include <console/console.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame] | 20 | #include <cpu/intel/haswell/haswell.h> |
| 21 | #include <northbridge/intel/haswell/haswell.h> |
| 22 | #include <northbridge/intel/haswell/raminit.h> |
| 23 | #include <southbridge/intel/lynxpoint/pch.h> |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 24 | #include "gpio.h" |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 25 | |
Aaron Durbin | 239c2e8 | 2012-12-19 11:31:17 -0600 | [diff] [blame] | 26 | const struct rcba_config_instruction rcba_config[] = { |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 27 | /* |
| 28 | * GFX INTA -> PIRQA (MSI) |
| 29 | * D28IP_P1IP WLAN INTA -> PIRQB |
| 30 | * D28IP_P4IP ETH0 INTB -> PIRQC |
| 31 | * D29IP_E1P EHCI1 INTA -> PIRQD |
| 32 | * D26IP_E2P EHCI2 INTA -> PIRQE |
| 33 | * D31IP_SIP SATA INTA -> PIRQF (MSI) |
| 34 | * D31IP_SMIP SMBUS INTB -> PIRQG |
| 35 | * D31IP_TTIP THRT INTC -> PIRQH |
| 36 | * D27IP_ZIP HDA INTA -> PIRQG (MSI) |
| 37 | */ |
| 38 | |
| 39 | /* Device interrupt pin register (board specific) */ |
Aaron Durbin | 239c2e8 | 2012-12-19 11:31:17 -0600 | [diff] [blame] | 40 | RCBA_SET_REG_32(D31IP, (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) | |
| 41 | (INTB << D31IP_SMIP) | (INTA << D31IP_SIP)), |
| 42 | RCBA_SET_REG_32(D30IP, (NOINT << D30IP_PIP)), |
| 43 | RCBA_SET_REG_32(D29IP, (INTA << D29IP_E1P)), |
| 44 | RCBA_SET_REG_32(D28IP, (INTA << D28IP_P1IP) | (INTC << D28IP_P3IP) | |
| 45 | (INTB << D28IP_P4IP)), |
| 46 | RCBA_SET_REG_32(D27IP, (INTA << D27IP_ZIP)), |
| 47 | RCBA_SET_REG_32(D26IP, (INTA << D26IP_E2P)), |
| 48 | RCBA_SET_REG_32(D25IP, (NOINT << D25IP_LIP)), |
| 49 | RCBA_SET_REG_32(D22IP, (NOINT << D22IP_MEI1IP)), |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 50 | |
| 51 | /* Device interrupt route registers */ |
Aaron Durbin | 239c2e8 | 2012-12-19 11:31:17 -0600 | [diff] [blame] | 52 | RCBA_SET_REG_32(D31IR, DIR_ROUTE(PIRQF, PIRQG, PIRQH, PIRQA)), |
| 53 | RCBA_SET_REG_32(D29IR, DIR_ROUTE(PIRQD, PIRQE, PIRQF, PIRQG)), |
| 54 | RCBA_SET_REG_32(D28IR, DIR_ROUTE(PIRQB, PIRQC, PIRQD, PIRQE)), |
| 55 | RCBA_SET_REG_32(D27IR, DIR_ROUTE(PIRQG, PIRQH, PIRQA, PIRQB)), |
| 56 | RCBA_SET_REG_32(D26IR, DIR_ROUTE(PIRQE, PIRQF, PIRQG, PIRQH)), |
| 57 | RCBA_SET_REG_32(D25IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)), |
| 58 | RCBA_SET_REG_32(D22IR, DIR_ROUTE(PIRQA, PIRQB, PIRQC, PIRQD)), |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 59 | |
| 60 | /* Disable unused devices (board specific) */ |
Aaron Durbin | 239c2e8 | 2012-12-19 11:31:17 -0600 | [diff] [blame] | 61 | RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS), |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 62 | |
Aaron Durbin | 239c2e8 | 2012-12-19 11:31:17 -0600 | [diff] [blame] | 63 | RCBA_END_CONFIG, |
| 64 | }; |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 65 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 66 | void mainboard_romstage_entry(unsigned long bist) |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 67 | { |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 68 | struct pei_data pei_data = { |
Edward O'Callaghan | c686c95 | 2014-05-24 02:07:18 +1000 | [diff] [blame] | 69 | .pei_version = PEI_VERSION, |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 70 | .mchbar = (uintptr_t)DEFAULT_MCHBAR, |
| 71 | .dmibar = (uintptr_t)DEFAULT_DMIBAR, |
Edward O'Callaghan | c686c95 | 2014-05-24 02:07:18 +1000 | [diff] [blame] | 72 | .epbar = DEFAULT_EPBAR, |
| 73 | .pciexbar = DEFAULT_PCIEXBAR, |
| 74 | .smbusbar = SMBUS_IO_BASE, |
| 75 | .wdbbar = 0x4000000, |
| 76 | .wdbsize = 0x1000, |
| 77 | .hpet_address = HPET_ADDR, |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 78 | .rcba = (uintptr_t)DEFAULT_RCBA, |
Edward O'Callaghan | c686c95 | 2014-05-24 02:07:18 +1000 | [diff] [blame] | 79 | .pmbase = DEFAULT_PMBASE, |
| 80 | .gpiobase = DEFAULT_GPIOBASE, |
| 81 | .temp_mmio_base = 0xfed08000, |
| 82 | .system_type = 0, // 0 Mobile, 1 Desktop/Server |
| 83 | .tseg_size = CONFIG_SMM_TSEG_SIZE, |
| 84 | .spd_addresses = { 0xa0, 0xa2, 0xa4, 0xa6 }, |
| 85 | .ec_present = 0, |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 86 | // 0 = leave channel enabled |
| 87 | // 1 = disable dimm 0 on channel |
| 88 | // 2 = disable dimm 1 on channel |
| 89 | // 3 = disable dimm 0+1 on channel |
Edward O'Callaghan | c686c95 | 2014-05-24 02:07:18 +1000 | [diff] [blame] | 90 | .dimm_channel0_disabled = 0, |
| 91 | .dimm_channel1_disabled = 0, |
| 92 | .max_ddr3_freq = 1600, |
| 93 | .usb2_ports = { |
Duncan Laurie | bcfcfa4 | 2013-06-03 10:41:12 -0700 | [diff] [blame] | 94 | /* Length, Enable, OCn#, Location */ |
| 95 | { 0x0040, 1, 0, /* P0: Back USB3 port (OC0) */ |
| 96 | USB_PORT_BACK_PANEL }, |
| 97 | { 0x0040, 1, 0, /* P1: Back USB3 port (OC0) */ |
| 98 | USB_PORT_BACK_PANEL }, |
| 99 | { 0x0040, 1, 1, /* P2: Flex Port on bottom (OC1) */ |
| 100 | USB_PORT_FLEX }, |
| 101 | { 0x0040, 1, USB_OC_PIN_SKIP, /* P3: Dock connector */ |
| 102 | USB_PORT_DOCK }, |
| 103 | { 0x0040, 1, USB_OC_PIN_SKIP, /* P4: Mini PCIE */ |
| 104 | USB_PORT_MINI_PCIE }, |
| 105 | { 0x0040, 1, 1, /* P5: USB eSATA header (OC1) */ |
| 106 | USB_PORT_FLEX }, |
| 107 | { 0x0040, 1, 3, /* P6: Front Header J8H2 (OC3) */ |
| 108 | USB_PORT_FRONT_PANEL }, |
| 109 | { 0x0040, 1, 3, /* P7: Front Header J8H2 (OC3) */ |
| 110 | USB_PORT_FRONT_PANEL }, |
| 111 | { 0x0040, 1, 4, /* P8: USB/LAN Jack (OC4) */ |
| 112 | USB_PORT_FRONT_PANEL }, |
| 113 | { 0x0040, 1, 4, /* P9: USB/LAN Jack (OC4) */ |
| 114 | USB_PORT_FRONT_PANEL }, |
| 115 | { 0x0040, 1, 5, /* P10: Front Header J7H3 (OC5) */ |
| 116 | USB_PORT_FRONT_PANEL }, |
| 117 | { 0x0040, 1, 5, /* P11: Front Header J7H3 (OC5) */ |
| 118 | USB_PORT_FRONT_PANEL }, |
| 119 | { 0x0040, 1, 6, /* P12: USB/DP Jack (OC6) */ |
| 120 | USB_PORT_FRONT_PANEL }, |
| 121 | { 0x0040, 1, 6, /* P13: USB/DP Jack (OC6) */ |
| 122 | USB_PORT_FRONT_PANEL }, |
Aaron Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 123 | }, |
Edward O'Callaghan | c686c95 | 2014-05-24 02:07:18 +1000 | [diff] [blame] | 124 | .usb3_ports = { |
Aaron Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 125 | /* Enable, OCn# */ |
| 126 | { 1, 0 }, /* P1; */ |
| 127 | { 1, 0 }, /* P2; */ |
| 128 | { 1, 0 }, /* P3; */ |
| 129 | { 1, 0 }, /* P4; */ |
| 130 | { 1, 0 }, /* P6; */ |
| 131 | { 1, 0 }, /* P6; */ |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 132 | }, |
| 133 | }; |
| 134 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 135 | struct romstage_params romstage_params = { |
| 136 | .pei_data = &pei_data, |
| 137 | .gpio_map = &mainboard_gpio_map, |
| 138 | .rcba_config = &rcba_config[0], |
| 139 | .bist = bist, |
Aaron Durbin | c7633f4 | 2013-06-13 17:29:36 -0700 | [diff] [blame] | 140 | .copy_spd = NULL, |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 141 | }; |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 142 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 143 | /* Call into the real romstage main with this board's attributes. */ |
| 144 | romstage_common(&romstage_params); |
Aaron Durbin | f6933a6 | 2012-10-30 09:09:39 -0500 | [diff] [blame] | 145 | } |