mb/google/nissa/var/rull: add ssd timing and modify ssd GPIO pins of rtd3
[coreboot2.git] / src / mainboard / dell / xps_8300 / early_init.c
blob5494ac7113543d50d7177ef0d72ca1cc3885ff6b
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <bootblock_common.h>
4 #include <device/pci_ops.h>
5 #include <northbridge/intel/sandybridge/sandybridge.h>
6 #include <superio/ite/common/ite.h>
7 #include <superio/ite/it8772f/it8772f.h>
9 #define GPIO_DEV PNP_DEV(0x2e, IT8772F_GPIO)
10 #define MOUSE_DEV PNP_DEV(0x2e, IT8772F_KBCM)
11 #define EC_DEV PNP_DEV(0x2e, IT8772F_EC)
13 void bootblock_mainboard_early_init(void)
15 pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3f0e);
16 pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0010);
18 /* Set up GPIOs on Super I/O. */
19 ite_ac_resume_southbridge(EC_DEV);
20 ite_reg_write(MOUSE_DEV, 0x30, 0x00); // PS/2 Mouse disable
22 ite_reg_write(EC_DEV, 0x30, 0x01); // Environment controller activate
23 ite_reg_write(EC_DEV, 0x60, 0x0a); // Environment controller MSB Register Base Address
24 ite_reg_write(EC_DEV, 0x61, 0x30); // Environment controller LSB Register Base Address
25 ite_reg_write(EC_DEV, 0x62, 0x0a); // PME Direct Access MSB Register Base Address
26 ite_reg_write(EC_DEV, 0x63, 0x20); // PME Direct Access LSB Register Base Address
28 ite_reg_write(GPIO_DEV, 0x25, 0x00); // GPIO Set 1
29 ite_reg_write(GPIO_DEV, 0x26, 0xfc); // GPIO Set 2, Enable pin 7 and 8 to GPIO
30 ite_reg_write(GPIO_DEV, 0x27, 0x00); // GPIO Set 3
31 ite_reg_write(GPIO_DEV, 0x28, 0x00); // GPIO Set 4
32 ite_reg_write(GPIO_DEV, 0x29, 0x00); // GPIO Set 5 and 6
33 ite_reg_write(GPIO_DEV, 0x2a, 0x00); // Special function 1
34 ite_reg_write(GPIO_DEV, 0x2b, 0x00); // Special function 2
35 ite_reg_write(GPIO_DEV, 0x2c, 0x03); // Special function 3
36 ite_reg_write(GPIO_DEV, 0x60, 0x0a); // SMI MSB Register Base Address
37 ite_reg_write(GPIO_DEV, 0x62, 0x0a); // Simple I/O MSB Register Base Address
38 ite_reg_write(GPIO_DEV, 0xb0, 0x00); // Pin set 1 polarity registers
39 ite_reg_write(GPIO_DEV, 0xb1, 0x00); // Pin set 2 polarity registers
40 ite_reg_write(GPIO_DEV, 0xb2, 0x00); // Pin set 3 polarity registers
41 ite_reg_write(GPIO_DEV, 0xb3, 0x00); // Pin set 4 polarity registers
42 ite_reg_write(GPIO_DEV, 0xb4, 0x00); // Pin set 5 polarity registers
43 ite_reg_write(GPIO_DEV, 0xb8, 0x00); // Pin set 1 int pull-up disable
44 ite_reg_write(GPIO_DEV, 0xb9, 0x00); // Pin set 1 int pull-up disable
45 ite_reg_write(GPIO_DEV, 0xba, 0x00); // Pin set 1 int pull-up disable
46 ite_reg_write(GPIO_DEV, 0xbb, 0x00); // Pin set 1 int pull-up disable
47 ite_reg_write(GPIO_DEV, 0xbc, 0x00); // Pin set 1 int pull-up disable
48 ite_reg_write(GPIO_DEV, 0xbd, 0x00); // Pin set 1 int pull-up disable
49 ite_reg_write(GPIO_DEV, 0xc0, 0x01); // Set Simple I/O functions on SI/O Set 1
50 ite_reg_write(GPIO_DEV, 0xc1, 0x0c); // Set Simple I/O functions on SI/O Set 2
51 ite_reg_write(GPIO_DEV, 0xc2, 0x00); // Set Simple I/O functions on SI/O Set 3
52 ite_reg_write(GPIO_DEV, 0xc3, 0x40); // Set Simple I/O functions on SI/O Set 4
53 ite_reg_write(GPIO_DEV, 0xc4, 0x00); // Set Simple I/O functions on SI/O Set 5
54 ite_reg_write(GPIO_DEV, 0xc8, 0x01); // Set Simple I/O Output on SI/O Set 1
55 ite_reg_write(GPIO_DEV, 0xc9, 0x0c); // Set Simple I/O Output on SI/O Set 2
56 ite_reg_write(GPIO_DEV, 0xca, 0x00); // Set Simple I/O Output on SI/O Set 3
57 ite_reg_write(GPIO_DEV, 0xcb, 0x40); // Set Simple I/O Output on SI/O Set 4
58 ite_reg_write(GPIO_DEV, 0xcc, 0x00); // Set Simple I/O Output on SI/O Set 5
59 ite_reg_write(GPIO_DEV, 0xcd, 0x00); // Set Simple I/O Output on SI/O Set 6
60 ite_reg_write(GPIO_DEV, 0xe9, 0x07); // GPIO Bus Select Control Register
61 ite_reg_write(GPIO_DEV, 0xf6, 0x00); // Hardware Monitor Alert Beep Pin Mapping Register