blob: e658d374651c6aeb96067826339379ff6d129ff7 [file] [log] [blame]
Angel Pons54c54722020-04-05 13:20:54 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -08002
Felix Held972d9f22022-02-23 16:32:20 +01003#include <arch/hpet.h>
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -08004#include <stdint.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +11005#include <northbridge/intel/sandybridge/sandybridge.h>
Vladimir Serbinenko421b3402016-02-10 02:39:51 +01006#include <northbridge/intel/sandybridge/raminit.h>
Alexandru Gagniuc83b05eb2015-02-15 14:09:21 -06007#include <northbridge/intel/sandybridge/raminit_native.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +11008#include <southbridge/intel/bd82x6x/pch.h>
Patrick Rudolphe8e66f42016-02-06 17:42:42 +01009#include <southbridge/intel/common/gpio.h>
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -080010
Arthur Heymans9c538342019-11-12 16:42:33 +010011void mainboard_late_rcba_config(void)
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -080012{
Kyösti Mälkki6f499062015-06-06 11:52:24 +030013 /*
14 * GFX INTA -> PIRQA (MSI)
15 * D28IP_P1IP WLAN INTA -> PIRQB
16 * D28IP_P2IP ETH0 INTB -> PIRQF
17 * D28IP_P3IP SDCARD INTC -> PIRQD
18 * D29IP_E1P EHCI1 INTA -> PIRQD
19 * D26IP_E2P EHCI2 INTA -> PIRQF
20 * D31IP_SIP SATA INTA -> PIRQB (MSI)
21 * D31IP_SMIP SMBUS INTB -> PIRQH
22 * D31IP_TTIP THRT INTC -> PIRQA
23 * D27IP_ZIP HDA INTA -> PIRQA (MSI)
24 *
25 * Trackpad interrupt is edge triggered and cannot be shared.
26 * TRACKPAD -> PIRQG
27
28 */
29
30 /* Device interrupt pin register (board specific) */
31 RCBA32(D31IP) = (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) |
32 (INTB << D31IP_SMIP) | (INTA << D31IP_SIP);
33 RCBA32(D29IP) = (INTA << D29IP_E1P);
34 RCBA32(D28IP) = (INTA << D28IP_P1IP) | (INTB << D28IP_P2IP) |
35 (INTC << D28IP_P3IP);
36 RCBA32(D27IP) = (INTA << D27IP_ZIP);
37 RCBA32(D26IP) = (INTA << D26IP_E2P);
38 RCBA32(D25IP) = (NOINT << D25IP_LIP);
39 RCBA32(D22IP) = (NOINT << D22IP_MEI1IP);
40
41 /* Device interrupt route registers */
42 DIR_ROUTE(D31IR, PIRQB, PIRQH, PIRQA, PIRQC);
43 DIR_ROUTE(D29IR, PIRQD, PIRQE, PIRQF, PIRQG);
44 DIR_ROUTE(D28IR, PIRQB, PIRQF, PIRQD, PIRQE);
45 DIR_ROUTE(D27IR, PIRQA, PIRQH, PIRQA, PIRQB);
46 DIR_ROUTE(D26IR, PIRQF, PIRQE, PIRQG, PIRQH);
47 DIR_ROUTE(D25IR, PIRQA, PIRQB, PIRQC, PIRQD);
48 DIR_ROUTE(D22IR, PIRQA, PIRQB, PIRQC, PIRQD);
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -080049}
50
Alexandru Gagniuc83b05eb2015-02-15 14:09:21 -060051const struct southbridge_usb_port mainboard_usb_ports[] = {
Elyes HAOUAS44f558e2020-02-24 13:26:04 +010052 /* enabled power USB oc pin */
Vladimir Serbinenko4a84e472016-02-10 02:51:48 +010053 { 1, 0, -1 }, /* P0: Right USB 3.0 #1 (no OC) */
54 { 1, 0, -1 }, /* P1: Right USB 3.0 #2 (no OC) */
55 { 1, 0, -1 }, /* P2: Camera (no OC) */
56 { 0, 0, -1 }, /* P3: Empty */
57 { 0, 0, -1 }, /* P4: Empty */
58 { 0, 0, -1 }, /* P5: Empty */
59 { 0, 0, -1 }, /* P6: Empty */
60 { 0, 0, -1 }, /* P7: Empty */
61 { 0, 0, -1 }, /* P8: Empty */
62 { 1, 1, -1 }, /* P9: Left USB 1 (no OC) */
63 { 1, 0, -1 }, /* P10: Mini PCIe - WLAN / BT (no OC) */
64 { 0, 0, -1 }, /* P11: Empty */
65 { 0, 0, -1 }, /* P12: Empty */
66 { 0, 0, -1 }, /* P13: Empty */
Alexandru Gagniuc83b05eb2015-02-15 14:09:21 -060067};
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -080068
Peter Lemenkov498f1cc2019-02-07 10:48:10 +010069void mainboard_get_spd(spd_raw_data *spd, bool id_only)
70{
Kyösti Mälkkie258b9a2016-11-18 19:59:23 +020071 read_spd(&spd[0], 0x50, id_only);
72 read_spd(&spd[2], 0x52, id_only);
Stefan Reinauerd7bd4eb2013-02-11 11:11:36 -080073}
Vladimir Serbinenko609bd942016-01-31 14:00:54 +010074
Vladimir Serbinenko421b3402016-02-10 02:39:51 +010075void mainboard_fill_pei_data(struct pei_data *pei_data)
76{
Keith Hui7039edd2023-07-21 10:12:05 -040077 const uint8_t spdaddr[] = {0xA0, 0x00, 0xA4, 0x00};
78
79 memcpy(pei_data->spd_addresses, &spdaddr, sizeof(pei_data->spd_addresses));
80
81 /* TODO: Confirm if nortbridge_fill_pei_data() gets .system_type right (should be 0) */
Vladimir Serbinenko421b3402016-02-10 02:39:51 +010082}