blob: 81616979a7c6d92651fe06e1a54cf1be743f40ac [file] [log] [blame]
Angel Pons96d93d12020-04-05 13:22:23 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauera7198b32012-12-11 16:00:47 -08002
3#include <stdint.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +11004#include <northbridge/intel/sandybridge/sandybridge.h>
5#include <northbridge/intel/sandybridge/raminit.h>
Vladimir Serbinenko144eea02016-02-10 02:36:04 +01006#include <northbridge/intel/sandybridge/raminit_native.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +11007#include <southbridge/intel/bd82x6x/pch.h>
Patrick Rudolphe8e66f42016-02-06 17:42:42 +01008#include <southbridge/intel/common/gpio.h>
Stefan Reinauera7198b32012-12-11 16:00:47 -08009#include "ec/compal/ene932/ec.h"
10
Arthur Heymans9c538342019-11-12 16:42:33 +010011void mainboard_late_rcba_config(void)
Stefan Reinauera7198b32012-12-11 16:00:47 -080012{
Kyösti Mälkki6f499062015-06-06 11:52:24 +030013 /*
14 * GFX INTA -> PIRQA (MSI)
15 * D28IP_P2IP WLAN INTA -> PIRQB
16 * D28IP_P3IP ETH0 INTC -> PIRQD
17 * D29IP_E1P EHCI1 INTA -> PIRQE
18 * D26IP_E2P EHCI2 INTA -> PIRQE
19 * D31IP_SIP SATA INTA -> PIRQF (MSI)
20 * D31IP_SMIP SMBUS INTB -> PIRQG
21 * D31IP_TTIP THRT INTC -> PIRQH
22 * D27IP_ZIP HDA INTA -> PIRQG (MSI)
23 *
24 * Trackpad DVT PIRQA (16)
25 * Trackpad DVT PIRQE (20)
26 */
27
28 /* Device interrupt pin register (board specific) */
29 RCBA32(D31IP) = (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) |
30 (INTB << D31IP_SMIP) | (INTA << D31IP_SIP);
31 RCBA32(D30IP) = (NOINT << D30IP_PIP);
32 RCBA32(D29IP) = (INTA << D29IP_E1P);
33 RCBA32(D28IP) = (NOINT << D28IP_P1IP) | (INTA << D28IP_P2IP) |
34 (INTC << D28IP_P3IP) | (NOINT << D28IP_P4IP) |
35 (NOINT << D28IP_P5IP) | (NOINT << D28IP_P6IP) |
36 (NOINT << D28IP_P7IP) | (NOINT << D28IP_P8IP);
37 RCBA32(D27IP) = (INTA << D27IP_ZIP);
38 RCBA32(D26IP) = (INTA << D26IP_E2P);
39 RCBA32(D25IP) = (NOINT << D25IP_LIP);
40 RCBA32(D22IP) = (NOINT << D22IP_MEI1IP);
41
42 /* Device interrupt route registers */
43 DIR_ROUTE(D31IR, PIRQB, PIRQH, PIRQA, PIRQC);
44 DIR_ROUTE(D29IR, PIRQD, PIRQE, PIRQF, PIRQG);
45 DIR_ROUTE(D28IR, PIRQB, PIRQC, PIRQD, PIRQE);
46 DIR_ROUTE(D27IR, PIRQA, PIRQH, PIRQA, PIRQB);
47 DIR_ROUTE(D26IR, PIRQF, PIRQE, PIRQG, PIRQH);
48 DIR_ROUTE(D25IR, PIRQA, PIRQB, PIRQC, PIRQD);
49 DIR_ROUTE(D22IR, PIRQA, PIRQB, PIRQC, PIRQD);
Stefan Reinauera7198b32012-12-11 16:00:47 -080050}
51
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010052void mainboard_fill_pei_data(struct pei_data *pei_data)
53{
54 struct pei_data pei_data_template = {
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100055 .pei_version = PEI_VERSION,
Angel Ponsd9e58dc2021-01-20 01:22:20 +010056 .mchbar = CONFIG_FIXED_MCHBAR_MMIO_BASE,
57 .dmibar = CONFIG_FIXED_DMIBAR_MMIO_BASE,
58 .epbar = CONFIG_FIXED_EPBAR_MMIO_BASE,
Shelley Chen4e9bb332021-10-20 15:43:45 -070059 .pciexbar = CONFIG_ECAM_MMCONF_BASE_ADDRESS,
Angel Ponsb21bffa2020-07-03 01:02:28 +020060 .smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100061 .wdbbar = 0x4000000,
62 .wdbsize = 0x1000,
63 .hpet_address = CONFIG_HPET_ADDRESS,
Angel Pons92717ff2020-09-14 16:22:22 +020064 .rcba = (uintptr_t)DEFAULT_RCBA,
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100065 .pmbase = DEFAULT_PMBASE,
66 .gpiobase = DEFAULT_GPIOBASE,
67 .thermalbase = 0xfed08000,
68 .system_type = 0, // 0 Mobile, 1 Desktop/Server
69 .tseg_size = CONFIG_SMM_TSEG_SIZE,
Felix Singer98b51f4cf2021-01-07 02:40:36 +000070 .spd_addresses = { 0xA0, 0x00, 0xA4, 0x00 },
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100071 .ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
72 .ec_present = 1,
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100073 .max_ddr3_freq = 1600,
74 .usb_port_config = {
Stefan Reinauera7198b32012-12-11 16:00:47 -080075 /* Empty and onboard Ports 0-7, set to un-used pin OC3 */
76 { 0, 3, 0x0000 }, /* P0: Empty */
77 { 1, 0, 0x0040 }, /* P1: Left USB 1 (OC0) */
78 { 1, 1, 0x0040 }, /* P2: Left USB 2 (OC1) */
79 { 1, 1, 0x0040 }, /* P3: Left USB 3 (OC1) */
80 { 0, 3, 0x0000 }, /* P4: Empty */
81 { 0, 3, 0x0000 }, /* P5: Empty */
82 { 0, 3, 0x0000 }, /* P6: Empty */
83 { 0, 3, 0x0000 }, /* P7: Empty */
84 /* Empty and onboard Ports 8-13, set to un-used pin OC4 */
85 { 1, 4, 0x0040 }, /* P8: MiniPCIe (WLAN) (no OC) */
86 { 0, 4, 0x0000 }, /* P9: Empty */
87 { 1, 4, 0x0040 }, /* P10: Camera (no OC) */
88 { 0, 4, 0x0000 }, /* P11: Empty */
89 { 0, 4, 0x0000 }, /* P12: Empty */
90 { 0, 4, 0x0000 }, /* P13: Empty */
91 },
92 };
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010093 *pei_data = pei_data_template;
94}
Stefan Reinauera7198b32012-12-11 16:00:47 -080095
Vladimir Serbinenko144eea02016-02-10 02:36:04 +010096const struct southbridge_usb_port mainboard_usb_ports[] = {
Elyes HAOUAS44f558e2020-02-24 13:26:04 +010097 /* enabled power USB oc pin */
Vladimir Serbinenko144eea02016-02-10 02:36:04 +010098 { 0, 0, -1 }, /* P0: Empty */
99 { 1, 0, 0 }, /* P1: Left USB 1 (OC0) */
100 { 1, 0, 1 }, /* P2: Left USB 2 (OC1) */
101 { 1, 0, 1 }, /* P3: Left USB 3 (OC1) */
102 { 0, 0, -1 }, /* P4: Empty */
103 { 0, 0, -1 }, /* P5: Empty */
104 { 0, 0, -1 }, /* P6: Empty */
105 { 0, 0, -1 }, /* P7: Empty */
106 /* Empty and onboard Ports 8-13, set to un-used pin OC4 */
107 { 1, 0, -1 }, /* P8: MiniPCIe (WLAN) (no OC) */
108 { 0, 0, -1 }, /* P9: Empty */
109 { 1, 0, -1 }, /* P10: Camera (no OC) */
110 { 0, 0, -1 }, /* P11: Empty */
111 { 0, 0, -1 }, /* P12: Empty */
112 { 0, 0, -1 }, /* P13: Empty */
113};
114
Peter Lemenkov498f1cc2019-02-07 10:48:10 +0100115void mainboard_get_spd(spd_raw_data *spd, bool id_only)
116{
Kyösti Mälkkie258b9a2016-11-18 19:59:23 +0200117 read_spd(&spd[0], 0x50, id_only);
118 read_spd(&spd[2], 0x52, id_only);
Vladimir Serbinenko144eea02016-02-10 02:36:04 +0100119}
120
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +0100121int mainboard_should_reset_usb(int s3resume)
122{
123 return !s3resume;
Stefan Reinauera7198b32012-12-11 16:00:47 -0800124}