Marcin Wojciechowski (marcin.wojciechowski(a)intel.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12418
-gerrit
commit e9dce3f09edf6a35d0b3d649011374c42fbca11b
Author: Marcin Wojciechowski <marcin.wojciechowski(a)intel.com>
Date: Thu Nov 12 16:05:42 2015 +0100
fsp1_0: Update rangeley to revision POSTGOLD4
Alignment of Intel Firmware Support Package 1.0 Rangeley
header and source files to the revision: POSTGOLD4
Detail changelog can be found at http://www.intel.com/fsp
FSP release date September 24, 2015
Change-Id: If1a6f95aed3e9a60af9af8cf9cd466a560ef0fe2
Signed-off-by: Marcin Wojciechowski <marcin.wojciechowski(a)intel.com>
---
.../intel/fsp1_0/rangeley/include/fspguid.h | 69 +++++
.../intel/fsp1_0/rangeley/include/fspplatform.h | 3 +-
.../intel/fsp1_0/rangeley/include/fspsupport.h | 95 +++++++
.../intel/fsp1_0/rangeley/include/fsptypes.h | 9 +-
.../intel/fsp1_0/rangeley/include/fspvpd.h | 12 +-
.../intel/fsp1_0/rangeley/srx/fsp_support.c | 288 +++++++++++++++++++++
6 files changed, 468 insertions(+), 8 deletions(-)
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspguid.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspguid.h
new file mode 100644
index 0000000..b9a6183
--- /dev/null
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspguid.h
@@ -0,0 +1,69 @@
+/** @file
+
+Copyright (C) 2014, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+**/
+
+#ifndef __FSP_GUID_H__
+#define __FSP_GUID_H__
+
+/**
+
+ FSP specific GUID HOB definitions
+
+ **/
+#define FSP_INFO_HEADER_GUID \
+ { \
+ 0x912740BE, 0x2284, 0x4734, {0xB9, 0x71, 0x84, 0xB0, 0x27, 0x35, 0x3F, 0x0C} \
+ }
+
+#define FSP_NON_VOLATILE_STORAGE_HOB_GUID \
+ { \
+ 0x721acf02, 0x4d77, 0x4c2a, { 0xb3, 0xdc, 0x27, 0xb, 0x7b, 0xa9, 0xe4, 0xb0 } \
+ }
+
+#define FSP_BOOTLOADER_TEMPORARY_MEMORY_HOB_GUID \
+ { \
+ 0xbbcff46c, 0xc8d3, 0x4113, { 0x89, 0x85, 0xb9, 0xd4, 0xf3, 0xb3, 0xf6, 0x4e } \
+ }
+
+#define FSP_HOB_RESOURCE_OWNER_FSP_GUID \
+ { \
+ 0x69a79759, 0x1373, 0x4367, { 0xa6, 0xc4, 0xc7, 0xf5, 0x9e, 0xfd, 0x98, 0x6e } \
+ }
+
+#define FSP_HOB_RESOURCE_OWNER_TSEG_GUID \
+ { \
+ 0xd038747c, 0xd00c, 0x4980, { 0xb3, 0x19, 0x49, 0x01, 0x99, 0xa4, 0x7d, 0x55 } \
+ }
+
+#define FSP_HOB_RESOURCE_OWNER_GRAPHICS_GUID \
+ { \
+ 0x9c7c3aa7, 0x5332, 0x4917, { 0x82, 0xb9, 0x56, 0xa5, 0xf3, 0xe6, 0x2a, 0x07 } \
+ }
+
+#endif
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h
index ce479bf..c35dca0 100644
--- a/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h
@@ -1,6 +1,6 @@
/**
-Copyright (C) 2013, Intel Corporation
+Copyright (C) 2013 - 2015, Intel Corporation
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -74,6 +74,7 @@ typedef struct {
UINT8 tRTPmin; // 27 Minimum Internal Read to Precharge Command Delay Time (tRTPmin)
UINT8 UpperNibbleFortFAW; // 28 Upper Nibble for tFAW
UINT8 tFAWmin; // 29 Minimum Four Activate Window Delay Time (tFAWmin)
+ UINT8 SdramThermalRefreshOption; // 31 SdramThermalRefreshOption
UINT8 ModuleThermalSensor; // 32 ModuleThermalSensor
UINT8 SDRAMDeviceType; // 33 SDRAM Device Type
UINT8 tCKminFine; // 34 Fine Offset for SDRAM Minimum Cycle Time (tCKmin)
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspsupport.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspsupport.h
new file mode 100644
index 0000000..dbbbf77
--- /dev/null
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspsupport.h
@@ -0,0 +1,95 @@
+/** @file
+
+Copyright (C) 2013 - 2014, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+**/
+
+#ifndef __FSP_SUPPORT_H__
+#define __FSP_SUPPORT_H__
+
+#include "fsptypes.h"
+#include "fspfv.h"
+#include "fspffs.h"
+#include "fspapi.h"
+#include "fsphob.h"
+#include "fspguid.h"
+#include "fspplatform.h"
+#include "fspinfoheader.h"
+#include "fspbootmode.h"
+#include "fspvpd.h"
+
+UINT32
+GetUsableLowMemTop (
+ CONST VOID *HobListPtr
+ );
+
+UINT64
+GetUsableHighMemTop (
+ CONST VOID *HobListPtr
+ );
+
+VOID *
+GetGuidHobDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length,
+ EFI_GUID *Guid
+ );
+
+VOID
+GetFspReservedMemoryFromGuid (
+ CONST VOID *HobListPtr,
+ EFI_PHYSICAL_ADDRESS *FspMemoryBase,
+ UINT64 *FspMemoryLength,
+ EFI_GUID *FspReservedMemoryGuid
+ );
+
+UINT32
+GetTsegReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+);
+
+UINT32
+GetFspReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+);
+
+VOID*
+GetFspNvsDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+ );
+
+VOID *
+GetBootloaderTempMemoryBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+ );
+
+
+#endif
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h
index 5912e01..3d2e663 100644
--- a/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h
@@ -100,13 +100,18 @@ typedef struct {
#define TRUE ((BOOLEAN)(1==1))
#define FALSE ((BOOLEAN)(0==1))
+static inline void DebugDeadLoop(void) {
+ for (;;);
+}
+
#define FSPAPI __attribute__((cdecl))
#define EFIAPI __attribute__((cdecl))
+#define _ASSERT(Expression) DebugDeadLoop()
#define ASSERT(Expression) \
do { \
if (!(Expression)) { \
- for (;;); \
+ _ASSERT (Expression); \
} \
} while (FALSE)
@@ -175,4 +180,4 @@ typedef UINT32 EFI_STATUS;
#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
(SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
-#endif
+#endif
\ No newline at end of file
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h
index fba38a0..4ba1a28 100644
--- a/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h
@@ -1,6 +1,6 @@
/** @file
-Copyright (C) 2013-2014 Intel Corporation
+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:
@@ -50,7 +50,8 @@ typedef struct _UPD_DATA_REGION {
UINT8 PcdSpdBaseAddress_0_1; /* Offset 0x0026 */
UINT8 PcdSpdBaseAddress_1_0; /* Offset 0x0027 */
UINT8 PcdSpdBaseAddress_1_1; /* Offset 0x0028 */
- UINT8 UnusedUpdSpace1[7]; /* Offset 0x0029 */
+ UINT8 PcdExtendedTemperatureEnable; /* Offset 0x0029 */
+ UINT8 UnusedUpdSpace1[6]; /* Offset 0x002A */
UINT8 PcdEnableLan; /* Offset 0x0030 */
UINT8 PcdEnableSata2; /* Offset 0x0031 */
UINT8 PcdEnableSata3; /* Offset 0x0032 */
@@ -65,13 +66,14 @@ typedef struct _UPD_DATA_REGION {
UINT8 PcdPrintDebugMessages; /* Offset 0x0040 */
UINT8 PcdFastboot; /* Offset 0x0041 */
UINT8 PcdEccSupport; /* Offset 0x0042 */
- UINT8 PcdCustomerRevision[32]; /* Offset 0x0043 */
- UINT8 UnusedUpdSpace3[13]; /* Offset 0x0063 */
+ UINT8 PcdSerialPortBaudRate; /* Offset 0x0043 */
+ UINT8 PcdCustomerRevision[32]; /* Offset 0x0044 */
+ UINT8 UnusedUpdSpace3[12]; /* Offset 0x0064 */
UINT16 PcdRegionTerminator; /* Offset 0x0070 */
} UPD_DATA_REGION;
#define VPD_IMAGE_ID 0x562D474E524E5641 /* 'AVNRNG-V' */
-#define VPD_IMAGE_REV 0x00000102
+#define VPD_IMAGE_REV 0x00000140
typedef struct _VPD_DATA_REGION {
UINT64 PcdVpdRegionSign; /* Offset 0x0000 */
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/srx/fsp_support.c b/src/vendorcode/intel/fsp1_0/rangeley/srx/fsp_support.c
new file mode 100644
index 0000000..9f15b3e
--- /dev/null
+++ b/src/vendorcode/intel/fsp1_0/rangeley/srx/fsp_support.c
@@ -0,0 +1,288 @@
+/** @file
+
+Copyright (C) 2013 - 2014, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+**/
+
+#include <types.h>
+#include <string.h>
+#include "fspsupport.h"
+
+/**
+ This function retrieves the top of usable low memory.
+
+ @param HobListPtr A HOB list pointer.
+
+ @retval Usable low memory top.
+
+**/
+UINT32
+GetUsableLowMemTop (
+ CONST VOID *HobStart
+)
+{
+ EFI_PEI_HOB_POINTERS Hob;
+ UINT32 MemLen;
+ /*
+ * Get the HOB list for processing
+ */
+ Hob.Raw = (VOID *)HobStart;
+
+ /*
+ * Collect memory ranges
+ */
+ MemLen = 0x100000;
+ while (!END_OF_HOB_LIST (Hob)) {
+ if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
+ /*
+ * Need memory above 1MB to be collected here
+ */
+ if (Hob.ResourceDescriptor->PhysicalStart >= 0x100000 &&
+ Hob.ResourceDescriptor->PhysicalStart < (EFI_PHYSICAL_ADDRESS) 0x100000000) {
+ MemLen += (UINT32) (Hob.ResourceDescriptor->ResourceLength);
+ }
+ }
+ }
+ Hob.Raw = GET_NEXT_HOB (Hob);
+ }
+
+ return MemLen;
+}
+
+/**
+ This function retrieves the top of usable high memory.
+
+ @param HobListPtr A HOB list pointer.
+
+ @retval Usable high memory top.
+
+**/
+UINT64
+GetUsableHighMemTop (
+ CONST VOID *HobStart
+)
+{
+ EFI_PEI_HOB_POINTERS Hob;
+ UINT64 MemTop;
+ /*
+ * Get the HOB list for processing
+ */
+ Hob.Raw = (VOID *)HobStart;
+
+ /*
+ * Collect memory ranges
+ */
+ MemTop = 0x100000000;
+ while (!END_OF_HOB_LIST (Hob)) {
+ if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
+ /*
+ * Need memory above 1MB to be collected here
+ */
+ if (Hob.ResourceDescriptor->PhysicalStart >= (EFI_PHYSICAL_ADDRESS) 0x100000000) {
+ MemTop += (UINT32) (Hob.ResourceDescriptor->ResourceLength);
+ }
+ }
+ }
+ Hob.Raw = GET_NEXT_HOB (Hob);
+ }
+
+ return MemTop;
+}
+
+/**
+ This function retrieves a special reserved memory region.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the GUID HOB data buffer length. If the GUID HOB is
+ located, the length will be updated.
+ @param OwnerGuid A pointer to the owner guild.
+ @retval Reserved region start address. 0 if this region does not exist.
+
+**/
+VOID
+GetFspReservedMemoryFromGuid (
+ CONST VOID *HobListPtr,
+ EFI_PHYSICAL_ADDRESS *Base,
+ UINT64 *Length,
+ EFI_GUID *OwnerGuid
+)
+{
+ EFI_PEI_HOB_POINTERS Hob;
+
+ /*
+ * Get the HOB list for processing
+ */
+ Hob.Raw = (VOID *)HobListPtr;
+
+ /*
+ * Collect memory ranges
+ */
+ while (!END_OF_HOB_LIST (Hob)) {
+ if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) {
+ if (CompareGuid(&Hob.ResourceDescriptor->Owner, OwnerGuid)) {
+ *Base = (EFI_PHYSICAL_ADDRESS) (Hob.ResourceDescriptor->PhysicalStart);
+ *Length = (UINT64) (Hob.ResourceDescriptor->ResourceLength);
+ break;
+ }
+ }
+ }
+ Hob.Raw = GET_NEXT_HOB (Hob);
+ }
+}
+
+/**
+ This function retrieves the TSEG reserved normal memory.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the TSEG reserved memory length buffer. If the GUID HOB is
+ located, the length will be updated.
+ @param Guid A pointer to owner HOB GUID.
+ @retval NULL Failed to find the TSEG reserved memory.
+ @retval others TSEG reserved memory base.
+
+**/
+UINT32
+GetTsegReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID TsegOwnerHobGuid = FSP_HOB_RESOURCE_OWNER_TSEG_GUID;
+ UINT64 Length64 = 0;
+ EFI_PHYSICAL_ADDRESS Base = 0;
+
+ GetFspReservedMemoryFromGuid (HobListPtr, &Base, &Length64, (EFI_GUID *)&TsegOwnerHobGuid);
+ if ((Length != NULL) && (Base != 0)) {
+ *Length = (UINT32)Length64;
+ }
+ return (UINT32)Base;
+}
+
+/**
+ This function retrieves the FSP reserved normal memory.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the FSP reserved memory length buffer. If the GUID HOB is
+ located, the length will be updated.
+ @param Guid A pointer to owner HOB GUID.
+ @retval NULL Failed to find the FSP reserved memory.
+ @retval others FSP reserved memory base.
+
+**/
+UINT32
+GetFspReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID FspOwnerHobGuid = FSP_HOB_RESOURCE_OWNER_FSP_GUID;
+ UINT64 Length64 = 0;
+ EFI_PHYSICAL_ADDRESS Base = 0;
+
+ GetFspReservedMemoryFromGuid (HobListPtr, &Base, &Length64, (EFI_GUID *)&FspOwnerHobGuid);
+ if ((Length != NULL) && (Base != 0)) {
+ *Length = (UINT32)Length64;
+ }
+ return (UINT32)Base;
+}
+
+
+/**
+ This function retrieves a GUIDed HOB data buffer and size.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the GUID HOB data buffer length. If the
+ GUID HOB is located, the length will be updated.
+ @param Guid A pointer to HOB GUID.
+ @retval NULL Failed to find the GUID HOB.
+ @retval others GUID HOB data buffer pointer.
+
+**/
+VOID *
+GetGuidHobDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length,
+ EFI_GUID *Guid
+)
+{
+ UINT8 *GuidHob;
+
+ /* FSP NVS DATA HOB */
+ GuidHob = GetNextGuidHob(Guid, HobListPtr);
+ if (GuidHob == NULL) {
+ return NULL;
+ } else {
+ if (Length) {
+ *Length = GET_GUID_HOB_DATA_SIZE (GuidHob);
+ }
+ return GET_GUID_HOB_DATA (GuidHob);
+ }
+}
+
+/**
+ This function retrieves FSP Non-volatile Storage HOB buffer and size.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the NVS data buffer length. If the FSP NVS
+ HOB is located, the length will be updated.
+ @retval NULL Failed to find the NVS HOB.
+ @retval others FSP NVS data buffer pointer.
+
+**/
+VOID *
+GetFspNvsDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID FspNvsHobGuid = FSP_NON_VOLATILE_STORAGE_HOB_GUID;
+ return GetGuidHobDataBuffer (HobListPtr, Length, (EFI_GUID *)&FspNvsHobGuid);
+}
+
+
+/**
+ This function retrieves Bootloader temporary stack buffer and size.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the Bootloader temporary stack length.
+ If the HOB is located, the length will be updated.
+ @retval NULL Failed to find the Bootloader temporary stack HOB.
+ @retval others Bootloader temporary stackbuffer pointer.
+
+**/
+VOID *
+GetBootloaderTempMemoryBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID FspBootloaderTemporaryMemoryHobGuid = FSP_BOOTLOADER_TEMPORARY_MEMORY_HOB_GUID;
+ return GetGuidHobDataBuffer (HobListPtr, Length, (EFI_GUID *)&FspBootloaderTemporaryMemoryHobGuid);
+}
Damien Zammit (damien(a)zamaudio.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12432
-gerrit
commit caaf4d3c615f38c9a00c53919b148d97aa422e8d
Author: Damien Zammit <damien(a)zamaudio.com>
Date: Sat Nov 14 01:05:21 2015 +1100
NOTFORMERGE: Final hack for Pineview board to boot
This needs to be cleaned up so that a working patch can be
submitted. However I am providing this dirty hack here to complete the
Intel D510MO board port.
It modifies the cpu bits and CAR includes for an Atom CPU,
but clearly cannot be merged as is.
Change-Id: I088ba51498047027ee172dfc6628fcd00624f110
Signed-off-by: Damien Zammit <damien(a)zamaudio.com>
---
src/cpu/intel/model_106cx/Kconfig | 2 +-
src/cpu/intel/model_106cx/Makefile.inc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cpu/intel/model_106cx/Kconfig b/src/cpu/intel/model_106cx/Kconfig
index 09acfd9..a311dc2 100644
--- a/src/cpu/intel/model_106cx/Kconfig
+++ b/src/cpu/intel/model_106cx/Kconfig
@@ -16,6 +16,6 @@ if CPU_INTEL_MODEL_106CX
config CPU_ADDR_BITS
int
- default 32
+ default 36
endif
diff --git a/src/cpu/intel/model_106cx/Makefile.inc b/src/cpu/intel/model_106cx/Makefile.inc
index 25631e5..ad7b733 100644
--- a/src/cpu/intel/model_106cx/Makefile.inc
+++ b/src/cpu/intel/model_106cx/Makefile.inc
@@ -1,5 +1,5 @@
ramstage-y += model_106cx_init.c
subdirs-y += ../../x86/name
-cpu_incs-y += $(src)/cpu/intel/car/cache_as_ram_ht.inc
+cpu_incs += $(src)/cpu/intel/model_6ex/cache_as_ram.inc
cpu_microcode_bins += 3rdparty/blobs/cpu/intel/model_106cx/microcode.bin
Damien Zammit (damien(a)zamaudio.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10074
-gerrit
commit 6ed5cce94d2f3cca6194c84fccbc9a23dc545277
Author: Damien Zammit <damien(a)zamaudio.com>
Date: Mon May 4 10:41:21 2015 +1000
mainboard/intel/d510mo: Add Intel D510MO mainboard
Board currently has no raminit, (uses Pineview minimal northbridge)
Board boots to UART console.
Change-Id: I8e459c6d40e0711fac8fb8cfbf31d9cb2aaab3aa
Signed-off-by: Damien Zammit <damien(a)zamaudio.com>
---
src/mainboard/intel/d510mo/Kconfig | 61 +++++++++
src/mainboard/intel/d510mo/Kconfig.name | 2 +
src/mainboard/intel/d510mo/acpi/ec.asl | 49 +++++++
src/mainboard/intel/d510mo/acpi/ich7_pci_irqs.asl | 82 ++++++++++++
src/mainboard/intel/d510mo/acpi/mainboard.asl | 34 +++++
.../intel/d510mo/acpi/pineview_pci_irqs.asl | 69 ++++++++++
src/mainboard/intel/d510mo/acpi/superio.asl | 45 +++++++
src/mainboard/intel/d510mo/acpi_tables.c | 66 ++++++++++
src/mainboard/intel/d510mo/board_info.txt | 5 +
src/mainboard/intel/d510mo/devicetree.cb | 88 +++++++++++++
src/mainboard/intel/d510mo/dsdt.asl | 51 ++++++++
src/mainboard/intel/d510mo/hda_verb.c | 7 +
src/mainboard/intel/d510mo/romstage.c | 145 +++++++++++++++++++++
13 files changed, 704 insertions(+)
diff --git a/src/mainboard/intel/d510mo/Kconfig b/src/mainboard/intel/d510mo/Kconfig
new file mode 100644
index 0000000..021cdc8
--- /dev/null
+++ b/src/mainboard/intel/d510mo/Kconfig
@@ -0,0 +1,61 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.com>
+#
+# 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
+#
+if BOARD_INTEL_D510MO
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select CPU_INTEL_SOCKET_ATOM_D5XX
+ select CPU_MICROCODE_CBFS_NONE
+ select NORTHBRIDGE_INTEL_PINEVIEW
+ select SOUTHBRIDGE_INTEL_I82801GX
+ select SUPERIO_WINBOND_W83627THG
+ #select HAVE_PIRQ_TABLE
+ select HAVE_ACPI_TABLES
+ #select BROKEN_CAR_MIGRATE
+ #select USE_WATCHDOG_ON_BOOT
+ #select UDELAY_TSC
+ #select EARLY_CBMEM_INIT
+ select BOARD_ROMSIZE_KB_1024
+ select POST_IO
+
+config MAX_CPUS
+ int
+ default 4
+
+config MMCONF_BASE_ADDRESS
+ hex
+ default 0xe0000000
+
+config CBFS_SIZE
+ hex "Size of CBFS filesystem in ROM"
+ default 0x100000
+
+config MAINBOARD_DIR
+ string
+ default intel/d510mo
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "D510MO"
+
+config IRQ_SLOT_COUNT
+ int
+ default 7
+
+endif # BOARD_INTEL_D510MO
diff --git a/src/mainboard/intel/d510mo/Kconfig.name b/src/mainboard/intel/d510mo/Kconfig.name
new file mode 100644
index 0000000..2df0dca
--- /dev/null
+++ b/src/mainboard/intel/d510mo/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_INTEL_D510MO
+ bool "D510MO"
diff --git a/src/mainboard/intel/d510mo/acpi/ec.asl b/src/mainboard/intel/d510mo/acpi/ec.asl
new file mode 100644
index 0000000..31c7001
--- /dev/null
+++ b/src/mainboard/intel/d510mo/acpi/ec.asl
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+Device(EC0)
+{
+ Name (_HID, EISAID("PNP0C09"))
+ Name (_UID, 1)
+
+ Method (_CRS, 0)
+ {
+ Name (ECMD, ResourceTemplate()
+ {
+ IO (Decode16, 0x62, 0x62, 0, 1)
+ IO (Decode16, 0x66, 0x66, 0, 1)
+ })
+
+ Return (ECMD)
+ }
+
+ Method (_REG, 2)
+ {
+ // This method is needed by Windows XP/2000
+ // for EC initialization before a driver
+ // is loaded
+ }
+
+ Name (_GPE, 23) // GPI07 / GPE23 -> Runtime SCI
+
+ // TODO EC Query methods
+
+ // TODO Scope _SB devices for AC power, LID, Power button
+
+}
diff --git a/src/mainboard/intel/d510mo/acpi/ich7_pci_irqs.asl b/src/mainboard/intel/d510mo/acpi/ich7_pci_irqs.asl
new file mode 100644
index 0000000..cf9f98c
--- /dev/null
+++ b/src/mainboard/intel/d510mo/acpi/ich7_pci_irqs.asl
@@ -0,0 +1,82 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+/* This is board specific information: IRQ routing for the
+ * 0:1e.0 PCI bridge of the ICH7
+ */
+
+If (PICM) {
+ Return (Package() {
+ Package() { 0x0000ffff, 0, 0, 22},
+ Package() { 0x0000ffff, 1, 0, 20},
+ Package() { 0x0000ffff, 2, 0, 17},
+ Package() { 0x0000ffff, 3, 0, 16},
+
+ Package() { 0x0001ffff, 0, 0, 22},
+ Package() { 0x0001ffff, 1, 0, 20},
+ Package() { 0x0001ffff, 2, 0, 17},
+ Package() { 0x0001ffff, 3, 0, 16},
+
+ Package() { 0x0002ffff, 0, 0, 22},
+ Package() { 0x0002ffff, 1, 0, 20},
+ Package() { 0x0002ffff, 2, 0, 17},
+ Package() { 0x0002ffff, 3, 0, 16},
+
+ Package() { 0x0003ffff, 0, 0, 22},
+ Package() { 0x0003ffff, 1, 0, 20},
+ Package() { 0x0003ffff, 2, 0, 17},
+ Package() { 0x0003ffff, 3, 0, 16},
+
+ Package() { 0x0005ffff, 0, 0, 22},
+ Package() { 0x0005ffff, 1, 0, 20},
+ Package() { 0x0005ffff, 2, 0, 17},
+ Package() { 0x0005ffff, 3, 0, 16},
+
+ Package() { 0x0008ffff, 0, 0, 20},
+ })
+} Else {
+ Return (Package() {
+ Package() { 0x0000ffff, 0, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0000ffff, 1, \_SB.PCI0.LPCB.LNKE, 0},
+ Package() { 0x0000ffff, 2, \_SB.PCI0.LPCB.LNKB, 0},
+ Package() { 0x0000ffff, 3, \_SB.PCI0.LPCB.LNKA, 0},
+
+ Package() { 0x0001ffff, 0, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0001ffff, 1, \_SB.PCI0.LPCB.LNKE, 0},
+ Package() { 0x0001ffff, 2, \_SB.PCI0.LPCB.LNKB, 0},
+ Package() { 0x0001ffff, 3, \_SB.PCI0.LPCB.LNKA, 0},
+
+ Package() { 0x0002ffff, 0, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0002ffff, 1, \_SB.PCI0.LPCB.LNKE, 0},
+ Package() { 0x0002ffff, 2, \_SB.PCI0.LPCB.LNKB, 0},
+ Package() { 0x0002ffff, 3, \_SB.PCI0.LPCB.LNKA, 0},
+
+ Package() { 0x0003ffff, 0, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0003ffff, 1, \_SB.PCI0.LPCB.LNKE, 0},
+ Package() { 0x0003ffff, 2, \_SB.PCI0.LPCB.LNKB, 0},
+ Package() { 0x0003ffff, 3, \_SB.PCI0.LPCB.LNKA, 0},
+
+ Package() { 0x0005ffff, 0, \_SB.PCI0.LPCB.LNKG, 0},
+ Package() { 0x0005ffff, 1, \_SB.PCI0.LPCB.LNKE, 0},
+ Package() { 0x0005ffff, 2, \_SB.PCI0.LPCB.LNKB, 0},
+ Package() { 0x0005ffff, 3, \_SB.PCI0.LPCB.LNKA, 0},
+
+ Package() { 0x0008ffff, 0, \_SB.PCI0.LPCB.LNKE, 0},
+ })
+}
diff --git a/src/mainboard/intel/d510mo/acpi/mainboard.asl b/src/mainboard/intel/d510mo/acpi/mainboard.asl
new file mode 100644
index 0000000..73189be
--- /dev/null
+++ b/src/mainboard/intel/d510mo/acpi/mainboard.asl
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+Device (SLPB)
+{
+ Name(_HID, EisaId("PNP0C0E"))
+
+ // Wake
+ Name(_PRW, Package(){0x1d, 0x04})
+}
+
+Device (PWRB)
+{
+ Name(_HID, EisaId("PNP0C0C"))
+
+ // Wake
+ Name(_PRW, Package(){0x1d, 0x04})
+}
diff --git a/src/mainboard/intel/d510mo/acpi/pineview_pci_irqs.asl b/src/mainboard/intel/d510mo/acpi/pineview_pci_irqs.asl
new file mode 100644
index 0000000..446b6b6
--- /dev/null
+++ b/src/mainboard/intel/d510mo/acpi/pineview_pci_irqs.asl
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+/* This is board specific information: IRQ routing for the
+ * i945
+ */
+
+
+// PCI Interrupt Routing
+Method(_PRT)
+{
+ If (PICM) {
+ Return (Package() {
+ // High Definition Audio 0:1b.0
+ Package() { 0x001bffff, 0, 0, 22 },
+ // PCIe Root Ports 0:1c.x
+ Package() { 0x001cffff, 0, 0, 17 },
+ Package() { 0x001cffff, 1, 0, 16 },
+ Package() { 0x001cffff, 2, 0, 18 },
+ Package() { 0x001cffff, 3, 0, 19 },
+ // USB and EHCI 0:1d.x
+ Package() { 0x001dffff, 0, 0, 23 },
+ Package() { 0x001dffff, 1, 0, 19 },
+ Package() { 0x001dffff, 2, 0, 18 },
+ Package() { 0x001dffff, 3, 0, 16 },
+ // AC97/IDE 0:1e.2, 0:1e.3
+ Package() { 0x001effff, 0, 0, 20 },
+ // LPC device 0:1f.0, 0:1f.2
+ Package() { 0x001fffff, 0, 0, 19 },
+ Package() { 0x001fffff, 1, 0, 19 },
+ })
+ } Else {
+ Return (Package() {
+ // High Definition Audio 0:1b.0
+ Package() { 0x001bffff, 0, \_SB.PCI0.LPCB.LNKG, 0 },
+ // PCIe Root Ports 0:1c.x
+ Package() { 0x001cffff, 0, \_SB.PCI0.LPCB.LNKB, 0 },
+ Package() { 0x001cffff, 1, \_SB.PCI0.LPCB.LNKA, 0 },
+ Package() { 0x001cffff, 2, \_SB.PCI0.LPCB.LNKC, 0 },
+ Package() { 0x001cffff, 3, \_SB.PCI0.LPCB.LNKD, 0 },
+ // USB and EHCI 0:1d.x
+ Package() { 0x001dffff, 0, \_SB.PCI0.LPCB.LNKH, 0 },
+ Package() { 0x001dffff, 1, \_SB.PCI0.LPCB.LNKD, 0 },
+ Package() { 0x001dffff, 2, \_SB.PCI0.LPCB.LNKC, 0 },
+ Package() { 0x001dffff, 3, \_SB.PCI0.LPCB.LNKA, 0 },
+ // AC97/IDE 0:1e.2, 0:1e.3
+ Package() { 0x001effff, 0, \_SB.PCI0.LPCB.LNKE, 0 },
+ // LPC device 0:1f.0, 0:1f.2
+ Package() { 0x001fffff, 0, \_SB.PCI0.LPCB.LNKD, 0 },
+ Package() { 0x001fffff, 1, \_SB.PCI0.LPCB.LNKD, 0 },
+ })
+ }
+}
diff --git a/src/mainboard/intel/d510mo/acpi/superio.asl b/src/mainboard/intel/d510mo/acpi/superio.asl
new file mode 100644
index 0000000..d615242
--- /dev/null
+++ b/src/mainboard/intel/d510mo/acpi/superio.asl
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+
+Device (SIO1)
+{
+ Name (_HID, EISAID("PNP0A05"))
+ Name (_UID, 1)
+
+ Device (UAR1)
+ {
+ Name(_HID, EISAID("PNP0501"))
+ Name(_UID, 1)
+
+ // Some methods need an implementation here:
+ // missing: _STA, _DIS, _CRS, _PRS,
+ // missing: _SRS, _PS0, _PS3
+ }
+
+ Device (UAR2)
+ {
+ Name(_HID, EISAID("PNP0501"))
+ Name(_UID, 2)
+
+ // Some methods need an implementation here:
+ // missing: _STA, _DIS, _CRS, _PRS,
+ // missing: _SRS, _PS0, _PS3
+ }
+}
diff --git a/src/mainboard/intel/d510mo/acpi_tables.c b/src/mainboard/intel/d510mo/acpi_tables.c
new file mode 100644
index 0000000..35c23a5
--- /dev/null
+++ b/src/mainboard/intel/d510mo/acpi_tables.c
@@ -0,0 +1,66 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+#include <types.h>
+#include <string.h>
+#include <console/console.h>
+#include <arch/acpi.h>
+#include <arch/acpigen.h>
+#include <arch/smp/mpspec.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <device/pci_ids.h>
+#include <cpu/x86/msr.h>
+#include <arch/ioapic.h>
+
+#include "southbridge/intel/i82801gx/nvs.h"
+
+void acpi_create_gnvs(global_nvs_t *gnvs)
+{
+}
+
+unsigned long acpi_fill_madt(unsigned long current)
+{
+ /* Local APICs */
+ current = acpi_create_madt_lapics(current);
+
+ /* IOAPIC */
+ current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
+ 2, IO_APIC_ADDR, 0);
+
+ /* INT_SRC_OVR */
+ current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
+ current, 0, 0, 2, 0);
+ current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
+ current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_HIGH);
+
+ return current;
+}
+
+unsigned long acpi_fill_slit(unsigned long current)
+{
+ // Not implemented
+ return current;
+}
+
+unsigned long acpi_fill_srat(unsigned long current)
+{
+ /* No NUMA, no SRAT */
+ return current;
+}
diff --git a/src/mainboard/intel/d510mo/board_info.txt b/src/mainboard/intel/d510mo/board_info.txt
new file mode 100644
index 0000000..192798a
--- /dev/null
+++ b/src/mainboard/intel/d510mo/board_info.txt
@@ -0,0 +1,5 @@
+Category: desktop
+Board URL: http://www.intel.com/p/en_US/support/highlights/dsktpboards/d510mo
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: n
diff --git a/src/mainboard/intel/d510mo/devicetree.cb b/src/mainboard/intel/d510mo/devicetree.cb
new file mode 100644
index 0000000..69431cb
--- /dev/null
+++ b/src/mainboard/intel/d510mo/devicetree.cb
@@ -0,0 +1,88 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.com>
+#
+# 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; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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
+#
+
+chip northbridge/intel/pineview # Northbridge
+ device cpu_cluster 0 on # APIC cluster
+ chip cpu/intel/model_106cx # CPU
+ device lapic 00 on end # APIC
+ device lapic 01 on end # APIC
+ device lapic 02 on end # APIC
+ device lapic 03 on end # APIC
+ end
+ end
+ device domain 0 on # PCI domain
+ device pci 0.0 on end # Host Bridge
+ device pci 2.0 off end # Integrated graphics controller
+ chip southbridge/intel/i82801gx # Southbridge
+ device pci 1b.0 on end # Audio
+ device pci 1c.0 on end # PCIe 1
+ device pci 1c.1 on end # PCIe 2
+ device pci 1c.2 on end # PCIe 3
+ device pci 1c.3 on end # PCIe 4
+ device pci 1d.0 on end # USB
+ device pci 1d.1 on end # USB
+ device pci 1d.2 on end # USB
+ device pci 1d.3 on end # USB
+ device pci 1d.7 on end # USB
+ device pci 1e.0 off end # PCI bridge
+ device pci 1f.0 on # ISA bridge
+ chip superio/winbond/w83627thg # Super I/O
+ device pnp 4e.0 off end # Floppy
+ device pnp 4e.1 on # Parallel port
+ io 0x60 = 0x378
+ irq 0x70 = 7
+ drq 0x74 = 4
+ end
+ device pnp 4e.2 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 4e.3 on # COM2
+ io 0x60 = 0x2f8
+ irq 0x70 = 3
+ drq 0xf1 = 0
+ end
+ device pnp 4e.5 on # PS/2 keyboard / mouse
+ io 0x60 = 0x60
+ io 0x62 = 0x64
+ irq 0x70 = 1 # PS/2 keyboard interrupt
+ irq 0x72 = 12 # PS/2 mouse interrupt
+ drq 0xf0 = 0x80
+ end
+ device pnp 4e.6 off end
+ device pnp 4e.7 off end
+ device pnp 4e.8 off end
+ device pnp 4e.9 off end
+ device pnp 4e.a off end # ACPI
+ device pnp 4e.b on # HWM
+ io 0x60 = 0x290
+ irq 0x70 = 0
+ end
+ end
+ end
+ device pci 1f.1 off end
+ device pci 1f.2 on end # SATA
+ device pci 1f.3 on end # SMbus
+ device pci 1f.4 off end
+ device pci 1f.5 off end
+ device pci 1f.6 off end
+ end
+ end
+end
diff --git a/src/mainboard/intel/d510mo/dsdt.asl b/src/mainboard/intel/d510mo/dsdt.asl
new file mode 100644
index 0000000..124e56c
--- /dev/null
+++ b/src/mainboard/intel/d510mo/dsdt.asl
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, // DSDT revision: ACPI v2.0
+ "COREv4", // OEM id
+ "COREBOOT", // OEM table id
+ 0x20090419 // OEM revision
+)
+{
+ // global NVS and variables
+ #include <southbridge/intel/i82801gx/acpi/globalnvs.asl>
+ #include <southbridge/intel/i82801gx/acpi/platform.asl>
+
+ #include "acpi/ec.asl"
+
+ // mainboard specific devices
+ #include "acpi/mainboard.asl"
+
+ // Thermal Zone
+ //#include "acpi/thermal.asl"
+
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ #include <northbridge/intel/pineview/acpi/pineview.asl>
+ #include <southbridge/intel/i82801gx/acpi/ich7.asl>
+ }
+ }
+
+ /* Chipset specific sleep states */
+ #include <southbridge/intel/i82801gx/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/intel/d510mo/hda_verb.c b/src/mainboard/intel/d510mo/hda_verb.c
new file mode 100644
index 0000000..072a306
--- /dev/null
+++ b/src/mainboard/intel/d510mo/hda_verb.c
@@ -0,0 +1,7 @@
+#include <device/azalia_device.h>
+
+const u32 cim_verb_data[0] = {};
+
+const u32 pc_beep_verbs[0] = {};
+
+AZALIA_ARRAY_SIZES;
diff --git a/src/mainboard/intel/d510mo/romstage.c b/src/mainboard/intel/d510mo/romstage.c
new file mode 100644
index 0000000..b469608
--- /dev/null
+++ b/src/mainboard/intel/d510mo/romstage.c
@@ -0,0 +1,145 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Damien Zammit <damien(a)zamaudio.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <device/pci_def.h>
+#include <arch/io.h>
+#include <device/pnp_def.h>
+#include <console/console.h>
+#include <southbridge/intel/i82801gx/i82801gx.h>
+#include <northbridge/intel/pineview/raminit.h>
+#include <northbridge/intel/pineview/pineview.h>
+#include <cpu/x86/bist.h>
+#include <cpu/x86/lapic.h>
+#include <superio/winbond/w83627thg/w83627thg.h>
+#include <superio/winbond/common/winbond.h>
+#include <lib.h>
+#include <arch/stages.h>
+
+#define SERIAL_DEV PNP_DEV(0x4e, W83627THG_SP1)
+#define SUPERIO_DEV PNP_DEV(0x4e, 0)
+
+#include <cpu/intel/romstage.h>
+
+/* Early mainboard specific GPIO setup.
+ * We should use standard gpio.h eventually
+ */
+static void mb_gpio_init(void)
+{
+ device_t dev;
+
+ /* Southbridge GPIOs. */
+ dev = PCI_DEV(0x0, 0x1f, 0x0);
+
+ /* Set the value for GPIO base address register and enable GPIO. */
+ pci_write_config32(dev, GPIO_BASE, (DEFAULT_GPIOBASE | 1));
+ pci_write_config8(dev, GPIO_CNTL, 0x10);
+
+ outl(0x1ff9f7c1, DEFAULT_GPIOBASE + 0x00); /* GPIO_USE_SEL */
+ outl(0xe0e9e803, DEFAULT_GPIOBASE + 0x04); /* GP_IO_SEL */
+ outl(0xece9e842, DEFAULT_GPIOBASE + 0x0c); /* GP_LVL */
+ outl(0x00002000, DEFAULT_GPIOBASE + 0x2c); /* GPI_INV */
+ outl(0x000000fe, DEFAULT_GPIOBASE + 0x30);
+ outl(0x0000007e, DEFAULT_GPIOBASE + 0x34);
+ outl(0x000300f3, DEFAULT_GPIOBASE + 0x38);
+}
+
+static void nm10_enable_lpc(void)
+{
+ /* Disable Serial IRQ */
+ pci_write_config8(PCI_DEV(0, 0x1f, 0), 0x64, 0x00);
+ /* Decode range */
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80,
+ pci_read_config16(PCI_DEV(0, 0x1f, 0), 0x80) | 0x0010);
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), LPC_EN,
+ CNF1_LPC_EN | CNF2_LPC_EN | KBC_LPC_EN | COMA_LPC_EN | COMB_LPC_EN);
+
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x88, 0x0291);
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8a, 0x007c);
+
+ // Forward any IO to PCI for post codes on port 0x80 to PCI post card
+ //pci_write_config8(PCI_DEV(0, 30, 0), 0x4,
+ // pci_read_config8(PCI_DEV(0, 30, 0), 0x4) | 1);
+
+}
+
+static void rcba_config(void)
+{
+ /* Set up virtual channel 0 */
+ RCBA32(0x0014) = 0x80000001;
+ RCBA32(0x001c) = 0x03128010;
+
+ /* Device 1f interrupt pin register */
+ RCBA32(0x3100) = 0x00042210;
+ RCBA32(0x3108) = 0x10004321;
+
+ /* PCIe Interrupts */
+ RCBA32(0x310c) = 0x00214321;
+ /* HD Audio Interrupt */
+ RCBA32(0x3110) = 0x00000001;
+
+ /* dev irq route register */
+ RCBA16(0x3140) = 0x0132;
+ RCBA16(0x3142) = 0x0146;
+ RCBA16(0x3144) = 0x0237;
+ RCBA16(0x3146) = 0x3201;
+ RCBA16(0x3148) = 0x0146;
+
+ /* Enable IOAPIC */
+ RCBA8(0x31ff) = 0x03;
+
+ RCBA32(0x3418) = 0x003000e2;
+ RCBA32(0x3418) |= 1;
+}
+
+void main(unsigned long bist)
+{
+ const u8 spd_addrmap[4] = { 0x50, 0x51, 0, 0 };
+
+ if (bist == 0)
+ enable_lapic();
+
+ /* Disable watchdog timer */
+ RCBA32(0x3410) = RCBA32(0x3410) | 0x20;
+
+ /* Set southbridge and Super I/O GPIOs. */
+ mb_gpio_init();
+
+ nm10_enable_lpc();
+ winbond_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+ console_init();
+
+ report_bist_failure(bist);
+ enable_smbus();
+
+ pineview_early_initialization();
+
+ post_code(0x30);
+
+ printk(BIOS_DEBUG, "Start native raminit\n");
+ sdram_initialize(0, spd_addrmap);
+ printk(BIOS_DEBUG, "Done native raminit\n");
+
+ post_code(0x31);
+ ram_check(0x200000,0x300000);
+
+ rcba_config();
+}
Damien Zammit (damien(a)zamaudio.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10073
-gerrit
commit 3e7b5ea45c36b9c5caff9f27c292bf61c24a0526
Author: Damien Zammit <damien(a)zamaudio.com>
Date: Sun May 3 21:34:38 2015 +1000
northbridge/intel/pineview: Add minimal Pineview northbridge
Based on i945. Tested on Intel D510MO mainboard
Change-Id: I1d92a1aa6d6d767bda8379807dc26b50b9de75c9
Signed-off-by: Damien Zammit <damien(a)zamaudio.com>
---
src/northbridge/intel/pineview/Kconfig | 73 ++++++++++++++++
src/northbridge/intel/pineview/Makefile.inc | 35 ++++++++
src/northbridge/intel/pineview/acpi.c | 75 ++++++++++++++++
src/northbridge/intel/pineview/bootblock.c | 22 +++++
src/northbridge/intel/pineview/pineview.h | 129 ++++++++++++++++++++++++++++
src/northbridge/intel/pineview/ram_calc.c | 62 +++++++++++++
src/northbridge/intel/pineview/udelay.c | 82 ++++++++++++++++++
7 files changed, 478 insertions(+)
diff --git a/src/northbridge/intel/pineview/Kconfig b/src/northbridge/intel/pineview/Kconfig
new file mode 100644
index 0000000..4d6dcc2
--- /dev/null
+++ b/src/northbridge/intel/pineview/Kconfig
@@ -0,0 +1,73 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2007-2009 coresystems GmbH
+##
+## 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
+##
+
+config NORTHBRIDGE_INTEL_PINEVIEW
+ bool
+
+if NORTHBRIDGE_INTEL_PINEVIEW
+
+config NORTHBRIDGE_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select MMCONF_SUPPORT
+ select MMCONF_SUPPORT_DEFAULT
+ #select HAVE_DEBUG_RAM_SETUP
+ select LAPIC_MONOTONIC_TIMER
+ select VGA
+ select PER_DEVICE_ACPI_TABLES
+
+config BOOTBLOCK_NORTHBRIDGE_INIT
+ string
+ default "northbridge/intel/pineview/bootblock.c"
+
+config VGA_BIOS_ID
+ string
+ default "8086,a001"
+
+config CHANNEL_XOR_RANDOMIZATION
+ bool
+ default n
+
+config OVERRIDE_CLOCK_DISABLE
+ bool
+ default n
+ help
+ Usually system firmware turns off system memory clock
+ signals to unused SO-DIMM slots to reduce EMI and power
+ consumption.
+ However, some boards do not like unused clock signals to
+ be disabled.
+
+config MAXIMUM_SUPPORTED_FREQUENCY
+ int
+ default 0
+ help
+ If non-zero, this designates the maximum DDR frequency
+ the board supports, despite what the chipset should be
+ capable of.
+
+config CHECK_SLFRCS_ON_RESUME
+ def_bool n
+ help
+ On some boards it may be neccessary to hard reset early
+ during resume from S3 if the SLFRCS register indicates that
+ a memory channel is not guaranteed to be in self-refresh.
+ On other boards the check always creates a false positive,
+ effectively making it impossible to resume.
+
+endif
diff --git a/src/northbridge/intel/pineview/Makefile.inc b/src/northbridge/intel/pineview/Makefile.inc
new file mode 100644
index 0000000..8416342
--- /dev/null
+++ b/src/northbridge/intel/pineview/Makefile.inc
@@ -0,0 +1,35 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2007-2009 coresystems GmbH
+#
+# 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
+#
+
+ifeq ($(CONFIG_NORTHBRIDGE_INTEL_PINEVIEW),y)
+
+ramstage-y += ram_calc.c
+#ramstage-y += northbridge.c
+#ramstage-y += gma.c
+ramstage-y += acpi.c
+
+romstage-y += ram_calc.c
+#romstage-y += raminit.c
+#romstage-y += early_init.c
+#romstage-y += errata.c
+#romstage-y += debug.c
+
+smm-y += udelay.c
+
+endif
diff --git a/src/northbridge/intel/pineview/acpi.c b/src/northbridge/intel/pineview/acpi.c
new file mode 100644
index 0000000..b393170
--- /dev/null
+++ b/src/northbridge/intel/pineview/acpi.c
@@ -0,0 +1,75 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+#include <arch/acpigen.h>
+#include <arch/acpi.h>
+#include <cbmem.h>
+#include <console/console.h>
+#include <cpu/cpu.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <device/pci_ids.h>
+#include <northbridge/intel/pineview/pineview.h>
+#include <string.h>
+#include <types.h>
+
+unsigned long acpi_fill_mcfg(unsigned long current)
+{
+ device_t dev;
+ u32 pciexbar = 0;
+ u32 pciexbar_reg;
+ int max_buses;
+
+ dev = dev_find_slot(0, PCI_DEVFN(0,0));
+ if (!dev)
+ return current;
+
+ pciexbar_reg = pci_read_config32(dev, PCIEXBAR);
+
+ // MMCFG not supported or not enabled.
+ if (!(pciexbar_reg & (1 << 0)))
+ return current;
+
+ switch ((pciexbar_reg >> 1) & 3) {
+ case 0: // 256MB
+ pciexbar = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28));
+ max_buses = 256;
+ break;
+ case 1: // 128M
+ pciexbar = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27));
+ max_buses = 128;
+ break;
+ case 2: // 64M
+ pciexbar = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)|(1 << 26));
+ max_buses = 64;
+ break;
+ default: // RSVD
+ return current;
+ }
+
+ if (!pciexbar)
+ return current;
+
+ current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current,
+ pciexbar, 0x0, 0x0, max_buses - 1);
+
+ return current;
+}
diff --git a/src/northbridge/intel/pineview/bootblock.c b/src/northbridge/intel/pineview/bootblock.c
new file mode 100644
index 0000000..985eddd
--- /dev/null
+++ b/src/northbridge/intel/pineview/bootblock.c
@@ -0,0 +1,22 @@
+#include <arch/io.h>
+#include <northbridge/intel/pineview/pineview.h>
+
+static void bootblock_northbridge_init(void)
+{
+ uint32_t reg;
+
+ /*
+ * The "io" variant of the config access is explicitly used to
+ * setup the PCIEXBAR because CONFIG_MMCONF_SUPPORT_DEFAULT is set to
+ * to true. That way all subsequent non-explicit config accesses use
+ * MCFG. This code also assumes that bootblock_northbridge_init() is
+ * the first thing called in the non-asm boot block code. The final
+ * assumption is that no assembly code is using the
+ * CONFIG_MMCONF_SUPPORT_DEFAULT option to do PCI config acceses.
+ *
+ * The PCIEXBAR is assumed to live in the memory mapped IO space under
+ * 4GiB.
+ */
+ reg = CONFIG_MMCONF_BASE_ADDRESS | 4 | 1; /* 64MiB - 0-63 buses. */
+ pci_io_write_config32(PCI_DEV(0,0,0), PCIEXBAR, reg);
+}
diff --git a/src/northbridge/intel/pineview/pineview.h b/src/northbridge/intel/pineview/pineview.h
new file mode 100644
index 0000000..7bd4c44
--- /dev/null
+++ b/src/northbridge/intel/pineview/pineview.h
@@ -0,0 +1,129 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) Damien Zammit <damien(a)zamaudio.com>
+ *
+ * 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 NORTHBRIDGE_INTEL_PINEVIEW_H
+#define NORTHBRIDGE_INTEL_PINEVIEW_H
+
+/* Northbridge BARs */
+#define DEFAULT_PCIEXBAR CONFIG_MMCONF_BASE_ADDRESS /* 4 KB per PCIe device */
+#define DEFAULT_MCHBAR 0xfed14000 /* 16 KB */
+#define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */
+#define DEFAULT_EPBAR 0xfed19000 /* 4 KB */
+
+#include <southbridge/intel/i82801gx/i82801gx.h>
+
+/* Everything below this line is ignored in the DSDT */
+#ifndef __ACPI__
+
+/* Device 0:0.0 PCI configuration space (Host Bridge) */
+
+#define EPBAR 0x40
+#define MCHBAR 0x48
+#define PCIEXBAR 0x60
+#define DMIBAR 0x68
+#define PMIOBAR 0x78
+
+#define GGC 0x52 /* GMCH Graphics Control */
+
+#define DEVEN 0x54 /* Device Enable */
+#define DEVEN_D0F0 (1 << 0)
+#define DEVEN_D1F0 (1 << 1)
+#define DEVEN_D2F0 (1 << 3)
+#define DEVEN_D2F1 (1 << 4)
+
+#ifndef BOARD_DEVEN
+#define BOARD_DEVEN ( DEVEN_D0F0 | DEVEN_D2F0 | DEVEN_D2F1 )
+#endif /* BOARD_DEVEN */
+
+#define PAM0 0x90
+#define PAM1 0x91
+#define PAM2 0x92
+#define PAM3 0x93
+#define PAM4 0x94
+#define PAM5 0x95
+#define PAM6 0x96
+
+#define LAC 0x97 /* Legacy Access Control */
+#define REMAPBASE 0x98
+#define REMAPLIMIT 0x9a
+#define SMRAM 0x9d /* System Management RAM Control */
+#define ESMRAM 0x9e /* Extended System Management RAM Control */
+
+#define TOM 0xa0
+#define TOUUD 0xa2
+#define GBSM 0xa4
+#define BGSM 0xa8
+#define TSEGMB 0xac
+#define TOLUD 0xb0 /* Top of Low Used Memory */
+#define ERRSTS 0xc8
+#define ERRCMD 0xca
+#define SMICMD 0xcc
+#define SCICMD 0xce
+#define CGDIS 0xd8
+#define SKPAD 0xdc /* Scratchpad Data */
+#define CAPID0 0xe0
+#define DEV0T 0xf0
+#define MSLCK 0xf4
+#define MID0 0xf8
+#define DEBUP0 0xfc
+
+/* Device 0:1.0 PCI configuration space (PCI Express) */
+
+#define BCTRL1 0x3e /* 16bit */
+#define PEGSTS 0x214 /* 32bit */
+
+
+/* Device 0:2.0 PCI configuration space (Graphics Device) */
+
+#define GMADR 0x18
+#define GTTADR 0x1c
+#define BSM 0x5c
+#define GCFC 0xf0 /* Graphics Clock Frequency & Gating Control */
+
+
+/*
+ * MCHBAR
+ */
+
+#define MCHBAR8(x) *((volatile u8 *)(DEFAULT_MCHBAR + x))
+#define MCHBAR16(x) *((volatile u16 *)(DEFAULT_MCHBAR + x))
+#define MCHBAR32(x) *((volatile u32 *)(DEFAULT_MCHBAR + x))
+
+/*
+ * EPBAR - Egress Port Root Complex Register Block
+ */
+
+#define EPBAR8(x) *((volatile u8 *)(DEFAULT_EPBAR + x))
+#define EPBAR16(x) *((volatile u16 *)(DEFAULT_EPBAR + x))
+#define EPBAR32(x) *((volatile u32 *)(DEFAULT_EPBAR + x))
+
+/*
+ * DMIBAR
+ */
+
+#define DMIBAR8(x) *((volatile u8 *)(DEFAULT_DMIBAR + x))
+#define DMIBAR16(x) *((volatile u16 *)(DEFAULT_DMIBAR + x))
+#define DMIBAR32(x) *((volatile u32 *)(DEFAULT_DMIBAR + x))
+
+/* provided by mainboard code */
+void setup_ich7_gpios(void);
+
+#endif /* __ACPI__ */
+
+#endif /* NORTHBRIDGE_INTEL_PINEVIEW_H */
diff --git a/src/northbridge/intel/pineview/ram_calc.c b/src/northbridge/intel/pineview/ram_calc.c
new file mode 100644
index 0000000..d7cc732
--- /dev/null
+++ b/src/northbridge/intel/pineview/ram_calc.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2009 coresystems GmbH
+ *
+ * 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
+ */
+
+/* Use simple device model for this file even in ramstage */
+#define __SIMPLE_DEVICE__
+
+#include <arch/io.h>
+#include <cbmem.h>
+#include <northbridge/intel/pineview/pineview.h>
+
+static unsigned long find_ramtop(void)
+{
+ uint32_t tom;
+
+ if (pci_read_config8(PCI_DEV(0, 0x0, 0), DEVEN) & (DEVEN_D2F0 | DEVEN_D2F1)) {
+ /* IGD enabled, get top of Memory from BSM register */
+ tom = pci_read_config32(PCI_DEV(0,2,0), BSM);
+ } else {
+ tom = (pci_read_config8(PCI_DEV(0,0,0), TOLUD) & 0xf7) << 24;
+ }
+
+ /* if TSEG enabled subtract size */
+ switch(pci_read_config8(PCI_DEV(0, 0, 0), ESMRAM) & 0x07) {
+ case 0x01:
+ /* 1MB TSEG */
+ tom -= 0x100000;
+ break;
+ case 0x03:
+ /* 2MB TSEG */
+ tom -= 0x200000;
+ break;
+ case 0x05:
+ /* 8MB TSEG */
+ tom -= 0x800000;
+ break;
+ default:
+ /* TSEG either disabled or invalid */
+ break;
+ }
+ return (unsigned long) tom;
+}
+
+void *cbmem_top(void)
+{
+ return (void *) find_ramtop();
+}
diff --git a/src/northbridge/intel/pineview/udelay.c b/src/northbridge/intel/pineview/udelay.c
new file mode 100644
index 0000000..9e68512
--- /dev/null
+++ b/src/northbridge/intel/pineview/udelay.c
@@ -0,0 +1,82 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007-2008 coresystems GmbH
+ *
+ * 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
+ */
+
+#include <delay.h>
+#include <stdint.h>
+#include <cpu/x86/tsc.h>
+#include <cpu/x86/msr.h>
+#include <cpu/intel/speedstep.h>
+
+/**
+ * Intel Core(tm) CPUs always run the TSC at the maximum possible CPU clock
+ */
+
+void udelay(uint32_t us)
+{
+ uint32_t dword;
+ tsc_t tsc, tsc1, tscd;
+ msr_t msr;
+ uint32_t fsb = 0, divisor;
+ uint32_t d; /* ticks per us */
+
+ msr = rdmsr(MSR_FSB_FREQ);
+ switch (msr.lo & 0x07) {
+ case 5:
+ fsb = 400;
+ break;
+ case 1:
+ fsb = 533;
+ break;
+ case 3:
+ fsb = 667;
+ break;
+ case 2:
+ fsb = 800;
+ break;
+ case 0:
+ fsb = 1067;
+ break;
+ case 4:
+ fsb = 1333;
+ break;
+ case 6:
+ fsb = 1600;
+ break;
+ }
+
+ msr = rdmsr(0x198);
+ divisor = (msr.hi >> 8) & 0x1f;
+
+ d = (fsb * divisor) / 4; /* CPU clock is always a quarter. */
+
+ multiply_to_tsc(&tscd, us, d);
+
+ tsc1 = rdtsc();
+ dword = tsc1.lo + tscd.lo;
+ if ((dword < tsc1.lo) || (dword < tscd.lo)) {
+ tsc1.hi++;
+ }
+ tsc1.lo = dword;
+ tsc1.hi += tscd.hi;
+
+ do {
+ tsc = rdtsc();
+ } while ((tsc.hi < tsc1.hi)
+ || ((tsc.hi == tsc1.hi) && (tsc.lo < tsc1.lo)));
+}
Marcin Wojciechowski (marcin.wojciechowski(a)intel.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12418
-gerrit
commit acd8bf9b7dbc6d1e0cb8e239a3e38dd44c9000ac
Author: Marcin Wojciechowski <marcin.wojciechowski(a)intel.com>
Date: Thu Nov 12 16:05:42 2015 +0100
fsp1_0: Update rangeley to revision POSTGOLD 4
Alligment of Intel Firmware Support Package 1.0 rangeley
header and source files to the revision: POSTGOLD4
FSP release date September 24, 2015
Change-Id: If1a6f95aed3e9a60af9af8cf9cd466a560ef0fe2
Signed-off-by: Marcin Wojciechowski <marcin.wojciechowski(a)intel.com>
---
.../intel/fsp1_0/rangeley/include/fspguid.h | 69 +++++
.../intel/fsp1_0/rangeley/include/fspplatform.h | 3 +-
.../intel/fsp1_0/rangeley/include/fspsupport.h | 95 +++++++
.../intel/fsp1_0/rangeley/include/fsptypes.h | 9 +-
.../intel/fsp1_0/rangeley/include/fspvpd.h | 12 +-
.../intel/fsp1_0/rangeley/srx/fsp_support.c | 288 +++++++++++++++++++++
6 files changed, 468 insertions(+), 8 deletions(-)
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspguid.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspguid.h
new file mode 100644
index 0000000..b9a6183
--- /dev/null
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspguid.h
@@ -0,0 +1,69 @@
+/** @file
+
+Copyright (C) 2014, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+**/
+
+#ifndef __FSP_GUID_H__
+#define __FSP_GUID_H__
+
+/**
+
+ FSP specific GUID HOB definitions
+
+ **/
+#define FSP_INFO_HEADER_GUID \
+ { \
+ 0x912740BE, 0x2284, 0x4734, {0xB9, 0x71, 0x84, 0xB0, 0x27, 0x35, 0x3F, 0x0C} \
+ }
+
+#define FSP_NON_VOLATILE_STORAGE_HOB_GUID \
+ { \
+ 0x721acf02, 0x4d77, 0x4c2a, { 0xb3, 0xdc, 0x27, 0xb, 0x7b, 0xa9, 0xe4, 0xb0 } \
+ }
+
+#define FSP_BOOTLOADER_TEMPORARY_MEMORY_HOB_GUID \
+ { \
+ 0xbbcff46c, 0xc8d3, 0x4113, { 0x89, 0x85, 0xb9, 0xd4, 0xf3, 0xb3, 0xf6, 0x4e } \
+ }
+
+#define FSP_HOB_RESOURCE_OWNER_FSP_GUID \
+ { \
+ 0x69a79759, 0x1373, 0x4367, { 0xa6, 0xc4, 0xc7, 0xf5, 0x9e, 0xfd, 0x98, 0x6e } \
+ }
+
+#define FSP_HOB_RESOURCE_OWNER_TSEG_GUID \
+ { \
+ 0xd038747c, 0xd00c, 0x4980, { 0xb3, 0x19, 0x49, 0x01, 0x99, 0xa4, 0x7d, 0x55 } \
+ }
+
+#define FSP_HOB_RESOURCE_OWNER_GRAPHICS_GUID \
+ { \
+ 0x9c7c3aa7, 0x5332, 0x4917, { 0x82, 0xb9, 0x56, 0xa5, 0xf3, 0xe6, 0x2a, 0x07 } \
+ }
+
+#endif
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h
index ce479bf..c35dca0 100644
--- a/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspplatform.h
@@ -1,6 +1,6 @@
/**
-Copyright (C) 2013, Intel Corporation
+Copyright (C) 2013 - 2015, Intel Corporation
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -74,6 +74,7 @@ typedef struct {
UINT8 tRTPmin; // 27 Minimum Internal Read to Precharge Command Delay Time (tRTPmin)
UINT8 UpperNibbleFortFAW; // 28 Upper Nibble for tFAW
UINT8 tFAWmin; // 29 Minimum Four Activate Window Delay Time (tFAWmin)
+ UINT8 SdramThermalRefreshOption; // 31 SdramThermalRefreshOption
UINT8 ModuleThermalSensor; // 32 ModuleThermalSensor
UINT8 SDRAMDeviceType; // 33 SDRAM Device Type
UINT8 tCKminFine; // 34 Fine Offset for SDRAM Minimum Cycle Time (tCKmin)
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspsupport.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspsupport.h
new file mode 100644
index 0000000..dbbbf77
--- /dev/null
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspsupport.h
@@ -0,0 +1,95 @@
+/** @file
+
+Copyright (C) 2013 - 2014, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+**/
+
+#ifndef __FSP_SUPPORT_H__
+#define __FSP_SUPPORT_H__
+
+#include "fsptypes.h"
+#include "fspfv.h"
+#include "fspffs.h"
+#include "fspapi.h"
+#include "fsphob.h"
+#include "fspguid.h"
+#include "fspplatform.h"
+#include "fspinfoheader.h"
+#include "fspbootmode.h"
+#include "fspvpd.h"
+
+UINT32
+GetUsableLowMemTop (
+ CONST VOID *HobListPtr
+ );
+
+UINT64
+GetUsableHighMemTop (
+ CONST VOID *HobListPtr
+ );
+
+VOID *
+GetGuidHobDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length,
+ EFI_GUID *Guid
+ );
+
+VOID
+GetFspReservedMemoryFromGuid (
+ CONST VOID *HobListPtr,
+ EFI_PHYSICAL_ADDRESS *FspMemoryBase,
+ UINT64 *FspMemoryLength,
+ EFI_GUID *FspReservedMemoryGuid
+ );
+
+UINT32
+GetTsegReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+);
+
+UINT32
+GetFspReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+);
+
+VOID*
+GetFspNvsDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+ );
+
+VOID *
+GetBootloaderTempMemoryBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+ );
+
+
+#endif
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h
index 5912e01..3d2e663 100644
--- a/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fsptypes.h
@@ -100,13 +100,18 @@ typedef struct {
#define TRUE ((BOOLEAN)(1==1))
#define FALSE ((BOOLEAN)(0==1))
+static inline void DebugDeadLoop(void) {
+ for (;;);
+}
+
#define FSPAPI __attribute__((cdecl))
#define EFIAPI __attribute__((cdecl))
+#define _ASSERT(Expression) DebugDeadLoop()
#define ASSERT(Expression) \
do { \
if (!(Expression)) { \
- for (;;); \
+ _ASSERT (Expression); \
} \
} while (FALSE)
@@ -175,4 +180,4 @@ typedef UINT32 EFI_STATUS;
#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
(SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
-#endif
+#endif
\ No newline at end of file
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h b/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h
index fba38a0..4ba1a28 100644
--- a/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h
+++ b/src/vendorcode/intel/fsp1_0/rangeley/include/fspvpd.h
@@ -1,6 +1,6 @@
/** @file
-Copyright (C) 2013-2014 Intel Corporation
+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:
@@ -50,7 +50,8 @@ typedef struct _UPD_DATA_REGION {
UINT8 PcdSpdBaseAddress_0_1; /* Offset 0x0026 */
UINT8 PcdSpdBaseAddress_1_0; /* Offset 0x0027 */
UINT8 PcdSpdBaseAddress_1_1; /* Offset 0x0028 */
- UINT8 UnusedUpdSpace1[7]; /* Offset 0x0029 */
+ UINT8 PcdExtendedTemperatureEnable; /* Offset 0x0029 */
+ UINT8 UnusedUpdSpace1[6]; /* Offset 0x002A */
UINT8 PcdEnableLan; /* Offset 0x0030 */
UINT8 PcdEnableSata2; /* Offset 0x0031 */
UINT8 PcdEnableSata3; /* Offset 0x0032 */
@@ -65,13 +66,14 @@ typedef struct _UPD_DATA_REGION {
UINT8 PcdPrintDebugMessages; /* Offset 0x0040 */
UINT8 PcdFastboot; /* Offset 0x0041 */
UINT8 PcdEccSupport; /* Offset 0x0042 */
- UINT8 PcdCustomerRevision[32]; /* Offset 0x0043 */
- UINT8 UnusedUpdSpace3[13]; /* Offset 0x0063 */
+ UINT8 PcdSerialPortBaudRate; /* Offset 0x0043 */
+ UINT8 PcdCustomerRevision[32]; /* Offset 0x0044 */
+ UINT8 UnusedUpdSpace3[12]; /* Offset 0x0064 */
UINT16 PcdRegionTerminator; /* Offset 0x0070 */
} UPD_DATA_REGION;
#define VPD_IMAGE_ID 0x562D474E524E5641 /* 'AVNRNG-V' */
-#define VPD_IMAGE_REV 0x00000102
+#define VPD_IMAGE_REV 0x00000140
typedef struct _VPD_DATA_REGION {
UINT64 PcdVpdRegionSign; /* Offset 0x0000 */
diff --git a/src/vendorcode/intel/fsp1_0/rangeley/srx/fsp_support.c b/src/vendorcode/intel/fsp1_0/rangeley/srx/fsp_support.c
new file mode 100644
index 0000000..9f15b3e
--- /dev/null
+++ b/src/vendorcode/intel/fsp1_0/rangeley/srx/fsp_support.c
@@ -0,0 +1,288 @@
+/** @file
+
+Copyright (C) 2013 - 2014, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ THE POSSIBILITY OF SUCH DAMAGE.
+
+**/
+
+#include <types.h>
+#include <string.h>
+#include "fspsupport.h"
+
+/**
+ This function retrieves the top of usable low memory.
+
+ @param HobListPtr A HOB list pointer.
+
+ @retval Usable low memory top.
+
+**/
+UINT32
+GetUsableLowMemTop (
+ CONST VOID *HobStart
+)
+{
+ EFI_PEI_HOB_POINTERS Hob;
+ UINT32 MemLen;
+ /*
+ * Get the HOB list for processing
+ */
+ Hob.Raw = (VOID *)HobStart;
+
+ /*
+ * Collect memory ranges
+ */
+ MemLen = 0x100000;
+ while (!END_OF_HOB_LIST (Hob)) {
+ if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
+ /*
+ * Need memory above 1MB to be collected here
+ */
+ if (Hob.ResourceDescriptor->PhysicalStart >= 0x100000 &&
+ Hob.ResourceDescriptor->PhysicalStart < (EFI_PHYSICAL_ADDRESS) 0x100000000) {
+ MemLen += (UINT32) (Hob.ResourceDescriptor->ResourceLength);
+ }
+ }
+ }
+ Hob.Raw = GET_NEXT_HOB (Hob);
+ }
+
+ return MemLen;
+}
+
+/**
+ This function retrieves the top of usable high memory.
+
+ @param HobListPtr A HOB list pointer.
+
+ @retval Usable high memory top.
+
+**/
+UINT64
+GetUsableHighMemTop (
+ CONST VOID *HobStart
+)
+{
+ EFI_PEI_HOB_POINTERS Hob;
+ UINT64 MemTop;
+ /*
+ * Get the HOB list for processing
+ */
+ Hob.Raw = (VOID *)HobStart;
+
+ /*
+ * Collect memory ranges
+ */
+ MemTop = 0x100000000;
+ while (!END_OF_HOB_LIST (Hob)) {
+ if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
+ /*
+ * Need memory above 1MB to be collected here
+ */
+ if (Hob.ResourceDescriptor->PhysicalStart >= (EFI_PHYSICAL_ADDRESS) 0x100000000) {
+ MemTop += (UINT32) (Hob.ResourceDescriptor->ResourceLength);
+ }
+ }
+ }
+ Hob.Raw = GET_NEXT_HOB (Hob);
+ }
+
+ return MemTop;
+}
+
+/**
+ This function retrieves a special reserved memory region.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the GUID HOB data buffer length. If the GUID HOB is
+ located, the length will be updated.
+ @param OwnerGuid A pointer to the owner guild.
+ @retval Reserved region start address. 0 if this region does not exist.
+
+**/
+VOID
+GetFspReservedMemoryFromGuid (
+ CONST VOID *HobListPtr,
+ EFI_PHYSICAL_ADDRESS *Base,
+ UINT64 *Length,
+ EFI_GUID *OwnerGuid
+)
+{
+ EFI_PEI_HOB_POINTERS Hob;
+
+ /*
+ * Get the HOB list for processing
+ */
+ Hob.Raw = (VOID *)HobListPtr;
+
+ /*
+ * Collect memory ranges
+ */
+ while (!END_OF_HOB_LIST (Hob)) {
+ if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
+ if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) {
+ if (CompareGuid(&Hob.ResourceDescriptor->Owner, OwnerGuid)) {
+ *Base = (EFI_PHYSICAL_ADDRESS) (Hob.ResourceDescriptor->PhysicalStart);
+ *Length = (UINT64) (Hob.ResourceDescriptor->ResourceLength);
+ break;
+ }
+ }
+ }
+ Hob.Raw = GET_NEXT_HOB (Hob);
+ }
+}
+
+/**
+ This function retrieves the TSEG reserved normal memory.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the TSEG reserved memory length buffer. If the GUID HOB is
+ located, the length will be updated.
+ @param Guid A pointer to owner HOB GUID.
+ @retval NULL Failed to find the TSEG reserved memory.
+ @retval others TSEG reserved memory base.
+
+**/
+UINT32
+GetTsegReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID TsegOwnerHobGuid = FSP_HOB_RESOURCE_OWNER_TSEG_GUID;
+ UINT64 Length64 = 0;
+ EFI_PHYSICAL_ADDRESS Base = 0;
+
+ GetFspReservedMemoryFromGuid (HobListPtr, &Base, &Length64, (EFI_GUID *)&TsegOwnerHobGuid);
+ if ((Length != NULL) && (Base != 0)) {
+ *Length = (UINT32)Length64;
+ }
+ return (UINT32)Base;
+}
+
+/**
+ This function retrieves the FSP reserved normal memory.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the FSP reserved memory length buffer. If the GUID HOB is
+ located, the length will be updated.
+ @param Guid A pointer to owner HOB GUID.
+ @retval NULL Failed to find the FSP reserved memory.
+ @retval others FSP reserved memory base.
+
+**/
+UINT32
+GetFspReservedMemory (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID FspOwnerHobGuid = FSP_HOB_RESOURCE_OWNER_FSP_GUID;
+ UINT64 Length64 = 0;
+ EFI_PHYSICAL_ADDRESS Base = 0;
+
+ GetFspReservedMemoryFromGuid (HobListPtr, &Base, &Length64, (EFI_GUID *)&FspOwnerHobGuid);
+ if ((Length != NULL) && (Base != 0)) {
+ *Length = (UINT32)Length64;
+ }
+ return (UINT32)Base;
+}
+
+
+/**
+ This function retrieves a GUIDed HOB data buffer and size.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the GUID HOB data buffer length. If the
+ GUID HOB is located, the length will be updated.
+ @param Guid A pointer to HOB GUID.
+ @retval NULL Failed to find the GUID HOB.
+ @retval others GUID HOB data buffer pointer.
+
+**/
+VOID *
+GetGuidHobDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length,
+ EFI_GUID *Guid
+)
+{
+ UINT8 *GuidHob;
+
+ /* FSP NVS DATA HOB */
+ GuidHob = GetNextGuidHob(Guid, HobListPtr);
+ if (GuidHob == NULL) {
+ return NULL;
+ } else {
+ if (Length) {
+ *Length = GET_GUID_HOB_DATA_SIZE (GuidHob);
+ }
+ return GET_GUID_HOB_DATA (GuidHob);
+ }
+}
+
+/**
+ This function retrieves FSP Non-volatile Storage HOB buffer and size.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the NVS data buffer length. If the FSP NVS
+ HOB is located, the length will be updated.
+ @retval NULL Failed to find the NVS HOB.
+ @retval others FSP NVS data buffer pointer.
+
+**/
+VOID *
+GetFspNvsDataBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID FspNvsHobGuid = FSP_NON_VOLATILE_STORAGE_HOB_GUID;
+ return GetGuidHobDataBuffer (HobListPtr, Length, (EFI_GUID *)&FspNvsHobGuid);
+}
+
+
+/**
+ This function retrieves Bootloader temporary stack buffer and size.
+
+ @param HobListPtr A HOB list pointer.
+ @param Length A pointer to the Bootloader temporary stack length.
+ If the HOB is located, the length will be updated.
+ @retval NULL Failed to find the Bootloader temporary stack HOB.
+ @retval others Bootloader temporary stackbuffer pointer.
+
+**/
+VOID *
+GetBootloaderTempMemoryBuffer (
+ CONST VOID *HobListPtr,
+ UINT32 *Length
+)
+{
+ const EFI_GUID FspBootloaderTemporaryMemoryHobGuid = FSP_BOOTLOADER_TEMPORARY_MEMORY_HOB_GUID;
+ return GetGuidHobDataBuffer (HobListPtr, Length, (EFI_GUID *)&FspBootloaderTemporaryMemoryHobGuid);
+}