aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake/include
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2015-05-12 18:23:27 -0700
committerLeroy P Leahy <leroy.p.leahy@intel.com>2015-07-16 17:24:48 +0200
commit1d14b3e926c15027f9272f1e80b8913fef8cf25d (patch)
treeb3d89ad4bb1b0ea5ac05d1d7dc6cbf26ec93e6c3 /src/soc/intel/skylake/include
parentb000513741d330947bb832a5835378e35bdfb394 (diff)
soc/intel: Add Skylake SOC support
Add the files to support the Skylake SOC. Matches chromium tree at 927026db BRANCH=none BUG=None TEST=Build and run on a Skylake platform Change-Id: I80248f7e47eaf13b52e3c7ff951eb1976edbaa15 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: http://review.coreboot.org/10341 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/skylake/include')
-rw-r--r--src/soc/intel/skylake/include/soc/acpi.h15
-rw-r--r--src/soc/intel/skylake/include/soc/adsp.h56
-rw-r--r--src/soc/intel/skylake/include/soc/chipset_fsp_util.h41
-rw-r--r--src/soc/intel/skylake/include/soc/cpu.h23
-rw-r--r--src/soc/intel/skylake/include/soc/device_nvs.h33
-rw-r--r--src/soc/intel/skylake/include/soc/ehci.h32
-rw-r--r--src/soc/intel/skylake/include/soc/gpio.h510
-rw-r--r--src/soc/intel/skylake/include/soc/iobp.h28
-rw-r--r--src/soc/intel/skylake/include/soc/iomap.h14
-rw-r--r--src/soc/intel/skylake/include/soc/irq.h (renamed from src/soc/intel/skylake/include/soc/reset.h)24
-rw-r--r--src/soc/intel/skylake/include/soc/lpc.h56
-rw-r--r--src/soc/intel/skylake/include/soc/me.h507
-rw-r--r--src/soc/intel/skylake/include/soc/msr.h19
-rw-r--r--src/soc/intel/skylake/include/soc/nvs.h14
-rw-r--r--src/soc/intel/skylake/include/soc/pch.h38
-rw-r--r--src/soc/intel/skylake/include/soc/pci_devs.h131
-rw-r--r--src/soc/intel/skylake/include/soc/pcr.h104
-rw-r--r--src/soc/intel/skylake/include/soc/pei_data.h25
-rw-r--r--src/soc/intel/skylake/include/soc/pei_wrapper.h11
-rw-r--r--src/soc/intel/skylake/include/soc/pm.h28
-rw-r--r--src/soc/intel/skylake/include/soc/pmc.h71
-rw-r--r--src/soc/intel/skylake/include/soc/ramstage.h24
-rw-r--r--src/soc/intel/skylake/include/soc/rcba.h178
-rw-r--r--src/soc/intel/skylake/include/soc/romstage.h35
-rw-r--r--src/soc/intel/skylake/include/soc/sata.h89
-rw-r--r--src/soc/intel/skylake/include/soc/serialio.h109
-rw-r--r--src/soc/intel/skylake/include/soc/smbus.h9
-rw-r--r--src/soc/intel/skylake/include/soc/smm.h46
-rw-r--r--src/soc/intel/skylake/include/soc/spi.h122
-rw-r--r--src/soc/intel/skylake/include/soc/systemagent.h37
-rw-r--r--src/soc/intel/skylake/include/soc/xhci.h17
31 files changed, 1089 insertions, 1357 deletions
diff --git a/src/soc/intel/skylake/include/soc/acpi.h b/src/soc/intel/skylake/include/soc/acpi.h
index 2b1e77eea0..cd1a6639cc 100644
--- a/src/soc/intel/skylake/include/soc/acpi.h
+++ b/src/soc/intel/skylake/include/soc/acpi.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +15,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_ACPI_H_
-#define _BROADWELL_ACPI_H_
+#ifndef _SOC_ACPI_H_
+#define _SOC_ACPI_H_
#include <arch/acpi.h>
#include <soc/nvs.h>
@@ -29,9 +30,13 @@
#define PSS_LATENCY_TRANSITION 10
#define PSS_LATENCY_BUSMASTER 10
-void acpi_create_intel_hpet(acpi_hpet_t *hpet);
+void acpi_create_serialio_ssdt(acpi_header_t *ssdt);
void acpi_fill_in_fadt(acpi_fadt_t *fadt);
unsigned long acpi_madt_irq_overrides(unsigned long current);
void acpi_init_gnvs(global_nvs_t *gnvs);
+void southcluster_inject_dsdt(device_t device);
+unsigned long southcluster_write_acpi_tables(device_t device,
+ unsigned long current, struct acpi_rsdp *rsdp);
+
+#endif /* _SOC_ACPI_H_ */
-#endif
diff --git a/src/soc/intel/skylake/include/soc/adsp.h b/src/soc/intel/skylake/include/soc/adsp.h
deleted file mode 100644
index 747a123579..0000000000
--- a/src/soc/intel/skylake/include/soc/adsp.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BROADWELL_ADSP_H_
-#define _BROADWELL_ADSP_H_
-
-#define ADSP_PCI_IRQ 23
-#define ADSP_ACPI_IRQ 3
-#define ADSP_ACPI_IRQEN (1 << 3)
-
-#define ADSP_SHIM_BASE_LPT 0xe7000
-#define ADSP_SHIM_BASE_WPT 0xfb000
-#define ADSP_SHIM_LTRC 0xe0
-#define ADSP_SHIM_LTRC_VALUE 0x3003
-#define ADSP_SHIM_IMC 0x28
-#define ADSP_SHIM_IPCD 0x40
-
-#define ADSP_PCI_VDRTCTL0 0xa0
-#define ADSP_VDRTCTL0_D3PGD_LPT (1 << 1)
-#define ADSP_VDRTCTL0_D3PGD_WPT (1 << 0)
-#define ADSP_VDRTCTL0_D3SRAMPGD_LPT (1 << 2)
-#define ADSP_VDRTCTL0_D3SRAMPGD_WPT (1 << 1)
-#define ADSP_PCI_VDRTCTL1 0xa4
-#define ADSP_PCI_VDRTCTL2 0xa8
-#define ADSP_VDRTCTL2_VALUE 0x00000fff
-
-#define ADSP_IOBP_VDLDAT1 0xd7000624
-#define ADSP_VDLDAT1_VALUE 0x00040100
-#define ADSP_IOBP_VDLDAT2 0xd7000628
-#define ADSP_IOBP_ACPI_IRQ3 0xd9d8
-#define ADSP_IOBP_ACPI_IRQ3I 0xd8d9
-#define ADSP_IOBP_ACPI_IRQ4 0xdbda
-#define ADSP_IOBP_PMCTL 0xd70001e0
-#define ADSP_PMCTL_VALUE 0x3f
-#define ADSP_IOBP_PCICFGCTL 0xd7000500
-#define ADSP_PCICFGCTL_PCICD (1 << 0)
-#define ADSP_PCICFGCTL_ACPIIE (1 << 1)
-#define ADSP_PCICFGCTL_SPCBAD (1 << 7)
-
-#endif
diff --git a/src/soc/intel/skylake/include/soc/chipset_fsp_util.h b/src/soc/intel/skylake/include/soc/chipset_fsp_util.h
new file mode 100644
index 0000000000..2c05f01b79
--- /dev/null
+++ b/src/soc/intel/skylake/include/soc/chipset_fsp_util.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Intel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc.
+ */
+
+#ifndef _CHIPSET_FSP_UTIL_H_
+#define _CHIPSET_FSP_UTIL_H_
+
+/*
+ * Include the FSP binary interface files
+ *
+ * These files include the necessary UEFI constants and data structures
+ * that are used to interface to the FSP binary.
+ */
+
+#include <uefi_types.h> /* UEFI data types */
+#include <IntelFspPkg/Include/FspApi.h> /* FSP API definitions */
+#include <IntelFspPkg/Include/FspInfoHeader.h> /* FSP binary layout */
+#include <MdePkg/Include/Pi/PiBootMode.h> /* UEFI boot mode definitions */
+#include <MdePkg/Include/Pi/PiFirmwareFile.h> /* UEFI file definitions */
+#include <MdePkg/Include/Pi/PiFirmwareVolume.h> /* UEFI file system defs */
+#include <MdePkg/Include/Uefi/UefiMultiPhase.h> /* UEFI memory types */
+#include <MdePkg/Include/Pi/PiHob.h> /* Hand off block definitions */
+#include <MdePkg/Include/Library/HobLib.h> /* HOB routine declarations */
+#include <FspUpdVpd.h> /* Vital/updatable product data definitions */
+
+#endif /* _CHIPSET_FSP_UTIL_H_ */
diff --git a/src/soc/intel/skylake/include/soc/cpu.h b/src/soc/intel/skylake/include/soc/cpu.h
index 312532d68a..c62b3080c9 100644
--- a/src/soc/intel/skylake/include/soc/cpu.h
+++ b/src/soc/intel/skylake/include/soc/cpu.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,29 +15,21 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_CPU_H_
-#define _BROADWELL_CPU_H_
+#ifndef _SOC_CPU_H_
+#define _SOC_CPU_H_
#include <arch/cpu.h>
#include <device/device.h>
/* CPU types */
-#define HASWELL_FAMILY_ULT 0x40650
-#define BROADWELL_FAMILY_ULT 0x306d0
+#define SKYLAKE_FAMILY_ULT 0x406e0
/* Supported CPUIDs */
-#define CPUID_HASWELL_A0 0x306c1
-#define CPUID_HASWELL_B0 0x306c2
-#define CPUID_HASWELL_C0 0x306c3
-#define CPUID_HASWELL_ULT_B0 0x40650
-#define CPUID_HASWELL_ULT 0x40651
-#define CPUID_HASWELL_HALO 0x40661
-#define CPUID_BROADWELL_C0 0x306d2
-#define CPUID_BROADWELL_D0 0x306d3
-#define CPUID_BROADWELL_E0 0x306d4
+#define CPUID_SKYLAKE_C0 0x406e2
+#define CPUID_SKYLAKE_D0 0x406e3
/* CPU bus clock is fixed at 100MHz */
#define CPU_BCLK 100
@@ -53,7 +46,7 @@
(((1 << ((base)*5)) * (limit)) / 1000)
#define C_STATE_LATENCY_FROM_LAT_REG(reg) \
C_STATE_LATENCY_MICRO_SECONDS(C_STATE_LATENCY_CONTROL_ ##reg## _LIMIT, \
- (IRTL_1024_NS >> 10))
+ (IRTL_1024_NS >> 10))
/* Configure power limits for turbo mode */
void set_power_limits(u8 power_limit_1_time);
diff --git a/src/soc/intel/skylake/include/soc/device_nvs.h b/src/soc/intel/skylake/include/soc/device_nvs.h
index 7dab40da6a..822c976a15 100644
--- a/src/soc/intel/skylake/include/soc/device_nvs.h
+++ b/src/soc/intel/skylake/include/soc/device_nvs.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,31 +15,33 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_DEVICE_NVS_H_
-#define _BROADWELL_DEVICE_NVS_H_
+#ifndef _SOC_DEVICE_NVS_H_
+#define _SOC_DEVICE_NVS_H_
#include <stdint.h>
/* Offset in Global NVS where this structure lives */
#define DEVICE_NVS_OFFSET 0x1000
-#define SIO_NVS_DMA 0
-#define SIO_NVS_I2C0 1
-#define SIO_NVS_I2C1 2
-#define SIO_NVS_SPI0 3
-#define SIO_NVS_SPI1 4
-#define SIO_NVS_UART0 5
-#define SIO_NVS_UART1 6
-#define SIO_NVS_SDIO 7
-#define SIO_NVS_ADSP 8
+#define SIO_NVS_I2C0 0
+#define SIO_NVS_I2C1 1
+#define SIO_NVS_I2C2 2
+#define SIO_NVS_I2C3 3
+#define SIO_NVS_I2C4 4
+#define SIO_NVS_I2C5 5
+#define SIO_NVS_SPI0 6
+#define SIO_NVS_SPI1 7
+#define SIO_NVS_UART0 8
+#define SIO_NVS_UART1 9
+#define SIO_NVS_UART2 10
typedef struct {
- u8 enable[9];
- u32 bar0[9];
- u32 bar1[9];
+ u8 enable[11];
+ u32 bar0[11];
+ u32 bar1[11];
} __attribute__((packed)) device_nvs_t;
#endif
diff --git a/src/soc/intel/skylake/include/soc/ehci.h b/src/soc/intel/skylake/include/soc/ehci.h
deleted file mode 100644
index 44d51ef311..0000000000
--- a/src/soc/intel/skylake/include/soc/ehci.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BROADWELL_EHCI_H_
-#define _BROADWELL_EHCI_H_
-
-/* EHCI Memory Registers */
-#define EHCI_USB_CMD 0x20
-#define EHCI_USB_CMD_RUN (1 << 0)
-#define EHCI_USB_CMD_PSE (1 << 4)
-#define EHCI_USB_CMD_ASE (1 << 5)
-#define EHCI_PORTSC(port) (0x64 + (port * 4))
-#define EHCI_PORTSC_ENABLED (1 << 2)
-#define EHCI_PORTSC_SUSPEND (1 << 7)
-
-#endif
diff --git a/src/soc/intel/skylake/include/soc/gpio.h b/src/soc/intel/skylake/include/soc/gpio.h
index a0359755d2..efc666f4cd 100644
--- a/src/soc/intel/skylake/include/soc/gpio.h
+++ b/src/soc/intel/skylake/include/soc/gpio.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +15,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_GPIO_H_
-#define _BROADWELL_GPIO_H_
+#ifndef _SOC_GPIO_H_
+#define _SOC_GPIO_H_
#include <stdint.h>
@@ -39,11 +40,115 @@
#define GPIO_CONFIG0(gpio) (0x100 + ((gpio) * 8))
#define GPIO_CONFIG1(gpio) (0x104 + ((gpio) * 8))
-#define MAX_GPIO_NUMBER 94 /* zero based */
+/*
+ * GPP_Ax to GPP_Gx;
+ * where x=24 [between GPIO Community A to F]
+ * = 7 [only for GPIO Community G]
+ */
+#define MAX_GPIO_NUMBER 151 /* zero based */
#define GPIO_LIST_END 0xffffffff
-/* conf0 */
+/*
+ * Skylake LP GPIO PIN to Pad Mapping
+ */
+#define GPIO_LP_GROUP_A 0x0
+#define GPIO_LP_GROUP_B 0x1
+#define GPIO_LP_GROUP_C 0x2
+#define GPIO_LP_GROUP_D 0x3
+#define GPIO_LP_GROUP_E 0x4
+#define GPIO_LP_GROUP_F 0x5
+#define GPIO_LP_GROUP_G 0x6
+
+#define GPIO_LP_GROUP_GPP_A 0x0200
+#define GPIO_LP_GROUP_GPP_B 0x0201
+#define GPIO_LP_GROUP_GPP_C 0x0202
+#define GPIO_LP_GROUP_GPP_D 0x0203
+#define GPIO_LP_GROUP_GPP_E 0x0204
+#define GPIO_LP_GROUP_GPP_F 0x0205
+#define GPIO_LP_GROUP_GPP_G 0x0206
+
+#define GPIO_GROUP_SHIFT 16
+#define MAX_GPIO_PIN_PER_GROUP 24
+
+/* GPIO TX STATE */
+#define B_PCH_GPIO_TX_STATE 0x0001
+#define N_PCH_GPIO_TX_STATE 0
+
+/* Interrupt number */
+#define B_PCH_GPIO_INTSEL 0x7F
+#define N_PCH_GPIO_INTSEL 0
+
+/* Structure for storing information about registers offset, community,
+ * maximal pad number, smi status and smi enable for available groups
+ */
+typedef struct {
+ u32 community;
+ u32 padcfgoffset;
+ u32 padpergroup;
+ u32 smistsoffset;
+ u32 smienoffset;
+} GPIO_GROUP_INFO;
+
+/*
+ * GPIO Community 0 Registers are for GPP_A and GPP_B groups
+ */
+#define R_PCH_PCR_GPIO_GPP_A_PADCFG_OFFSET 0x400
+#define R_PCH_PCR_GPIO_GPP_B_PADCFG_OFFSET 0x4C0
+#define R_PCH_PCR_GPIO_GPP_A_SMI_STS 0x0180
+#define R_PCH_PCR_GPIO_GPP_B_SMI_STS 0x0184
+#define R_PCH_PCR_GPIO_GPP_A_SMI_EN 0x01A0
+#define R_PCH_PCR_GPIO_GPP_B_SMI_EN 0x01A4
+
+/*
+ * GPIO Community 1 Registers are for GPP_C, GPP_D, GPP_E groups
+ */
+#define R_PCH_PCR_GPIO_GPP_C_PADCFG_OFFSET 0x400
+#define R_PCH_PCR_GPIO_GPP_D_PADCFG_OFFSET 0x4C0
+#define R_PCH_PCR_GPIO_GPP_E_PADCFG_OFFSET 0x580
+#define R_PCH_PCR_GPIO_GPP_C_SMI_STS 0x0180
+#define R_PCH_PCR_GPIO_GPP_D_SMI_STS 0x0184
+#define R_PCH_PCR_GPIO_GPP_E_SMI_STS 0x0188
+#define R_PCH_PCR_GPIO_GPP_C_SMI_EN 0x01A0
+#define R_PCH_PCR_GPIO_GPP_D_SMI_EN 0x01A4
+#define R_PCH_PCR_GPIO_GPP_E_SMI_EN 0x01A8
+
+/*
+ * GPIO Community 3 Registers are for GPP_F and GPP_G groups
+ */
+#define R_PCH_PCR_GPIO_GPP_F_PADCFG_OFFSET 0x400
+#define R_PCH_PCR_GPIO_GPP_G_PADCFG_OFFSET 0x4C0
+/*
+ * GPIO Community 2 Registers are for GPP_DSW
+ */
+#define R_PCH_PCR_GPIO_GPD_PADCFG_OFFSET 0x400
+
+#define READ 0
+#define WRITE 1
+
+/* If in GPIO_GROUP_INFO structure certain register doesn't exist
+ * it will have value equal to NO_REGISTER_PROPERTY
+ */
+#define NO_REGISTER_PROPERTY (~0u)
+
+#define V_PCH_GPIO_GPP_A_PAD_MAX 24
+#define V_PCH_GPIO_GPP_B_PAD_MAX 24
+#define V_PCH_GPIO_GPP_C_PAD_MAX 24
+#define V_PCH_GPIO_GPP_D_PAD_MAX 24
+#define V_PCH_GPIO_GPP_E_PAD_MAX 24
+#define V_PCH_GPIO_GPP_F_PAD_MAX 24
+#define V_PCH_GPIO_GPP_G_PAD_MAX 8
+#define V_PCH_GPIO_GPD_PAD_MAX 12
+
+/* SOC has 8 GPIO communities GPP A~G, GPD */
+#define GPIO_COMMUNITY_MAX 8
+
+#define GPIO_GET_GROUP_INDEX(group) (group & 0xFF)
+#define GPIO_GET_GROUP_INDEX_FROM_PAD(pad) (\
+ GPIO_GET_GROUP_INDEX((pad >> 16)))
+#define GPIO_GET_PAD_NUMBER(pad) (pad & 0xFFFF)
+
+/* conf0 */
#define GPIO_MODE_NATIVE (0 << 0)
#define GPIO_MODE_GPIO (1 << 0)
@@ -66,7 +171,6 @@
#define GPO_LEVEL_HIGH (GPIO_OUT_HIGH << GPO_LEVEL_SHIFT)
/* conf1 */
-
#define GPIO_PULL_NONE (0 << 0)
#define GPIO_PULL_DOWN (1 << 0)
#define GPIO_PULL_UP (2 << 0)
@@ -75,27 +179,22 @@
#define GPIO_SENSE_DISABLE (1 << 2)
/* owner */
-
#define GPIO_OWNER_ACPI 0
#define GPIO_OWNER_GPIO 1
/* route */
-
#define GPIO_ROUTE_SCI 0
#define GPIO_ROUTE_SMI 1
/* irqen */
-
#define GPIO_IRQ_DISABLE 0
#define GPIO_IRQ_ENABLE 1
/* blink */
-
#define GPO_NO_BLINK 0
#define GPO_BLINK 1
/* reset */
-
#define GPIO_RESET_PWROK 0
#define GPIO_RESET_RSMRST 1
@@ -170,23 +269,388 @@ struct gpio_config {
u8 pirq;
} __attribute__ ((packed));
-/* Configure GPIOs with mainboard provided settings */
-void init_one_gpio(int gpio_num, struct gpio_config *config);
-void init_gpios(const struct gpio_config config[]);
-/* Get GPIO pin value */
-int get_gpio(int gpio_num);
+/* For any GpioPad usage in code use GPIO_PAD type*/
+typedef u32 GPIO_PAD;
+
+/* For any GpioGroup usage in code use GPIO_GROUP type */
+typedef u32 GPIO_GROUP;
+
+/*
+ * GPIO configuration structure used for pin programming.
+ * Structure contains fields that can be used to configure pad.
+ */
+typedef struct {
+ /*
+ Pad Mode
+ Pad can be set as GPIO or one of its native functions.
+ When in native mode setting Direction, OutputState, Interrupt is unnecessary.
+ Refer to definition of GPIO_PAD_MODE.
+ Refer to EDS for each native mode according to the pad.
+ */
+ u32 PadMode : 4;
+ /*
+ Host Software Pad Ownership
+ Set pad to ACPI mode or GPIO Driver Mode.
+ Refer to definition of GPIO_HOSTSW_OWN.
+ */
+ u32 HostSoftPadOwn : 2;
+ /*
+ GPIO Direction
+ Can choose between In, In with inversion Out, both In and Out, both In with inversion and out or d
+ isabling both.
+ Refer to definition of GPIO_DIRECTION for supported settings.
+ */
+ u32 Direction : 5;
+ /*
+ Output State
+ Set Pad output value.
+ Refer to definition of GPIO_OUTPUT_STATE for supported settings.
+ This setting takes place when output is enabled.
+ */
+ u32 OutputState : 2;
+ /*
+ GPIO Interrupt Configuration
+ Set Pad to cause one of interrupts (IOxAPIC/SCI/SMI/NMI). This setting is applicable only if GPIO
+ A is in input mode.
+ If GPIO is set to cause an SCI then also Gpe is enabled for this pad.
+ Refer to definition of GPIO_INT_CONFIG for supported settings.
+ */
+ u32 InterruptConfig : 8;
+ /*
+ GPIO Power Configuration.
+ This setting controls Pad Reset Configuration and Power Rail Type.
+ Refer to definition of GPIO_RESET_CONFIG for supported settings.
+ */
+ u32 PowerConfig : 4;
+ /*
+ GPIO Electrical Configuration
+ This setting controls pads termination and voltage tolerance.
+ Refer to definition of GPIO_ELECTRICAL_CONFIG for supported settings.
+ */
+ u32 ElectricalConfig : 7;
+ /*
+ GPIO Lock Configuration
+ This setting controls pads lock.
+ Refer to definition of GPIO_LOCK_CONFIG for supported settings.
+ */
+ u32 LockConfig : 3;
+ /*
+ Additional GPIO configuration
+ Refer to definition of GPIO_OTHER_CONFIG for supported settings.
+ */
+ u32 OtherSettings : 2;
+ u32 RsvdBits : 27;
+} GPIO_CONFIG;
+
+typedef struct {
+ GPIO_PAD GpioPad;
+ GPIO_CONFIG GpioConfig;
+} GPIO_INIT_CONFIG;
+
+typedef enum {
+ GpioHardwareDefault = 0x0
+} GPIO_HARDWARE_DEFAULT;
+
+/* GPIO Pad Mode */
+typedef enum {
+ GpioPadModeGpio = 0x1,
+ GpioPadModeNative1 = 0x3,
+ GpioPadModeNative2 = 0x5,
+ GpioPadModeNative3 = 0x7,
+ GpioPadModeNative4 = 0x9,
+} GPIO_PAD_MODE;
+
+/* Host Software Pad Ownership modes */
+typedef enum {
+ GpioHostOwnDefault = 0x0, /* Leave ownership value unmodified */
+ GpioHostOwnAcpi = 0x1, /* Set HOST ownership to ACPI */
+ GpioHostOwnGpio = 0x3 /* Set HOST ownership to GPIO */
+} GPIO_HOSTSW_OWN;
+
+/* GPIO Direction */
+typedef enum {
+ GpioDirDefault = 0x0, /* Leave pad direction setting unmodified */
+ GpioDirInOut = (0x1 | (0x1 << 3)), /* Set pad for both output and input */
+ GpioDirInInvOut = (0x1 | (0x3 << 3)), /* Set pad for both output and input with inversion */
+ GpioDirIn = (0x3 | (0x1 << 3)), /* Set pad for input only */
+ GpioDirInInv = (0x3 | (0x3 << 3)), /* Set pad for input with inversion */
+ GpioDirOut = 0x5, /* Set pad for output only */
+ GpioDirNone = 0x7 /* Disable both output and input */
+} GPIO_DIRECTION;
+
+/* GPIO Output State */
+typedef enum {
+ GpioOutDefault = 0x0,
+ GpioOutLow = 0x1,
+ GpioOutHigh = 0x3
+} GPIO_OUTPUT_STATE;
+
+/*
+ * GPIO interrupt configuration
+ * This setting is applicable only if GPIO is in input mode.
+ * GPIO_INT_CONFIG allows to choose which interrupt is generted
+ * (IOxAPIC/SCI/SMI/NMI) and how it is triggered (edge or level).
+ * Field from GpioIntNmi to GpioIntApic can be OR'ed with GpioIntLevel to
+ * GpioIntBothEdgecan to describe an interrupt e.g. GpioIntApic | GpioIntLevel
+ * If GPIO is set to cause an SCI then also Gpe is enabled for this pad.
+ * Not all GPIO are capable of generating an SMI or NMI interrupt
+ */
+typedef enum {
+ GpioIntDefault = 0x0, /* Leave value of interrupt routing unmodified */
+ GpioIntDis = 0x1, /* Disable IOxAPIC/SCI/SMI/NMI interrupt generation */
+ GpioIntNmi = 0x3, /* Enable NMI interrupt only */
+ GpioIntSmi = 0x5, /* Enable SMI interrupt only */
+ GpioIntSci = 0x9, /* Enable SCI interrupt only */
+ GpioIntApic = 0x11, /* Enable IOxAPIC interrupt only */
+ GpioIntLevel = (0x1 << 5), /* Set interrupt as level triggered */
+ GpioIntEdge = (0x3 << 5), /* Set interrupt as edge triggered */
+ GpioIntLvlEdgDis = (0x5 << 5), /* Disable interrupt trigger */
+ GpioIntBothEdge = (0x7 << 5) /* Set interrupt as both edge triggered */
+} GPIO_INT_CONFIG;
+
+/*
+ * GPIO Power Configuration
+ * GPIO_RESET_CONFIG allows to set GPIO Reset (used to reset the specified
+ * Pad Register fields).
+ */
+typedef enum {
+ GpioResetDefault = 0x0, /* Leave value of pad reset unmodified */
+ GpioResetPwrGood = 0x1, /* Powergood reset */
+ GpioResetDeep = 0x3, /* Deep GPIO Reset */
+ GpioResetNormal = 0x5, /* GPIO Reset */
+ GpioResetResume = 0x7 /* Resume Reset */
+} GPIO_RESET_CONFIG;
+
+typedef int gpio_t;
+
+/* Clear GPIO SMI Status */
+void clear_all_smi(void);
-/* Set GPIO pin value */
-void set_gpio(int gpio_num, int value);
+/* Get GPIO SMI Status */
+void get_smi_status(u32 status[GPIO_COMMUNITY_MAX]);
-/* Return non-zero if gpio is set to native function. 0 otherwise. */
-int gpio_is_native(int gpio_num);
+/* Enable GPIO SMI */
+void enable_all_smi(void);
+
+/* Enable GPIO individual Group SMI */
+void enable_gpio_groupsmi(gpio_t gpio_num, u32 mask);
/*
- * Get a number comprised of multiple GPIO values. gpio_num_array points to
- * the array of gpio pin numbers to scan, terminated by -1.
+ * GPIO Electrical Configuration
+ * Set GPIO termination and Pad Tolerance (applicable only for some pads)
+ * Field from GpioTermDefault to GpioTermNative can be OR'ed with
+ * GpioTolerance1v8.
*/
-unsigned get_gpios(const int *gpio_num_array);
+typedef enum {
+ GpioTermDefault = 0x0, /* Leave termination setting unmodified */
+ GpioTermNone = 0x1, /* none */
+ GpioTermWpd5K = 0x5, /* 5kOhm weak pull-down */
+ GpioTermWpd20K = 0x9, /* 20kOhm weak pull-down */
+ GpioTermWpu1K = 0x13, /* 1kOhm weak pull-up */
+ GpioTermWpu2K = 0x17, /* 2kOhm weak pull-up */
+ GpioTermWpu5K = 0x15, /* 5kOhm weak pull-up */
+ GpioTermWpu20K = 0x19, /* 20kOhm weak pull-up */
+ GpioTermWpu1K2K = 0x1B, /* 1kOhm & 2kOhm weak pull-up */
+ GpioTermNative = 0x1F, /* Native function for pads termination */
+ GpioNoTolerance1v8 = (0x1 << 5), /* Disable 1.8V pad tolerance */
+ GpioTolerance1v8 = (0x3 << 5) /* Enable 1.8V pad tolerance */
+} GPIO_ELECTRICAL_CONFIG;
+/*
+ * GPIO LockConfiguration
+ * Set GPIO configuration lock and output state lock
+ * GpioLockPadConfig and GpioLockOutputState can be OR'ed
+ */
+typedef enum {
+ GpioLockDefault = 0x0, /* Leave lock setting unmodified */
+ GpioPadConfigLock = 0x3, /* Lock Pad Configuration */
+ GpioOutputStateLock = 0x5 /* Lock GPIO pad output value */
+} GPIO_LOCK_CONFIG;
+
+/*
+ * Other GPIO Configuration GPIO_OTHER_CONFIG is used for less often
+ * settings and for future extensions Supported settings:
+ * - RX raw override to '1' - allows to override input value to '1'
+ * This is applicable only if in input mode (both in GPIO and native usage)
+ * The override takes place at the internal pad state directly from buffer
+ * and before the RXINV.
+ */
+typedef enum {
+ GpioRxRaw1Default = 0x0, /* Use default input override value */
+ GpioRxRaw1Dis = 0x1, /* Don't override input */
+ GpioRxRaw1En = 0x3 /* Override input to '1' */
+} GPIO_OTHER_CONFIG;
+
+/*
+ * LP GPIO pins: Use below for functions from PCH GPIO Lib which
+ * require GpioPad as argument. Encoding used here
+ * has all information required by library functions
+ */
+#define GPIO_LP_GPP_A0 0x02000000
+#define GPIO_LP_GPP_A1 0x02000001
+#define GPIO_LP_GPP_A2 0x02000002
+#define GPIO_LP_GPP_A3 0x02000003
+#define GPIO_LP_GPP_A4 0x02000004
+#define GPIO_LP_GPP_A5 0x02000005
+#define GPIO_LP_GPP_A6 0x02000006
+#define GPIO_LP_GPP_A7 0x02000007
+#define GPIO_LP_GPP_A8 0x02000008
+#define GPIO_LP_GPP_A9 0x02000009
+#define GPIO_LP_GPP_A10 0x0200000A
+#define GPIO_LP_GPP_A11 0x0200000B
+#define GPIO_LP_GPP_A12 0x0200000C
+#define GPIO_LP_GPP_A13 0x0200000D
+#define GPIO_LP_GPP_A14 0x0200000E
+#define GPIO_LP_GPP_A15 0x0200000F
+#define GPIO_LP_GPP_A16 0x02000010
+#define GPIO_LP_GPP_A17 0x02000011
+#define GPIO_LP_GPP_A18 0x02000012
+#define GPIO_LP_GPP_A19 0x02000013
+#define GPIO_LP_GPP_A20 0x02000014
+#define GPIO_LP_GPP_A21 0x02000015
+#define GPIO_LP_GPP_A22 0x02000016
+#define GPIO_LP_GPP_A23 0x02000017
+#define GPIO_LP_GPP_B0 0x02010000
+#define GPIO_LP_GPP_B1 0x02010001
+#define GPIO_LP_GPP_B2 0x02010002
+#define GPIO_LP_GPP_B3 0x02010003
+#define GPIO_LP_GPP_B4 0x02010004
+#define GPIO_LP_GPP_B5 0x02010005
+#define GPIO_LP_GPP_B6 0x02010006
+#define GPIO_LP_GPP_B7 0x02010007
+#define GPIO_LP_GPP_B8 0x02010008
+#define GPIO_LP_GPP_B9 0x02010009
+#define GPIO_LP_GPP_B10 0x0201000A
+#define GPIO_LP_GPP_B11 0x0201000B
+#define GPIO_LP_GPP_B12 0x0201000C
+#define GPIO_LP_GPP_B13 0x0201000D
+#define GPIO_LP_GPP_B14 0x0201000E
+#define GPIO_LP_GPP_B15 0x0201000F
+#define GPIO_LP_GPP_B16 0x02010010
+#define GPIO_LP_GPP_B17 0x02010011
+#define GPIO_LP_GPP_B18 0x02010012
+#define GPIO_LP_GPP_B19 0x02010013
+#define GPIO_LP_GPP_B20 0x02010014
+#define GPIO_LP_GPP_B21 0x02010015
+#define GPIO_LP_GPP_B22 0x02010016
+#define GPIO_LP_GPP_B23 0x02010017
+#define GPIO_LP_GPP_C0 0x02020000
+#define GPIO_LP_GPP_C1 0x02020001
+#define GPIO_LP_GPP_C2 0x02020002
+#define GPIO_LP_GPP_C3 0x02020003
+#define GPIO_LP_GPP_C4 0x02020004
+#define GPIO_LP_GPP_C5 0x02020005
+#define GPIO_LP_GPP_C6 0x02020006
+#define GPIO_LP_GPP_C7 0x02020007
+#define GPIO_LP_GPP_C8 0x02020008
+#define GPIO_LP_GPP_C9 0x02020009
+#define GPIO_LP_GPP_C10 0x0202000A
+#define GPIO_LP_GPP_C11 0x0202000B
+#define GPIO_LP_GPP_C12 0x0202000C
+#define GPIO_LP_GPP_C13 0x0202000D
+#define GPIO_LP_GPP_C14 0x0202000E
+#define GPIO_LP_GPP_C15 0x0202000F
+#define GPIO_LP_GPP_C16 0x02020010
+#define GPIO_LP_GPP_C17 0x02020011
+#define GPIO_LP_GPP_C18 0x02020012
+#define GPIO_LP_GPP_C19 0x02020013
+#define GPIO_LP_GPP_C20 0x02020014
+#define GPIO_LP_GPP_C21 0x02020015
+#define GPIO_LP_GPP_C22 0x02020016
+#define GPIO_LP_GPP_C23 0x02020017
+#define GPIO_LP_GPP_D0 0x02030000
+#define GPIO_LP_GPP_D1 0x02030001
+#define GPIO_LP_GPP_D2 0x02030002
+#define GPIO_LP_GPP_D3 0x02030003
+#define GPIO_LP_GPP_D4 0x02030004
+#define GPIO_LP_GPP_D5 0x02030005
+#define GPIO_LP_GPP_D6 0x02030006
+#define GPIO_LP_GPP_D7 0x02030007
+#define GPIO_LP_GPP_D8 0x02030008
+#define GPIO_LP_GPP_D9 0x02030009
+#define GPIO_LP_GPP_D10 0x0203000A
+#define GPIO_LP_GPP_D11 0x0203000B
+#define GPIO_LP_GPP_D12 0x0203000C
+#define GPIO_LP_GPP_D13 0x0203000D
+#define GPIO_LP_GPP_D14 0x0203000E
+#define GPIO_LP_GPP_D15 0x0203000F
+#define GPIO_LP_GPP_D16 0x02030010
+#define GPIO_LP_GPP_D17 0x02030011
+#define GPIO_LP_GPP_D18 0x02030012
+#define GPIO_LP_GPP_D19 0x02030013
+#define GPIO_LP_GPP_D20 0x02030014
+#define GPIO_LP_GPP_D21 0x02030015
+#define GPIO_LP_GPP_D22 0x02030016
+#define GPIO_LP_GPP_D23 0x02030017
+#define GPIO_LP_GPP_E0 0x02040000
+#define GPIO_LP_GPP_E1 0x02040001
+#define GPIO_LP_GPP_E2 0x02040002
+#define GPIO_LP_GPP_E3 0x02040003
+#define GPIO_LP_GPP_E4 0x02040004
+#define GPIO_LP_GPP_E5 0x02040005
+#define GPIO_LP_GPP_E6 0x02040006
+#define GPIO_LP_GPP_E7 0x02040007
+#define GPIO_LP_GPP_E8 0x02040008
+#define GPIO_LP_GPP_E9 0x02040009
+#define GPIO_LP_GPP_E10 0x0204000A
+#define GPIO_LP_GPP_E11 0x0204000B
+#define GPIO_LP_GPP_E12 0x0204000C
+#define GPIO_LP_GPP_E13 0x0204000D
+#define GPIO_LP_GPP_E14 0x0204000E
+#define GPIO_LP_GPP_E15 0x0204000F
+#define GPIO_LP_GPP_E16 0x02040010
+#define GPIO_LP_GPP_E17 0x02040011
+#define GPIO_LP_GPP_E18 0x02040012
+#define GPIO_LP_GPP_E19 0x02040013
+#define GPIO_LP_GPP_E20 0x02040014
+#define GPIO_LP_GPP_E21 0x02040015
+#define GPIO_LP_GPP_E22 0x02040016
+#define GPIO_LP_GPP_E23 0x02040017
+#define GPIO_LP_GPP_F0 0x02050000
+#define GPIO_LP_GPP_F1 0x02050001
+#define GPIO_LP_GPP_F2 0x02050002
+#define GPIO_LP_GPP_F3 0x02050003
+#define GPIO_LP_GPP_F4 0x02050004
+#define GPIO_LP_GPP_F5 0x02050005
+#define GPIO_LP_GPP_F6 0x02050006
+#define GPIO_LP_GPP_F7 0x02050007
+#define GPIO_LP_GPP_F8 0x02050008
+#define GPIO_LP_GPP_F9 0x02050009
+#define GPIO_LP_GPP_F10 0x0205000A
+#define GPIO_LP_GPP_F11 0x0205000B
+#define GPIO_LP_GPP_F12 0x0205000C
+#define GPIO_LP_GPP_F13 0x0205000D
+#define GPIO_LP_GPP_F14 0x0205000E
+#define GPIO_LP_GPP_F15 0x0205000F
+#define GPIO_LP_GPP_F16 0x02050010
+#define GPIO_LP_GPP_F17 0x02050011
+#define GPIO_LP_GPP_F18 0x02050012
+#define GPIO_LP_GPP_F19 0x02050013
+#define GPIO_LP_GPP_F20 0x02050014
+#define GPIO_LP_GPP_F21 0x02050015
+#define GPIO_LP_GPP_F22 0x02050016
+#define GPIO_LP_GPP_F23 0x02050017
+#define GPIO_LP_GPP_G0 0x02060000
+#define GPIO_LP_GPP_G1 0x02060001
+#define GPIO_LP_GPP_G2 0x02060002
+#define GPIO_LP_GPP_G3 0x02060003
+#define GPIO_LP_GPP_G4 0x02060004
+#define GPIO_LP_GPP_G5 0x02060005
+#define GPIO_LP_GPP_G6 0x02060006
+#define GPIO_LP_GPP_G7 0x02060007
+#define GPIO_LP_GPD0 0x02070000
+#define GPIO_LP_GPD1 0x02070001
+#define GPIO_LP_GPD2 0x02070002
+#define GPIO_LP_GPD3 0x02070003
+#define GPIO_LP_GPD4 0x02070004
+#define GPIO_LP_GPD5 0x02070005
+#define GPIO_LP_GPD6 0x02070006
+#define GPIO_LP_GPD7 0x02070007
+#define GPIO_LP_GPD8 0x02070008
+#define GPIO_LP_GPD9 0x02070009
+#define GPIO_LP_GPD10 0x0207000A
+#define GPIO_LP_GPD11 0x0207000B
+
+#define END_OF_GPIO_TABLE 0xFFFFFFFF
#endif
diff --git a/src/soc/intel/skylake/include/soc/iobp.h b/src/soc/intel/skylake/include/soc/iobp.h
deleted file mode 100644
index 9f17692508..0000000000
--- a/src/soc/intel/skylake/include/soc/iobp.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BROADWELL_IOBP_H_
-#define _BROADWELL_IOBP_H_
-
-u32 pch_iobp_read(u32 address);
-void pch_iobp_write(u32 address, u32 data);
-void pch_iobp_update(u32 address, u32 andvalue, u32 orvalue);
-void pch_iobp_exec(u32 addr, u16 op_dcode, u8 route_id, u32 *data, u8 *resp);
-
-#endif
diff --git a/src/soc/intel/skylake/include/soc/iomap.h b/src/soc/intel/skylake/include/soc/iomap.h
index bb98975d85..05c5419f49 100644
--- a/src/soc/intel/skylake/include/soc/iomap.h
+++ b/src/soc/intel/skylake/include/soc/iomap.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +15,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_IOMAP_H_
-#define _BROADWELL_IOMAP_H_
+#ifndef _SOC_IOMAP_H_
+#define _SOC_IOMAP_H_
#define MCFG_BASE_ADDRESS CONFIG_MMCONF_BASE_ADDRESS
#define MCFG_BASE_SIZE 0x4000000
@@ -38,12 +39,16 @@
#define GDXC_BASE_ADDRESS 0xfed84000
#define GDXC_BASE_SIZE 0x1000
+/* TODO: need to remove RCBA code after ASL clean up */
#define RCBA_BASE_ADDRESS 0xfed1c000
#define RCBA_BASE_SIZE 0x4000
#define HPET_BASE_ADDRESS 0xfed00000
-#define ACPI_BASE_ADDRESS 0x1000
+#define PCH_PWRM_BASE_ADDRESS 0xfe000000
+#define PCH_PWRM_BASE_SIZE 0x10000
+
+#define ACPI_BASE_ADDRESS 0x1800
#define ACPI_BASE_SIZE 0x100
#define GPIO_BASE_ADDRESS 0x1400
@@ -55,7 +60,6 @@
/* Temporary addresses used in romstage */
#define EARLY_GTT_BAR 0xe0000000
#define EARLY_XHCI_BAR 0xd7000000
-#define EARLY_EHCI_BAR CONFIG_EHCI_BAR
#define EARLY_UART_BAR CONFIG_TTYS0_BASE
#define EARLY_TEMP_MMIO 0xfed08000
diff --git a/src/soc/intel/skylake/include/soc/reset.h b/src/soc/intel/skylake/include/soc/irq.h
index 6f21181a0c..7f3fd65617 100644
--- a/src/soc/intel/skylake/include/soc/reset.h
+++ b/src/soc/intel/skylake/include/soc/irq.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -11,15 +12,22 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _BROADWELL_RESET_H_
-#define _BROADWELL_RESET_H_
+#ifndef _SOC_IRQ_H_
+#define _SOC_IRQ_H_
-void reset_system(void);
+#define LPSS_I2C0_IRQ 16
+#define LPSS_I2C1_IRQ 17
+#define LPSS_I2C2_IRQ 18
+#define LPSS_I2C3_IRQ 19
+#define LPSS_I2C4_IRQ 34
+#define LPSS_I2C5_IRQ 33
+#define LPSS_SPI0_IRQ 22
+#define LPSS_SPI1_IRQ 23
+#define LPSS_UART0_IRQ 20
+#define LPSS_UART1_IRQ 21
+#define LPSS_UART2_IRQ 32
+#define SDIO_IRQ 22
-#endif
+#endif /* _SOC_IRQ_H_ */
diff --git a/src/soc/intel/skylake/include/soc/lpc.h b/src/soc/intel/skylake/include/soc/lpc.h
index 180e527c9e..4e826d7688 100644
--- a/src/soc/intel/skylake/include/soc/lpc.h
+++ b/src/soc/intel/skylake/include/soc/lpc.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,16 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_LPC_H_
-#define _BROADWELL_LPC_H_
+#ifndef _SOC_LPC_H_
+#define _SOC_LPC_H_
/* PCI Configuration Space (D31:F0): LPC */
-#define SERIRQ_CNTL 0x64
-#define PMBASE 0x40
-#define ACPI_CNTL 0x44
+#define ABASE 0x40
+#define ACNTL 0x44
#define ACPI_EN (1 << 7)
#define SCI_IRQ_SEL (7 << 0)
#define SCIS_IRQ9 0
@@ -33,23 +33,10 @@
#define SCIS_IRQ21 5
#define SCIS_IRQ22 6
#define SCIS_IRQ23 7
-#define GPIOBASE 0x48
-#define BIOS_CNTL 0xdc
-#define GPIO_BASE 0x48 /* LPC GPIO Base Address Register */
-#define GPIO_CNTL 0x4C /* LPC GPIO Control Register */
-#define GPIO_EN (1 << 4)
-#define GPIO_ROUT 0xb8
-
-#define PIRQA_ROUT 0x60
-#define PIRQB_ROUT 0x61
-#define PIRQC_ROUT 0x62
-#define PIRQD_ROUT 0x63
-#define PIRQE_ROUT 0x68
-#define PIRQF_ROUT 0x69
-#define PIRQG_ROUT 0x6A
-#define PIRQH_ROUT 0x6B
-
+#define SERIRQ_CNTL 0x64
#define LPC_IO_DEC 0x80 /* IO Decode Ranges Register */
+#define COMA_RANGE 0x0 /* 0x3F8 - 0x3FF COM1*/
+#define COMB_RANGE 0x1 /* 0x2F8 - 0x2FF COM2*/
#define LPC_EN 0x82 /* LPC IF Enables Register */
#define CNF2_LPC_EN (1 << 13) /* 0x4e/0x4f */
#define CNF1_LPC_EN (1 << 12) /* 0x2e/0x2f */
@@ -66,28 +53,5 @@
#define LPC_GEN3_DEC 0x8c /* LPC IF Generic Decode Range 3 */
#define LPC_GEN4_DEC 0x90 /* LPC IF Generic Decode Range 4 */
#define LGMR 0x98 /* LPC Generic Memory Range */
-#define RCBA 0xf0 /* Root Complex Register Block */
-
-/* Power Management */
-
-#define GEN_PMCON_1 0xa0
-#define SMI_LOCK (1 << 4)
-#define GEN_PMCON_2 0xa2
-#define SYSTEM_RESET_STS (1 << 4)
-#define THERMTRIP_STS (1 << 3)
-#define SYSPWR_FLR (1 << 1)
-#define PWROK_FLR (1 << 0)
-#define GEN_PMCON_3 0xa4
-#define SUS_PWR_FLR (1 << 14)
-#define GEN_RST_STS (1 << 9)
-#define RTC_BATTERY_DEAD (1 << 2)
-#define PWR_FLR (1 << 1)
-#define SLEEP_AFTER_POWER_FAIL (1 << 0)
-#define GEN_PMCON_LOCK 0xa6
-#define SLP_STR_POL_LOCK (1 << 2)
-#define ACPI_BASE_LOCK (1 << 1)
-#define PMIR 0xac
-#define PMIR_CF9LOCK (1 << 31)
-#define PMIR_CF9GR (1 << 20)
-
+#define BIOS_CNTL 0xdc
#endif
diff --git a/src/soc/intel/skylake/include/soc/me.h b/src/soc/intel/skylake/include/soc/me.h
deleted file mode 100644
index 3973fc85bf..0000000000
--- a/src/soc/intel/skylake/include/soc/me.h
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BROADWELL_ME_H_
-#define _BROADWELL_ME_H_
-
-#include <console/loglevel.h>
-
-#define ME_RETRY 100000 /* 1 second */
-#define ME_DELAY 10 /* 10 us */
-
-/*
- * Management Engine PCI registers
- */
-
-#define PCI_CPU_MEBASE_L 0x70 /* Set by MRC */
-#define PCI_CPU_MEBASE_H 0x74 /* Set by MRC */
-
-#define PCI_ME_HFS 0x40
-#define ME_HFS_CWS_RESET 0
-#define ME_HFS_CWS_INIT 1
-#define ME_HFS_CWS_REC 2
-#define ME_HFS_CWS_NORMAL 5
-#define ME_HFS_CWS_WAIT 6
-#define ME_HFS_CWS_TRANS 7
-#define ME_HFS_CWS_INVALID 8
-#define ME_HFS_STATE_PREBOOT 0
-#define ME_HFS_STATE_M0_UMA 1
-#define ME_HFS_STATE_M3 4
-#define ME_HFS_STATE_M0 5
-#define ME_HFS_STATE_BRINGUP 6
-#define ME_HFS_STATE_ERROR 7
-#define ME_HFS_ERROR_NONE 0
-#define ME_HFS_ERROR_UNCAT 1
-#define ME_HFS_ERROR_IMAGE 3
-#define ME_HFS_ERROR_DEBUG 4
-#define ME_HFS_MODE_NORMAL 0
-#define ME_HFS_MODE_DEBUG 2
-#define ME_HFS_MODE_DIS 3
-#define ME_HFS_MODE_OVER_JMPR 4
-#define ME_HFS_MODE_OVER_MEI 5
-#define ME_HFS_BIOS_DRAM_ACK 1
-#define ME_HFS_ACK_NO_DID 0
-#define ME_HFS_ACK_RESET 1
-#define ME_HFS_ACK_PWR_CYCLE 2
-#define ME_HFS_ACK_S3 3
-#define ME_HFS_ACK_S4 4
-#define ME_HFS_ACK_S5 5
-#define ME_HFS_ACK_GBL_RESET 6
-#define ME_HFS_ACK_CONTINUE 7
-
-struct me_hfs {
- u32 working_state: 4;
- u32 mfg_mode: 1;
- u32 fpt_bad: 1;
- u32 operation_state: 3;
- u32 fw_init_complete: 1;
- u32 ft_bup_ld_flr: 1;
- u32 update_in_progress: 1;
- u32 error_code: 4;
- u32 operation_mode: 4;
- u32 reserved: 4;
- u32 boot_options_present: 1;
- u32 ack_data: 3;
- u32 bios_msg_ack: 4;
-} __attribute__ ((packed));
-
-#define PCI_ME_UMA 0x44
-
-struct me_uma {
- u32 size: 6;
- u32 reserved_1: 10;
- u32 valid: 1;
- u32 reserved_0: 14;
- u32 set_to_one: 1;
-} __attribute__ ((packed));
-
-#define PCI_ME_H_GS 0x4c
-#define ME_INIT_DONE 1
-#define ME_INIT_STATUS_SUCCESS 0
-#define ME_INIT_STATUS_NOMEM 1
-#define ME_INIT_STATUS_ERROR 2
-#define ME_INIT_STATUS_SUCCESS_OTHER 3 /* SEE ME9 BWG */
-
-#define ME_HSIO_MESSAGE (7 << 28)
-#define ME_HSIO_CMD_GETHSIOVER 1
-#define ME_HSIO_CMD_CLOSE 0
-
-struct me_did {
- u32 uma_base: 16;
- u32 reserved: 7;
- u32 rapid_start: 1;
- u32 status: 4;
- u32 init_done: 4;
-} __attribute__ ((packed));
-
-/*
- * Apparently the GMES register is renamed to HFS2 (or HFSTS2 according
- * to ME9 BWG). Sadly the PCH EDS and the ME BWG do not match on nomenclature.
- */
-#define PCI_ME_HFS2 0x48
-/* Infrastructure Progress Values */
-#define ME_HFS2_PHASE_ROM 0
-#define ME_HFS2_PHASE_BUP 1
-#define ME_HFS2_PHASE_UKERNEL 2
-#define ME_HFS2_PHASE_POLICY 3
-#define ME_HFS2_PHASE_MODULE_LOAD 4
-#define ME_HFS2_PHASE_UNKNOWN 5
-#define ME_HFS2_PHASE_HOST_COMM 6
-/* Current State - Based on Infra Progress values. */
-/* ROM State */
-#define ME_HFS2_STATE_ROM_BEGIN 0
-#define ME_HFS2_STATE_ROM_DISABLE 6
-/* BUP State */
-#define ME_HFS2_STATE_BUP_INIT 0
-#define ME_HFS2_STATE_BUP_DIS_HOST_WAKE 1
-#define ME_HFS2_STATE_BUP_FLOW_DET 4
-#define ME_HFS2_STATE_BUP_VSCC_ERR 8
-#define ME_HFS2_STATE_BUP_CHECK_STRAP 0xa
-#define ME_HFS2_STATE_BUP_PWR_OK_TIMEOUT 0xb
-#define ME_HFS2_STATE_BUP_MANUF_OVRD_STRAP 0xd
-#define ME_HFS2_STATE_BUP_M3 0x11
-#define ME_HFS2_STATE_BUP_M0 0x12
-#define ME_HFS2_STATE_BUP_FLOW_DET_ERR 0x13
-#define ME_HFS2_STATE_BUP_M3_CLK_ERR 0x15
-#define ME_HFS2_STATE_BUP_CPU_RESET_DID_TIMEOUT_MEM_MISSING 0x17
-#define ME_HFS2_STATE_BUP_M3_KERN_LOAD 0x18
-#define ME_HFS2_STATE_BUP_T32_MISSING 0x1c
-#define ME_HFS2_STATE_BUP_WAIT_DID 0x1f
-#define ME_HFS2_STATE_BUP_WAIT_DID_FAIL 0x20
-#define ME_HFS2_STATE_BUP_DID_NO_FAIL 0x21
-#define ME_HFS2_STATE_BUP_ENABLE_UMA 0x22
-#define ME_HFS2_STATE_BUP_ENABLE_UMA_ERR 0x23
-#define ME_HFS2_STATE_BUP_SEND_DID_ACK 0x24
-#define ME_HFS2_STATE_BUP_SEND_DID_ACK_ERR 0x25
-#define ME_HFS2_STATE_BUP_M0_CLK 0x26
-#define ME_HFS2_STATE_BUP_M0_CLK_ERR 0x27
-#define ME_HFS2_STATE_BUP_TEMP_DIS 0x28
-#define ME_HFS2_STATE_BUP_M0_KERN_LOAD 0x32
-/* Policy Module State */
-#define ME_HFS2_STATE_POLICY_ENTRY 0
-#define ME_HFS2_STATE_POLICY_RCVD_S3 3
-#define ME_HFS2_STATE_POLICY_RCVD_S4 4
-#define ME_HFS2_STATE_POLICY_RCVD_S5 5
-#define ME_HFS2_STATE_POLICY_RCVD_UPD 6
-#define ME_HFS2_STATE_POLICY_RCVD_PCR 7
-#define ME_HFS2_STATE_POLICY_RCVD_NPCR 8
-#define ME_HFS2_STATE_POLICY_RCVD_HOST_WAKE 9
-#define ME_HFS2_STATE_POLICY_RCVD_AC_DC 0xa
-#define ME_HFS2_STATE_POLICY_RCVD_DID 0xb
-#define ME_HFS2_STATE_POLICY_VSCC_NOT_FOUND 0xc
-#define ME_HFS2_STATE_POLICY_VSCC_INVALID 0xd
-#define ME_HFS2_STATE_POLICY_FPB_ERR 0xe
-#define ME_HFS2_STATE_POLICY_DESCRIPTOR_ERR 0xf
-#define ME_HFS2_STATE_POLICY_VSCC_NO_MATCH 0x10
-/* Current PM Event Values */
-#define ME_HFS2_PMEVENT_CLEAN_MOFF_MX_WAKE 0
-#define ME_HFS2_PMEVENT_MOFF_MX_WAKE_ERROR 1
-#define ME_HFS2_PMEVENT_CLEAN_GLOBAL_RESET 2
-#define ME_HFS2_PMEVENT_CLEAN_GLOBAL_RESET_ERROR 3
-#define ME_HFS2_PMEVENT_CLEAN_ME_RESET 4
-#define ME_HFS2_PMEVENT_ME_RESET_EXCEPTION 5
-#define ME_HFS2_PMEVENT_PSEUDO_ME_RESET 6
-#define ME_HFS2_PMEVENT_S0MO_SXM3 7
-#define ME_HFS2_PMEVENT_SXM3_S0M0 8
-#define ME_HFS2_PMEVENT_NON_PWR_CYCLE_RESET 9
-#define ME_HFS2_PMEVENT_PWR_CYCLE_RESET_M3 0xa
-#define ME_HFS2_PMEVENT_PWR_CYCLE_RESET_MOFF 0xb
-#define ME_HFS2_PMEVENT_SXMX_SXMOFF 0xc
-
-struct me_hfs2 {
- u32 bist_in_progress: 1;
- u32 reserved1: 2;
- u32 invoke_mebx: 1;
- u32 cpu_replaced_sts: 1;
- u32 mbp_rdy: 1;
- u32 mfs_failure: 1;
- u32 warm_reset_request: 1;
- u32 cpu_replaced_valid: 1;
- u32 reserved2: 4;
- u32 mbp_cleared: 1;
- u32 reserved3: 2;
- u32 current_state: 8;
- u32 current_pmevent: 4;
- u32 progress_code: 4;
-} __attribute__ ((packed));
-
-#define PCI_ME_HFS5 0x68
-
-#define PCI_ME_H_GS2 0x70
-#define PCI_ME_MBP_GIVE_UP 0x01
-
-#define PCI_ME_HERES 0xbc
-#define PCI_ME_EXT_SHA1 0x00
-#define PCI_ME_EXT_SHA256 0x02
-#define PCI_ME_HER(x) (0xc0+(4*(x)))
-
-struct me_heres {
- u32 extend_reg_algorithm: 4;
- u32 reserved: 26;
- u32 extend_feature_present: 1;
- u32 extend_reg_valid: 1;
-} __attribute__ ((packed));
-
-/*
- * Management Engine MEI registers
- */
-
-#define MEI_H_CB_WW 0x00
-#define MEI_H_CSR 0x04
-#define MEI_ME_CB_RW 0x08
-#define MEI_ME_CSR_HA 0x0c
-
-struct mei_csr {
- u32 interrupt_enable: 1;
- u32 interrupt_status: 1;
- u32 interrupt_generate: 1;
- u32 ready: 1;
- u32 reset: 1;
- u32 reserved: 3;
- u32 buffer_read_ptr: 8;
- u32 buffer_write_ptr: 8;
- u32 buffer_depth: 8;
-} __attribute__ ((packed));
-
-#define MEI_ADDRESS_CORE 0x01
-#define MEI_ADDRESS_AMT 0x02
-#define MEI_ADDRESS_RESERVED 0x03
-#define MEI_ADDRESS_WDT 0x04
-#define MEI_ADDRESS_MKHI 0x07
-#define MEI_ADDRESS_ICC 0x08
-#define MEI_ADDRESS_THERMAL 0x09
-
-#define MEI_HOST_ADDRESS 0
-
-struct mei_header {
- u32 client_address: 8;
- u32 host_address: 8;
- u32 length: 9;
- u32 reserved: 6;
- u32 is_complete: 1;
-} __attribute__ ((packed));
-
-#define MKHI_GROUP_ID_CBM 0x00
-#define MKHI_GLOBAL_RESET 0x0b
-#define MKHI_GROUP_ID_FWCAPS 0x03
-#define MKHI_FWCAPS_GET_RULE 0x02
-#define MKHI_GROUP_ID_HMRFPO 0x05
-#define MKHI_HMRFPO_LOCK 0x02
-#define MKHI_HMRFPO_LOCK_NOACK 0x05
-#define MKHI_GROUP_ID_MDES 0x08
-#define MKHI_MDES_ENABLE 0x09
-#define MKHI_GROUP_ID_GEN 0xff
-#define MKHI_GET_FW_VERSION 0x02
-#define MKHI_END_OF_POST 0x0c
-#define MKHI_FEATURE_OVERRIDE 0x14
-#define MKHI_END_OF_POST_NOACK 0x1a
-
-struct mkhi_header {
- u32 group_id: 8;
- u32 command: 7;
- u32 is_response: 1;
- u32 reserved: 8;
- u32 result: 8;
-} __attribute__ ((packed));
-
-struct me_fw_version {
- u16 code_minor;
- u16 code_major;
- u16 code_build_number;
- u16 code_hot_fix;
- u16 recovery_minor;
- u16 recovery_major;
- u16 recovery_build_number;
- u16 recovery_hot_fix;
-} __attribute__ ((packed));
-
-/* ICC Messages */
-#define ICC_SET_CLOCK_ENABLES 0x3
-#define ICC_API_VERSION_LYNXPOINT 0x00030000
-
-struct icc_header {
- u32 api_version;
- u32 icc_command;
- u32 icc_status;
- u32 length;
- u32 reserved;
-} __attribute__ ((packed));
-
-struct icc_clock_enables_msg {
- u32 clock_enables;
- u32 clock_mask;
- u32 no_response: 1;
- u32 reserved: 31;
-} __attribute__ ((packed));
-
-#define HECI_EOP_STATUS_SUCCESS 0x0
-#define HECI_EOP_PERFORM_GLOBAL_RESET 0x1
-
-#define CBM_RR_GLOBAL_RESET 0x01
-
-#define GLOBAL_RESET_BIOS_MRC 0x01
-#define GLOBAL_RESET_BIOS_POST 0x02
-#define GLOBAL_RESET_MEBX 0x03
-
-struct me_global_reset {
- u8 request_origin;
- u8 reset_type;
-} __attribute__ ((packed));
-
-typedef enum {
- ME_NORMAL_BIOS_PATH,
- ME_S3WAKE_BIOS_PATH,
- ME_ERROR_BIOS_PATH,
- ME_RECOVERY_BIOS_PATH,
- ME_DISABLE_BIOS_PATH,
- ME_FIRMWARE_UPDATE_BIOS_PATH,
-} me_bios_path;
-
-/*
- * ME to BIOS Payload Datastructures and definitions. The ordering of the
- * structures follows the ordering in the ME9 BWG.
- */
-
-#define MBP_APPID_KERNEL 1
-#define MBP_APPID_INTEL_AT 3
-#define MBP_APPID_HWA 4
-#define MBP_APPID_ICC 5
-#define MBP_APPID_NFC 6
-/* Kernel items: */
-#define MBP_KERNEL_FW_VER_ITEM 1
-#define MBP_KERNEL_FW_CAP_ITEM 2
-#define MBP_KERNEL_ROM_BIST_ITEM 3
-#define MBP_KERNEL_PLAT_KEY_ITEM 4
-#define MBP_KERNEL_FW_TYPE_ITEM 5
-#define MBP_KERNEL_MFS_FAILURE_ITEM 6
-#define MBP_KERNEL_PLAT_TIME_ITEM 7
-/* Intel AT items: */
-#define MBP_INTEL_AT_STATE_ITEM 1
-/* ICC Items: */
-#define MBP_ICC_PROFILE_ITEM 1
-/* HWA Items: */
-#define MBP_HWA_REQUEST_ITEM 1
-/* NFC Items: */
-#define MBP_NFC_SUPPORT_DATA_ITEM 1
-
-#define MBP_MAKE_IDENT(appid, item) ((appid << 8) | item)
-#define MBP_IDENT(appid, item) \
- MBP_MAKE_IDENT(MBP_APPID_##appid, MBP_##appid##_##item##_ITEM)
-
-typedef struct {
- u32 mbp_size : 8;
- u32 num_entries : 8;
- u32 rsvd : 16;
-} __attribute__ ((packed)) mbp_header;
-
-typedef struct {
- u32 app_id : 8;
- u32 item_id : 8;
- u32 length : 8;
- u32 rsvd : 8;
-} __attribute__ ((packed)) mbp_item_header;
-
-typedef struct {
- u32 major_version : 16;
- u32 minor_version : 16;
- u32 hotfix_version : 16;
- u32 build_version : 16;
-} __attribute__ ((packed)) mbp_fw_version_name;
-
-typedef struct {
- u32 full_net : 1;
- u32 std_net : 1;
- u32 manageability : 1;
- u32 reserved_2 : 2;
- u32 intel_at : 1;
- u32 intel_cls : 1;
- u32 reserved : 3;
- u32 intel_mpc : 1;
- u32 icc_over_clocking : 1;
- u32 pavp : 1;
- u32 reserved_1 : 4;
- u32 ipv6 : 1;
- u32 kvm : 1;
- u32 och : 1;
- u32 vlan : 1;
- u32 tls : 1;
- u32 reserved_4 : 1;
- u32 wlan : 1;
- u32 reserved_5 : 8;
-} __attribute__ ((packed)) mbp_mefwcaps;
-
-typedef struct {
- u16 device_id;
- u16 fuse_test_flags;
- u32 umchid[4];
-} __attribute__ ((packed)) mbp_rom_bist_data;
-
-typedef struct {
- u32 key[8];
-} mbp_platform_key;
-
-typedef struct {
- u32 mobile: 1;
- u32 desktop: 1;
- u32 server: 1;
- u32 workstation: 1;
- u32 corporate: 1;
- u32 consumer: 1;
- u32 regular_super_sku: 1;
- u32 rsvd: 1;
- u32 image_type: 4;
- u32 brand: 4;
- u32 rsvd1: 16;
-} __attribute__ ((packed)) mbp_me_firmware_type;
-
-typedef struct {
- mbp_me_firmware_type rule_data;
- u8 available;
-} mbp_plat_type;
-
-typedef struct {
- u16 icc_start_address;
- u16 mask;
-} __attribute__ ((packed)) icc_address_mask;
-
-typedef struct {
- u8 num_icc_profiles;
- u8 icc_profile_soft_strap;
- u8 icc_profile_index;
- u8 reserved;
- u32 icc_reg_bundles;
- icc_address_mask icc_address_mask[0];
-} __attribute__ ((packed)) mbp_icc_profile;
-
-typedef struct {
- u16 lock_state : 1;
- u16 authenticate_module : 1;
- u16 s3authentication : 1;
- u16 flash_wear_out : 1;
- u16 flash_variable_security : 1;
- u16 reserved : 11;
-} __attribute__ ((packed)) tdt_state_flag;
-
-typedef struct {
- u8 state;
- u8 last_theft_trigger;
- tdt_state_flag flags;
-} __attribute__ ((packed)) mbp_at_state;
-
-typedef struct {
- u32 wake_event_mrst_time_ms;
- u32 mrst_pltrst_time_ms;
- u32 pltrst_cpurst_time_ms;
-} __attribute__ ((packed)) mbp_plat_time;
-
-typedef struct {
- u32 device_type : 2;
- u32 reserved : 30;
-} __attribute__ ((packed)) mbp_nfc_data;
-
-typedef struct {
- mbp_fw_version_name *fw_version_name;
- mbp_mefwcaps *fw_capabilities;
- mbp_rom_bist_data *rom_bist_data;
- mbp_platform_key *platform_key;
- mbp_plat_type *fw_plat_type;
- mbp_icc_profile *icc_profile;
- mbp_at_state *at_state;
- u32 *mfsintegrity;
- mbp_plat_time *plat_time;
- mbp_nfc_data *nfc_data;
-} me_bios_payload;
-
-struct me_fwcaps {
- u32 id;
- u8 length;
- mbp_mefwcaps caps_sku;
- u8 reserved[3];
-} __attribute__ ((packed));
-
-void intel_me_hsio_version(uint16_t *version, uint16_t *checksum);
-
-#if (CONFIG_DEFAULT_CONSOLE_LOGLEVEL >= BIOS_DEBUG)
-/* Defined in me_status.c for both romstage and ramstage */
-void intel_me_status(void);
-#else
-static inline void intel_me_status(void) { }
-#endif
-
-#endif
diff --git a/src/soc/intel/skylake/include/soc/msr.h b/src/soc/intel/skylake/include/soc/msr.h
index 707041a161..b857dbe85e 100644
--- a/src/soc/intel/skylake/include/soc/msr.h
+++ b/src/soc/intel/skylake/include/soc/msr.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +15,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_MSR_H_
-#define _BROADWELL_MSR_H_
+#ifndef _SOC_MSR_H_
+#define _SOC_MSR_H_
#define MSR_PIC_MSG_CONTROL 0x2e
#define CORE_THREAD_COUNT_MSR 0x35
@@ -41,21 +42,21 @@
#define MISC_PWR_MGMT_EIST_HW_DIS (1 << 0)
#define MSR_TURBO_RATIO_LIMIT 0x1ad
#define MSR_TEMPERATURE_TARGET 0x1a2
-#define IA32_PERF_CTL 0x199
+#define IA32_PERF_CTL 0x199
#define IA32_THERM_INTERRUPT 0x19b
#define IA32_ENERGY_PERFORMANCE_BIAS 0x1b0
#define ENERGY_POLICY_PERFORMANCE 0
#define ENERGY_POLICY_NORMAL 6
#define ENERGY_POLICY_POWERSAVE 15
#define IA32_PACKAGE_THERM_INTERRUPT 0x1b2
-#define EMRRphysBase_MSR 0x1f4
-#define EMRRphysMask_MSR 0x1f5
+#define EMRR_PHYS_BASE_MSR 0x1f4
+#define EMRR_PHYS_MASK_MSR 0x1f5
#define IA32_PLATFORM_DCA_CAP 0x1f8
#define MSR_POWER_CTL 0x1fc
#define MSR_LT_LOCK_MEMORY 0x2e7
-#define UNCORE_EMRRphysBase_MSR 0x2f4
-#define UNCORE_EMRRphysMask_MSR 0x2f5
-#define IA32_MC0_STATUS 0x401
+#define UNCORE_EMRR_PHYS_BASE_MSR 0x2f4
+#define UNCORE_EMRR_PHYS_MASK_MSR 0x2f5
+#define IA32_MC0_STATUS 0x401
#define SMM_FEATURE_CONTROL_MSR 0x4e0
#define SMM_CPU_SAVE_EN (1 << 1)
diff --git a/src/soc/intel/skylake/include/soc/nvs.h b/src/soc/intel/skylake/include/soc/nvs.h
index 0f1e63a67a..2c83c5f019 100644
--- a/src/soc/intel/skylake/include/soc/nvs.h
+++ b/src/soc/intel/skylake/include/soc/nvs.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 2008-2009 coresystems GmbH
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,12 +16,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_NVS_H_
-#define _BROADWELL_NVS_H_
+#ifndef _SOC_NVS_H_
+#define _SOC_NVS_H_
+#include <rules.h>
#include <vendorcode/google/chromeos/gnvs.h>
#include <soc/device_nvs.h>
@@ -53,7 +55,9 @@ typedef struct {
u32 cbmc; /* 0x1c - 0x1f - Coreboot Memory Console */
u64 pm1i; /* 0x20 - 0x27 - PM1 wake status bit */
u64 gpei; /* 0x28 - 0x2f - GPE wake status bit */
- u8 unused[208];
+ u32 rpa[12]; /* 0x30 - 0x5f - Root Port Address */
+
+ u8 unused[160];
/* ChromeOS specific (0x100 - 0xfff) */
chromeos_acpi_t chromeos;
@@ -63,7 +67,7 @@ typedef struct {
} __attribute__((packed)) global_nvs_t;
void acpi_create_gnvs(global_nvs_t *gnvs);
-#ifdef __SMM__
+#if ENV_SMM
/* Used in SMM to find the ACPI GNVS address */
global_nvs_t *smm_get_gnvs(void);
#endif
diff --git a/src/soc/intel/skylake/include/soc/pch.h b/src/soc/intel/skylake/include/soc/pch.h
index e677215c7f..4b67e998db 100644
--- a/src/soc/intel/skylake/include/soc/pch.h
+++ b/src/soc/intel/skylake/include/soc/pch.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 2008-2009 coresystems GmbH
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,38 +16,27 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_PCH_H_
-#define _BROADWELL_PCH_H_
+#ifndef _SOC_PCH_H_
+#define _SOC_PCH_H_
-/* Haswell ULT Pch (LynxPoint-LP) */
-#define PCH_LPT_LP_SAMPLE 0x9c41
-#define PCH_LPT_LP_PREMIUM 0x9c43
-#define PCH_LPT_LP_MAINSTREAM 0x9c45
-#define PCH_LPT_LP_VALUE 0x9c47
+#include <device/device.h>
+#include <rules.h>
-/* Broadwell PCH (WildatPoint) */
-#define PCH_WPT_HSW_U_SAMPLE 0x9cc1
-#define PCH_WPT_BDW_U_SAMPLE 0x9cc2
-#define PCH_WPT_BDW_U_PREMIUM 0x9cc3
-#define PCH_WPT_BDW_U_BASE 0x9cc5
-#define PCH_WPT_BDW_Y_SAMPLE 0x9cc6
-#define PCH_WPT_BDW_Y_PREMIUM 0x9cc7
-#define PCH_WPT_BDW_Y_BASE 0x9cc9
-#define PCH_WPT_BDW_H 0x9ccb
-
-/* Power Management Control and Status */
-#define PCH_PCS 0x84
-#define PCH_PCS_PS_D3HOT 3
+/* PCH (SunRisePoint LP) */
+#define PCH_SPT_LP_SAMPLE 0x9d41
+#define PCH_SPT_LP_U_BASE 0x9d43
+#define PCH_SPT_LP_U_PREMIUM 0x9d48
+#define PCH_SPT_LP_Y_PREMIUM 0x9d46
u8 pch_revision(void);
u16 pch_type(void);
-int pch_is_wpt(void);
-int pch_is_wpt_ulx(void);
u32 pch_read_soft_strap(int id);
void pch_log_state(void);
+#if ENV_RAMSTAGE
void pch_disable_devfn(device_t dev);
-
#endif
+
+#endif /* _SOC_PCH_H_ */
diff --git a/src/soc/intel/skylake/include/soc/pci_devs.h b/src/soc/intel/skylake/include/soc/pci_devs.h
index 76e3a688ed..240bd4a4e1 100644
--- a/src/soc/intel/skylake/include/soc/pci_devs.h
+++ b/src/soc/intel/skylake/include/soc/pci_devs.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,24 +15,26 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_PCI_DEVS_H_
-#define _BROADWELL_PCI_DEVS_H_
+#ifndef _SOC_PCI_DEVS_H_
+#define _SOC_PCI_DEVS_H_
+
+#include <rules.h>
#define _SA_DEVFN(slot) PCI_DEVFN(SA_DEV_SLOT_ ## slot, 0)
-#define _PCH_DEVFN(slot,func) PCI_DEVFN(PCH_DEV_SLOT_ ## slot, func)
+#define _PCH_DEVFN(slot, func) PCI_DEVFN(PCH_DEV_SLOT_ ## slot, func)
-#if defined(__PRE_RAM__) || defined(__SMM__) || defined(__ROMCC__)
-#include <arch/io.h>
-#define _SA_DEV(slot) PCI_DEV(0, SA_DEV_SLOT_ ## slot, 0)
-#define _PCH_DEV(slot,func) PCI_DEV(0, PCH_DEV_SLOT_ ## slot, func)
-#else
+#if ENV_RAMSTAGE
#include <device/device.h>
#include <device/pci_def.h>
#define _SA_DEV(slot) dev_find_slot(0, _SA_DEVFN(slot))
-#define _PCH_DEV(slot,func) dev_find_slot(0, _PCH_DEVFN(slot, func))
+#define _PCH_DEV(slot, func) dev_find_slot(0, _PCH_DEVFN(slot, func))
+#else
+#include <arch/io.h>
+#define _SA_DEV(slot) PCI_DEV(0, SA_DEV_SLOT_ ## slot, 0)
+#define _PCH_DEV(slot, func) PCI_DEV(0, PCH_DEV_SLOT_ ## slot, func)
#endif
/* System Agent Devices */
@@ -44,76 +47,84 @@
#define SA_DEVFN_IGD _SA_DEVFN(IGD)
#define SA_DEV_IGD _SA_DEV(IGD)
-#define SA_DEV_SLOT_MINIHD 0x03
-#define SA_DEVFN_MINIHD _SA_DEVFN(MINIHD)
-#define SA_DEV_MINIHD _SA_DEV(MINIHD)
-
/* PCH Devices */
-
-#define PCH_DEV_SLOT_ADSP 0x13
-#define PCH_DEVFN_ADSP _PCH_DEVFN(ADSP, 0)
-#define PCH_DEV_ADSP _PCH_DEV(ADSP, 0)
-
#define PCH_DEV_SLOT_XHCI 0x14
#define PCH_DEVFN_XHCI _PCH_DEVFN(XHCI, 0)
+#define PCH_DEVFN_USBOTG _PCH_DEVFN(XHCI, 1)
+#define PCH_DEVFN_THERMAL _PCH_DEVFN(XHCI, 2)
#define PCH_DEV_XHCI _PCH_DEV(XHCI, 0)
-
-#define PCH_DEV_SLOT_SIO 0x15
-#define PCH_DEV_SDMA _PCH_DEV(SIO, 0)
-#define PCH_DEV_I2C0 _PCH_DEV(SIO, 1)
-#define PCH_DEV_I2C1 _PCH_DEV(SIO, 2)
-#define PCH_DEV_SPI0 _PCH_DEV(SIO, 3)
-#define PCH_DEV_SPI1 _PCH_DEV(SIO, 4)
-#define PCH_DEV_UART0 _PCH_DEV(SIO, 5)
-#define PCH_DEV_UART1 _PCH_DEV(SIO, 6)
-#define PCH_DEVFN_SDMA _PCH_DEVFN(SIO, 0)
-#define PCH_DEVFN_I2C0 _PCH_DEVFN(SIO, 1)
-#define PCH_DEVFN_I2C1 _PCH_DEVFN(SIO, 2)
-#define PCH_DEVFN_SPI0 _PCH_DEVFN(SIO, 3)
-#define PCH_DEVFN_SPI1 _PCH_DEVFN(SIO, 4)
-#define PCH_DEVFN_UART0 _PCH_DEVFN(SIO, 5)
-#define PCH_DEVFN_UART1 _PCH_DEVFN(SIO, 6)
+#define PCH_DEV_USBOTG _PCH_DEV(XHCI, 1)
+#define PCH_DEV_THERMAL _PCH_DEV(XHCI, 2)
+
+#define PCH_DEV_SLOT_SIO1 0x15
+#define PCH_DEVFN_I2C0 _PCH_DEVFN(SIO1, 0)
+#define PCH_DEVFN_I2C1 _PCH_DEVFN(SIO1, 1)
+#define PCH_DEVFN_I2C2 _PCH_DEVFN(SIO1, 2)
+#define PCH_DEVFN_I2C3 _PCH_DEVFN(SIO1, 3)
+#define PCH_DEV_I2C0 _PCH_DEV(SIO1, 0)
+#define PCH_DEV_I2C1 _PCH_DEV(SIO1, 1)
+#define PCH_DEV_I2C2 _PCH_DEV(SIO1, 2)
+#define PCH_DEV_I2C3 _PCH_DEV(SIO1, 3)
#define PCH_DEV_SLOT_ME 0x16
#define PCH_DEVFN_ME _PCH_DEVFN(ME, 0)
#define PCH_DEVFN_ME_2 _PCH_DEVFN(ME, 1)
#define PCH_DEVFN_ME_IDER _PCH_DEVFN(ME, 2)
#define PCH_DEVFN_ME_KT _PCH_DEVFN(ME, 3)
+#define PCH_DEVFN_ME_3 _PCH_DEVFN(ME, 4)
#define PCH_DEV_ME _PCH_DEV(ME, 0)
#define PCH_DEV_ME_2 _PCH_DEV(ME, 1)
#define PCH_DEV_ME_IDER _PCH_DEV(ME, 2)
#define PCH_DEV_ME_KT _PCH_DEV(ME, 3)
+#define PCH_DEV_ME_3 _PCH_DEV(ME, 4)
-#define PCH_DEV_SLOT_SDIO 0x17
-#define PCH_DEVFN_SDIO _PCH_DEVFN(SDIO, 0)
-#define PCH_DEV_SDIO _PCH_DEV(SDIO, 0)
+#define PCH_DEV_SLOT_SATA 0x17
+#define PCH_DEVFN_SATA _PCH_DEVFN(SATA, 0)
+#define PCH_DEV_SATA _PCH_DEV(SATA, 0)
-#define PCH_DEV_SLOT_GBE 0x19
-#define PCH_DEVFN_GBE _PCH_DEVFN(GBE, 0)
-#define PCH_DEV_GBE _PCH_DEV(GBE, 0)
-
-#define PCH_DEV_SLOT_HDA 0x1b
-#define PCH_DEVFN_HDA _PCH_DEVFN(HDA, 0)
-#define PCH_DEV_HDA _PCH_DEV(HDA, 0)
+#define PCH_DEV_SLOT_SIO2 0x19
+#define PCH_DEVFN_UART2 _PCH_DEVFN(SIO2, 0)
+#define PCH_DEVFN_I2C5 _PCH_DEVFN(SIO2, 1)
+#define PCH_DEVFN_I2C4 _PCH_DEVFN(SIO2, 2)
+#define PCH_DEV_UART2 _PCH_DEV(SIO2, 0)
+#define PCH_DEV_I2C5 _PCH_DEV(SIO2, 1)
+#define PCH_DEV_I2C4 _PCH_DEV(SIO2, 2)
#define PCH_DEV_SLOT_PCIE 0x1c
-
-#define PCH_DEV_SLOT_EHCI 0x1d
-#define PCH_DEVFN_EHCI _PCH_DEVFN(EHCI, 0)
-#define PCH_DEV_EHCI _PCH_DEV(EHCI, 0)
+#define PCH_DEVFN_PCIE1 _PCH_DEVFN(PCIE, 0)
+#define PCH_DEVFN_PCIE2 _PCH_DEVFN(PCIE, 1)
+#define PCH_DEVFN_PCIE3 _PCH_DEVFN(PCIE, 2)
+#define PCH_DEVFN_PCIE4 _PCH_DEVFN(PCIE, 3)
+#define PCH_DEVFN_PCIE5 _PCH_DEVFN(PCIE, 4)
+#define PCH_DEVFN_PCIE6 _PCH_DEVFN(PCIE, 5)
+#define PCH_DEV_PCIE1 _PCH_DEV(PCIE, 0)
+#define PCH_DEV_PCIE2 _PCH_DEV(PCIE, 1)
+#define PCH_DEV_PCIE3 _PCH_DEV(PCIE, 2)
+#define PCH_DEV_PCIE4 _PCH_DEV(PCIE, 3)
+#define PCH_DEV_PCIE5 _PCH_DEV(PCIE, 4)
+#define PCH_DEV_PCIE6 _PCH_DEV(PCIE, 5)
+
+#define PCH_DEV_SLOT_STORAGE 0x1e
+#define PCH_DEVFN_UART0 _PCH_DEVFN(STORAGE, 0)
+#define PCH_DEVFN_UART1 _PCH_DEVFN(STORAGE, 1)
+#define PCH_DEVFN_EMMC _PCH_DEVFN(STORAGE, 4)
+#define PCH_DEVFN_SDCARD _PCH_DEVFN(STORAGE, 6)
+#define PCH_DEV_UART0 _PCH_DEV(STORAGE, 0)
+#define PCH_DEV_UART1 _PCH_DEV(STORAGE, 1)
+#define PCH_DEV_EMMC _PCH_DEV(STORAGE, 4)
+#define PCH_DEV_SDCARD _PCH_DEV(STORAGE, 6)
#define PCH_DEV_SLOT_LPC 0x1f
#define PCH_DEVFN_LPC _PCH_DEVFN(LPC, 0)
-#define PCH_DEVFN_IDE _PCH_DEVFN(LPC, 1)
-#define PCH_DEVFN_SATA _PCH_DEVFN(LPC, 2)
-#define PCH_DEVFN_SMBUS _PCH_DEVFN(LPC, 3)
-#define PCH_DEVFN_SATA2 _PCH_DEVFN(LPC, 5)
-#define PCH_DEVFN_THERMAL _PCH_DEVFN(LPC, 6)
+#define PCH_DEVFN_PMC _PCH_DEVFN(LPC, 2)
+#define PCH_DEVFN_HDA _PCH_DEVFN(LPC, 3)
+#define PCH_DEVFN_SMBUS _PCH_DEVFN(LPC, 4)
+#define PCH_DEVFN_SPI _PCH_DEVFN(LPC, 5)
+#define PCH_DEVFN_GBE _PCH_DEVFN(LPC, 6)
#define PCH_DEV_LPC _PCH_DEV(LPC, 0)
-#define PCH_DEV_IDE _PCH_DEV(LPC, 1)
-#define PCH_DEV_SATA _PCH_DEV(LPC, 2)
-#define PCH_DEV_SMBUS _PCH_DEV(LPC, 3)
-#define PCH_DEV_SATA2 _PCH_DEV(LPC, 5)
-#define PCH_DEV_THERMAL _PCH_DEV(LPC, 6)
-
+#define PCH_DEV_PMC _PCH_DEV(LPC, 2)
+#define PCH_DEV_HDA _PCH_DEV(LPC, 3)
+#define PCH_DEV_SMBUS _PCH_DEV(LPC, 4)
+#define PCH_DEV_SPI _PCH_DEV(LPC, 5)
+#define PCH_DEV_GBE _PCH_DEV(LPC, 6)
#endif
diff --git a/src/soc/intel/skylake/include/soc/pcr.h b/src/soc/intel/skylake/include/soc/pcr.h
new file mode 100644
index 0000000000..9ac9eddd48
--- /dev/null
+++ b/src/soc/intel/skylake/include/soc/pcr.h
@@ -0,0 +1,104 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_PCR_H_
+#define _SOC_PCR_H_
+
+/* PCH (SunRisePoint LP) */
+#define PCH_PCR_BASE_ADDRESS 0xFD000000
+#define R_PCH_PCR_LPC_GCFD 0x3418
+
+/* DMI Control Register */
+#define R_PCH_PCR_DMI_DMIC 0x2234
+#define B_PCH_PCR_DMI_DMIC_SRL (1 << 31)
+#define R_PCH_PCR_DMI_LPCLGIR1 0x2730
+#define R_PCH_PCR_DMI_LPCLGIR2 0x2734
+#define R_PCH_PCR_DMI_LPCLGIR3 0x2738
+#define R_PCH_PCR_DMI_LPCLGIR4 0x273c
+#define R_PCH_PCR_DMI_LPCIOD 0x2770
+#define R_PCH_PCR_DMI_LPCIOE 0x2774
+
+/* RTC configuration */
+#define R_PCH_PCR_RTC_CONF 0x3400
+#define B_PCH_PCR_RTC_CONF_UCMOS_EN 0x4
+
+/* ITSS PCRs*/
+/* PIRQA Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQA_ROUT 0x3100
+/* PIRQB Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQB_ROUT 0x3101
+/* PIRQC Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQC_ROUT 0x3102
+/* PIRQD Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQD_ROUT 0x3103
+/* PIRQE Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQE_ROUT 0x3104
+/* PIRQF Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQF_ROUT 0x3105
+/* PIRQG Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQG_ROUT 0x3106
+/* PIRQH Routing Control Register*/
+#define R_PCH_PCR_ITSS_PIRQH_ROUT 0x3107
+
+/* IO Trap PCRs */
+/* Trap status Register */
+#define R_PCH_PCR_PSTH_TRPST 0x1E00
+/* Trapped cycle */
+#define R_PCH_PCR_PSTH_TRPC 0x1E10
+/* Trapped write data */
+#define R_PCH_PCR_PSTH_TRPD 0x1E18
+
+/* Serial IO UART controller legacy mode */
+#define R_PCH_PCR_SERIAL_IO_GPPRVRW7 0x618
+#define SIO_PCH_LEGACY_UART0 (1 << 0)
+#define SIO_PCH_LEGACY_UART1 (1 << 1)
+#define SIO_PCH_LEGACY_UART2 (1 << 2)
+
+/*
+ * Definition for PCR address
+ * The PCR address is used to the PCR MMIO programming
+ */
+#define PCH_PCR_ADDRESS(pid, offset) (void *)(\
+ PCH_PCR_BASE_ADDRESS | ((u8)(pid) << 16) | (u16)(offset))
+
+/*
+ * Definition for SBI PID
+ * The PCH_SBI_PID defines the PID for PCR MMIO programming and
+ * PCH SBI programming as well.
+ */
+typedef enum {
+ PID_PSTH = 0x89,
+ PID_GPIOCOM3 = 0xAC,
+ PID_GPIOCOM2 = 0xAD,
+ PID_GPIOCOM1 = 0xAE,
+ PID_GPIOCOM0 = 0xAF,
+ PID_LPC = 0xC7,
+ PID_ITSS = 0xC4,
+ PID_RTC = 0xC3,
+ PID_SERIALIO = 0xCB,
+ PID_DMI = 0xEF,
+} PCH_SBI_PID;
+
+u8 pcr_read32(PCH_SBI_PID pid, u16 offset, u32 *outdata);
+u8 pcr_read16(PCH_SBI_PID pid, u16 offset, u16 *outdata);
+u8 pcr_read8(PCH_SBI_PID pid, u16 offset, u8 *outdata);
+u8 pcr_write32(PCH_SBI_PID pid, u16 offset, u32 indata);
+u8 pcr_write16(PCH_SBI_PID pid, u16 offset, u16 indata);
+u8 pcr_write8(PCH_SBI_PID pid, u16 offset, u8 indata);
+u8 pcr_andthenor32(PCH_SBI_PID pid, u16 offset, u32 anddata, u32 ordata);
+u8 pcr_andthenor16(PCH_SBI_PID pid, u16 offset, u16 anddata, u16 ordata);
+u8 pcr_andthenor8(PCH_SBI_PID pid, u16 offset, u8 anddata, u8 ordata);
+
+#endif /* _SOC_PCR_H_ */
diff --git a/src/soc/intel/skylake/include/soc/pei_data.h b/src/soc/intel/skylake/include/soc/pei_data.h
index e6147181f7..232843664a 100644
--- a/src/soc/intel/skylake/include/soc/pei_data.h
+++ b/src/soc/intel/skylake/include/soc/pei_data.h
@@ -1,7 +1,8 @@
/*
- * Broadwell UEFI PEI wrapper
+ * UEFI PEI wrapper
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -26,17 +27,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PEI_DATA_H
-#define PEI_DATA_H
+#ifndef _PEI_DATA_H_
+#define _PEI_DATA_H_
#include <types.h>
-#include <memory_info.h>
#define PEI_VERSION 22
#define ABI_X86 __attribute__((regparm(0)))
-typedef void ABI_X86 (*tx_byte_func)(unsigned char byte);
+typedef void ABI_X86(*tx_byte_func)(unsigned char byte);
enum board_type {
BOARD_TYPE_CRB_MOBILE = 0, /* CRB Mobile */
@@ -86,24 +86,19 @@ struct usb3_port_setting {
uint8_t fixed_eq;
} __attribute__((packed));
-struct pei_data
-{
+struct pei_data {
uint32_t pei_version;
enum board_type board_type;
int boot_mode;
int ec_present;
- int usbdebug;
/* Base addresses */
uint32_t pciexbar;
uint16_t smbusbar;
uint32_t xhcibar;
- uint32_t ehcibar;
uint32_t gttbar;
- uint32_t rcba;
uint32_t pmbase;
- uint32_t gpiobase;
uint32_t temp_mmio_base;
uint32_t tseg_size;
@@ -173,14 +168,15 @@ struct pei_data
* DQByteMap[5] - CmdVDQByteMap: Always program to [0xFF, 0]
* since we have 1 CA Vref
*/
- uint8_t dq_map[2][6][2];
+ uint8_t dq_map[2][12];
/*
* LPDDR3 Map from CPU DQS pins to SDRAM DQS pins
* [CHANNEL][MAX_BYTES]
*/
uint8_t dqs_map[2][8];
-
+ uint16_t RcompResistor[3];
+ uint16_t RcompTarget[5];
/* Data read from flash and passed into MRC */
const void *saved_data;
int saved_data_size;
@@ -191,9 +187,8 @@ struct pei_data
/* Data from MRC that should be saved to flash */
void *data_to_save;
int data_to_save_size;
- struct memory_info meminfo;
} __attribute__((packed));
typedef struct pei_data PEI_DATA;
-#endif
+#endif /* _PEI_DATA_H_ */
diff --git a/src/soc/intel/skylake/include/soc/pei_wrapper.h b/src/soc/intel/skylake/include/soc/pei_wrapper.h
index 3ade4ffff7..7d37c10e2e 100644
--- a/src/soc/intel/skylake/include/soc/pei_wrapper.h
+++ b/src/soc/intel/skylake/include/soc/pei_wrapper.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,15 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_PEI_WRAPPER_H_
-#define _BROADWELL_PEI_WRAPPER_H_
+#ifndef _SOC_PEI_WRAPPER_H_
+#define _SOC_PEI_WRAPPER_H_
#include <soc/pei_data.h>
-typedef int ABI_X86 (*pei_wrapper_entry_t)(struct pei_data *pei_data);
+typedef int ABI_X86(*pei_wrapper_entry_t)(struct pei_data *pei_data);
static inline void pei_data_usb2_port(struct pei_data *pei_data, int port,
uint16_t length, uint8_t enable,
@@ -43,7 +44,7 @@ static inline void pei_data_usb3_port(struct pei_data *pei_data, int port,
pei_data->usb3_ports[port].fixed_eq = fixed_eq;
}
-void broadwell_fill_pei_data(struct pei_data *pei_data);
+void soc_fill_pei_data(struct pei_data *pei_data);
void mainboard_fill_pei_data(struct pei_data *pei_data);
#endif
diff --git a/src/soc/intel/skylake/include/soc/pm.h b/src/soc/intel/skylake/include/soc/pm.h
index 54fc4a7f1d..3be83f4add 100644
--- a/src/soc/intel/skylake/include/soc/pm.h
+++ b/src/soc/intel/skylake/include/soc/pm.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +15,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_PM_H_
-#define _BROADWELL_PM_H_
+#ifndef _SOC_PM_H_
+#define _SOC_PM_H_
/* ACPI_BASE_ADDRESS / PMBASE */
@@ -76,12 +77,6 @@
#define SWGPE_CTRL (1 << 1)
#define DEVACT_STS 0x44
#define PM2_CNT 0x50
-#define TCO1_CNT 0x60
-#define TCO_TMR_HLT (1 << 11)
-#define TCO1_STS 0x64
-#define DMISCI_STS (1 << 9)
-#define TCO2_STS 0x66
-#define TCO2_STS_SECOND_TO (1 << 1)
#define GPE0_REG_MAX 4
#define GPE0_REG_SIZE 32
@@ -102,7 +97,7 @@
#define SWGPE_STS (1 << 2)
#define HOT_PLUG_STS (1 << 1)
#define GPE0_EN(x) (0x90 + (x * 4))
-#define WADT_en (1 << 18)
+#define WADT_EN (1 << 18)
#define GP27_EN (1 << 16)
#define PME_B0_EN (1 << 13)
#define ME_SCI_EN (1 << 12)
@@ -129,9 +124,8 @@ struct chipset_power_state {
uint16_t tco2_sts;
uint32_t gpe0_sts[4];
uint32_t gpe0_en[4];
- uint16_t gen_pmcon1;
- uint16_t gen_pmcon2;
- uint16_t gen_pmcon3;
+ uint16_t gen_pmcon_a;
+ uint16_t gen_pmcon_b;
int prev_sleep_state;
uint16_t hsio_version;
uint16_t hsio_checksum;
@@ -152,7 +146,8 @@ void disable_smi(uint32_t mask);
/* ALT_GP_SMI */
uint32_t clear_alt_smi_status(void);
-void enable_alt_smi(uint32_t mask);
+void enable_alt_smi(int gpionum, u32 mask);
+void reset_alt_smi_status(void);
/* TCO */
uint32_t clear_tco_status(void);
@@ -169,4 +164,9 @@ void disable_gpe(uint32_t mask);
/* Return the selected ACPI SCI IRQ */
int acpi_sci_irq(void);
+/* Get base address PMC memory mapped registers. */
+uint8_t *pmc_mmio_regs(void);
+/* Get base address of TCO I/O registers. */
+uint16_t pmc_tco_regs(void);
+
#endif
diff --git a/src/soc/intel/skylake/include/soc/pmc.h b/src/soc/intel/skylake/include/soc/pmc.h
new file mode 100644
index 0000000000..72c9a59e47
--- /dev/null
+++ b/src/soc/intel/skylake/include/soc/pmc.h
@@ -0,0 +1,71 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SOC_PMC_H_
+#define _SOC_PMC_H_
+
+/* PCI Configuration Space (D31:F2): PMC */
+#define ABASE 0x40
+#define ACTL 0x44
+#define PWRM_EN (1 << 8)
+#define ACPI_EN (1 << 7)
+#define SCI_IRQ_SEL (7 << 0)
+#define SCIS_IRQ9 0
+#define SCIS_IRQ10 1
+#define SCIS_IRQ11 2
+#define SCIS_IRQ20 4
+#define SCIS_IRQ21 5
+#define SCIS_IRQ22 6
+#define SCIS_IRQ23 7
+#define PWRMBASE 0x48
+#define GEN_PMCON_A 0xa0
+#define SMI_LOCK (1 << 4)
+#define GEN_PMCON_B 0xa4
+#define SLP_STR_POL_LOCK (1 << 18)
+#define ACPI_BASE_LOCK (1 << 17)
+#define SUS_PWR_FLR (1 << 14)
+#define HOST_RST_STS (1 << 9)
+#define RTC_BATTERY_DEAD (1 << 2)
+#define PWR_FLR (1 << 1)
+#define SLEEP_AFTER_POWER_FAIL (1 << 0)
+#define ETR3 0xac
+#define ETR3_CF9LOCK (1 << 31)
+#define ETR3_CF9GR (1 << 20)
+
+/* Memory mapped IO registers in PMC */
+#define S3_PWRGATE_POL 0x28
+#define S3DC_GATE_SUS (1 << 1)
+#define S3AC_GATE_SUS (1 << 0)
+#define S4_PWRGATE_POL 0x2c
+#define S4DC_GATE_SUS (1 << 1)
+#define S4AC_GATE_SUS (1 << 0)
+#define S5_PWRGATE_POL 0x30
+#define S5DC_GATE_SUS (1 << 15)
+#define S5AC_GATE_SUS (1 << 14)
+#define PMSYNC_TPR_CFG 0xc4
+#define PMSYNC_LOCK (1 << 31)
+
+
+/* TCO registers and fields live behind TCOBASE I/O bar in SMBus device. */
+#define TCO1_STS 0x04
+#define TCO2_STS 0x06
+#define TCO2_STS_SECOND_TO 0x02
+#define TCO2_STS_BOOT 0x04
+#define TCO1_CNT 0x08
+#define TCO_LOCK (1 << 12)
+#define TCO_TMR_HLT (1 << 11)
+
+#endif
diff --git a/src/soc/intel/skylake/include/soc/ramstage.h b/src/soc/intel/skylake/include/soc/ramstage.h
index 9242aa9ea3..fb06b3386f 100644
--- a/src/soc/intel/skylake/include/soc/ramstage.h
+++ b/src/soc/intel/skylake/include/soc/ramstage.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,25 +15,20 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_RAMSTAGE_H_
-#define _BROADWELL_RAMSTAGE_H_
+#ifndef _SOC_RAMSTAGE_H_
+#define _SOC_RAMSTAGE_H_
+#include <chip.h>
#include <device/device.h>
-#include <soc/intel/broadwell/chip.h>
+#include <soc/intel/common/ramstage.h>
-void broadwell_init_pre_device(void *chip_info);
-void broadwell_init_cpus(device_t dev);
-void broadwell_pch_enable_dev(device_t dev);
+void pch_enable_dev(device_t dev);
+void soc_init_pre_device(void *chip_info);
+void soc_init_cpus(device_t dev);
-#if CONFIG_HAVE_REFCODE_BLOB
-void broadwell_run_reference_code(void);
-#else
-static inline void broadwell_run_reference_code(void) { }
-#endif
-
-extern struct pci_operations broadwell_pci_ops;
+extern struct pci_operations soc_pci_ops;
#endif
diff --git a/src/soc/intel/skylake/include/soc/rcba.h b/src/soc/intel/skylake/include/soc/rcba.h
deleted file mode 100644
index 2c40d0720b..0000000000
--- a/src/soc/intel/skylake/include/soc/rcba.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BROADWELL_RCBA_H_
-#define _BROADWELL_RCBA_H_
-
-#include <soc/iomap.h>
-
-#define RCBA8(x) *((volatile u8 *)(RCBA_BASE_ADDRESS + x))
-#define RCBA16(x) *((volatile u16 *)(RCBA_BASE_ADDRESS + x))
-#define RCBA32(x) *((volatile u32 *)(RCBA_BASE_ADDRESS + x))
-
-#define RCBA_AND_OR(bits, x, and, or) \
- RCBA##bits(x) = ((RCBA##bits(x) & (and)) | (or))
-#define RCBA8_AND_OR(x, and, or) RCBA_AND_OR(8, x, and, or)
-#define RCBA16_AND_OR(x, and, or) RCBA_AND_OR(16, x, and, or)
-#define RCBA32_AND_OR(x, and, or) RCBA_AND_OR(32, x, and, or)
-#define RCBA32_OR(x, or) RCBA_AND_OR(32, x, ~0UL, or)
-
-#define RPC 0x0400 /* 32bit */
-#define RPFN 0x0404 /* 32bit */
-
-/* Root Port configuration space hide */
-#define RPFN_HIDE(port) (1 << (((port) * 4) + 3))
-/* Get the function number assigned to a Root Port */
-#define RPFN_FNGET(reg,port) (((reg) >> ((port) * 4)) & 7)
-/* Set the function number for a Root Port */
-#define RPFN_FNSET(port,func) (((func) & 7) << ((port) * 4))
-/* Root Port function number mask */
-#define RPFN_FNMASK(port) (7 << ((port) * 4))
-
-#define NOINT 0
-#define INTA 1
-#define INTB 2
-#define INTC 3
-#define INTD 4
-
-#define DIR_IDR 12 /* Interrupt D Pin Offset */
-#define DIR_ICR 8 /* Interrupt C Pin Offset */
-#define DIR_IBR 4 /* Interrupt B Pin Offset */
-#define DIR_IAR 0 /* Interrupt A Pin Offset */
-
-#define PIRQA 0
-#define PIRQB 1
-#define PIRQC 2
-#define PIRQD 3
-#define PIRQE 4
-#define PIRQF 5
-#define PIRQG 6
-#define PIRQH 7
-
-/* IO Buffer Programming */
-#define IOBPIRI 0x2330
-#define IOBPD 0x2334
-#define IOBPS 0x2338
-#define IOBPS_READY 0x0001
-#define IOBPS_TX_MASK 0x0006
-#define IOBPS_MASK 0xff00
-#define IOBPS_READ 0x0600
-#define IOBPS_WRITE 0x0700
-#define IOBPU 0x233a
-#define IOBPU_MAGIC 0xf000
-#define IOBP_PCICFG_READ 0x0400
-#define IOBP_PCICFG_WRITE 0x0500
-
-#define D31IP 0x3100 /* 32bit */
-#define D31IP_TTIP 24 /* Thermal Throttle Pin */
-#define D31IP_SIP2 20 /* SATA Pin 2 */
-#define D31IP_SMIP 12 /* SMBUS Pin */
-#define D31IP_SIP 8 /* SATA Pin */
-#define D30IP 0x3104 /* 32bit */
-#define D30IP_PIP 0 /* PCI Bridge Pin */
-#define D29IP 0x3108 /* 32bit */
-#define D29IP_E1P 0 /* EHCI #1 Pin */
-#define D28IP 0x310c /* 32bit */
-#define D28IP_P8IP 28 /* PCI Express Port 8 */
-#define D28IP_P7IP 24 /* PCI Express Port 7 */
-#define D28IP_P6IP 20 /* PCI Express Port 6 */
-#define D28IP_P5IP 16 /* PCI Express Port 5 */
-#define D28IP_P4IP 12 /* PCI Express Port 4 */
-#define D28IP_P3IP 8 /* PCI Express Port 3 */
-#define D28IP_P2IP 4 /* PCI Express Port 2 */
-#define D28IP_P1IP 0 /* PCI Express Port 1 */
-#define D27IP 0x3110 /* 32bit */
-#define D27IP_ZIP 0 /* HD Audio Pin */
-#define D26IP 0x3114 /* 32bit */
-#define D26IP_E2P 0 /* EHCI #2 Pin */
-#define D25IP 0x3118 /* 32bit */
-#define D25IP_LIP 0 /* GbE LAN Pin */
-#define D22IP 0x3124 /* 32bit */
-#define D22IP_KTIP 12 /* KT Pin */
-#define D22IP_IDERIP 8 /* IDE-R Pin */
-#define D22IP_MEI2IP 4 /* MEI #2 Pin */
-#define D22IP_MEI1IP 0 /* MEI #1 Pin */
-#define D20IP 0x3128 /* 32bit */
-#define D20IP_XHCI 0 /* XHCI Pin */
-#define D31IR 0x3140 /* 16bit */
-#define D30IR 0x3142 /* 16bit */
-#define D29IR 0x3144 /* 16bit */
-#define D28IR 0x3146 /* 16bit */
-#define D27IR 0x3148 /* 16bit */
-#define D26IR 0x314c /* 16bit */
-#define D25IR 0x3150 /* 16bit */
-#define D23IR 0x3158 /* 16bit */
-#define D22IR 0x315c /* 16bit */
-#define D20IR 0x3160 /* 16bit */
-#define D21IR 0x3164 /* 16bit */
-#define D19IR 0x3168 /* 16bit */
-#define ACPIIRQEN 0x31e0 /* 32bit */
-#define OIC 0x31fe /* 16bit */
-#define DEEP_S3_POL 0x3328 /* 32bit */
-#define DEEP_S3_EN_AC (1 << 0)
-#define DEEP_S3_EN_DC (1 << 1)
-#define DEEP_S5_POL 0x3330 /* 32bit */
-#define DEEP_S5_EN_AC (1 << 14)
-#define DEEP_S5_EN_DC (1 << 15)
-#define DEEP_SX_CONFIG 0x3334 /* 32bit */
-#define DEEP_SX_WAKE_PIN_EN (1 << 2)
-#define DEEP_SX_ACPRESENT_PD (1 << 1)
-#define DEEP_SX_GP27_PIN_EN (1 << 0)
-#define PMSYNC_CONFIG 0x33c4 /* 32bit */
-#define PMSYNC_CONFIG2 0x33cc /* 32bit */
-#define SOFT_RESET_CTRL 0x38f4
-#define SOFT_RESET_DATA 0x38f8
-
-#define DIR_ROUTE(a,b,c,d) \
- (((d) << DIR_IDR) | ((c) << DIR_ICR) | \
- ((b) << DIR_IBR) | ((a) << DIR_IAR))
-
-#define RC 0x3400 /* 32bit */
-#define HPTC 0x3404 /* 32bit */
-#define GCS 0x3410 /* 32bit */
-#define BUC 0x3414 /* 32bit */
-#define PCH_DISABLE_GBE (1 << 5)
-#define FD 0x3418 /* 32bit */
-#define FDSW 0x3420 /* 8bit */
-#define DISPBDF 0x3424 /* 16bit */
-#define FD2 0x3428 /* 32bit */
-#define CG 0x341c /* 32bit */
-
-/* Function Disable 1 RCBA 0x3418 */
-#define PCH_DISABLE_ALWAYS (1 << 0)
-#define PCH_DISABLE_ADSPD (1 << 1)
-#define PCH_DISABLE_SATA1 (1 << 2)
-#define PCH_DISABLE_SMBUS (1 << 3)
-#define PCH_DISABLE_HD_AUDIO (1 << 4)
-#define PCH_DISABLE_EHCI2 (1 << 13)
-#define PCH_DISABLE_LPC (1 << 14)
-#define PCH_DISABLE_EHCI1 (1 << 15)
-#define PCH_DISABLE_PCIE(x) (1 << (16 + x))
-#define PCH_DISABLE_THERMAL (1 << 24)
-#define PCH_DISABLE_SATA2 (1 << 25)
-#define PCH_DISABLE_XHCI (1 << 27)
-
-/* Function Disable 2 RCBA 0x3428 */
-#define PCH_DISABLE_KT (1 << 4)
-#define PCH_DISABLE_IDER (1 << 3)
-#define PCH_DISABLE_MEI2 (1 << 2)
-#define PCH_DISABLE_MEI1 (1 << 1)
-#define PCH_ENABLE_DBDF (1 << 0)
-
-#endif
diff --git a/src/soc/intel/skylake/include/soc/romstage.h b/src/soc/intel/skylake/include/soc/romstage.h
index b636223561..f030301bdb 100644
--- a/src/soc/intel/skylake/include/soc/romstage.h
+++ b/src/soc/intel/skylake/include/soc/romstage.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,38 +15,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_ROMSTAGE_H_
-#define _BROADWELL_ROMSTAGE_H_
+#ifndef _SOC_ROMSTAGE_H_
+#define _SOC_ROMSTAGE_H_
-#include <stdint.h>
-#include <arch/cpu.h>
-
-struct chipset_power_state;
-struct pei_data;
-struct romstage_params {
- unsigned long bist;
- struct chipset_power_state *power_state;
- struct pei_data *pei_data;
-};
-
-void mainboard_romstage_entry(struct romstage_params *params);
-void romstage_common(struct romstage_params *params);
-void *asmlinkage romstage_main(unsigned long bist, uint32_t tsc_lo,
- uint32_t tsc_high);
-void asmlinkage romstage_after_car(void);
-void raminit(struct pei_data *pei_data);
-void *setup_stack_and_mttrs(void);
+#include <soc/intel/common/romstage.h>
struct chipset_power_state;
struct chipset_power_state *fill_power_state(void);
-void report_platform_info(void);
-void report_memory_config(void);
-
-void set_max_freq(void);
-
void systemagent_early_init(void);
void pch_early_init(void);
void pch_uart_init(void);
@@ -56,6 +35,6 @@ int smbus_read_byte(unsigned device, unsigned address);
int early_spi_read(u32 offset, u32 size, u8 *buffer);
int early_spi_read_wpsr(u8 *sr);
+void mainboard_fill_spd_data(struct pei_data *pei_data);
-void mainboard_pre_console_init(void);
-#endif
+#endif /* _SOC_ROMSTAGE_H_ */
diff --git a/src/soc/intel/skylake/include/soc/sata.h b/src/soc/intel/skylake/include/soc/sata.h
deleted file mode 100644
index 73e7b3150a..0000000000
--- a/src/soc/intel/skylake/include/soc/sata.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BROADWELL_SATA_H_
-#define _BROADWELL_SATA_H_
-
-#define SATA_SIRI 0xa0 /* SATA Indexed Register Index */
-#define SATA_SIRD 0xa4 /* SATA Indexed Register Data */
-#define SATA_SP 0xd0 /* Scratchpad */
-
-/* SATA IOBP Registers */
-#define SATA_IOBP_SP0_SECRT88 0xea002688
-#define SATA_IOBP_SP1_SECRT88 0xea002488
-
-#define SATA_SECRT88_VADJ_MASK 0xff
-#define SATA_SECRT88_VADJ_SHIFT 16
-
-#define SATA_IOBP_SP0DTLE_DATA 0xea002550
-#define SATA_IOBP_SP0DTLE_EDGE 0xea002554
-#define SATA_IOBP_SP1DTLE_DATA 0xea002750
-#define SATA_IOBP_SP1DTLE_EDGE 0xea002754
-
-#define SATA_DTLE_MASK 0xF
-#define SATA_DTLE_DATA_SHIFT 24
-#define SATA_DTLE_EDGE_SHIFT 16
-
-/* PCI Configuration Space (D31:F1): IDE */
-#define INTR_LN 0x3c
-#define IDE_TIM_PRI 0x40 /* IDE timings, primary */
-#define IDE_DECODE_ENABLE (1 << 15)
-#define IDE_SITRE (1 << 14)
-#define IDE_ISP_5_CLOCKS (0 << 12)
-#define IDE_ISP_4_CLOCKS (1 << 12)
-#define IDE_ISP_3_CLOCKS (2 << 12)
-#define IDE_RCT_4_CLOCKS (0 << 8)
-#define IDE_RCT_3_CLOCKS (1 << 8)
-#define IDE_RCT_2_CLOCKS (2 << 8)
-#define IDE_RCT_1_CLOCKS (3 << 8)
-#define IDE_DTE1 (1 << 7)
-#define IDE_PPE1 (1 << 6)
-#define IDE_IE1 (1 << 5)
-#define IDE_TIME1 (1 << 4)
-#define IDE_DTE0 (1 << 3)
-#define IDE_PPE0 (1 << 2)
-#define IDE_IE0 (1 << 1)
-#define IDE_TIME0 (1 << 0)
-#define IDE_TIM_SEC 0x42 /* IDE timings, secondary */
-
-#define IDE_SDMA_CNT 0x48 /* Synchronous DMA control */
-#define IDE_SSDE1 (1 << 3)
-#define IDE_SSDE0 (1 << 2)
-#define IDE_PSDE1 (1 << 1)
-#define IDE_PSDE0 (1 << 0)
-
-#define IDE_SDMA_TIM 0x4a
-
-#define IDE_CONFIG 0x54 /* IDE I/O Configuration Register */
-#define SIG_MODE_SEC_NORMAL (0 << 18)
-#define SIG_MODE_SEC_TRISTATE (1 << 18)
-#define SIG_MODE_SEC_DRIVELOW (2 << 18)
-#define SIG_MODE_PRI_NORMAL (0 << 16)
-#define SIG_MODE_PRI_TRISTATE (1 << 16)
-#define SIG_MODE_PRI_DRIVELOW (2 << 16)
-#define FAST_SCB1 (1 << 15)
-#define FAST_SCB0 (1 << 14)
-#define FAST_PCB1 (1 << 13)
-#define FAST_PCB0 (1 << 12)
-#define SCB1 (1 << 3)
-#define SCB0 (1 << 2)
-#define PCB1 (1 << 1)
-#define PCB0 (1 << 0)
-
-#endif
diff --git a/src/soc/intel/skylake/include/soc/serialio.h b/src/soc/intel/skylake/include/soc/serialio.h
index 2fd6dca973..0bc07c30d7 100644
--- a/src/soc/intel/skylake/include/soc/serialio.h
+++ b/src/soc/intel/skylake/include/soc/serialio.h
@@ -1,7 +1,8 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2013 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -11,84 +12,44 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _BROADWELL_SERIALIO_H_
-#define _BROADWELL_SERIALIO_H_
-
-/* Serial IO IOBP Registers */
-#define SIO_IOBP_PORTCTRL0 0xcb000000 /* SDIO D23:F0 */
-#define SIO_IOBP_PORTCTRL0_ACPI_IRQ_EN (1 << 5)
-#define SIO_IOBP_PORTCTRL0_PCI_CONF_DIS (1 << 4)
-#define SIO_IOBP_PORTCTRL1 0xcb000014 /* SDIO D23:F0 */
-#define SIO_IOBP_PORTCTRL1_SNOOP_SELECT(x) (((x) & 3) << 13)
-#define SIO_IOBP_GPIODF 0xcb000154
-#define SIO_IOBP_GPIODF_SDIO_IDLE_DET_EN (1 << 4)
-#define SIO_IOBP_GPIODF_DMA_IDLE_DET_EN (1 << 3)
-#define SIO_IOBP_GPIODF_UART_IDLE_DET_EN (1 << 2)
-#define SIO_IOBP_GPIODF_I2C_IDLE_DET_EN (1 << 1)
-#define SIO_IOBP_GPIODF_SPI_IDLE_DET_EN (1 << 0)
-#define SIO_IOBP_GPIODF_UART0_BYTE_ACCESS (1 << 10)
-#define SIO_IOBP_GPIODF_UART1_BYTE_ACCESS (1 << 11)
-#define SIO_IOBP_PORTCTRL2 0xcb000240 /* DMA D21:F0 */
-#define SIO_IOBP_PORTCTRL3 0xcb000248 /* I2C0 D21:F1 */
-#define SIO_IOBP_PORTCTRL4 0xcb000250 /* I2C1 D21:F2 */
-#define SIO_IOBP_PORTCTRL5 0xcb000258 /* SPI0 D21:F3 */
-#define SIO_IOBP_PORTCTRL6 0xcb000260 /* SPI1 D21:F4 */
-#define SIO_IOBP_PORTCTRL7 0xcb000268 /* UART0 D21:F5 */
-#define SIO_IOBP_PORTCTRL8 0xcb000270 /* UART1 D21:F6 */
-#define SIO_IOBP_PORTCTRLX(x) (0xcb000240 + ((x) * 8))
-/* PORTCTRL 2-8 have the same layout */
-#define SIO_IOBP_PORTCTRL_ACPI_IRQ_EN (1 << 21)
-#define SIO_IOBP_PORTCTRL_PCI_CONF_DIS (1 << 20)
-#define SIO_IOBP_PORTCTRL_SNOOP_SELECT(x) (((x) & 3) << 18)
-#define SIO_IOBP_PORTCTRL_INT_PIN(x) (((x) & 0xf) << 2)
-#define SIO_IOBP_PORTCTRL_PM_CAP_PRSNT (1 << 1)
-#define SIO_IOBP_FUNCDIS0 0xce00aa07 /* DMA D21:F0 */
-#define SIO_IOBP_FUNCDIS1 0xce00aa47 /* I2C0 D21:F1 */
-#define SIO_IOBP_FUNCDIS2 0xce00aa87 /* I2C1 D21:F2 */
-#define SIO_IOBP_FUNCDIS3 0xce00aac7 /* SPI0 D21:F3 */
-#define SIO_IOBP_FUNCDIS4 0xce00ab07 /* SPI1 D21:F4 */
-#define SIO_IOBP_FUNCDIS5 0xce00ab47 /* UART0 D21:F5 */
-#define SIO_IOBP_FUNCDIS6 0xce00ab87 /* UART1 D21:F6 */
-#define SIO_IOBP_FUNCDIS7 0xce00ae07 /* SDIO D23:F0 */
-#define SIO_IOBP_FUNCDIS_DIS (1 << 8)
+#ifndef _SERIALIO_H_
+#define _SERIALIO_H_
-/* Serial IO Devices */
-#define SIO_ID_SDMA 0 /* D21:F0 */
-#define SIO_ID_I2C0 1 /* D21:F1 */
-#define SIO_ID_I2C1 2 /* D21:F2 */
-#define SIO_ID_SPI0 3 /* D21:F3 */
-#define SIO_ID_SPI1 4 /* D21:F4 */
-#define SIO_ID_UART0 5 /* D21:F5 */
-#define SIO_ID_UART1 6 /* D21:F6 */
-#define SIO_ID_SDIO 7 /* D23:F0 */
+#define SIO_REG_PPR_CLOCK 0x200
+#define SIO_REG_PPR_CLOCK_EN (1 << 0)
+#define SIO_REG_PPR_CLOCK_UPDATE (1 << 31)
+#define SIO_REG_PPR_CLOCK_N_DIV 0xc35
+#define SIO_REG_PPR_CLOCK_M_DIV 0x30
-#define SIO_REG_PPR_CLOCK 0x800
-#define SIO_REG_PPR_CLOCK_EN (1 << 0)
-#define SIO_REG_PPR_CLOCK_UPDATE (1 << 31)
-#define SIO_REG_PPR_CLOCK_M_DIV 0x25a
-#define SIO_REG_PPR_CLOCK_N_DIV 0x7fff
-#define SIO_REG_PPR_RST 0x804
-#define SIO_REG_PPR_RST_ASSERT 0x3
-#define SIO_REG_PPR_GEN 0x808
-#define SIO_REG_PPR_GEN_LTR_MODE_MASK (1 << 2)
-#define SIO_REG_PPR_GEN_VOLTAGE_MASK (1 << 3)
-#define SIO_REG_PPR_GEN_VOLTAGE(x) ((x & 1) << 3)
-#define SIO_REG_AUTO_LTR 0x814
+#define SIO_REG_PPR_RESETS 0x204
+#define SIO_REG_PPR_RESETS_FUNC (1 << 0)
+#define SIO_REG_PPR_RESETS_APB (1 << 1)
+#define SIO_REG_PPR_RESETS_IDMA (1 << 2)
-#define SIO_REG_SDIO_PPR_GEN 0x1008
-#define SIO_REG_SDIO_PPR_SW_LTR 0x1010
-#define SIO_REG_SDIO_PPR_CMD12 0x3c
-#define SIO_REG_SDIO_PPR_CMD12_B30 (1 << 30)
+typedef enum {
+ PchSerialIoDisabled,
+ PchSerialIoAcpi,
+ PchSerialIoPci,
+ PchSerialIoAcpiHidden,
+ PchSerialIoLegacyUart
+} PCH_SERIAL_IO_MODE;
-#define SIO_PIN_INTA 1 /* IRQ5 in ACPI mode */
-#define SIO_PIN_INTB 2 /* IRQ6 in ACPI mode */
-#define SIO_PIN_INTC 3 /* IRQ7 in ACPI mode */
-#define SIO_PIN_INTD 4 /* IRQ13 in ACPI mode */
+typedef enum {
+ PchSerialIoIndexI2C0,
+ PchSerialIoIndexI2C1,
+ PchSerialIoIndexI2C2,
+ PchSerialIoIndexI2C3,
+ PchSerialIoIndexI2C4,
+ PchSerialIoIndexI2C5,
+ PchSerialIoIndexSpi0,
+ PchSerialIoIndexSpi1,
+ PchSerialIoIndexUart0,
+ PchSerialIoIndexUart1,
+ PchSerialIoIndexUart2,
+ PchSerialIoIndexMax
+} PCH_SERIAL_IO_CONTROLLER;
#endif
+
diff --git a/src/soc/intel/skylake/include/soc/smbus.h b/src/soc/intel/skylake/include/soc/smbus.h
index fb13c2d8a9..c081cdf3e3 100644
--- a/src/soc/intel/skylake/include/soc/smbus.h
+++ b/src/soc/intel/skylake/include/soc/smbus.h
@@ -4,6 +4,7 @@
* Copyright (C) 2005 Yinghai Lu <yinghailu@gmail.com>
* Copyright (C) 2009 coresystems GmbH
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,17 +17,19 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_SMBUS_H_
-#define _BROADWELL_SMBUS_H_
+#ifndef _SOC_SMBUS_H_
+#define _SOC_SMBUS_H_
/* PCI Configuration Space (D31:F3): SMBus */
#define SMB_BASE 0x20
#define HOSTC 0x40
#define HST_EN (1 << 0)
#define SMB_RCV_SLVA 0x09
+/* SMBUS TCO base address. */
+#define TCOBASE 0x50
/* SMBus I/O bits. */
#define SMBHSTSTAT 0x0
diff --git a/src/soc/intel/skylake/include/soc/smm.h b/src/soc/intel/skylake/include/soc/smm.h
index f7f515cd9b..d89530287e 100644
--- a/src/soc/intel/skylake/include/soc/smm.h
+++ b/src/soc/intel/skylake/include/soc/smm.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,14 +15,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_SMM_H_
-#define _BROADWELL_SMM_H_
+#ifndef _SOC_SMM_H_
+#define _SOC_SMM_H_
#include <stdint.h>
#include <cpu/x86/msr.h>
+#include <soc/intel/common/romstage.h>
+#include <soc/intel/common/memmap.h>
struct ied_header {
char signature[10];
@@ -40,23 +43,16 @@ struct smm_relocation_params {
msr_t emrr_mask;
msr_t uncore_emrr_base;
msr_t uncore_emrr_mask;
- /* The smm_save_state_in_msrs field indicates if SMM save state
+ /*
+ * The smm_save_state_in_msrs field indicates if SMM save state
* locations live in MSRs. This indicates to the CPUs how to adjust
- * the SMMBASE and IEDBASE */
+ * the SMMBASE and IEDBASE
+ */
int smm_save_state_in_msrs;
};
-/* There is a bug in the order of Kconfig includes in that arch/x86/Kconfig
- * is included after chipset code. This causes the chipset's Kconfig to be
- * clobbered by the arch/x86/Kconfig if they have the same name. */
-static inline int smm_region_size(void)
-{
- /* Make it 8MiB by default. */
- if (CONFIG_SMM_TSEG_SIZE == 0)
- return (8 << 20);
- return CONFIG_SMM_TSEG_SIZE;
-}
-
+#define smm_region_size mmap_region_granluarity
+#if IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)
int smm_initialize(void);
void smm_relocate(void);
@@ -64,10 +60,24 @@ void smm_relocate(void);
void southbridge_trigger_smi(void);
void southbridge_clear_smi_status(void);
-/* The initialization of the southbridge is split into 2 components. One is
+/*
+ * The initialization of the southbridge is split into 2 compoments. One is
* for clearing the state in the SMM registers. The other is for enabling
- * SMIs. They are split so that other work between the 2 actions. */
+ * SMIs.
+ */
void southbridge_smm_clear_state(void);
void southbridge_smm_enable_smi(void);
+#else /* CONFIG_HAVE_SMI_HANDLER */
+static inline int smm_initialize(void)
+{
+ return 0;
+}
+
+static inline void smm_relocate(void) {}
+static inline void southbridge_trigger_smi(void) {}
+static inline void southbridge_clear_smi_status(void) {}
+static inline void southbridge_smm_clear_state(void) {}
+static inline void southbridge_smm_enable_smi(void) {}
+#endif /* CONFIG_HAVE_SMI_HANDLER */
#endif
diff --git a/src/soc/intel/skylake/include/soc/spi.h b/src/soc/intel/skylake/include/soc/spi.h
index 1449e29cda..a31c9b2ceb 100644
--- a/src/soc/intel/skylake/include/soc/spi.h
+++ b/src/soc/intel/skylake/include/soc/spi.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,39 +15,39 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_SPI_H_
-#define _BROADWELL_SPI_H_
+#ifndef _SOC_SPI_H_
+#define _SOC_SPI_H_
/*
* SPI Opcode Menu setup for SPIBAR lockdown
* should support most common flash chips.
*/
-
-#define SPIBAR_OFFSET 0x3800
-#define SPIBAR8(x) RCBA8(x + SPIBAR_OFFSET)
-#define SPIBAR16(x) RCBA16(x + SPIBAR_OFFSET)
-#define SPIBAR32(x) RCBA32(x + SPIBAR_OFFSET)
-
-/* Registers within the SPIBAR */
-#define SPIBAR_SSFC 0x91
-#define SPIBAR_FDOC 0xb0
-#define SPIBAR_FDOD 0xb4
-
-#define SPI_PRR_MAX 5
-#define SPI_PRR(x) (0x74 + ((x) * 4))
-#define SPI_PRR_SHIFT 12
-#define SPI_PRR_MASK 0x1fff
-#define SPI_PRR_BASE_SHIFT 0
-#define SPI_PRR_LIMIT_SHIFT 16
-#define SPI_PRR_WPE (1 << 31)
-
-#define SPIBAR_PREOP 0x94
-#define SPIBAR_OPTYPE 0x96
-#define SPIBAR_OPMENU_LOWER 0x98
-#define SPIBAR_OPMENU_UPPER 0x9c
+#define SPIDVID_OFFSET 0x0
+/* Temporay SPI BASE ADDRESS */
+#define TEMP_SPI_BAR 0xFE010000
+/* SPI BASE ADDRESS Register */
+#define B_PCH_SPI_BAR0_MASK 0x0FFF
+#define PCH_SPI_BASE_ADDRESS 0x10
+#define SPIBAR_MEMBAR_MASK 0xFFFFF000
+/* Reigsters within the SPIBAR */
+#define SPIBAR_SSFC 0xA1
+
+#define SPIBAR_PREOP 0xA4
+#define SPIBAR_OPTYPE 0xA6
+#define SPIBAR_OPMENU_LOWER 0xA8
+#define SPIBAR_OPMENU_UPPER 0xAc
+/* STRAP LOCK Register */
+#define SPIBAR_RESET_LOCK 0xF0
+#define SPIBAR_RESET_LOCK_DISABLE 0
+#define SPIBAR_RESET_LOCK_ENABLE 1
+/* STRAP MSG Control Register*/
+#define SPIBAR_RESET_CTRL 0xF4
+#define SPIBAR_RESET_CTRL_SSMC 1
+/* STRAP Data Register*/
+#define SPIBAR_RESET_DATA 0xF8
#define SPI_OPMENU_0 0x01 /* WRSR: Write Status Register */
#define SPI_OPTYPE_0 0x01 /* Write, no address */
@@ -78,33 +79,52 @@
(SPI_OPMENU_1 << 8) | SPI_OPMENU_0)
#define SPI_OPTYPE ((SPI_OPTYPE_7 << 14) | (SPI_OPTYPE_6 << 12) | \
- (SPI_OPTYPE_5 << 10) | (SPI_OPTYPE_4 << 8) | \
- (SPI_OPTYPE_3 << 6) | (SPI_OPTYPE_2 << 4) | \
+ (SPI_OPTYPE_5 << 10) | (SPI_OPTYPE_4 << 8) | \
+ (SPI_OPTYPE_3 << 6) | (SPI_OPTYPE_2 << 4) | \
(SPI_OPTYPE_1 << 2) | (SPI_OPTYPE_0))
#define SPI_OPPREFIX ((0x50 << 8) | 0x06) /* EWSR and WREN */
-#define SPIBAR_HSFS 0x04 /* SPI hardware sequence status */
-#define SPIBAR_HSFS_FLOCKDN (1 << 15)/* Flash Configuration Lock-Down */
-#define SPIBAR_HSFS_SCIP (1 << 5) /* SPI Cycle In Progress */
-#define SPIBAR_HSFS_AEL (1 << 2) /* SPI Access Error Log */
-#define SPIBAR_HSFS_FCERR (1 << 1) /* SPI Flash Cycle Error */
-#define SPIBAR_HSFS_FDONE (1 << 0) /* SPI Flash Cycle Done */
-#define SPIBAR_HSFC 0x06 /* SPI hardware sequence control */
-#define SPIBAR_HSFC_BYTE_COUNT(c) (((c - 1) & 0x3f) << 8)
-#define SPIBAR_HSFC_CYCLE_READ (0 << 1) /* Read cycle */
-#define SPIBAR_HSFC_CYCLE_WRITE (2 << 1) /* Write cycle */
-#define SPIBAR_HSFC_CYCLE_ERASE (3 << 1) /* Erase cycle */
-#define SPIBAR_HSFC_GO (1 << 0) /* GO: start SPI transaction */
-#define SPIBAR_FADDR 0x08 /* SPI flash address */
-#define SPIBAR_FDATA(n) (0x10 + (4 * n)) /* SPI flash data */
-#define SPIBAR_SSFS 0x90
-#define SPIBAR_SSFS_ERROR (1 << 3)
-#define SPIBAR_SSFS_DONE (1 << 2)
-#define SPIBAR_SSFC 0x91
-#define SPIBAR_SSFC_DATA (1 << 14)
-#define SPIBAR_SSFC_GO (1 << 1)
-
-int spi_flash_protect(u32 start, u32 size);
-
+#define SPIBAR_HSFS 0x04 /* SPI hardware sequence status */
+#define SPIBAR_HSFS_FLOCKDN (1 << 15)/* Flash Configuration Lock-Down */
+#define SPIBAR_HSFS_SCIP (1 << 5) /* SPI Cycle In Progress */
+#define SPIBAR_HSFS_AEL (1 << 2) /* SPI Access Error Log */
+#define SPIBAR_HSFS_FCERR (1 << 1) /* SPI Flash Cycle Error */
+#define SPIBAR_HSFS_FDONE (1 << 0) /* SPI Flash Cycle Done */
+#define SPIBAR_HSFS_BERASE_MASK 3 /* Block/Sector Erase MASK */
+#define SPIBAR_HSFS_BERASE_OFFSET 3 /* Block/Sector Erase OFFSET */
+#define SPIBAR_HSFC 0x06 /* SPI hardware sequence control */
+#define SPIBAR_HSFC_BYTE_COUNT(c) (((c - 1) & 0x3f) << 8)
+#define SPIBAR_HSFC_CYCLE_READ (0 << 1) /* Read cycle */
+#define SPIBAR_HSFC_CYCLE_WRITE (2 << 1) /* Write cycle */
+#define SPIBAR_HSFC_CYCLE_ERASE (3 << 1) /* Erase cycle */
+#define SPIBAR_HSFC_GO (1 << 0) /* GO: start SPI transaction */
+#define SPIBAR_FADDR 0x08 /* SPI flash address */
+#define SPIBAR_FADDR_MASK 0x7FFFFFF
+
+#define SPIBAR_FDATA(n) (0x10 + (4 * n)) /* SPI flash data */
+#define SPIBAR_FPR(n) (0x84 + (4 * n)) /* SPI flash protected range */
+#define SPIBAR_FPR_WPE (1 << 31) /* Flash Write protected */
+#define SPIBAR_SSFS 0xA0
+#define SPIBAR_SSFS_ERROR (1 << 3)
+#define SPIBAR_SSFS_DONE (1 << 2)
+#define SPIBAR_SSFC 0xA1
+#define SPIBAR_SSFC_DATA (1 << 14)
+#define SPIBAR_SSFC_GO (1 << 1)
+
+#define SPIBAR_FDOC 0xB4
+#define SPIBAR_FDOC_COMPONENT (1 << 12)
+#define SPIBAR_FDOC_FDSI_1 (1 << 2)
+
+#define SPIBAR_FDOD 0xB8
+#define FLCOMP_C0DEN_MASK 0xF
+#define FLCOMP_C0DEN_8MB 4
+#define FLCOMP_C0DEN_16MB 5
+#define FLCOMP_C0DEN_32MB 6
+
+#define SPIBAR_BIOS_CNTL 0xDC
+#define SPIBAR_BC_WPD (1 << 0)
+#define SPIBAR_BC_EISS (1 << 5)
+
+void *get_spi_bar(void);
#endif
diff --git a/src/soc/intel/skylake/include/soc/systemagent.h b/src/soc/intel/skylake/include/soc/systemagent.h
index 325a4a5a6c..6bb5c66d2a 100644
--- a/src/soc/intel/skylake/include/soc/systemagent.h
+++ b/src/soc/intel/skylake/include/soc/systemagent.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 2007-2008 coresystems GmbH
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,31 +16,23 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_SYSTEMAGENT_H_
-#define _BROADWELL_SYSTEMAGENT_H_
+#ifndef _SOC_SYSTEMAGENT_H_
+#define _SOC_SYSTEMAGENT_H_
#include <soc/iomap.h>
#define SA_IGD_OPROM_VENDEV 0x80860406
-#define IGD_HASWELL_ULT_GT1 0x0a06
-#define IGD_HASWELL_ULT_GT2 0x0a16
-#define IGD_HASWELL_ULT_GT3 0x0a26
-#define IGD_BROADWELL_U_GT1 0x1606
-#define IGD_BROADWELL_U_GT2 0x1616
-#define IGD_BROADWELL_U_GT3_15W 0x1626
-#define IGD_BROADWELL_U_GT3_28W 0x162b
-#define IGD_BROADWELL_Y_GT2 0x161e
-#define IGD_BROADWELL_H_GT2 0x1612
-#define IGD_BROADWELL_H_GT3 0x1622
-
-#define MCH_BROADWELL_ID_U_Y 0x1604
-#define MCH_BROADWELL_REV_D0 0x06
-#define MCH_BROADWELL_REV_E0 0x08
-#define MCH_BROADWELL_REV_F0 0x09
+#define IGD_SKYLAKE_GT1_SULTM 0x1906
+#define IGD_SKYLAKE_GT2_SULXM 0x191E
+#define IGD_SKYLAKE_GT2_SULTM 0x1916
+
+#define MCH_SKYLAKE_ID_U 0x1904
+#define MCH_SKYLAKE_ID_Y 0x190c
+#define MCH_SKYLAKE_ID_ULX 0x1924
/* Device 0:0.0 PCI configuration space */
@@ -91,9 +84,9 @@
/* MCHBAR */
-#define MCHBAR8(x) *((volatile u8 *)(MCH_BASE_ADDRESS + x))
-#define MCHBAR16(x) *((volatile u16 *)(MCH_BASE_ADDRESS + x))
-#define MCHBAR32(x) *((volatile u32 *)(MCH_BASE_ADDRESS + x))
+#define MCHBAR8(x) (*(volatile u8 *)(MCH_BASE_ADDRESS + x))
+#define MCHBAR16(x) (*(volatile u16 *)(MCH_BASE_ADDRESS + x))
+#define MCHBAR32(x) (*(volatile u32 *)(MCH_BASE_ADDRESS + x))
#define MCHBAR_PEI_VERSION 0x5034
#define BIOS_RESET_CPL 0x5da8
@@ -115,8 +108,6 @@
#define MAILBOX_BIOS_CMD_FSM_MEASURE_INTVL 0x909
#define MAILBOX_BIOS_CMD_READ_PCH_POWER 0xa
#define MAILBOX_BIOS_CMD_READ_PCH_POWER_EXT 0xb
-#define MAILBOX_BIOS_CMD_READ_C9C10_VOLTAGE 0x26
-#define MAILBOX_BIOS_CMD_WRITE_C9C10_VOLTAGE 0x27
/* Errors are returned back in bits 7:0. */
#define MAILBOX_BIOS_ERROR_NONE 0
#define MAILBOX_BIOS_ERROR_INVALID_COMMAND 1
diff --git a/src/soc/intel/skylake/include/soc/xhci.h b/src/soc/intel/skylake/include/soc/xhci.h
index 2b899a3d75..8830ede865 100644
--- a/src/soc/intel/skylake/include/soc/xhci.h
+++ b/src/soc/intel/skylake/include/soc/xhci.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Google Inc.
+ * Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,11 +15,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc.
*/
-#ifndef _BROADWELL_XHCI_H_
-#define _BROADWELL_XHCI_H_
+#ifndef _SOC_XHCI_H_
+#define _SOC_XHCI_H_
+
+#include <rules.h>
/* XHCI PCI Registers */
#define XHCI_PWR_CTL_STS 0x74
@@ -39,14 +42,14 @@
#define XHCI_USB3PDO 0xe8
/* XHCI Memory Registers */
-#define XHCI_USB3_PORTSC(port) (0x530 + (port * 0x10))
+#define XHCI_USB3_PORTSC(port) (0x510 + (port * 0x10))
#define XHCI_USB3_PORTSC_CHST (0x7f << 17)
#define XHCI_USB3_PORTSC_WCE (1 << 25) /* Wake on Connect */
#define XHCI_USB3_PORTSC_WDE (1 << 26) /* Wake on Disconnect */
#define XHCI_USB3_PORTSC_WOE (1 << 27) /* Wake on Overcurrent */
#define XHCI_USB3_PORTSC_WRC (1 << 19) /* Warm Reset Complete */
-#define XHCI_USB3_PORTSC_LWS (1 << 16) /* Link Write Strobe */
-#define XHCI_USB3_PORTSC_PED (1 << 1) /* Port Enabled/Disabled */
+#define XHCI_USB3_PORTSC_LWS (1 << 16) /* Link Write Strobe */
+#define XHCI_USB3_PORTSC_PED (1 << 1) /* Port Enabled/Disabled */
#define XHCI_USB3_PORTSC_WPR (1 << 31) /* Warm Port Reset */
#define XHCI_USB3_PORTSC_PLS (0xf << 5) /* Port Link State */
#define XHCI_PLSR_DISABLED (4 << 5) /* Port is disabled */
@@ -54,7 +57,7 @@
#define XHCI_PLSR_POLLING (7 << 5) /* Port is polling */
#define XHCI_PLSW_ENABLE (5 << 5) /* Transition from disabled */
-#ifdef __SMM__
+#if ENV_SMM
void usb_xhci_sleep_prepare(device_t dev, u8 slp_typ);
#endif