/* * This file is part of the coreboot project. * * Copyright (C) 2012 Advanced Micro Devices, 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 _AMD_H_ #define _AMD_H_ #include #define VOLATILE volatile #define CALLCONV #define ROMDATA #define CIMXAPI EFIAPI // // // AGESA Types and Definitions // // #ifndef NULL #define NULL 0 #endif #define LAST_ENTRY 0xFFFFFFFF #define IOCF8 0xCF8 #define IOCFC 0xCFC #define IN #define OUT #define IMAGE_SIGNATURE 'DMA$' typedef UINTN AGESA_STATUS; #define AGESA_SUCCESS ((AGESA_STATUS) 0x0) #define AGESA_ALERT ((AGESA_STATUS) 0x40000000) #define AGESA_WARNING ((AGESA_STATUS) 0x40000001) #define AGESA_UNSUPPORTED ((AGESA_STATUS) 0x80000003) #define AGESA_ERROR ((AGESA_STATUS) 0xC0000001) #define AGESA_CRITICAL ((AGESA_STATUS) 0xC0000002) #define AGESA_FATAL ((AGESA_STATUS) 0xC0000003) typedef AGESA_STATUS (*CALLOUT_ENTRY) (UINT32 Param1, UINTN Param2, VOID* ConfigPtr); typedef AGESA_STATUS (*IMAGE_ENTRY) (IN OUT VOID* ConfigPtr); typedef AGESA_STATUS (*MODULE_ENTRY) (IN OUT VOID* ConfigPtr); ///This allocation type is used by the AmdCreateStruct entry point typedef enum { PreMemHeap = 0, ///< Create heap in cache. PostMemDram, ///< Create heap in memory. ByHost ///< Create heap by Host. } ALLOCATION_METHOD; /// These width descriptors are used by the library function, and others, to specify the data size typedef enum ACCESS_WIDTH { AccessWidth8 = 1, ///< Access width is 8 bits. AccessWidth16, ///< Access width is 16 bits. AccessWidth32, ///< Access width is 32 bits. AccessWidth64, ///< Access width is 64 bits. AccessS3SaveWidth8 = 0x81, ///< Save 8 bits data. AccessS3SaveWidth16, ///< Save 16 bits data. AccessS3SaveWidth32, ///< Save 32 bits data. AccessS3SaveWidth64, ///< Save 64 bits data. } ACCESS_WIDTH; // AGESA Structures /// The standard header AMD NB UEFI drivers typedef struct _AMD_CONFIG_PARAMS { VOID **PeiServices; ///< Pointer to PEI service table VOID *StallPpi; ///< Pointer to Stall PPI // UINT32 Func; VOID *PcieBasePtr; ///< TBD CALLOUT_ENTRY CalloutPtr; ///