blob: ba93531cb5bc266ab63816652d5135ff2b7e3c47 [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
Felix Held972d9f22022-02-23 16:32:20 +01003#include <arch/hpet.h>
Stefan Reinauera7198b32012-12-11 16:00:47 -08004#include <stdint.h>
Edward O'Callaghan77757c22015-01-04 21:33:39 +11005#include <northbridge/intel/sandybridge/sandybridge.h>
6#include <northbridge/intel/sandybridge/raminit.h>
Vladimir Serbinenko144eea02016-02-10 02:36:04 +01007#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 Reinauera7198b32012-12-11 16:00:47 -080010#include "ec/compal/ene932/ec.h"
11
Arthur Heymans9c538342019-11-12 16:42:33 +010012void mainboard_late_rcba_config(void)
Stefan Reinauera7198b32012-12-11 16:00:47 -080013{
Kyösti Mälkki6f499062015-06-06 11:52:24 +030014 /*
15 * GFX INTA -> PIRQA (MSI)
16 * D28IP_P2IP WLAN INTA -> PIRQB
17 * D28IP_P3IP ETH0 INTC -> PIRQD
18 * D29IP_E1P EHCI1 INTA -> PIRQE
19 * D26IP_E2P EHCI2 INTA -> PIRQE
20 * D31IP_SIP SATA INTA -> PIRQF (MSI)
21 * D31IP_SMIP SMBUS INTB -> PIRQG
22 * D31IP_TTIP THRT INTC -> PIRQH
23 * D27IP_ZIP HDA INTA -> PIRQG (MSI)
24 *
25 * Trackpad DVT PIRQA (16)
26 * Trackpad DVT PIRQE (20)
27 */
28
29 /* Device interrupt pin register (board specific) */
30 RCBA32(D31IP) = (INTC << D31IP_TTIP) | (NOINT << D31IP_SIP2) |
31 (INTB << D31IP_SMIP) | (INTA << D31IP_SIP);
32 RCBA32(D30IP) = (NOINT << D30IP_PIP);
33 RCBA32(D29IP) = (INTA << D29IP_E1P);
34 RCBA32(D28IP) = (NOINT << D28IP_P1IP) | (INTA << D28IP_P2IP) |
35 (INTC << D28IP_P3IP) | (NOINT << D28IP_P4IP) |
36 (NOINT << D28IP_P5IP) | (NOINT << D28IP_P6IP) |
37 (NOINT << D28IP_P7IP) | (NOINT << D28IP_P8IP);
38 RCBA32(D27IP) = (INTA << D27IP_ZIP);
39 RCBA32(D26IP) = (INTA << D26IP_E2P);
40 RCBA32(D25IP) = (NOINT << D25IP_LIP);
41 RCBA32(D22IP) = (NOINT << D22IP_MEI1IP);
42
43 /* Device interrupt route registers */
44 DIR_ROUTE(D31IR, PIRQB, PIRQH, PIRQA, PIRQC);
45 DIR_ROUTE(D29IR, PIRQD, PIRQE, PIRQF, PIRQG);
46 DIR_ROUTE(D28IR, PIRQB, PIRQC, PIRQD, PIRQE);
47 DIR_ROUTE(D27IR, PIRQA, PIRQH, PIRQA, PIRQB);
48 DIR_ROUTE(D26IR, PIRQF, PIRQE, PIRQG, PIRQH);
49 DIR_ROUTE(D25IR, PIRQA, PIRQB, PIRQC, PIRQD);
50 DIR_ROUTE(D22IR, PIRQA, PIRQB, PIRQC, PIRQD);
Stefan Reinauera7198b32012-12-11 16:00:47 -080051}
52
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010053void mainboard_fill_pei_data(struct pei_data *pei_data)
54{
55 struct pei_data pei_data_template = {
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100056 .pei_version = PEI_VERSION,
Angel Ponsd9e58dc2021-01-20 01:22:20 +010057 .mchbar = CONFIG_FIXED_MCHBAR_MMIO_BASE,
58 .dmibar = CONFIG_FIXED_DMIBAR_MMIO_BASE,
59 .epbar = CONFIG_FIXED_EPBAR_MMIO_BASE,
Shelley Chen4e9bb332021-10-20 15:43:45 -070060 .pciexbar = CONFIG_ECAM_MMCONF_BASE_ADDRESS,
Angel Ponsb21bffa2020-07-03 01:02:28 +020061 .smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100062 .wdbbar = 0x4000000,
63 .wdbsize = 0x1000,
Felix Held972d9f22022-02-23 16:32:20 +010064 .hpet_address = HPET_BASE_ADDRESS,
Angel Pons92717ff2020-09-14 16:22:22 +020065 .rcba = (uintptr_t)DEFAULT_RCBA,
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100066 .pmbase = DEFAULT_PMBASE,
67 .gpiobase = DEFAULT_GPIOBASE,
68 .thermalbase = 0xfed08000,
69 .system_type = 0, // 0 Mobile, 1 Desktop/Server
70 .tseg_size = CONFIG_SMM_TSEG_SIZE,
Felix Singer98b51f4cf2021-01-07 02:40:36 +000071 .spd_addresses = { 0xA0, 0x00, 0xA4, 0x00 },
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100072 .ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
73 .ec_present = 1,
Edward O'Callaghanf5037bd2014-05-23 08:36:01 +100074 .max_ddr3_freq = 1600,
75 .usb_port_config = {
Stefan Reinauera7198b32012-12-11 16:00:47 -080076 /* Empty and onboard Ports 0-7, set to un-used pin OC3 */
77 { 0, 3, 0x0000 }, /* P0: Empty */
78 { 1, 0, 0x0040 }, /* P1: Left USB 1 (OC0) */
79 { 1, 1, 0x0040 }, /* P2: Left USB 2 (OC1) */
80 { 1, 1, 0x0040 }, /* P3: Left USB 3 (OC1) */
81 { 0, 3, 0x0000 }, /* P4: Empty */
82 { 0, 3, 0x0000 }, /* P5: Empty */
83 { 0, 3, 0x0000 }, /* P6: Empty */
84 { 0, 3, 0x0000 }, /* P7: Empty */
85 /* Empty and onboard Ports 8-13, set to un-used pin OC4 */
86 { 1, 4, 0x0040 }, /* P8: MiniPCIe (WLAN) (no OC) */
87 { 0, 4, 0x0000 }, /* P9: Empty */
88 { 1, 4, 0x0040 }, /* P10: Camera (no OC) */
89 { 0, 4, 0x0000 }, /* P11: Empty */
90 { 0, 4, 0x0000 }, /* P12: Empty */
91 { 0, 4, 0x0000 }, /* P13: Empty */
92 },
93 };
Vladimir Serbinenkoffbb3c02016-02-10 01:36:25 +010094 *pei_data = pei_data_template;
95}
Stefan Reinauera7198b32012-12-11 16:00:47 -080096
Vladimir Serbinenko144eea02016-02-10 02:36:04 +010097const struct southbridge_usb_port mainboard_usb_ports[] = {
Elyes HAOUAS44f558e2020-02-24 13:26:04 +010098 /* enabled power USB oc pin */
Vladimir Serbinenko144eea02016-02-10 02:36:04 +010099 { 0, 0, -1 }, /* P0: Empty */
100 { 1, 0, 0 }, /* P1: Left USB 1 (OC0) */
101 { 1, 0, 1 }, /* P2: Left USB 2 (OC1) */
102 { 1, 0, 1 }, /* P3: Left USB 3 (OC1) */
103 { 0, 0, -1 }, /* P4: Empty */
104 { 0, 0, -1 }, /* P5: Empty */
105 { 0, 0, -1 }, /* P6: Empty */
106 { 0, 0, -1 }, /* P7: Empty */
107 /* Empty and onboard Ports 8-13, set to un-used pin OC4 */
108 { 1, 0, -1 }, /* P8: MiniPCIe (WLAN) (no OC) */
109 { 0, 0, -1 }, /* P9: Empty */
110 { 1, 0, -1 }, /* P10: Camera (no OC) */
111 { 0, 0, -1 }, /* P11: Empty */
112 { 0, 0, -1 }, /* P12: Empty */
113 { 0, 0, -1 }, /* P13: Empty */
114};
115
Peter Lemenkov498f1cc2019-02-07 10:48:10 +0100116void mainboard_get_spd(spd_raw_data *spd, bool id_only)
117{
Kyösti Mälkkie258b9a2016-11-18 19:59:23 +0200118 read_spd(&spd[0], 0x50, id_only);
119 read_spd(&spd[2], 0x52, id_only);
Vladimir Serbinenko144eea02016-02-10 02:36:04 +0100120}