Rename __attribute__((packed)) --> __packed
Also unify __attribute__ ((..)) to __attribute__((..)) and handle ((__packed__)) like ((packed)) Change-Id: Ie60a51c3fa92b5009724a5b7c2932e361bf3490c Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/15921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
		@@ -152,7 +152,7 @@ struct cbfs_header {
 | 
				
			|||||||
        u32 offset;
 | 
					        u32 offset;
 | 
				
			||||||
        u32 architecture;
 | 
					        u32 architecture;
 | 
				
			||||||
        u32 pad[1];
 | 
					        u32 pad[1];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The meaning of each member is as follows:
 | 
					The meaning of each member is as follows:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,7 +65,7 @@ After such a transition, timestamp_init() must not be run again.
 | 
				
			|||||||
Data structures used
 | 
					Data structures used
 | 
				
			||||||
====================
 | 
					====================
 | 
				
			||||||
The main structure that maintains information about the timestamp cache is:
 | 
					The main structure that maintains information about the timestamp cache is:
 | 
				
			||||||
struct __attribute__((__packed__)) timestamp_cache {
 | 
					struct __packed timestamp_cache {
 | 
				
			||||||
        uint16_t cache_state;
 | 
					        uint16_t cache_state;
 | 
				
			||||||
        struct timestamp_table table;
 | 
					        struct timestamp_table table;
 | 
				
			||||||
        struct timestamp_entry entries[MAX_TIMESTAMP_CACHE];
 | 
					        struct timestamp_entry entries[MAX_TIMESTAMP_CACHE];
 | 
				
			||||||
@@ -109,7 +109,7 @@ struct timestamp_table {
 | 
				
			|||||||
        uint32_t        max_entries;
 | 
					        uint32_t        max_entries;
 | 
				
			||||||
        uint32_t        num_entries;
 | 
					        uint32_t        num_entries;
 | 
				
			||||||
        struct timestamp_entry entries[0]; /* Variable number of entries */
 | 
					        struct timestamp_entry entries[0]; /* Variable number of entries */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
It indicates the base time for all timestamp entries, maximum number
 | 
					It indicates the base time for all timestamp entries, maximum number
 | 
				
			||||||
of entries that can be stored, total number of entries that currently
 | 
					of entries that can be stored, total number of entries that currently
 | 
				
			||||||
@@ -125,7 +125,7 @@ defined by:
 | 
				
			|||||||
struct timestamp_entry {
 | 
					struct timestamp_entry {
 | 
				
			||||||
        uint32_t        entry_id;
 | 
					        uint32_t        entry_id;
 | 
				
			||||||
        uint64_t        entry_stamp;
 | 
					        uint64_t        entry_stamp;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
entry_id holds the timestamp id corresponding to this entry and
 | 
					entry_id holds the timestamp id corresponding to this entry and
 | 
				
			||||||
entry_stamp holds the actual timestamp.
 | 
					entry_stamp holds the actual timestamp.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,7 +33,7 @@ struct cbmem_console {
 | 
				
			|||||||
	u32 size;
 | 
						u32 size;
 | 
				
			||||||
	u32 cursor;
 | 
						u32 cursor;
 | 
				
			||||||
	u8 body[0];
 | 
						u8 body[0];
 | 
				
			||||||
} __attribute__ ((__packed__));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CURSOR_MASK ((1 << 28) - 1)
 | 
					#define CURSOR_MASK ((1 << 28) - 1)
 | 
				
			||||||
#define OVERFLOW (1 << 31)
 | 
					#define OVERFLOW (1 << 31)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,7 +44,7 @@ struct cbheader {
 | 
				
			|||||||
	u32 offset;
 | 
						u32 offset;
 | 
				
			||||||
	u32 architecture;
 | 
						u32 architecture;
 | 
				
			||||||
	u32 pad[1];
 | 
						u32 pad[1];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfile {
 | 
					struct cbfile {
 | 
				
			||||||
	u64 magic;
 | 
						u64 magic;
 | 
				
			||||||
@@ -53,7 +53,7 @@ struct cbfile {
 | 
				
			|||||||
	u32 checksum;
 | 
						u32 checksum;
 | 
				
			||||||
	u32 offset;
 | 
						u32 offset;
 | 
				
			||||||
	char filename[0];
 | 
						char filename[0];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int filecount = 0, selected = 0, start_row = 0;
 | 
					static int filecount = 0, selected = 0, start_row = 0;
 | 
				
			||||||
static char **filenames;
 | 
					static char **filenames;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,10 +22,10 @@ struct gdb_regs
 | 
				
			|||||||
	struct fp_reg
 | 
						struct fp_reg
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		u8 byte[12];
 | 
							u8 byte[12];
 | 
				
			||||||
	} __attribute__((packed)) f[8];
 | 
						} __packed f[8];
 | 
				
			||||||
	u32 fps;
 | 
						u32 fps;
 | 
				
			||||||
	u32 cpsr;
 | 
						u32 cpsr;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const u8 type_to_signal[] = {
 | 
					static const u8 type_to_signal[] = {
 | 
				
			||||||
	[EXC_UNDEF]  = GDB_SIGILL,
 | 
						[EXC_UNDEF]  = GDB_SIGILL,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,11 +22,11 @@ struct gdb_regs
 | 
				
			|||||||
	struct fp_reg
 | 
						struct fp_reg
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		u64 quad[2];
 | 
							u64 quad[2];
 | 
				
			||||||
	} __attribute__((packed)) f[32];
 | 
						} __packed f[32];
 | 
				
			||||||
	u32 fpcr;
 | 
						u32 fpcr;
 | 
				
			||||||
	u32 fpsr;
 | 
						u32 fpsr;
 | 
				
			||||||
	u32 spsr;
 | 
						u32 spsr;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const u8 type_to_signal[] = {
 | 
					static const u8 type_to_signal[] = {
 | 
				
			||||||
	[EXC_SYNC_SP0] = GDB_SIGTRAP,
 | 
						[EXC_SYNC_SP0] = GDB_SIGTRAP,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@ struct cbmem_console {
 | 
				
			|||||||
	uint32_t size;
 | 
						uint32_t size;
 | 
				
			||||||
	uint32_t cursor;
 | 
						uint32_t cursor;
 | 
				
			||||||
	uint8_t body[0];
 | 
						uint8_t body[0];
 | 
				
			||||||
} __attribute__ ((__packed__));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CURSOR_MASK ((1 << 28) - 1)
 | 
					#define CURSOR_MASK ((1 << 28) - 1)
 | 
				
			||||||
#define OVERFLOW (1 << 31)
 | 
					#define OVERFLOW (1 << 31)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,7 +55,7 @@ typedef volatile struct {
 | 
				
			|||||||
	u32 hcsparams;
 | 
						u32 hcsparams;
 | 
				
			||||||
	u32 hccparams;
 | 
						u32 hccparams;
 | 
				
			||||||
	u64 hcsp_portroute;
 | 
						u64 hcsp_portroute;
 | 
				
			||||||
} __attribute__ ((packed)) hc_cap_t;
 | 
					} __packed hc_cap_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef volatile struct {
 | 
					typedef volatile struct {
 | 
				
			||||||
	u32 usbcmd;
 | 
						u32 usbcmd;
 | 
				
			||||||
@@ -83,7 +83,7 @@ typedef volatile struct {
 | 
				
			|||||||
	u8 res2[0x40];
 | 
						u8 res2[0x40];
 | 
				
			||||||
	u32 hostpc;
 | 
						u32 hostpc;
 | 
				
			||||||
	/* hostpc register is used for CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT */
 | 
						/* hostpc register is used for CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT */
 | 
				
			||||||
} __attribute__ ((packed)) hc_op_t;
 | 
					} __packed hc_op_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef volatile struct {
 | 
					typedef volatile struct {
 | 
				
			||||||
#define QTD_TERMINATE 1
 | 
					#define QTD_TERMINATE 1
 | 
				
			||||||
@@ -108,7 +108,7 @@ typedef volatile struct {
 | 
				
			|||||||
#define QTD_TOGGLE_DATA1 (1 << QTD_TOGGLE_SHIFT)
 | 
					#define QTD_TOGGLE_DATA1 (1 << QTD_TOGGLE_SHIFT)
 | 
				
			||||||
	u32 bufptrs[5];
 | 
						u32 bufptrs[5];
 | 
				
			||||||
	u32 bufptrs64[5];
 | 
						u32 bufptrs64[5];
 | 
				
			||||||
} __attribute__ ((packed)) qtd_t;
 | 
					} __packed qtd_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef volatile struct {
 | 
					typedef volatile struct {
 | 
				
			||||||
	u32 horiz_link_ptr;
 | 
						u32 horiz_link_ptr;
 | 
				
			||||||
@@ -132,7 +132,7 @@ typedef volatile struct {
 | 
				
			|||||||
#define QH_PIPE_MULTIPLIER_SHIFT 30
 | 
					#define QH_PIPE_MULTIPLIER_SHIFT 30
 | 
				
			||||||
	volatile u32 current_td_ptr;
 | 
						volatile u32 current_td_ptr;
 | 
				
			||||||
	volatile qtd_t td;
 | 
						volatile qtd_t td;
 | 
				
			||||||
} __attribute__ ((packed)) ehci_qh_t;
 | 
					} __packed ehci_qh_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct ehci {
 | 
					typedef struct ehci {
 | 
				
			||||||
	hc_cap_t *capabilities;
 | 
						hc_cap_t *capabilities;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -186,7 +186,7 @@
 | 
				
			|||||||
	   _DO NOT_ use |= to set the bits,
 | 
						   _DO NOT_ use |= to set the bits,
 | 
				
			||||||
	   this clears the entire state */
 | 
						   this clears the entire state */
 | 
				
			||||||
	volatile u32 HcRhPortStatus[];
 | 
						volatile u32 HcRhPortStatus[];
 | 
				
			||||||
     } __attribute__ ((packed)) opreg_t;
 | 
					     } __packed opreg_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	typedef struct { /* should be 256 bytes according to spec */
 | 
						typedef struct { /* should be 256 bytes according to spec */
 | 
				
			||||||
		u32 HccaInterruptTable[32];
 | 
							u32 HccaInterruptTable[32];
 | 
				
			||||||
@@ -195,14 +195,14 @@
 | 
				
			|||||||
		volatile u32 HccaDoneHead;
 | 
							volatile u32 HccaDoneHead;
 | 
				
			||||||
		u8 reserved[116]; /* pad according to spec */
 | 
							u8 reserved[116]; /* pad according to spec */
 | 
				
			||||||
		u8 what[4]; /* really pad to 256 as spec only covers 252 */
 | 
							u8 what[4]; /* really pad to 256 as spec only covers 252 */
 | 
				
			||||||
	} __attribute__ ((packed)) hcca_t;
 | 
						} __packed hcca_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	typedef volatile struct {
 | 
						typedef volatile struct {
 | 
				
			||||||
		u32 config;
 | 
							u32 config;
 | 
				
			||||||
		u32 tail_pointer;
 | 
							u32 tail_pointer;
 | 
				
			||||||
		u32 head_pointer;
 | 
							u32 head_pointer;
 | 
				
			||||||
		u32 next_ed;
 | 
							u32 next_ed;
 | 
				
			||||||
	} __attribute__ ((packed)) ed_t;
 | 
						} __packed ed_t;
 | 
				
			||||||
#define ED_HALTED 1
 | 
					#define ED_HALTED 1
 | 
				
			||||||
#define ED_TOGGLE 2
 | 
					#define ED_TOGGLE 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -220,7 +220,7 @@
 | 
				
			|||||||
		u32 current_buffer_pointer;
 | 
							u32 current_buffer_pointer;
 | 
				
			||||||
		u32 next_td;
 | 
							u32 next_td;
 | 
				
			||||||
		u32 buffer_end;
 | 
							u32 buffer_end;
 | 
				
			||||||
	} __attribute__ ((packed)) td_t;
 | 
						} __packed td_t;
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Bits 0 through 17 of .config won't be interpreted by the host controller
 | 
					 * Bits 0 through 17 of .config won't be interpreted by the host controller
 | 
				
			||||||
 * (HC) and, after processing the TD, the HC has to ensure those bits have
 | 
					 * (HC) and, after processing the TD, the HC has to ensure those bits have
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,13 +67,13 @@ typedef struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	u32 bufptr;
 | 
						u32 bufptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__ ((packed))
 | 
					} __packed
 | 
				
			||||||
     td_t;
 | 
					     td_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     typedef struct {
 | 
					     typedef struct {
 | 
				
			||||||
	     flistp_t headlinkptr;
 | 
						     flistp_t headlinkptr;
 | 
				
			||||||
	     volatile flistp_t elementlinkptr;
 | 
						     volatile flistp_t elementlinkptr;
 | 
				
			||||||
     } __attribute__ ((packed))
 | 
					     } __packed
 | 
				
			||||||
     qh_t;
 | 
					     qh_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     typedef enum { USBCMD = 0, USBSTS = 2, USBINTR = 4, FRNUM =
 | 
					     typedef enum { USBCMD = 0, USBSTS = 2, USBINTR = 4, FRNUM =
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,14 +112,14 @@ typedef struct {
 | 
				
			|||||||
	unsigned long bCBWCBLength:5;
 | 
						unsigned long bCBWCBLength:5;
 | 
				
			||||||
	unsigned long:3;
 | 
						unsigned long:3;
 | 
				
			||||||
	unsigned char CBWCB[31 - 15];
 | 
						unsigned char CBWCB[31 - 15];
 | 
				
			||||||
} __attribute__ ((packed)) cbw_t;
 | 
					} __packed cbw_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned int dCSWSignature;
 | 
						unsigned int dCSWSignature;
 | 
				
			||||||
	unsigned int dCSWTag;
 | 
						unsigned int dCSWTag;
 | 
				
			||||||
	unsigned int dCSWDataResidue;
 | 
						unsigned int dCSWDataResidue;
 | 
				
			||||||
	unsigned char bCSWStatus;
 | 
						unsigned char bCSWStatus;
 | 
				
			||||||
} __attribute__ ((packed)) csw_t;
 | 
					} __packed csw_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
@@ -297,7 +297,7 @@ typedef struct {
 | 
				
			|||||||
	unsigned char res2;	//6
 | 
						unsigned char res2;	//6
 | 
				
			||||||
	unsigned short numblocks;	//7-8
 | 
						unsigned short numblocks;	//7-8
 | 
				
			||||||
	unsigned char control;	//9 - the block is 10 bytes long
 | 
						unsigned char control;	//9 - the block is 10 bytes long
 | 
				
			||||||
} __attribute__ ((packed)) cmdblock_t;
 | 
					} __packed cmdblock_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned char command;	//0
 | 
						unsigned char command;	//0
 | 
				
			||||||
@@ -312,7 +312,7 @@ typedef struct {
 | 
				
			|||||||
		unsigned char length;		// for REQUEST SENSE
 | 
							unsigned char length;		// for REQUEST SENSE
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	unsigned char control;	//5
 | 
						unsigned char control;	//5
 | 
				
			||||||
} __attribute__ ((packed)) cmdblock6_t;
 | 
					} __packed cmdblock6_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Like readwrite_blocks, but for soft-sectors of 512b size. Converts the
 | 
					 * Like readwrite_blocks, but for soft-sectors of 512b size. Converts the
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -165,7 +165,7 @@ typedef struct {
 | 
				
			|||||||
	trb_t *ring;
 | 
						trb_t *ring;
 | 
				
			||||||
	trb_t *cur;
 | 
						trb_t *cur;
 | 
				
			||||||
	u8 pcs;
 | 
						u8 pcs;
 | 
				
			||||||
} __attribute__ ((packed)) transfer_ring_t;
 | 
					} __packed transfer_ring_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define COMMAND_RING_SIZE 4
 | 
					#define COMMAND_RING_SIZE 4
 | 
				
			||||||
typedef transfer_ring_t command_ring_t;
 | 
					typedef transfer_ring_t command_ring_t;
 | 
				
			||||||
@@ -332,8 +332,8 @@ typedef struct xhci {
 | 
				
			|||||||
			struct {
 | 
								struct {
 | 
				
			||||||
				u8 hciver_lo;
 | 
									u8 hciver_lo;
 | 
				
			||||||
				u8 hciver_hi;
 | 
									u8 hciver_hi;
 | 
				
			||||||
			} __attribute__ ((packed));
 | 
								} __packed;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		union {
 | 
							union {
 | 
				
			||||||
			u32 hcsparams1;
 | 
								u32 hcsparams1;
 | 
				
			||||||
			struct {
 | 
								struct {
 | 
				
			||||||
@@ -341,8 +341,8 @@ typedef struct xhci {
 | 
				
			|||||||
				unsigned long MaxIntrs:11;
 | 
									unsigned long MaxIntrs:11;
 | 
				
			||||||
				unsigned long:6;
 | 
									unsigned long:6;
 | 
				
			||||||
				unsigned long MaxPorts:8;
 | 
									unsigned long MaxPorts:8;
 | 
				
			||||||
			} __attribute__ ((packed));
 | 
								} __packed;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		union {
 | 
							union {
 | 
				
			||||||
			u32 hcsparams2;
 | 
								u32 hcsparams2;
 | 
				
			||||||
			struct {
 | 
								struct {
 | 
				
			||||||
@@ -352,16 +352,16 @@ typedef struct xhci {
 | 
				
			|||||||
				unsigned long Max_Scratchpad_Bufs_Hi:5;
 | 
									unsigned long Max_Scratchpad_Bufs_Hi:5;
 | 
				
			||||||
				unsigned long SPR:1;
 | 
									unsigned long SPR:1;
 | 
				
			||||||
				unsigned long Max_Scratchpad_Bufs_Lo:5;
 | 
									unsigned long Max_Scratchpad_Bufs_Lo:5;
 | 
				
			||||||
			} __attribute__ ((packed));
 | 
								} __packed;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		union {
 | 
							union {
 | 
				
			||||||
			u32 hcsparams3;
 | 
								u32 hcsparams3;
 | 
				
			||||||
			struct {
 | 
								struct {
 | 
				
			||||||
				unsigned long u1latency:8;
 | 
									unsigned long u1latency:8;
 | 
				
			||||||
				unsigned long:8;
 | 
									unsigned long:8;
 | 
				
			||||||
				unsigned long u2latency:16;
 | 
									unsigned long u2latency:16;
 | 
				
			||||||
			} __attribute__ ((packed));
 | 
								} __packed;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		union {
 | 
							union {
 | 
				
			||||||
			u32 hccparams;
 | 
								u32 hccparams;
 | 
				
			||||||
			struct {
 | 
								struct {
 | 
				
			||||||
@@ -376,11 +376,11 @@ typedef struct xhci {
 | 
				
			|||||||
				unsigned long:4;
 | 
									unsigned long:4;
 | 
				
			||||||
				unsigned long MaxPSASize:4;
 | 
									unsigned long MaxPSASize:4;
 | 
				
			||||||
				unsigned long xECP:16;
 | 
									unsigned long xECP:16;
 | 
				
			||||||
			} __attribute__ ((packed));
 | 
								} __packed;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		u32 dboff;
 | 
							u32 dboff;
 | 
				
			||||||
		u32 rtsoff;
 | 
							u32 rtsoff;
 | 
				
			||||||
	} __attribute__ ((packed)) *capreg;
 | 
						} __packed *capreg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* opreg is R/W is most places, so volatile access is necessary.
 | 
						/* opreg is R/W is most places, so volatile access is necessary.
 | 
				
			||||||
	   volatile means that the compiler seeks byte writes if possible,
 | 
						   volatile means that the compiler seeks byte writes if possible,
 | 
				
			||||||
@@ -446,8 +446,8 @@ typedef struct xhci {
 | 
				
			|||||||
			u32 portpmsc;
 | 
								u32 portpmsc;
 | 
				
			||||||
			u32 portli;
 | 
								u32 portli;
 | 
				
			||||||
			u32 res;
 | 
								u32 res;
 | 
				
			||||||
		} __attribute__ ((packed)) prs[];
 | 
							} __packed prs[];
 | 
				
			||||||
	} __attribute__ ((packed)) *opreg;
 | 
						} __packed *opreg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* R/W, volatile, MMIO -> no bitfields */
 | 
						/* R/W, volatile, MMIO -> no bitfields */
 | 
				
			||||||
	volatile struct hcrreg {
 | 
						volatile struct hcrreg {
 | 
				
			||||||
@@ -462,8 +462,8 @@ typedef struct xhci {
 | 
				
			|||||||
			u32 erstba_hi;
 | 
								u32 erstba_hi;
 | 
				
			||||||
			u32 erdp_lo;
 | 
								u32 erdp_lo;
 | 
				
			||||||
			u32 erdp_hi;
 | 
								u32 erdp_hi;
 | 
				
			||||||
		} __attribute__ ((packed)) intrrs[]; // up to 1024, but maximum host specific, given in capreg->MaxIntrs
 | 
							} __packed intrrs[]; // up to 1024, but maximum host specific, given in capreg->MaxIntrs
 | 
				
			||||||
	} __attribute__ ((packed)) *hcrreg;
 | 
						} __packed *hcrreg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* R/W, volatile, MMIO -> no bitfields */
 | 
						/* R/W, volatile, MMIO -> no bitfields */
 | 
				
			||||||
	volatile u32 *dbreg;
 | 
						volatile u32 *dbreg;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,7 @@ struct bitmap_file_header {
 | 
				
			|||||||
	uint32_t file_size;
 | 
						uint32_t file_size;
 | 
				
			||||||
	uint16_t reserved[2];
 | 
						uint16_t reserved[2];
 | 
				
			||||||
	uint32_t bitmap_offset;
 | 
						uint32_t bitmap_offset;
 | 
				
			||||||
} __attribute__ ((__packed__));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Bitmap version 3 */
 | 
					/* Bitmap version 3 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -53,13 +53,13 @@ struct bitmap_header_v3 {
 | 
				
			|||||||
	int32_t v_res;
 | 
						int32_t v_res;
 | 
				
			||||||
	uint32_t colors_used;
 | 
						uint32_t colors_used;
 | 
				
			||||||
	uint32_t colors_important;
 | 
						uint32_t colors_important;
 | 
				
			||||||
} __attribute__ ((__packed__));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bitmap_palette_element_v3 {
 | 
					struct bitmap_palette_element_v3 {
 | 
				
			||||||
	uint8_t blue;
 | 
						uint8_t blue;
 | 
				
			||||||
	uint8_t green;
 | 
						uint8_t green;
 | 
				
			||||||
	uint8_t red;
 | 
						uint8_t red;
 | 
				
			||||||
	uint8_t reserved;
 | 
						uint8_t reserved;
 | 
				
			||||||
} __attribute__ ((__packed__));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* __BITMAP_H__ */
 | 
					#endif /* __BITMAP_H__ */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ struct exception_state
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	u32 regs[16];
 | 
						u32 regs[16];
 | 
				
			||||||
	u32 cpsr;
 | 
						u32 cpsr;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
extern struct exception_state exception_state;
 | 
					extern struct exception_state exception_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern u32 exception_stack[];
 | 
					extern u32 exception_stack[];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ struct exception_state
 | 
				
			|||||||
	uint64_t elr;
 | 
						uint64_t elr;
 | 
				
			||||||
	uint64_t esr;
 | 
						uint64_t esr;
 | 
				
			||||||
	uint64_t regs[31];
 | 
						uint64_t regs[31];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct exception_state *exception_state;
 | 
					extern struct exception_state *exception_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,6 +50,7 @@
 | 
				
			|||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** These are standard values for the known compression
 | 
					/** These are standard values for the known compression
 | 
				
			||||||
    alogrithms that coreboot knows about for stages and
 | 
					    alogrithms that coreboot knows about for stages and
 | 
				
			||||||
@@ -97,7 +98,7 @@ struct cbfs_header {
 | 
				
			|||||||
	uint32_t offset;
 | 
						uint32_t offset;
 | 
				
			||||||
	uint32_t architecture;
 | 
						uint32_t architecture;
 | 
				
			||||||
	uint32_t pad[1];
 | 
						uint32_t pad[1];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* this used to be flexible, but wasn't ever set to something different. */
 | 
					/* this used to be flexible, but wasn't ever set to something different. */
 | 
				
			||||||
#define CBFS_ALIGNMENT 64
 | 
					#define CBFS_ALIGNMENT 64
 | 
				
			||||||
@@ -134,7 +135,7 @@ struct cbfs_file {
 | 
				
			|||||||
	uint32_t attributes_offset;
 | 
						uint32_t attributes_offset;
 | 
				
			||||||
	uint32_t offset;
 | 
						uint32_t offset;
 | 
				
			||||||
	char filename[];
 | 
						char filename[];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Depending on how the header was initialized, it may be backed with 0x00 or
 | 
					/* Depending on how the header was initialized, it may be backed with 0x00 or
 | 
				
			||||||
 * 0xff. Support both. */
 | 
					 * 0xff. Support both. */
 | 
				
			||||||
@@ -151,7 +152,7 @@ struct cbfs_file_attribute {
 | 
				
			|||||||
	/* len covers the whole structure, incl. tag and len */
 | 
						/* len covers the whole structure, incl. tag and len */
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
	uint8_t data[0];
 | 
						uint8_t data[0];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_file_attr_compression {
 | 
					struct cbfs_file_attr_compression {
 | 
				
			||||||
	uint32_t tag;
 | 
						uint32_t tag;
 | 
				
			||||||
@@ -159,7 +160,7 @@ struct cbfs_file_attr_compression {
 | 
				
			|||||||
	/* whole file compression format. 0 if no compression. */
 | 
						/* whole file compression format. 0 if no compression. */
 | 
				
			||||||
	uint32_t compression;
 | 
						uint32_t compression;
 | 
				
			||||||
	uint32_t decompressed_size;
 | 
						uint32_t decompressed_size;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_file_attr_hash {
 | 
					struct cbfs_file_attr_hash {
 | 
				
			||||||
	uint32_t tag;
 | 
						uint32_t tag;
 | 
				
			||||||
@@ -167,7 +168,7 @@ struct cbfs_file_attr_hash {
 | 
				
			|||||||
	uint32_t hash_type;
 | 
						uint32_t hash_type;
 | 
				
			||||||
	/* hash_data is len - sizeof(struct) bytes */
 | 
						/* hash_data is len - sizeof(struct) bytes */
 | 
				
			||||||
	uint8_t  hash_data[];
 | 
						uint8_t  hash_data[];
 | 
				
			||||||
} __PACKED;
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*** Component sub-headers ***/
 | 
					/*** Component sub-headers ***/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -183,7 +184,7 @@ struct cbfs_stage {
 | 
				
			|||||||
	uint64_t load;   /** Where to load in memory */
 | 
						uint64_t load;   /** Where to load in memory */
 | 
				
			||||||
	uint32_t len;          /** length of data to load */
 | 
						uint32_t len;          /** length of data to load */
 | 
				
			||||||
	uint32_t memlen;	   /** total length of object in memory */
 | 
						uint32_t memlen;	   /** total length of object in memory */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** this is the sub-header for payload components.  Payloads
 | 
					/** this is the sub-header for payload components.  Payloads
 | 
				
			||||||
    are loaded by coreboot at the end of the boot process */
 | 
					    are loaded by coreboot at the end of the boot process */
 | 
				
			||||||
@@ -195,7 +196,7 @@ struct cbfs_payload_segment {
 | 
				
			|||||||
	uint64_t load_addr;
 | 
						uint64_t load_addr;
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
	uint32_t mem_len;
 | 
						uint32_t mem_len;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_payload {
 | 
					struct cbfs_payload {
 | 
				
			||||||
	struct cbfs_payload_segment segments;
 | 
						struct cbfs_payload_segment segments;
 | 
				
			||||||
@@ -210,7 +211,7 @@ struct cbfs_payload {
 | 
				
			|||||||
struct cbfs_optionrom {
 | 
					struct cbfs_optionrom {
 | 
				
			||||||
	uint32_t compression;
 | 
						uint32_t compression;
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CBFS_MEDIA_INVALID_MAP_ADDRESS	((void*)(0xffffffff))
 | 
					#define CBFS_MEDIA_INVALID_MAP_ADDRESS	((void*)(0xffffffff))
 | 
				
			||||||
#define CBFS_DEFAULT_MEDIA		((void*)(0x0))
 | 
					#define CBFS_DEFAULT_MEDIA		((void*)(0x0))
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										28
									
								
								payloads/libpayload/include/compiler.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								payloads/libpayload/include/compiler.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * This file is part of the coreboot project.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 2017 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.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef __COMPILER_H__
 | 
				
			||||||
 | 
					#define __COMPILER_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(__WIN32) || defined(__WIN64)
 | 
				
			||||||
 | 
					#define __packed __attribute__((gcc_struct, packed))
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#define __packed __attribute__((packed))
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define __aligned(x) __attribute__((aligned(x)))
 | 
				
			||||||
 | 
					#define __always_unused __attribute__((unused))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
@@ -56,7 +56,7 @@ struct fmap_area {
 | 
				
			|||||||
	uint32_t size;                  /* size in bytes */
 | 
						uint32_t size;                  /* size in bytes */
 | 
				
			||||||
	uint8_t  name[FMAP_STRLEN];     /* descriptive name */
 | 
						uint8_t  name[FMAP_STRLEN];     /* descriptive name */
 | 
				
			||||||
	uint16_t flags;                 /* flags for this area */
 | 
						uint16_t flags;                 /* flags for this area */
 | 
				
			||||||
}  __attribute__((packed));
 | 
					}  __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct fmap {
 | 
					struct fmap {
 | 
				
			||||||
	uint8_t  signature[8];		/* "__FMAP__" (0x5F5F464D41505F5F) */
 | 
						uint8_t  signature[8];		/* "__FMAP__" (0x5F5F464D41505F5F) */
 | 
				
			||||||
@@ -68,6 +68,6 @@ struct fmap {
 | 
				
			|||||||
	uint16_t nareas;		/* number of areas described by
 | 
						uint16_t nareas;		/* number of areas described by
 | 
				
			||||||
					   fmap_areas[] below */
 | 
										   fmap_areas[] below */
 | 
				
			||||||
	struct fmap_area areas[];
 | 
						struct fmap_area areas[];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif	/* FLASHMAP_SERIALIZED_H__ */
 | 
					#endif	/* FLASHMAP_SERIALIZED_H__ */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,6 +44,7 @@
 | 
				
			|||||||
#define _LIBPAYLOAD_H
 | 
					#define _LIBPAYLOAD_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <libpayload-config.h>
 | 
					#include <libpayload-config.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <cbgfx.h>
 | 
					#include <cbgfx.h>
 | 
				
			||||||
#include <ctype.h>
 | 
					#include <ctype.h>
 | 
				
			||||||
#include <die.h>
 | 
					#include <die.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,7 +70,7 @@ struct exception_state_t {
 | 
				
			|||||||
		u32 ra;
 | 
							u32 ra;
 | 
				
			||||||
	} regs;
 | 
						} regs;
 | 
				
			||||||
	u32 vector;
 | 
						u32 vector;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct exception_state_t *exception_state_ptr;
 | 
					extern struct exception_state_t *exception_state_ptr;
 | 
				
			||||||
extern u32 *exception_stack_end;
 | 
					extern u32 *exception_stack_end;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,13 +83,13 @@ typedef struct {
 | 
				
			|||||||
			unsigned long ttThinkTime:2;
 | 
								unsigned long ttThinkTime:2;
 | 
				
			||||||
			unsigned long arePortIndicatorsSupported:1;
 | 
								unsigned long arePortIndicatorsSupported:1;
 | 
				
			||||||
			unsigned long:8;
 | 
								unsigned long:8;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		unsigned short wHubCharacteristics;
 | 
							unsigned short wHubCharacteristics;
 | 
				
			||||||
	} __attribute__ ((packed));
 | 
						} __packed;
 | 
				
			||||||
	unsigned char bPowerOn2PwrGood;
 | 
						unsigned char bPowerOn2PwrGood;
 | 
				
			||||||
	unsigned char bHubContrCurrent;
 | 
						unsigned char bHubContrCurrent;
 | 
				
			||||||
	char DeviceRemovable[];
 | 
						char DeviceRemovable[];
 | 
				
			||||||
} __attribute__ ((packed)) hub_descriptor_t;
 | 
					} __packed hub_descriptor_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned char bLength;
 | 
						unsigned char bLength;
 | 
				
			||||||
@@ -106,7 +106,7 @@ typedef struct {
 | 
				
			|||||||
	unsigned char iProduct;
 | 
						unsigned char iProduct;
 | 
				
			||||||
	unsigned char iSerialNumber;
 | 
						unsigned char iSerialNumber;
 | 
				
			||||||
	unsigned char bNumConfigurations;
 | 
						unsigned char bNumConfigurations;
 | 
				
			||||||
} __attribute__ ((packed)) device_descriptor_t;
 | 
					} __packed device_descriptor_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned char bLength;
 | 
						unsigned char bLength;
 | 
				
			||||||
@@ -117,7 +117,7 @@ typedef struct {
 | 
				
			|||||||
	unsigned char iConfiguration;
 | 
						unsigned char iConfiguration;
 | 
				
			||||||
	unsigned char bmAttributes;
 | 
						unsigned char bmAttributes;
 | 
				
			||||||
	unsigned char bMaxPower;
 | 
						unsigned char bMaxPower;
 | 
				
			||||||
} __attribute__ ((packed)) configuration_descriptor_t;
 | 
					} __packed configuration_descriptor_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned char bLength;
 | 
						unsigned char bLength;
 | 
				
			||||||
@@ -129,7 +129,7 @@ typedef struct {
 | 
				
			|||||||
	unsigned char bInterfaceSubClass;
 | 
						unsigned char bInterfaceSubClass;
 | 
				
			||||||
	unsigned char bInterfaceProtocol;
 | 
						unsigned char bInterfaceProtocol;
 | 
				
			||||||
	unsigned char iInterface;
 | 
						unsigned char iInterface;
 | 
				
			||||||
} __attribute__ ((packed)) interface_descriptor_t;
 | 
					} __packed interface_descriptor_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned char bLength;
 | 
						unsigned char bLength;
 | 
				
			||||||
@@ -138,7 +138,7 @@ typedef struct {
 | 
				
			|||||||
	unsigned char bmAttributes;
 | 
						unsigned char bmAttributes;
 | 
				
			||||||
	unsigned short wMaxPacketSize;
 | 
						unsigned short wMaxPacketSize;
 | 
				
			||||||
	unsigned char bInterval;
 | 
						unsigned char bInterval;
 | 
				
			||||||
} __attribute__ ((packed)) endpoint_descriptor_t;
 | 
					} __packed endpoint_descriptor_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	unsigned char bLength;
 | 
						unsigned char bLength;
 | 
				
			||||||
@@ -148,7 +148,7 @@ typedef struct {
 | 
				
			|||||||
	unsigned char bNumDescriptors;
 | 
						unsigned char bNumDescriptors;
 | 
				
			||||||
	unsigned char bReportDescriptorType;
 | 
						unsigned char bReportDescriptorType;
 | 
				
			||||||
	unsigned short wReportDescriptorLength;
 | 
						unsigned short wReportDescriptorLength;
 | 
				
			||||||
} __attribute__ ((packed)) hid_descriptor_t;
 | 
					} __packed hid_descriptor_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	union {
 | 
						union {
 | 
				
			||||||
@@ -156,14 +156,14 @@ typedef struct {
 | 
				
			|||||||
			dev_req_recp req_recp:5;
 | 
								dev_req_recp req_recp:5;
 | 
				
			||||||
			dev_req_type req_type:2;
 | 
								dev_req_type req_type:2;
 | 
				
			||||||
			dev_req_dir data_dir:1;
 | 
								dev_req_dir data_dir:1;
 | 
				
			||||||
		} __attribute__ ((packed));
 | 
							} __packed;
 | 
				
			||||||
		unsigned char bmRequestType;
 | 
							unsigned char bmRequestType;
 | 
				
			||||||
	} __attribute__ ((packed));
 | 
						} __packed;
 | 
				
			||||||
	unsigned char bRequest;
 | 
						unsigned char bRequest;
 | 
				
			||||||
	unsigned short wValue;
 | 
						unsigned short wValue;
 | 
				
			||||||
	unsigned short wIndex;
 | 
						unsigned short wIndex;
 | 
				
			||||||
	unsigned short wLength;
 | 
						unsigned short wLength;
 | 
				
			||||||
} __attribute__ ((packed)) dev_req_t;
 | 
					} __packed dev_req_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct usbdev_hc;
 | 
					struct usbdev_hc;
 | 
				
			||||||
typedef struct usbdev_hc hci_t;
 | 
					typedef struct usbdev_hc hci_t;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ struct exception_state
 | 
				
			|||||||
	} regs;
 | 
						} regs;
 | 
				
			||||||
	u32 error_code;
 | 
						u32 error_code;
 | 
				
			||||||
	u32 vector;
 | 
						u32 vector;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
extern struct exception_state *exception_state;
 | 
					extern struct exception_state *exception_state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern u32 exception_stack[];
 | 
					extern u32 exception_stack[];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,7 +98,7 @@ struct lz4_frame_header {
 | 
				
			|||||||
	};
 | 
						};
 | 
				
			||||||
	/* + uint64_t content_size iff has_content_size is set */
 | 
						/* + uint64_t content_size iff has_content_size is set */
 | 
				
			||||||
	/* + uint8_t header_checksum */
 | 
						/* + uint8_t header_checksum */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct lz4_block_header {
 | 
					struct lz4_block_header {
 | 
				
			||||||
	union {
 | 
						union {
 | 
				
			||||||
@@ -110,7 +110,7 @@ struct lz4_block_header {
 | 
				
			|||||||
	};
 | 
						};
 | 
				
			||||||
	/* + size bytes of data */
 | 
						/* + size bytes of data */
 | 
				
			||||||
	/* + uint32_t block_checksum iff has_block_checksum is set */
 | 
						/* + uint32_t block_checksum iff has_block_checksum is set */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
 | 
					size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <cbmem.h>
 | 
					#include <cbmem.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <cpu/x86/gdt.h>
 | 
					#include <cpu/x86/gdt.h>
 | 
				
			||||||
@@ -27,7 +28,7 @@ struct gdtarg {
 | 
				
			|||||||
#else
 | 
					#else
 | 
				
			||||||
	u32 base;
 | 
						u32 base;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Copy GDT to new location and reload it.
 | 
					/* Copy GDT to new location and reload it.
 | 
				
			||||||
 * FIXME: We only do this for BSP CPU.
 | 
					 * FIXME: We only do this for BSP CPU.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,6 +45,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if !defined(__ASSEMBLER__) && !defined(__ACPI__) && !defined(__ROMCC__)
 | 
					#if !defined(__ASSEMBLER__) && !defined(__ACPI__) && !defined(__ROMCC__)
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <rules.h>
 | 
					#include <rules.h>
 | 
				
			||||||
#include <commonlib/helpers.h>
 | 
					#include <commonlib/helpers.h>
 | 
				
			||||||
#include <device/device.h>
 | 
					#include <device/device.h>
 | 
				
			||||||
@@ -77,7 +78,7 @@ typedef struct acpi_rsdp {
 | 
				
			|||||||
	u64   xsdt_address;	/* Physical address of XSDT (64 bits) */
 | 
						u64   xsdt_address;	/* Physical address of XSDT (64 bits) */
 | 
				
			||||||
	u8    ext_checksum;	/* Checksum of the whole table */
 | 
						u8    ext_checksum;	/* Checksum of the whole table */
 | 
				
			||||||
	u8    reserved[3];
 | 
						u8    reserved[3];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_rsdp_t;
 | 
					} __packed acpi_rsdp_t;
 | 
				
			||||||
/* Note: ACPI 1.0 didn't have length, xsdt_address, and ext_checksum. */
 | 
					/* Note: ACPI 1.0 didn't have length, xsdt_address, and ext_checksum. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* GAS (Generic Address Structure) */
 | 
					/* GAS (Generic Address Structure) */
 | 
				
			||||||
@@ -92,7 +93,7 @@ typedef struct acpi_gen_regaddr {
 | 
				
			|||||||
	};
 | 
						};
 | 
				
			||||||
	u32 addrl;		/* Register address, low 32 bits */
 | 
						u32 addrl;		/* Register address, low 32 bits */
 | 
				
			||||||
	u32 addrh;		/* Register address, high 32 bits */
 | 
						u32 addrh;		/* Register address, high 32 bits */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_addr_t;
 | 
					} __packed acpi_addr_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ACPI_ADDRESS_SPACE_MEMORY	   0	/* System memory */
 | 
					#define ACPI_ADDRESS_SPACE_MEMORY	   0	/* System memory */
 | 
				
			||||||
#define ACPI_ADDRESS_SPACE_IO		   1	/* System I/O */
 | 
					#define ACPI_ADDRESS_SPACE_IO		   1	/* System I/O */
 | 
				
			||||||
@@ -128,7 +129,7 @@ typedef struct acpi_table_header {
 | 
				
			|||||||
	u32  oem_revision;           /* OEM revision number */
 | 
						u32  oem_revision;           /* OEM revision number */
 | 
				
			||||||
	char asl_compiler_id[4];     /* ASL compiler vendor ID */
 | 
						char asl_compiler_id[4];     /* ASL compiler vendor ID */
 | 
				
			||||||
	u32  asl_compiler_revision;  /* ASL compiler revision number */
 | 
						u32  asl_compiler_revision;  /* ASL compiler revision number */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_header_t;
 | 
					} __packed acpi_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* A maximum number of 32 ACPI tables ought to be enough for now. */
 | 
					/* A maximum number of 32 ACPI tables ought to be enough for now. */
 | 
				
			||||||
#define MAX_ACPI_TABLES 32
 | 
					#define MAX_ACPI_TABLES 32
 | 
				
			||||||
@@ -137,13 +138,13 @@ typedef struct acpi_table_header {
 | 
				
			|||||||
typedef struct acpi_rsdt {
 | 
					typedef struct acpi_rsdt {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	u32 entry[MAX_ACPI_TABLES];
 | 
						u32 entry[MAX_ACPI_TABLES];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_rsdt_t;
 | 
					} __packed acpi_rsdt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* XSDT (Extended System Description Table) */
 | 
					/* XSDT (Extended System Description Table) */
 | 
				
			||||||
typedef struct acpi_xsdt {
 | 
					typedef struct acpi_xsdt {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	u64 entry[MAX_ACPI_TABLES];
 | 
						u64 entry[MAX_ACPI_TABLES];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_xsdt_t;
 | 
					} __packed acpi_xsdt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* HPET timers */
 | 
					/* HPET timers */
 | 
				
			||||||
typedef struct acpi_hpet {
 | 
					typedef struct acpi_hpet {
 | 
				
			||||||
@@ -153,20 +154,20 @@ typedef struct acpi_hpet {
 | 
				
			|||||||
	u8 number;
 | 
						u8 number;
 | 
				
			||||||
	u16 min_tick;
 | 
						u16 min_tick;
 | 
				
			||||||
	u8 attributes;
 | 
						u8 attributes;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_hpet_t;
 | 
					} __packed acpi_hpet_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MCFG (PCI Express MMIO config space BAR description table) */
 | 
					/* MCFG (PCI Express MMIO config space BAR description table) */
 | 
				
			||||||
typedef struct acpi_mcfg {
 | 
					typedef struct acpi_mcfg {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	u8 reserved[8];
 | 
						u8 reserved[8];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_mcfg_t;
 | 
					} __packed acpi_mcfg_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct acpi_tcpa {
 | 
					typedef struct acpi_tcpa {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	u16 platform_class;
 | 
						u16 platform_class;
 | 
				
			||||||
	u32 laml;
 | 
						u32 laml;
 | 
				
			||||||
	u64 lasa;
 | 
						u64 lasa;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_tcpa_t;
 | 
					} __packed acpi_tcpa_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct acpi_mcfg_mmconfig {
 | 
					typedef struct acpi_mcfg_mmconfig {
 | 
				
			||||||
	u32 base_address;
 | 
						u32 base_address;
 | 
				
			||||||
@@ -175,7 +176,7 @@ typedef struct acpi_mcfg_mmconfig {
 | 
				
			|||||||
	u8 start_bus_number;
 | 
						u8 start_bus_number;
 | 
				
			||||||
	u8 end_bus_number;
 | 
						u8 end_bus_number;
 | 
				
			||||||
	u8 reserved[4];
 | 
						u8 reserved[4];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_mcfg_mmconfig_t;
 | 
					} __packed acpi_mcfg_mmconfig_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SRAT (System Resource Affinity Table) */
 | 
					/* SRAT (System Resource Affinity Table) */
 | 
				
			||||||
typedef struct acpi_srat {
 | 
					typedef struct acpi_srat {
 | 
				
			||||||
@@ -183,7 +184,7 @@ typedef struct acpi_srat {
 | 
				
			|||||||
	u32 resv;
 | 
						u32 resv;
 | 
				
			||||||
	u64 resv1;
 | 
						u64 resv1;
 | 
				
			||||||
	/* Followed by static resource allocation structure[n] */
 | 
						/* Followed by static resource allocation structure[n] */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_srat_t;
 | 
					} __packed acpi_srat_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SRAT: Processor Local APIC/SAPIC Affinity Structure */
 | 
					/* SRAT: Processor Local APIC/SAPIC Affinity Structure */
 | 
				
			||||||
typedef struct acpi_srat_lapic {
 | 
					typedef struct acpi_srat_lapic {
 | 
				
			||||||
@@ -195,7 +196,7 @@ typedef struct acpi_srat_lapic {
 | 
				
			|||||||
	u8 local_sapic_eid;		/* Local SAPIC EID */
 | 
						u8 local_sapic_eid;		/* Local SAPIC EID */
 | 
				
			||||||
	u8 proximity_domain_31_8[3];	/* Proximity domain bits[31:8] */
 | 
						u8 proximity_domain_31_8[3];	/* Proximity domain bits[31:8] */
 | 
				
			||||||
	u32 resv;			/* TODO: Clock domain in ACPI 4.0. */
 | 
						u32 resv;			/* TODO: Clock domain in ACPI 4.0. */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_srat_lapic_t;
 | 
					} __packed acpi_srat_lapic_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SRAT: Memory Affinity Structure */
 | 
					/* SRAT: Memory Affinity Structure */
 | 
				
			||||||
typedef struct acpi_srat_mem {
 | 
					typedef struct acpi_srat_mem {
 | 
				
			||||||
@@ -212,20 +213,20 @@ typedef struct acpi_srat_mem {
 | 
				
			|||||||
		    * other bits reserved to 0
 | 
							    * other bits reserved to 0
 | 
				
			||||||
		    */
 | 
							    */
 | 
				
			||||||
	u32 resv2[2];
 | 
						u32 resv2[2];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_srat_mem_t;
 | 
					} __packed acpi_srat_mem_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SLIT (System Locality Distance Information Table) */
 | 
					/* SLIT (System Locality Distance Information Table) */
 | 
				
			||||||
typedef struct acpi_slit {
 | 
					typedef struct acpi_slit {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	/* Followed by static resource allocation 8+byte[num*num] */
 | 
						/* Followed by static resource allocation 8+byte[num*num] */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_slit_t;
 | 
					} __packed acpi_slit_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MADT (Multiple APIC Description Table) */
 | 
					/* MADT (Multiple APIC Description Table) */
 | 
				
			||||||
typedef struct acpi_madt {
 | 
					typedef struct acpi_madt {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	u32 lapic_addr;			/* Local APIC address */
 | 
						u32 lapic_addr;			/* Local APIC address */
 | 
				
			||||||
	u32 flags;			/* Multiple APIC flags */
 | 
						u32 flags;			/* Multiple APIC flags */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_madt_t;
 | 
					} __packed acpi_madt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* VFCT image header */
 | 
					/* VFCT image header */
 | 
				
			||||||
struct acpi_vfct_image_hdr {
 | 
					struct acpi_vfct_image_hdr {
 | 
				
			||||||
@@ -239,7 +240,7 @@ struct acpi_vfct_image_hdr {
 | 
				
			|||||||
	u32 Revision;
 | 
						u32 Revision;
 | 
				
			||||||
	u32 ImageLength;
 | 
						u32 ImageLength;
 | 
				
			||||||
	u8  VbiosContent;	// dummy - copy VBIOS here
 | 
						u8  VbiosContent;	// dummy - copy VBIOS here
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* VFCT (VBIOS Fetch Table) */
 | 
					/* VFCT (VBIOS Fetch Table) */
 | 
				
			||||||
struct acpi_vfct {
 | 
					struct acpi_vfct {
 | 
				
			||||||
@@ -249,10 +250,10 @@ struct acpi_vfct {
 | 
				
			|||||||
	u32 Lib1ImageOffset;
 | 
						u32 Lib1ImageOffset;
 | 
				
			||||||
	u32 Reserved[4];
 | 
						u32 Reserved[4];
 | 
				
			||||||
	struct acpi_vfct_image_hdr image_hdr;
 | 
						struct acpi_vfct_image_hdr image_hdr;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct acpi_ivrs_info {
 | 
					typedef struct acpi_ivrs_info {
 | 
				
			||||||
} __attribute__ ((packed)) acpi_ivrs_info_t;
 | 
					} __packed acpi_ivrs_info_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 10h */
 | 
					/* IVRS IVHD (I/O Virtualization Hardware Definition Block) Type 10h */
 | 
				
			||||||
typedef struct acpi_ivrs_ivhd {
 | 
					typedef struct acpi_ivrs_ivhd {
 | 
				
			||||||
@@ -267,7 +268,7 @@ typedef struct acpi_ivrs_ivhd {
 | 
				
			|||||||
	uint16_t iommu_info;
 | 
						uint16_t iommu_info;
 | 
				
			||||||
	uint32_t iommu_feature_info;
 | 
						uint32_t iommu_feature_info;
 | 
				
			||||||
	uint8_t entry[0];
 | 
						uint8_t entry[0];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_ivrs_ivhd_t;
 | 
					} __packed acpi_ivrs_ivhd_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* IVRS (I/O Virtualization Reporting Structure) Type 10h */
 | 
					/* IVRS (I/O Virtualization Reporting Structure) Type 10h */
 | 
				
			||||||
typedef struct acpi_ivrs {
 | 
					typedef struct acpi_ivrs {
 | 
				
			||||||
@@ -275,7 +276,7 @@ typedef struct acpi_ivrs {
 | 
				
			|||||||
	uint32_t iv_info;
 | 
						uint32_t iv_info;
 | 
				
			||||||
	uint32_t reserved[2];
 | 
						uint32_t reserved[2];
 | 
				
			||||||
	struct acpi_ivrs_ivhd ivhd;
 | 
						struct acpi_ivrs_ivhd ivhd;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_ivrs_t;
 | 
					} __packed acpi_ivrs_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum dev_scope_type {
 | 
					enum dev_scope_type {
 | 
				
			||||||
	SCOPE_PCI_ENDPOINT = 1,
 | 
						SCOPE_PCI_ENDPOINT = 1,
 | 
				
			||||||
@@ -293,8 +294,8 @@ typedef struct dev_scope {
 | 
				
			|||||||
	struct {
 | 
						struct {
 | 
				
			||||||
		u8 dev;
 | 
							u8 dev;
 | 
				
			||||||
		u8 fn;
 | 
							u8 fn;
 | 
				
			||||||
	} __attribute__((packed)) path[0];
 | 
						} __packed path[0];
 | 
				
			||||||
} __attribute__ ((packed)) dev_scope_t;
 | 
					} __packed dev_scope_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum dmar_type {
 | 
					enum dmar_type {
 | 
				
			||||||
	DMAR_DRHD = 0,
 | 
						DMAR_DRHD = 0,
 | 
				
			||||||
@@ -319,7 +320,7 @@ typedef struct dmar_entry {
 | 
				
			|||||||
	u8 reserved;
 | 
						u8 reserved;
 | 
				
			||||||
	u16 segment;
 | 
						u16 segment;
 | 
				
			||||||
	u64 bar;
 | 
						u64 bar;
 | 
				
			||||||
} __attribute__ ((packed)) dmar_entry_t;
 | 
					} __packed dmar_entry_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct dmar_atsr_entry {
 | 
					typedef struct dmar_atsr_entry {
 | 
				
			||||||
	u16 type;
 | 
						u16 type;
 | 
				
			||||||
@@ -327,7 +328,7 @@ typedef struct dmar_atsr_entry {
 | 
				
			|||||||
	u8 flags;
 | 
						u8 flags;
 | 
				
			||||||
	u8 reserved;
 | 
						u8 reserved;
 | 
				
			||||||
	u16 segment;
 | 
						u16 segment;
 | 
				
			||||||
} __attribute__ ((packed)) dmar_atsr_entry_t;
 | 
					} __packed dmar_atsr_entry_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* DMAR (DMA Remapping Reporting Structure) */
 | 
					/* DMAR (DMA Remapping Reporting Structure) */
 | 
				
			||||||
typedef struct acpi_dmar {
 | 
					typedef struct acpi_dmar {
 | 
				
			||||||
@@ -336,7 +337,7 @@ typedef struct acpi_dmar {
 | 
				
			|||||||
	u8 flags;
 | 
						u8 flags;
 | 
				
			||||||
	u8 reserved[10];
 | 
						u8 reserved[10];
 | 
				
			||||||
	dmar_entry_t structure[0];
 | 
						dmar_entry_t structure[0];
 | 
				
			||||||
} __attribute__ ((packed)) acpi_dmar_t;
 | 
					} __packed acpi_dmar_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MADT: APIC Structure Types */
 | 
					/* MADT: APIC Structure Types */
 | 
				
			||||||
/* TODO: Convert to ALLCAPS. */
 | 
					/* TODO: Convert to ALLCAPS. */
 | 
				
			||||||
@@ -363,7 +364,7 @@ typedef struct acpi_madt_lapic {
 | 
				
			|||||||
	u8 processor_id;		/* ACPI processor ID */
 | 
						u8 processor_id;		/* ACPI processor ID */
 | 
				
			||||||
	u8 apic_id;			/* Local APIC ID */
 | 
						u8 apic_id;			/* Local APIC ID */
 | 
				
			||||||
	u32 flags;			/* Local APIC flags */
 | 
						u32 flags;			/* Local APIC flags */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_madt_lapic_t;
 | 
					} __packed acpi_madt_lapic_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MADT: Local APIC NMI Structure */
 | 
					/* MADT: Local APIC NMI Structure */
 | 
				
			||||||
typedef struct acpi_madt_lapic_nmi {
 | 
					typedef struct acpi_madt_lapic_nmi {
 | 
				
			||||||
@@ -372,7 +373,7 @@ typedef struct acpi_madt_lapic_nmi {
 | 
				
			|||||||
	u8 processor_id;		/* ACPI processor ID */
 | 
						u8 processor_id;		/* ACPI processor ID */
 | 
				
			||||||
	u16 flags;			/* MPS INTI flags */
 | 
						u16 flags;			/* MPS INTI flags */
 | 
				
			||||||
	u8 lint;			/* Local APIC LINT# */
 | 
						u8 lint;			/* Local APIC LINT# */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_madt_lapic_nmi_t;
 | 
					} __packed acpi_madt_lapic_nmi_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MADT: I/O APIC Structure */
 | 
					/* MADT: I/O APIC Structure */
 | 
				
			||||||
typedef struct acpi_madt_ioapic {
 | 
					typedef struct acpi_madt_ioapic {
 | 
				
			||||||
@@ -382,7 +383,7 @@ typedef struct acpi_madt_ioapic {
 | 
				
			|||||||
	u8 reserved;
 | 
						u8 reserved;
 | 
				
			||||||
	u32 ioapic_addr;		/* I/O APIC address */
 | 
						u32 ioapic_addr;		/* I/O APIC address */
 | 
				
			||||||
	u32 gsi_base;			/* Global system interrupt base */
 | 
						u32 gsi_base;			/* Global system interrupt base */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_madt_ioapic_t;
 | 
					} __packed acpi_madt_ioapic_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* MADT: Interrupt Source Override Structure */
 | 
					/* MADT: Interrupt Source Override Structure */
 | 
				
			||||||
typedef struct acpi_madt_irqoverride {
 | 
					typedef struct acpi_madt_irqoverride {
 | 
				
			||||||
@@ -392,7 +393,7 @@ typedef struct acpi_madt_irqoverride {
 | 
				
			|||||||
	u8 source;			/* Bus-relative int. source (IRQ) */
 | 
						u8 source;			/* Bus-relative int. source (IRQ) */
 | 
				
			||||||
	u32 gsirq;			/* Global system interrupt */
 | 
						u32 gsirq;			/* Global system interrupt */
 | 
				
			||||||
	u16 flags;			/* MPS INTI flags */
 | 
						u16 flags;			/* MPS INTI flags */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_madt_irqoverride_t;
 | 
					} __packed acpi_madt_irqoverride_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* FADT (Fixed ACPI Description Table) */
 | 
					/* FADT (Fixed ACPI Description Table) */
 | 
				
			||||||
typedef struct acpi_fadt {
 | 
					typedef struct acpi_fadt {
 | 
				
			||||||
@@ -452,7 +453,7 @@ typedef struct acpi_fadt {
 | 
				
			|||||||
	struct acpi_gen_regaddr x_pm_tmr_blk;
 | 
						struct acpi_gen_regaddr x_pm_tmr_blk;
 | 
				
			||||||
	struct acpi_gen_regaddr x_gpe0_blk;
 | 
						struct acpi_gen_regaddr x_gpe0_blk;
 | 
				
			||||||
	struct acpi_gen_regaddr x_gpe1_blk;
 | 
						struct acpi_gen_regaddr x_gpe1_blk;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_fadt_t;
 | 
					} __packed acpi_fadt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* FADT TABLE Revision values */
 | 
					/* FADT TABLE Revision values */
 | 
				
			||||||
#define ACPI_FADT_REV_ACPI_1_0		1
 | 
					#define ACPI_FADT_REV_ACPI_1_0		1
 | 
				
			||||||
@@ -524,7 +525,7 @@ typedef struct acpi_facs {
 | 
				
			|||||||
	u32 x_firmware_waking_vector_h;		/* X FW waking vector, high */
 | 
						u32 x_firmware_waking_vector_h;		/* X FW waking vector, high */
 | 
				
			||||||
	u8 version;				/* ACPI 4.0: 2 */
 | 
						u8 version;				/* ACPI 4.0: 2 */
 | 
				
			||||||
	u8 resv[31];				/* FIXME: 4.0: ospm_flags */
 | 
						u8 resv[31];				/* FIXME: 4.0: ospm_flags */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_facs_t;
 | 
					} __packed acpi_facs_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* FACS flags */
 | 
					/* FACS flags */
 | 
				
			||||||
#define ACPI_FACS_S4BIOS_F	(1 << 0)
 | 
					#define ACPI_FACS_S4BIOS_F	(1 << 0)
 | 
				
			||||||
@@ -539,14 +540,14 @@ typedef struct acpi_ecdt {
 | 
				
			|||||||
	u32 uid;				/* UID */
 | 
						u32 uid;				/* UID */
 | 
				
			||||||
	u8 gpe_bit;				/* GPE bit */
 | 
						u8 gpe_bit;				/* GPE bit */
 | 
				
			||||||
	u8 ec_id[];				/* EC ID  */
 | 
						u8 ec_id[];				/* EC ID  */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_ecdt_t;
 | 
					} __packed acpi_ecdt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* HEST (Hardware Error Source Table) */
 | 
					/* HEST (Hardware Error Source Table) */
 | 
				
			||||||
typedef struct acpi_hest {
 | 
					typedef struct acpi_hest {
 | 
				
			||||||
	struct acpi_table_header header;
 | 
						struct acpi_table_header header;
 | 
				
			||||||
	u32 error_source_count;
 | 
						u32 error_source_count;
 | 
				
			||||||
	/* error_source_struct(s) */
 | 
						/* error_source_struct(s) */
 | 
				
			||||||
} __attribute__ ((packed)) acpi_hest_t;
 | 
					} __packed acpi_hest_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Error Source Descriptors */
 | 
					/* Error Source Descriptors */
 | 
				
			||||||
typedef struct acpi_hest_esd {
 | 
					typedef struct acpi_hest_esd {
 | 
				
			||||||
@@ -559,7 +560,7 @@ typedef struct acpi_hest_esd {
 | 
				
			|||||||
					 * pre-allocate for this error source.
 | 
										 * pre-allocate for this error source.
 | 
				
			||||||
					 */
 | 
										 */
 | 
				
			||||||
	u32 max_section_per_record;
 | 
						u32 max_section_per_record;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_hest_esd_t;
 | 
					} __packed acpi_hest_esd_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Hardware Error Notification */
 | 
					/* Hardware Error Notification */
 | 
				
			||||||
typedef struct acpi_hest_hen {
 | 
					typedef struct acpi_hest_hen {
 | 
				
			||||||
@@ -572,14 +573,14 @@ typedef struct acpi_hest_hen {
 | 
				
			|||||||
	u32 sw2poll_threshold_win;
 | 
						u32 sw2poll_threshold_win;
 | 
				
			||||||
	u32 error_threshold_val;
 | 
						u32 error_threshold_val;
 | 
				
			||||||
	u32 error_threshold_win;
 | 
						u32 error_threshold_win;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_hest_hen_t;
 | 
					} __packed acpi_hest_hen_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct acpi_cstate {
 | 
					typedef struct acpi_cstate {
 | 
				
			||||||
	u8  ctype;
 | 
						u8  ctype;
 | 
				
			||||||
	u16 latency;
 | 
						u16 latency;
 | 
				
			||||||
	u32 power;
 | 
						u32 power;
 | 
				
			||||||
	acpi_addr_t resource;
 | 
						acpi_addr_t resource;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_cstate_t;
 | 
					} __packed acpi_cstate_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct acpi_tstate {
 | 
					typedef struct acpi_tstate {
 | 
				
			||||||
	u32 percent;
 | 
						u32 percent;
 | 
				
			||||||
@@ -587,7 +588,7 @@ typedef struct acpi_tstate {
 | 
				
			|||||||
	u32 latency;
 | 
						u32 latency;
 | 
				
			||||||
	u32 control;
 | 
						u32 control;
 | 
				
			||||||
	u32 status;
 | 
						u32 status;
 | 
				
			||||||
} __attribute__ ((packed)) acpi_tstate_t;
 | 
					} __packed acpi_tstate_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long fw_cfg_acpi_tables(unsigned long start);
 | 
					unsigned long fw_cfg_acpi_tables(unsigned long start);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,7 @@
 | 
				
			|||||||
#define MAX_INTX_ENTRIES 4
 | 
					#define MAX_INTX_ENTRIES 4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PIRQ_SIGNATURE	(('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
 | 
					#define PIRQ_SIGNATURE	(('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
 | 
				
			||||||
#define PIRQ_VERSION 0x0100
 | 
					#define PIRQ_VERSION 0x0100
 | 
				
			||||||
@@ -37,10 +38,10 @@ struct irq_info {
 | 
				
			|||||||
	struct {
 | 
						struct {
 | 
				
			||||||
		u8 link;    /* IRQ line ID, chipset dependent, 0=not routed */
 | 
							u8 link;    /* IRQ line ID, chipset dependent, 0=not routed */
 | 
				
			||||||
		u16 bitmap; /* Available IRQs */
 | 
							u16 bitmap; /* Available IRQs */
 | 
				
			||||||
	} __attribute__((packed)) irq[4];
 | 
						} __packed irq[4];
 | 
				
			||||||
	u8 slot;	    /* Slot number, 0=onboard */
 | 
						u8 slot;	    /* Slot number, 0=onboard */
 | 
				
			||||||
	u8 rfu;
 | 
						u8 rfu;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct irq_routing_table {
 | 
					struct irq_routing_table {
 | 
				
			||||||
	u32 signature;		/* PIRQ_SIGNATURE should be here */
 | 
						u32 signature;		/* PIRQ_SIGNATURE should be here */
 | 
				
			||||||
@@ -53,7 +54,7 @@ struct irq_routing_table {
 | 
				
			|||||||
	u8  rfu[11];
 | 
						u8  rfu[11];
 | 
				
			||||||
	u8  checksum;		/* Modulo 256 checksum must give zero */
 | 
						u8  checksum;		/* Modulo 256 checksum must give zero */
 | 
				
			||||||
	struct irq_info slots[CONFIG_IRQ_SLOT_COUNT];
 | 
						struct irq_info slots[CONFIG_IRQ_SLOT_COUNT];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long copy_pirq_routing_table(unsigned long addr,
 | 
					unsigned long copy_pirq_routing_table(unsigned long addr,
 | 
				
			||||||
	const struct irq_routing_table *routing_table);
 | 
						const struct irq_routing_table *routing_table);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,7 @@
 | 
				
			|||||||
#ifndef __ARCH_REGISTERS_H
 | 
					#ifndef __ARCH_REGISTERS_H
 | 
				
			||||||
#define __ARCH_REGISTERS_H
 | 
					#define __ARCH_REGISTERS_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define __PACKED __attribute__((packed))
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DOWNTO8(A) \
 | 
					#define DOWNTO8(A) \
 | 
				
			||||||
	union { \
 | 
						union { \
 | 
				
			||||||
@@ -25,22 +25,22 @@
 | 
				
			|||||||
				struct { \
 | 
									struct { \
 | 
				
			||||||
					uint8_t A##l; \
 | 
										uint8_t A##l; \
 | 
				
			||||||
					uint8_t A##h; \
 | 
										uint8_t A##h; \
 | 
				
			||||||
				} __PACKED; \
 | 
									} __packed; \
 | 
				
			||||||
				uint16_t A##x; \
 | 
									uint16_t A##x; \
 | 
				
			||||||
			} __PACKED; \
 | 
								} __packed; \
 | 
				
			||||||
			uint16_t h##A##x; \
 | 
								uint16_t h##A##x; \
 | 
				
			||||||
		} __PACKED; \
 | 
							} __packed; \
 | 
				
			||||||
		uint32_t e##A##x; \
 | 
							uint32_t e##A##x; \
 | 
				
			||||||
	} __PACKED;
 | 
						} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DOWNTO16(A) \
 | 
					#define DOWNTO16(A) \
 | 
				
			||||||
	union { \
 | 
						union { \
 | 
				
			||||||
		struct { \
 | 
							struct { \
 | 
				
			||||||
			uint16_t A; \
 | 
								uint16_t A; \
 | 
				
			||||||
			uint16_t h##A; \
 | 
								uint16_t h##A; \
 | 
				
			||||||
		} __PACKED; \
 | 
							} __packed; \
 | 
				
			||||||
		uint32_t e##A; \
 | 
							uint32_t e##A; \
 | 
				
			||||||
	} __PACKED;
 | 
						} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct eregs {
 | 
					struct eregs {
 | 
				
			||||||
	DOWNTO8(a);
 | 
						DOWNTO8(a);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#ifndef __ASM_MPSPEC_H
 | 
					#ifndef __ASM_MPSPEC_H
 | 
				
			||||||
#define __ASM_MPSPEC_H
 | 
					#define __ASM_MPSPEC_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <device/device.h>
 | 
					#include <device/device.h>
 | 
				
			||||||
#include <cpu/x86/lapic_def.h>
 | 
					#include <cpu/x86/lapic_def.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,7 +53,7 @@ struct intel_mp_floating {
 | 
				
			|||||||
	u8 mpf_feature3;	/* Unused (0) */
 | 
						u8 mpf_feature3;	/* Unused (0) */
 | 
				
			||||||
	u8 mpf_feature4;	/* Unused (0) */
 | 
						u8 mpf_feature4;	/* Unused (0) */
 | 
				
			||||||
	u8 mpf_feature5;	/* Unused (0) */
 | 
						u8 mpf_feature5;	/* Unused (0) */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mp_config_table {
 | 
					struct mp_config_table {
 | 
				
			||||||
	char mpc_signature[4];
 | 
						char mpc_signature[4];
 | 
				
			||||||
@@ -69,7 +70,7 @@ struct mp_config_table {
 | 
				
			|||||||
	u16 mpe_length;	/* Extended Table size */
 | 
						u16 mpe_length;	/* Extended Table size */
 | 
				
			||||||
	u8 mpe_checksum;	/* Extended Table checksum */
 | 
						u8 mpe_checksum;	/* Extended Table checksum */
 | 
				
			||||||
	u8 reserved;
 | 
						u8 reserved;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Followed by entries */
 | 
					/* Followed by entries */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -92,13 +93,13 @@ struct mpc_config_processor {
 | 
				
			|||||||
#define MPC_CPU_FAMILY_MASK	0xF00
 | 
					#define MPC_CPU_FAMILY_MASK	0xF00
 | 
				
			||||||
	u32 mpc_featureflag;	/* CPUID feature value */
 | 
						u32 mpc_featureflag;	/* CPUID feature value */
 | 
				
			||||||
	u32 mpc_reserved[2];
 | 
						u32 mpc_reserved[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mpc_config_bus {
 | 
					struct mpc_config_bus {
 | 
				
			||||||
	u8 mpc_type;
 | 
						u8 mpc_type;
 | 
				
			||||||
	u8 mpc_busid;
 | 
						u8 mpc_busid;
 | 
				
			||||||
	u8 mpc_bustype[6];
 | 
						u8 mpc_bustype[6];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BUSTYPE_EISA	"EISA"
 | 
					#define BUSTYPE_EISA	"EISA"
 | 
				
			||||||
#define BUSTYPE_ISA	"ISA"
 | 
					#define BUSTYPE_ISA	"ISA"
 | 
				
			||||||
@@ -115,7 +116,7 @@ struct mpc_config_ioapic {
 | 
				
			|||||||
	u8 mpc_flags;
 | 
						u8 mpc_flags;
 | 
				
			||||||
#define MPC_APIC_USABLE		0x01
 | 
					#define MPC_APIC_USABLE		0x01
 | 
				
			||||||
	void *mpc_apicaddr;
 | 
						void *mpc_apicaddr;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mpc_config_intsrc {
 | 
					struct mpc_config_intsrc {
 | 
				
			||||||
	u8 mpc_type;
 | 
						u8 mpc_type;
 | 
				
			||||||
@@ -125,7 +126,7 @@ struct mpc_config_intsrc {
 | 
				
			|||||||
	u8 mpc_srcbusirq;
 | 
						u8 mpc_srcbusirq;
 | 
				
			||||||
	u8 mpc_dstapic;
 | 
						u8 mpc_dstapic;
 | 
				
			||||||
	u8 mpc_dstirq;
 | 
						u8 mpc_dstirq;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum mp_irq_source_types {
 | 
					enum mp_irq_source_types {
 | 
				
			||||||
	mp_INT = 0,
 | 
						mp_INT = 0,
 | 
				
			||||||
@@ -153,7 +154,7 @@ struct mpc_config_lintsrc {
 | 
				
			|||||||
	u8 mpc_destapic;
 | 
						u8 mpc_destapic;
 | 
				
			||||||
#define MP_APIC_ALL	0xFF
 | 
					#define MP_APIC_ALL	0xFF
 | 
				
			||||||
	u8 mpc_destapiclint;
 | 
						u8 mpc_destapiclint;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *	Default configurations
 | 
					 *	Default configurations
 | 
				
			||||||
@@ -185,7 +186,7 @@ enum mp_bustype {
 | 
				
			|||||||
struct mp_exten_config {
 | 
					struct mp_exten_config {
 | 
				
			||||||
	u8 mpe_type;
 | 
						u8 mpe_type;
 | 
				
			||||||
	u8 mpe_length;
 | 
						u8 mpe_length;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct mp_exten_config *mpe_t;
 | 
					typedef struct mp_exten_config *mpe_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -201,7 +202,7 @@ struct mp_exten_system_address_space {
 | 
				
			|||||||
	u32 mpe_address_base_high;
 | 
						u32 mpe_address_base_high;
 | 
				
			||||||
	u32 mpe_address_length_low;
 | 
						u32 mpe_address_length_low;
 | 
				
			||||||
	u32 mpe_address_length_high;
 | 
						u32 mpe_address_length_high;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mp_exten_bus_hierarchy {
 | 
					struct mp_exten_bus_hierarchy {
 | 
				
			||||||
	u8 mpe_type;
 | 
						u8 mpe_type;
 | 
				
			||||||
@@ -211,7 +212,7 @@ struct mp_exten_bus_hierarchy {
 | 
				
			|||||||
#define BUS_SUBTRACTIVE_DECODE 1
 | 
					#define BUS_SUBTRACTIVE_DECODE 1
 | 
				
			||||||
	u8 mpe_parent_busid;
 | 
						u8 mpe_parent_busid;
 | 
				
			||||||
	u8 reserved[3];
 | 
						u8 reserved[3];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mp_exten_compatibility_address_space {
 | 
					struct mp_exten_compatibility_address_space {
 | 
				
			||||||
	u8 mpe_type;
 | 
						u8 mpe_type;
 | 
				
			||||||
@@ -237,7 +238,7 @@ struct mp_exten_compatibility_address_space {
 | 
				
			|||||||
	 * XFB0 - XFBB
 | 
						 * XFB0 - XFBB
 | 
				
			||||||
	 * XFC0 - XCDF
 | 
						 * XFC0 - XCDF
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void mptable_init(struct mp_config_table *mc, u32 lapic_addr);
 | 
					void mptable_init(struct mp_config_table *mc, u32 lapic_addr);
 | 
				
			||||||
void *smp_next_mpc_entry(struct mp_config_table *mc);
 | 
					void *smp_next_mpc_entry(struct mp_config_table *mc);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <commonlib/endian.h>
 | 
					#include <commonlib/endian.h>
 | 
				
			||||||
#include <commonlib/fsp.h>
 | 
					#include <commonlib/fsp.h>
 | 
				
			||||||
@@ -67,7 +68,7 @@ struct fsp_patch_table {
 | 
				
			|||||||
	uint8_t reserved;
 | 
						uint8_t reserved;
 | 
				
			||||||
	uint32_t patch_entry_num;
 | 
						uint32_t patch_entry_num;
 | 
				
			||||||
	uint32_t patch_entries[0];
 | 
						uint32_t patch_entries[0];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define FSPP_SIG 0x50505346
 | 
					#define FSPP_SIG 0x50505346
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,6 +48,7 @@
 | 
				
			|||||||
#define _CBFS_SERIALIZED_H_
 | 
					#define _CBFS_SERIALIZED_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** These are standard values for the known compression
 | 
					/** These are standard values for the known compression
 | 
				
			||||||
    algorithms that coreboot knows about for stages and
 | 
					    algorithms that coreboot knows about for stages and
 | 
				
			||||||
@@ -101,7 +102,7 @@ struct cbfs_header {
 | 
				
			|||||||
	uint32_t offset;
 | 
						uint32_t offset;
 | 
				
			||||||
	uint32_t architecture;
 | 
						uint32_t architecture;
 | 
				
			||||||
	uint32_t pad[1];
 | 
						uint32_t pad[1];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* this used to be flexible, but wasn't ever set to something different. */
 | 
					/* this used to be flexible, but wasn't ever set to something different. */
 | 
				
			||||||
#define CBFS_ALIGNMENT 64
 | 
					#define CBFS_ALIGNMENT 64
 | 
				
			||||||
@@ -136,7 +137,7 @@ struct cbfs_file {
 | 
				
			|||||||
	uint32_t type;
 | 
						uint32_t type;
 | 
				
			||||||
	uint32_t attributes_offset;
 | 
						uint32_t attributes_offset;
 | 
				
			||||||
	uint32_t offset;
 | 
						uint32_t offset;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* The common fields of extended cbfs file attributes.
 | 
					/* The common fields of extended cbfs file attributes.
 | 
				
			||||||
   Attributes are expected to start with tag/len, then append their
 | 
					   Attributes are expected to start with tag/len, then append their
 | 
				
			||||||
@@ -146,7 +147,7 @@ struct cbfs_file_attribute {
 | 
				
			|||||||
	/* len covers the whole structure, incl. tag and len */
 | 
						/* len covers the whole structure, incl. tag and len */
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
	uint8_t data[0];
 | 
						uint8_t data[0];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Depending on how the header was initialized, it may be backed with 0x00 or
 | 
					/* Depending on how the header was initialized, it may be backed with 0x00 or
 | 
				
			||||||
 * 0xff. Support both. */
 | 
					 * 0xff. Support both. */
 | 
				
			||||||
@@ -163,7 +164,7 @@ struct cbfs_file_attr_compression {
 | 
				
			|||||||
	/* whole file compression format. 0 if no compression. */
 | 
						/* whole file compression format. 0 if no compression. */
 | 
				
			||||||
	uint32_t compression;
 | 
						uint32_t compression;
 | 
				
			||||||
	uint32_t decompressed_size;
 | 
						uint32_t decompressed_size;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_file_attr_hash {
 | 
					struct cbfs_file_attr_hash {
 | 
				
			||||||
	uint32_t tag;
 | 
						uint32_t tag;
 | 
				
			||||||
@@ -171,19 +172,19 @@ struct cbfs_file_attr_hash {
 | 
				
			|||||||
	uint32_t hash_type;
 | 
						uint32_t hash_type;
 | 
				
			||||||
	/* hash_data is len - sizeof(struct) bytes */
 | 
						/* hash_data is len - sizeof(struct) bytes */
 | 
				
			||||||
	uint8_t  hash_data[];
 | 
						uint8_t  hash_data[];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_file_attr_position {
 | 
					struct cbfs_file_attr_position {
 | 
				
			||||||
	uint32_t tag;
 | 
						uint32_t tag;
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
	uint32_t position;
 | 
						uint32_t position;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_file_attr_align {
 | 
					struct cbfs_file_attr_align {
 | 
				
			||||||
	uint32_t tag;
 | 
						uint32_t tag;
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
	uint32_t alignment;
 | 
						uint32_t alignment;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * ROMCC does not understand uint64_t, so we hide future definitions as they are
 | 
					 * ROMCC does not understand uint64_t, so we hide future definitions as they are
 | 
				
			||||||
@@ -205,7 +206,7 @@ struct cbfs_stage {
 | 
				
			|||||||
	uint64_t load;   /** Where to load in memory */
 | 
						uint64_t load;   /** Where to load in memory */
 | 
				
			||||||
	uint32_t len;          /** length of data to load */
 | 
						uint32_t len;          /** length of data to load */
 | 
				
			||||||
	uint32_t memlen;	   /** total length of object in memory */
 | 
						uint32_t memlen;	   /** total length of object in memory */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** this is the sub-header for payload components.  Payloads
 | 
					/** this is the sub-header for payload components.  Payloads
 | 
				
			||||||
    are loaded by coreboot at the end of the boot process */
 | 
					    are loaded by coreboot at the end of the boot process */
 | 
				
			||||||
@@ -217,7 +218,7 @@ struct cbfs_payload_segment {
 | 
				
			|||||||
	uint64_t load_addr;
 | 
						uint64_t load_addr;
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
	uint32_t mem_len;
 | 
						uint32_t mem_len;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct cbfs_payload {
 | 
					struct cbfs_payload {
 | 
				
			||||||
	struct cbfs_payload_segment segments;
 | 
						struct cbfs_payload_segment segments;
 | 
				
			||||||
@@ -232,7 +233,7 @@ struct cbfs_payload {
 | 
				
			|||||||
struct cbfs_optionrom {
 | 
					struct cbfs_optionrom {
 | 
				
			||||||
	uint32_t compression;
 | 
						uint32_t compression;
 | 
				
			||||||
	uint32_t len;
 | 
						uint32_t len;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* __ROMCC__ */
 | 
					#endif /* __ROMCC__ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,6 +37,7 @@
 | 
				
			|||||||
#define FLASHMAP_SERIALIZED_H__
 | 
					#define FLASHMAP_SERIALIZED_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define FMAP_SIGNATURE		"__FMAP__"
 | 
					#define FMAP_SIGNATURE		"__FMAP__"
 | 
				
			||||||
#define FMAP_VER_MAJOR		1	/* this header's FMAP minor version */
 | 
					#define FMAP_VER_MAJOR		1	/* this header's FMAP minor version */
 | 
				
			||||||
@@ -56,7 +57,7 @@ struct fmap_area {
 | 
				
			|||||||
	uint32_t size;                  /* size in bytes */
 | 
						uint32_t size;                  /* size in bytes */
 | 
				
			||||||
	uint8_t  name[FMAP_STRLEN];     /* descriptive name */
 | 
						uint8_t  name[FMAP_STRLEN];     /* descriptive name */
 | 
				
			||||||
	uint16_t flags;                 /* flags for this area */
 | 
						uint16_t flags;                 /* flags for this area */
 | 
				
			||||||
}  __attribute__((packed));
 | 
					}  __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct fmap {
 | 
					struct fmap {
 | 
				
			||||||
	uint8_t  signature[8];		/* "__FMAP__" (0x5F5F464D41505F5F) */
 | 
						uint8_t  signature[8];		/* "__FMAP__" (0x5F5F464D41505F5F) */
 | 
				
			||||||
@@ -68,6 +69,6 @@ struct fmap {
 | 
				
			|||||||
	uint16_t nareas;		/* number of areas described by
 | 
						uint16_t nareas;		/* number of areas described by
 | 
				
			||||||
					   fmap_areas[] below */
 | 
										   fmap_areas[] below */
 | 
				
			||||||
	struct fmap_area areas[];
 | 
						struct fmap_area areas[];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif	/* FLASHMAP_SERIALIZED_H__ */
 | 
					#endif	/* FLASHMAP_SERIALIZED_H__ */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define RMODULE_MAGIC 0xf8fe
 | 
					#define RMODULE_MAGIC 0xf8fe
 | 
				
			||||||
#define RMODULE_VERSION_1 1
 | 
					#define RMODULE_VERSION_1 1
 | 
				
			||||||
@@ -54,6 +55,6 @@ struct rmodule_header {
 | 
				
			|||||||
	uint32_t bss_end;
 | 
						uint32_t bss_end;
 | 
				
			||||||
	/* Add some room for growth. */
 | 
						/* Add some room for growth. */
 | 
				
			||||||
	uint32_t padding[4];
 | 
						uint32_t padding[4];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* RMODULE_DEFS_H */
 | 
					#endif /* RMODULE_DEFS_H */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,11 +17,12 @@
 | 
				
			|||||||
#define __TIMESTAMP_SERIALIZED_H__
 | 
					#define __TIMESTAMP_SERIALIZED_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct timestamp_entry {
 | 
					struct timestamp_entry {
 | 
				
			||||||
	uint32_t	entry_id;
 | 
						uint32_t	entry_id;
 | 
				
			||||||
	uint64_t	entry_stamp;
 | 
						uint64_t	entry_stamp;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct timestamp_table {
 | 
					struct timestamp_table {
 | 
				
			||||||
	uint64_t	base_time;
 | 
						uint64_t	base_time;
 | 
				
			||||||
@@ -29,7 +30,7 @@ struct timestamp_table {
 | 
				
			|||||||
	uint16_t	tick_freq_mhz;
 | 
						uint16_t	tick_freq_mhz;
 | 
				
			||||||
	uint32_t	num_entries;
 | 
						uint32_t	num_entries;
 | 
				
			||||||
	struct timestamp_entry entries[0]; /* Variable number of entries */
 | 
						struct timestamp_entry entries[0]; /* Variable number of entries */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum timestamp_id {
 | 
					enum timestamp_id {
 | 
				
			||||||
	TS_START_ROMSTAGE = 1,
 | 
						TS_START_ROMSTAGE = 1,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,6 +34,7 @@
 | 
				
			|||||||
#include <commonlib/helpers.h>
 | 
					#include <commonlib/helpers.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* LZ4 comes with its own supposedly portable memory access functions, but they
 | 
					/* LZ4 comes with its own supposedly portable memory access functions, but they
 | 
				
			||||||
 * seem to be very inefficient in practice (at least on ARM64). Since coreboot
 | 
					 * seem to be very inefficient in practice (at least on ARM64). Since coreboot
 | 
				
			||||||
@@ -115,7 +116,7 @@ struct lz4_frame_header {
 | 
				
			|||||||
	};
 | 
						};
 | 
				
			||||||
	/* + uint64_t content_size iff has_content_size is set */
 | 
						/* + uint64_t content_size iff has_content_size is set */
 | 
				
			||||||
	/* + uint8_t header_checksum */
 | 
						/* + uint8_t header_checksum */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct lz4_block_header {
 | 
					struct lz4_block_header {
 | 
				
			||||||
	union {
 | 
						union {
 | 
				
			||||||
@@ -127,7 +128,7 @@ struct lz4_block_header {
 | 
				
			|||||||
	};
 | 
						};
 | 
				
			||||||
	/* + size bytes of data */
 | 
						/* + size bytes of data */
 | 
				
			||||||
	/* + uint32_t block_checksum iff has_block_checksum is set */
 | 
						/* + uint32_t block_checksum iff has_block_checksum is set */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
 | 
					size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "memmap.h"
 | 
					#include "memmap.h"
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* CPU_AHB_APB0 config values */
 | 
					/* CPU_AHB_APB0 config values */
 | 
				
			||||||
#define CPU_CLK_SRC_MASK		(3 << 16)
 | 
					#define CPU_CLK_SRC_MASK		(3 << 16)
 | 
				
			||||||
@@ -267,7 +268,7 @@ struct a10_ccm {
 | 
				
			|||||||
	u32 mali_clk_cfg;	/* 0x154 */
 | 
						u32 mali_clk_cfg;	/* 0x154 */
 | 
				
			||||||
	u8 res7[0x4];
 | 
						u8 res7[0x4];
 | 
				
			||||||
	u32 mbus_clk_cfg;	/* 0x15c */
 | 
						u32 mbus_clk_cfg;	/* 0x15c */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void a1x_periph_clock_enable(enum a1x_clken periph);
 | 
					void a1x_periph_clock_enable(enum a1x_clken periph);
 | 
				
			||||||
void a1x_periph_clock_disable(enum a1x_clken periph);
 | 
					void a1x_periph_clock_disable(enum a1x_clken periph);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@
 | 
				
			|||||||
#define __CPU_ALLWINNER_A10_PINMUX_H
 | 
					#define __CPU_ALLWINNER_A10_PINMUX_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define GPIO_BASE		 0x01C20800
 | 
					#define GPIO_BASE		 0x01C20800
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -42,7 +43,7 @@ struct a10_gpio_port {
 | 
				
			|||||||
	u32 dat;
 | 
						u32 dat;
 | 
				
			||||||
	u32 drv[2];
 | 
						u32 drv[2];
 | 
				
			||||||
	u32 pul[2];
 | 
						u32 pul[2];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct a10_gpio {
 | 
					struct a10_gpio {
 | 
				
			||||||
	struct a10_gpio_port port[10];
 | 
						struct a10_gpio_port port[10];
 | 
				
			||||||
@@ -58,7 +59,7 @@ struct a10_gpio {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	u32 sdr_pad_drv;
 | 
						u32 sdr_pad_drv;
 | 
				
			||||||
	u32 sdr_pad_pul;
 | 
						u32 sdr_pad_pul;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* gpio.c */
 | 
					/* gpio.c */
 | 
				
			||||||
void gpio_set(u8 port, u8 pin);
 | 
					void gpio_set(u8 port, u8 pin);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "memmap.h"
 | 
					#include "memmap.h"
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* TMRx_CTRL values */
 | 
					/* TMRx_CTRL values */
 | 
				
			||||||
#define TIMER_CTRL_MODE_SINGLE		(1 << 7)
 | 
					#define TIMER_CTRL_MODE_SINGLE		(1 << 7)
 | 
				
			||||||
@@ -48,7 +49,7 @@ struct a1x_timer {
 | 
				
			|||||||
	u32 interval;
 | 
						u32 interval;
 | 
				
			||||||
	u32 val;
 | 
						u32 val;
 | 
				
			||||||
	u8 res[4];
 | 
						u8 res[4];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Audio video sync*/
 | 
					/* Audio video sync*/
 | 
				
			||||||
struct a1x_avs {
 | 
					struct a1x_avs {
 | 
				
			||||||
@@ -56,27 +57,27 @@ struct a1x_avs {
 | 
				
			|||||||
	u32 cnt0;		/* 0x84 */
 | 
						u32 cnt0;		/* 0x84 */
 | 
				
			||||||
	u32 cnt1;		/* 0x88 */
 | 
						u32 cnt1;		/* 0x88 */
 | 
				
			||||||
	u32 div;		/* 0x8c */
 | 
						u32 div;		/* 0x8c */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Watchdog */
 | 
					/* Watchdog */
 | 
				
			||||||
struct a1x_wdog {
 | 
					struct a1x_wdog {
 | 
				
			||||||
	u32 ctrl;		/* 0x90 */
 | 
						u32 ctrl;		/* 0x90 */
 | 
				
			||||||
	u32 mode;		/* 0x94 */
 | 
						u32 mode;		/* 0x94 */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* 64 bit counter */
 | 
					/* 64 bit counter */
 | 
				
			||||||
struct a1x_64cnt {
 | 
					struct a1x_64cnt {
 | 
				
			||||||
	u32 ctrl;		/* 0xa0 */
 | 
						u32 ctrl;		/* 0xa0 */
 | 
				
			||||||
	u32 lo;			/* 0xa4 */
 | 
						u32 lo;			/* 0xa4 */
 | 
				
			||||||
	u32 hi;			/* 0xa8 */
 | 
						u32 hi;			/* 0xa8 */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Rtc */
 | 
					/* Rtc */
 | 
				
			||||||
struct a1x_rtc {
 | 
					struct a1x_rtc {
 | 
				
			||||||
	u32 ctrl;		/* 0x100 */
 | 
						u32 ctrl;		/* 0x100 */
 | 
				
			||||||
	u32 yymmdd;		/* 0x104 */
 | 
						u32 yymmdd;		/* 0x104 */
 | 
				
			||||||
	u32 hhmmss;		/* 0x108 */
 | 
						u32 hhmmss;		/* 0x108 */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Alarm */
 | 
					/* Alarm */
 | 
				
			||||||
struct a1x_alarm {
 | 
					struct a1x_alarm {
 | 
				
			||||||
@@ -85,7 +86,7 @@ struct a1x_alarm {
 | 
				
			|||||||
	u32 en;			/* 0x114 */
 | 
						u32 en;			/* 0x114 */
 | 
				
			||||||
	u32 irq_en;		/* 0x118 */
 | 
						u32 irq_en;		/* 0x118 */
 | 
				
			||||||
	u32 irq_sta;		/* 0x11c */
 | 
						u32 irq_sta;		/* 0x11c */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct a1x_timer_module {
 | 
					struct a1x_timer_module {
 | 
				
			||||||
	u32 irq_en;		/* 0x00 */
 | 
						u32 irq_en;		/* 0x00 */
 | 
				
			||||||
@@ -103,7 +104,7 @@ struct a1x_timer_module {
 | 
				
			|||||||
	u32 gp_data[4];
 | 
						u32 gp_data[4];
 | 
				
			||||||
	u8 res5[8];
 | 
						u8 res5[8];
 | 
				
			||||||
	u32 cpu_cfg;
 | 
						u32 cpu_cfg;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u8 a1x_get_cpu_chip_revision(void);
 | 
					u8 a1x_get_cpu_chip_revision(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,6 +26,7 @@
 | 
				
			|||||||
#define CPU_ALLWINNER_A10_UART_H
 | 
					#define CPU_ALLWINNER_A10_UART_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct a10_uart {
 | 
					struct a10_uart {
 | 
				
			||||||
	union {
 | 
						union {
 | 
				
			||||||
@@ -71,7 +72,7 @@ struct a10_uart {
 | 
				
			|||||||
	u8 reserved_0xa0[4];
 | 
						u8 reserved_0xa0[4];
 | 
				
			||||||
	u32 halt;		/* Halt register */
 | 
						u32 halt;		/* Halt register */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum uart_parity {
 | 
					enum uart_parity {
 | 
				
			||||||
	UART_PARITY_NONE,
 | 
						UART_PARITY_NONE,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <device/device.h>
 | 
					#include <device/device.h>
 | 
				
			||||||
#include <device/pci.h>
 | 
					#include <device/pci.h>
 | 
				
			||||||
#include <cpu/cpu.h>
 | 
					#include <cpu/cpu.h>
 | 
				
			||||||
@@ -40,7 +41,7 @@ struct ied_header {
 | 
				
			|||||||
	char signature[10];
 | 
						char signature[10];
 | 
				
			||||||
	u32 size;
 | 
						u32 size;
 | 
				
			||||||
	u8 reserved[34];
 | 
						u8 reserved[34];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smm_relocation_params {
 | 
					struct smm_relocation_params {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#define __CPU_TI_AM335X_CLOCK_H__
 | 
					#define __CPU_TI_AM335X_CLOCK_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
	CM_ST_NO_SLEEP = 0x0,
 | 
						CM_ST_NO_SLEEP = 0x0,
 | 
				
			||||||
@@ -106,7 +107,7 @@ struct am335x_cm_per_regs {
 | 
				
			|||||||
	uint32_t lcdc_st;		// 0x148
 | 
						uint32_t lcdc_st;		// 0x148
 | 
				
			||||||
	uint32_t clkdiv32k;		// 0x14c
 | 
						uint32_t clkdiv32k;		// 0x14c
 | 
				
			||||||
	uint32_t clk_24mhz_st;		// 0x150
 | 
						uint32_t clk_24mhz_st;		// 0x150
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_per_regs * const am335x_cm_per = (void *)0x44e00000;
 | 
					static struct am335x_cm_per_regs * const am335x_cm_per = (void *)0x44e00000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clock module wakeup registers */
 | 
					/* Clock module wakeup registers */
 | 
				
			||||||
@@ -166,7 +167,7 @@ struct am335x_cm_wkup_regs {
 | 
				
			|||||||
	uint8_t _rsv0[4];		// 0xd0-0xd3
 | 
						uint8_t _rsv0[4];		// 0xd0-0xd3
 | 
				
			||||||
	uint32_t wkup_wdt1;		// 0xd4
 | 
						uint32_t wkup_wdt1;		// 0xd4
 | 
				
			||||||
	uint32_t div_m6_dpll_core;	// 0xd8
 | 
						uint32_t div_m6_dpll_core;	// 0xd8
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_wkup_regs * const am335x_cm_wkup = (void *)0x44e00400;
 | 
					static struct am335x_cm_wkup_regs * const am335x_cm_wkup = (void *)0x44e00400;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clock module pll registers */
 | 
					/* Clock module pll registers */
 | 
				
			||||||
@@ -187,20 +188,20 @@ struct am335x_cm_dpll_regs {
 | 
				
			|||||||
	uint32_t clksel_lcdc_pixel_clk;	// 0x34
 | 
						uint32_t clksel_lcdc_pixel_clk;	// 0x34
 | 
				
			||||||
	uint32_t clksel_wdt1_clk;	// 0x38
 | 
						uint32_t clksel_wdt1_clk;	// 0x38
 | 
				
			||||||
	uint32_t clksel_gpio0_dbclk;	// 0x3c
 | 
						uint32_t clksel_gpio0_dbclk;	// 0x3c
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_dpll_regs * const am335x_cm_dpll = (void *)0x44e00500;
 | 
					static struct am335x_cm_dpll_regs * const am335x_cm_dpll = (void *)0x44e00500;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clock module mpu registers */
 | 
					/* Clock module mpu registers */
 | 
				
			||||||
struct am335x_cm_mpu_regs {
 | 
					struct am335x_cm_mpu_regs {
 | 
				
			||||||
	uint32_t st;			// 0x0
 | 
						uint32_t st;			// 0x0
 | 
				
			||||||
	uint32_t mpu;			// 0x4
 | 
						uint32_t mpu;			// 0x4
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_mpu_regs * const am335x_cm_mpu = (void *)0x44e00600;
 | 
					static struct am335x_cm_mpu_regs * const am335x_cm_mpu = (void *)0x44e00600;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clock module device registers */
 | 
					/* Clock module device registers */
 | 
				
			||||||
struct am335x_cm_device_regs {
 | 
					struct am335x_cm_device_regs {
 | 
				
			||||||
	uint32_t cm_clkout_ctrl;	// 0x0
 | 
						uint32_t cm_clkout_ctrl;	// 0x0
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_device_regs * const am335x_cm_device =
 | 
					static struct am335x_cm_device_regs * const am335x_cm_device =
 | 
				
			||||||
		(void *)0x44e00700;
 | 
							(void *)0x44e00700;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -208,7 +209,7 @@ static struct am335x_cm_device_regs * const am335x_cm_device =
 | 
				
			|||||||
struct am335x_cm_rtc_regs {
 | 
					struct am335x_cm_rtc_regs {
 | 
				
			||||||
	uint32_t rtc;			// 0x0
 | 
						uint32_t rtc;			// 0x0
 | 
				
			||||||
	uint32_t st;			// 0x4
 | 
						uint32_t st;			// 0x4
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_rtc_regs * const am335x_cm_rtc = (void *)0x44e00800;
 | 
					static struct am335x_cm_rtc_regs * const am335x_cm_rtc = (void *)0x44e00800;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clock module graphics controller registers */
 | 
					/* Clock module graphics controller registers */
 | 
				
			||||||
@@ -219,7 +220,7 @@ struct am335x_cm_gfx_regs {
 | 
				
			|||||||
	uint32_t l4ls_gfx_st;		// 0xc
 | 
						uint32_t l4ls_gfx_st;		// 0xc
 | 
				
			||||||
	uint32_t mmucfg;		// 0x10
 | 
						uint32_t mmucfg;		// 0x10
 | 
				
			||||||
	uint32_t mmudata;		// 0x14
 | 
						uint32_t mmudata;		// 0x14
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_gfx_regs * const am335x_cm_gfx = (void *)0x44e00900;
 | 
					static struct am335x_cm_gfx_regs * const am335x_cm_gfx = (void *)0x44e00900;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clock module efuse registers */
 | 
					/* Clock module efuse registers */
 | 
				
			||||||
@@ -227,7 +228,7 @@ struct am335x_cm_cefuse_regs {
 | 
				
			|||||||
	uint32_t st;			// 0x0
 | 
						uint32_t st;			// 0x0
 | 
				
			||||||
	uint8_t _rsv0[0x1c];		// 0x4-0x1f
 | 
						uint8_t _rsv0[0x1c];		// 0x4-0x1f
 | 
				
			||||||
	uint32_t cefuse;		// 0x20
 | 
						uint32_t cefuse;		// 0x20
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
static struct am335x_cm_cefuse_regs * const am335x_cm_cefuse =
 | 
					static struct am335x_cm_cefuse_regs * const am335x_cm_cefuse =
 | 
				
			||||||
		(void *)0x44e00a00;
 | 
							(void *)0x44e00a00;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#define __CPU_TI_AM335X_GPIO_H__
 | 
					#define __CPU_TI_AM335X_GPIO_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
	AM335X_GPIO_BITS_PER_BANK = 32
 | 
						AM335X_GPIO_BITS_PER_BANK = 32
 | 
				
			||||||
@@ -53,7 +54,7 @@ struct am335x_gpio_regs {
 | 
				
			|||||||
	uint8_t _rsv4[0x38];		// 0x158-0x18f
 | 
						uint8_t _rsv4[0x38];		// 0x158-0x18f
 | 
				
			||||||
	uint32_t cleardataout;		// 0x190
 | 
						uint32_t cleardataout;		// 0x190
 | 
				
			||||||
	uint32_t setdataout;		// 0x194
 | 
						uint32_t setdataout;		// 0x194
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct am335x_gpio_regs * const am335x_gpio_banks[] = {
 | 
					static struct am335x_gpio_regs * const am335x_gpio_banks[] = {
 | 
				
			||||||
	(void *)0x44e07000, (void *)0x4804c000,
 | 
						(void *)0x44e07000, (void *)0x4804c000,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@
 | 
				
			|||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <symbols.h>
 | 
					#include <symbols.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "header.h"
 | 
					#include "header.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -25,7 +26,7 @@ struct config_headers {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// An inert instance of chsettings.
 | 
						// An inert instance of chsettings.
 | 
				
			||||||
	struct configuration_header_settings chsettings;
 | 
						struct configuration_header_settings chsettings;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct omap_image_headers {
 | 
					struct omap_image_headers {
 | 
				
			||||||
	union {
 | 
						union {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#define __CPU_TI_AM335X_HEADER_H
 | 
					#define __CPU_TI_AM335X_HEADER_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct configuration_header_toc_item {
 | 
					struct configuration_header_toc_item {
 | 
				
			||||||
	// Offset from the start address of the TOC to the actual address of
 | 
						// Offset from the start address of the TOC to the actual address of
 | 
				
			||||||
@@ -30,7 +31,7 @@ struct configuration_header_toc_item {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// 12-character name of a section, including the zero (\0) terminator.
 | 
						// 12-character name of a section, including the zero (\0) terminator.
 | 
				
			||||||
	char filename[12];
 | 
						char filename[12];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct configuration_header_settings {
 | 
					struct configuration_header_settings {
 | 
				
			||||||
	// Key used for section verification.
 | 
						// Key used for section verification.
 | 
				
			||||||
@@ -49,7 +50,7 @@ struct configuration_header_settings {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Flags. It's not clear what this is used for.
 | 
						// Flags. It's not clear what this is used for.
 | 
				
			||||||
	uint32_t flags;
 | 
						uint32_t flags;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct gp_device_header {
 | 
					struct gp_device_header {
 | 
				
			||||||
	// Size of the image.
 | 
						// Size of the image.
 | 
				
			||||||
@@ -57,6 +58,6 @@ struct gp_device_header {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Address to store the image/code entry point.
 | 
						// Address to store the image/code entry point.
 | 
				
			||||||
	uint32_t destination;
 | 
						uint32_t destination;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,8 @@
 | 
				
			|||||||
#ifndef AM335X_UART_H
 | 
					#ifndef AM335X_UART_H
 | 
				
			||||||
#define AM335X_UART_H
 | 
					#define AM335X_UART_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define AM335X_UART0_BASE	0x44e09000
 | 
					#define AM335X_UART0_BASE	0x44e09000
 | 
				
			||||||
#define AM335X_UART1_BASE	0x48020000
 | 
					#define AM335X_UART1_BASE	0x48020000
 | 
				
			||||||
#define AM335X_UART2_BASE	0x48024000
 | 
					#define AM335X_UART2_BASE	0x48024000
 | 
				
			||||||
@@ -168,6 +170,6 @@ struct am335x_uart {
 | 
				
			|||||||
	uint8_t rsvd_0x82[2];
 | 
						uint8_t rsvd_0x82[2];
 | 
				
			||||||
	uint16_t txdma;			/* TX DMA threshold */
 | 
						uint16_t txdma;			/* TX DMA threshold */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif	/* AM335X_UART_H */
 | 
					#endif	/* AM335X_UART_H */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <rmodule.h>
 | 
					#include <rmodule.h>
 | 
				
			||||||
#include <arch/cpu.h>
 | 
					#include <arch/cpu.h>
 | 
				
			||||||
#include <cpu/cpu.h>
 | 
					#include <cpu/cpu.h>
 | 
				
			||||||
@@ -103,14 +104,14 @@ struct sipi_params {
 | 
				
			|||||||
	uint32_t msr_count;
 | 
						uint32_t msr_count;
 | 
				
			||||||
	uint32_t c_handler;
 | 
						uint32_t c_handler;
 | 
				
			||||||
	atomic_t ap_count;
 | 
						atomic_t ap_count;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This also needs to match the assembly code for saved MSR encoding. */
 | 
					/* This also needs to match the assembly code for saved MSR encoding. */
 | 
				
			||||||
struct saved_msr {
 | 
					struct saved_msr {
 | 
				
			||||||
	uint32_t index;
 | 
						uint32_t index;
 | 
				
			||||||
	uint32_t lo;
 | 
						uint32_t lo;
 | 
				
			||||||
	uint32_t hi;
 | 
						uint32_t hi;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* The sipi vector rmodule is included in the ramstage using 'objdump -B'. */
 | 
					/* The sipi vector rmodule is included in the ramstage using 'objdump -B'. */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <cpu/cpu.h>
 | 
					#include <cpu/cpu.h>
 | 
				
			||||||
#include <cpu/x86/pae.h>
 | 
					#include <cpu/x86/pae.h>
 | 
				
			||||||
@@ -59,11 +60,11 @@ void *map_2M_page(unsigned long page)
 | 
				
			|||||||
	struct pde {
 | 
						struct pde {
 | 
				
			||||||
		uint32_t addr_lo;
 | 
							uint32_t addr_lo;
 | 
				
			||||||
		uint32_t addr_hi;
 | 
							uint32_t addr_hi;
 | 
				
			||||||
	} __attribute__ ((packed));
 | 
						} __packed;
 | 
				
			||||||
	struct pg_table {
 | 
						struct pg_table {
 | 
				
			||||||
		struct pde pd[2048];
 | 
							struct pde pd[2048];
 | 
				
			||||||
		struct pde pdp[512];
 | 
							struct pde pdp[512];
 | 
				
			||||||
	} __attribute__ ((packed));
 | 
						} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	static struct pg_table pgtbl[CONFIG_MAX_CPUS]
 | 
						static struct pg_table pgtbl[CONFIG_MAX_CPUS]
 | 
				
			||||||
		__attribute__((aligned(4096)));
 | 
							__attribute__((aligned(4096)));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <rmodule.h>
 | 
					#include <rmodule.h>
 | 
				
			||||||
#include <cpu/x86/smm.h>
 | 
					#include <cpu/x86/smm.h>
 | 
				
			||||||
@@ -47,7 +48,7 @@ struct smm_stub_params {
 | 
				
			|||||||
	u32 fxsave_area;
 | 
						u32 fxsave_area;
 | 
				
			||||||
	u32 fxsave_area_size;
 | 
						u32 fxsave_area_size;
 | 
				
			||||||
	struct smm_runtime runtime;
 | 
						struct smm_runtime runtime;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * The stub is the entry point that sets up protected mode and stacks for each
 | 
					 * The stub is the entry point that sets up protected mode and stacks for each
 | 
				
			||||||
@@ -67,7 +68,7 @@ extern unsigned char _binary_smmstub_start[];
 | 
				
			|||||||
struct smm_entry_ins {
 | 
					struct smm_entry_ins {
 | 
				
			||||||
	char jmp_rel;
 | 
						char jmp_rel;
 | 
				
			||||||
	uint16_t rel16;
 | 
						uint16_t rel16;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Place the entry instructions for num entries beginning at entry_start with
 | 
					 * Place the entry instructions for num entries beginning at entry_start with
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,6 +33,7 @@
 | 
				
			|||||||
 *****************************************************************************/
 | 
					 *****************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include "device.h"
 | 
					#include "device.h"
 | 
				
			||||||
#include "compat/rtas.h"
 | 
					#include "compat/rtas.h"
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
@@ -56,7 +57,7 @@ typedef struct {
 | 
				
			|||||||
	u8 cfg_space_offset;
 | 
						u8 cfg_space_offset;
 | 
				
			||||||
	u64 address;
 | 
						u64 address;
 | 
				
			||||||
	u64 size;
 | 
						u64 size;
 | 
				
			||||||
} __attribute__ ((__packed__)) assigned_address_t;
 | 
					} __packed assigned_address_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if IS_ENABLED(CONFIG_PCI_OPTION_ROM_RUN_YABEL)
 | 
					#if IS_ENABLED(CONFIG_PCI_OPTION_ROM_RUN_YABEL)
 | 
				
			||||||
/* coreboot version */
 | 
					/* coreboot version */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,6 +36,7 @@
 | 
				
			|||||||
#define DEVICE_LIB_H
 | 
					#define DEVICE_LIB_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <endian.h>
 | 
					#include <endian.h>
 | 
				
			||||||
#include "compat/of.h"
 | 
					#include "compat/of.h"
 | 
				
			||||||
#include "debug.h"
 | 
					#include "debug.h"
 | 
				
			||||||
@@ -62,7 +63,7 @@ typedef struct {
 | 
				
			|||||||
	u16 bev;		// Bootstrap Entry Vector
 | 
						u16 bev;		// Bootstrap Entry Vector
 | 
				
			||||||
	u16 reserved_2;
 | 
						u16 reserved_2;
 | 
				
			||||||
	u16 sriv;		// Static Resource Information Vector
 | 
						u16 sriv;		// Static Resource Information Vector
 | 
				
			||||||
} __attribute__ ((__packed__)) exp_header_struct_t;
 | 
					} __packed exp_header_struct_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// a PCI Data Struct as defined in PCI 2.3 Spec Chapter 6.3.1.2
 | 
					// a PCI Data Struct as defined in PCI 2.3 Spec Chapter 6.3.1.2
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -78,7 +79,7 @@ typedef struct {
 | 
				
			|||||||
	u8 code_type;
 | 
						u8 code_type;
 | 
				
			||||||
	u8 indicator;
 | 
						u8 indicator;
 | 
				
			||||||
	u16 reserved_2;
 | 
						u16 reserved_2;
 | 
				
			||||||
} __attribute__ ((__packed__)) pci_data_struct_t;
 | 
					} __packed pci_data_struct_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u8 bus;
 | 
						u8 bus;
 | 
				
			||||||
@@ -116,7 +117,7 @@ typedef struct {
 | 
				
			|||||||
	u64 address;
 | 
						u64 address;
 | 
				
			||||||
	u64 address_offset;
 | 
						u64 address_offset;
 | 
				
			||||||
	u64 size;
 | 
						u64 size;
 | 
				
			||||||
} __attribute__ ((__packed__)) translate_address_t;
 | 
					} __packed translate_address_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// array to store address translations for this
 | 
					// array to store address translations for this
 | 
				
			||||||
// device. Needed for faster address translation, so
 | 
					// device. Needed for faster address translation, so
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,6 +35,7 @@
 | 
				
			|||||||
#define _YABEL_PMM_H_
 | 
					#define _YABEL_PMM_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* PMM Structure see PMM Spec Version 1.01 Chapter 3.1.1
 | 
					/* PMM Structure see PMM Spec Version 1.01 Chapter 3.1.1
 | 
				
			||||||
 * (search web for specspmm101.pdf)
 | 
					 * (search web for specspmm101.pdf)
 | 
				
			||||||
@@ -54,7 +55,7 @@ typedef struct {
 | 
				
			|||||||
	 * see interrupt.c) and the INT Handler will do the actual PMM work.
 | 
						 * see interrupt.c) and the INT Handler will do the actual PMM work.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	u8 code[3];
 | 
						u8 code[3];
 | 
				
			||||||
} __attribute__ ((__packed__)) pmm_information_t;
 | 
					} __packed pmm_information_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This function is used to setup the PMM struct in virtual memory
 | 
					/* This function is used to setup the PMM struct in virtual memory
 | 
				
			||||||
 * at a certain offset */
 | 
					 * at a certain offset */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@
 | 
				
			|||||||
#include <pc80/mc146818rtc.h>
 | 
					#include <pc80/mc146818rtc.h>
 | 
				
			||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <elog.h>
 | 
					#include <elog.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
@@ -43,7 +44,7 @@ struct boot_count {
 | 
				
			|||||||
	u16 signature;
 | 
						u16 signature;
 | 
				
			||||||
	u32 count;
 | 
						u32 count;
 | 
				
			||||||
	u16 checksum;
 | 
						u16 checksum;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Read and validate boot count structure from CMOS */
 | 
					/* Read and validate boot count structure from CMOS */
 | 
				
			||||||
static int boot_count_cmos_read(struct boot_count *bc)
 | 
					static int boot_count_cmos_read(struct boot_count *bc)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,13 +16,14 @@
 | 
				
			|||||||
#ifndef ELOG_INTERNAL_H_
 | 
					#ifndef ELOG_INTERNAL_H_
 | 
				
			||||||
#define ELOG_INTERNAL_H_
 | 
					#define ELOG_INTERNAL_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
/* ELOG header */
 | 
					/* ELOG header */
 | 
				
			||||||
struct elog_header {
 | 
					struct elog_header {
 | 
				
			||||||
	u32 magic;
 | 
						u32 magic;
 | 
				
			||||||
	u8 version;
 | 
						u8 version;
 | 
				
			||||||
	u8 header_size;
 | 
						u8 header_size;
 | 
				
			||||||
	u8 reserved[2];
 | 
						u8 reserved[2];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* ELOG related constants */
 | 
					/* ELOG related constants */
 | 
				
			||||||
#define ELOG_SIGNATURE			0x474f4c45  /* 'ELOG' */
 | 
					#define ELOG_SIGNATURE			0x474f4c45  /* 'ELOG' */
 | 
				
			||||||
@@ -40,7 +41,7 @@ struct event_header {
 | 
				
			|||||||
	u8 hour;
 | 
						u8 hour;
 | 
				
			||||||
	u8 minute;
 | 
						u8 minute;
 | 
				
			||||||
	u8 second;
 | 
						u8 second;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SMBIOS Type 15 related constants */
 | 
					/* SMBIOS Type 15 related constants */
 | 
				
			||||||
#define ELOG_HEADER_TYPE_OEM		0x88
 | 
					#define ELOG_HEADER_TYPE_OEM		0x88
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <arch/io.h>
 | 
					#include <arch/io.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <cpu/x86/smm.h>
 | 
					#include <cpu/x86/smm.h>
 | 
				
			||||||
@@ -33,17 +34,17 @@ struct gsmi_set_eventlog_param {
 | 
				
			|||||||
	u32 data_ptr;
 | 
						u32 data_ptr;
 | 
				
			||||||
	u32 data_len;
 | 
						u32 data_len;
 | 
				
			||||||
	u32 type;
 | 
						u32 type;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct gsmi_set_eventlog_type1 {
 | 
					struct gsmi_set_eventlog_type1 {
 | 
				
			||||||
	u16 type;
 | 
						u16 type;
 | 
				
			||||||
	u32 instance;
 | 
						u32 instance;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct gsmi_clear_eventlog_param {
 | 
					struct gsmi_clear_eventlog_param {
 | 
				
			||||||
	u32 percentage;
 | 
						u32 percentage;
 | 
				
			||||||
	u32 data_type;
 | 
						u32 data_type;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Param is usually EBX, ret in EAX */
 | 
					/* Param is usually EBX, ret in EAX */
 | 
				
			||||||
u32 gsmi_exec(u8 command, u32 *param)
 | 
					u32 gsmi_exec(u8 command, u32 *param)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <arch/early_variables.h>
 | 
					#include <arch/early_variables.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <assert.h>
 | 
					#include <assert.h>
 | 
				
			||||||
#include <commonlib/endian.h>
 | 
					#include <commonlib/endian.h>
 | 
				
			||||||
@@ -33,7 +34,7 @@ struct tpm_output_header {
 | 
				
			|||||||
	uint16_t tag;
 | 
						uint16_t tag;
 | 
				
			||||||
	uint32_t length;
 | 
						uint32_t length;
 | 
				
			||||||
	uint32_t return_code;
 | 
						uint32_t return_code;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int tis_open(void)
 | 
					int tis_open(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#ifndef FSP_UTIL_H
 | 
					#ifndef FSP_UTIL_H
 | 
				
			||||||
#define FSP_UTIL_H
 | 
					#define FSP_UTIL_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <chipset_fsp_util.h>
 | 
					#include <chipset_fsp_util.h>
 | 
				
			||||||
#include "fsp_values.h"
 | 
					#include "fsp_values.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -71,7 +72,7 @@ struct mrc_data_container {
 | 
				
			|||||||
	u32	mrc_checksum;	// IP style checksum
 | 
						u32	mrc_checksum;	// IP style checksum
 | 
				
			||||||
	u32	reserved;		// For header alignment
 | 
						u32	reserved;		// For header alignment
 | 
				
			||||||
	u8	mrc_data[0];	// Variable size, platform/run time dependent.
 | 
						u8	mrc_data[0];	// Variable size, platform/run time dependent.
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mrc_data_container *find_current_mrc_cache(void);
 | 
					struct mrc_data_container *find_current_mrc_cache(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <bootstate.h>
 | 
					#include <bootstate.h>
 | 
				
			||||||
#include <cbmem.h>
 | 
					#include <cbmem.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
@@ -185,7 +186,7 @@ BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY,
 | 
				
			|||||||
struct fsp_runtime {
 | 
					struct fsp_runtime {
 | 
				
			||||||
	uint32_t fih;
 | 
						uint32_t fih;
 | 
				
			||||||
	uint32_t hob_list;
 | 
						uint32_t hob_list;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void fsp_set_runtime(FSP_INFO_HEADER *fih, void *hob_list)
 | 
					void fsp_set_runtime(FSP_INFO_HEADER *fih, void *hob_list)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@
 | 
				
			|||||||
#define _GMA_H_
 | 
					#define _GMA_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* IGD PCI Configuration register */
 | 
					/* IGD PCI Configuration register */
 | 
				
			||||||
#define ASLS		0xfc		/* OpRegion Base */
 | 
					#define ASLS		0xfc		/* OpRegion Base */
 | 
				
			||||||
@@ -35,7 +36,7 @@ typedef struct {
 | 
				
			|||||||
	u8	driver_version[16];
 | 
						u8	driver_version[16];
 | 
				
			||||||
	u32	mailboxes;
 | 
						u32	mailboxes;
 | 
				
			||||||
	u8	reserved[164];
 | 
						u8	reserved[164];
 | 
				
			||||||
} __attribute__((packed)) opregion_header_t;
 | 
					} __packed opregion_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
 | 
					#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
 | 
				
			||||||
#define IGD_OPREGION_VERSION  2
 | 
					#define IGD_OPREGION_VERSION  2
 | 
				
			||||||
@@ -72,7 +73,7 @@ typedef struct {
 | 
				
			|||||||
	u32	cnot;
 | 
						u32	cnot;
 | 
				
			||||||
	u32	nrdy;
 | 
						u32	nrdy;
 | 
				
			||||||
	u8	reserved2[60];
 | 
						u8	reserved2[60];
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox1_t;
 | 
					} __packed opregion_mailbox1_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* mailbox 2: software sci interface */
 | 
					/* mailbox 2: software sci interface */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -80,7 +81,7 @@ typedef struct {
 | 
				
			|||||||
	u32	parm;
 | 
						u32	parm;
 | 
				
			||||||
	u32	dslp;
 | 
						u32	dslp;
 | 
				
			||||||
	u8	reserved[244];
 | 
						u8	reserved[244];
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox2_t;
 | 
					} __packed opregion_mailbox2_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* mailbox 3: power conservation */
 | 
					/* mailbox 3: power conservation */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -99,7 +100,7 @@ typedef struct {
 | 
				
			|||||||
	u32	ccdv;
 | 
						u32	ccdv;
 | 
				
			||||||
	u32	pcft;
 | 
						u32	pcft;
 | 
				
			||||||
	u8	reserved[94];
 | 
						u8	reserved[94];
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox3_t;
 | 
					} __packed opregion_mailbox3_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IGD_BACKLIGHT_BRIGHTNESS 0xff
 | 
					#define IGD_BACKLIGHT_BRIGHTNESS 0xff
 | 
				
			||||||
#define IGD_INITIAL_BRIGHTNESS 0x64
 | 
					#define IGD_INITIAL_BRIGHTNESS 0x64
 | 
				
			||||||
@@ -111,7 +112,7 @@ typedef struct {
 | 
				
			|||||||
/* mailbox 4: vbt */
 | 
					/* mailbox 4: vbt */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u8 gvd1[7168];
 | 
						u8 gvd1[7168];
 | 
				
			||||||
} __attribute__((packed)) opregion_vbt_t;
 | 
					} __packed opregion_vbt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* IGD OpRegion */
 | 
					/* IGD OpRegion */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -120,7 +121,7 @@ typedef struct {
 | 
				
			|||||||
	opregion_mailbox2_t mailbox2;
 | 
						opregion_mailbox2_t mailbox2;
 | 
				
			||||||
	opregion_mailbox3_t mailbox3;
 | 
						opregion_mailbox3_t mailbox3;
 | 
				
			||||||
	opregion_vbt_t vbt;
 | 
						opregion_vbt_t vbt;
 | 
				
			||||||
} __attribute__((packed)) igd_opregion_t;
 | 
					} __packed igd_opregion_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Intel Video BIOS (Option ROM) */
 | 
					/* Intel Video BIOS (Option ROM) */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -129,7 +130,7 @@ typedef struct {
 | 
				
			|||||||
	u8	reserved[21];
 | 
						u8	reserved[21];
 | 
				
			||||||
	u16	pcir_offset;
 | 
						u16	pcir_offset;
 | 
				
			||||||
	u16	vbt_offset;
 | 
						u16	vbt_offset;
 | 
				
			||||||
} __attribute__((packed)) optionrom_header_t;
 | 
					} __packed optionrom_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define OPROM_SIGNATURE 0xaa55
 | 
					#define OPROM_SIGNATURE 0xaa55
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -146,7 +147,7 @@ typedef struct {
 | 
				
			|||||||
	u8  codetype;
 | 
						u8  codetype;
 | 
				
			||||||
	u8  indicator;
 | 
						u8  indicator;
 | 
				
			||||||
	u16 reserved2;
 | 
						u16 reserved2;
 | 
				
			||||||
} __attribute__((packed)) optionrom_pcir_t;
 | 
					} __packed optionrom_pcir_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u8  hdr_signature[20];
 | 
						u8  hdr_signature[20];
 | 
				
			||||||
@@ -170,7 +171,7 @@ typedef struct {
 | 
				
			|||||||
	u8  coreblock_integratedhw;
 | 
						u8  coreblock_integratedhw;
 | 
				
			||||||
	u8  coreblock_biosbuild[4];
 | 
						u8  coreblock_biosbuild[4];
 | 
				
			||||||
	u8  coreblock_biossignon[155];
 | 
						u8  coreblock_biossignon[155];
 | 
				
			||||||
} __attribute__((packed)) optionrom_vbt_t;
 | 
					} __packed optionrom_vbt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define VBT_SIGNATURE 0x54425624
 | 
					#define VBT_SIGNATURE 0x54425624
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,7 @@
 | 
				
			|||||||
 * (at your option) any later version.
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <cbfs.h>
 | 
					#include <cbfs.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <fsp/util.h>
 | 
					#include <fsp/util.h>
 | 
				
			||||||
@@ -37,7 +38,7 @@ struct hob_graphics_info {
 | 
				
			|||||||
	uint32_t blue_mask;
 | 
						uint32_t blue_mask;
 | 
				
			||||||
	uint32_t reserved_mask;
 | 
						uint32_t reserved_mask;
 | 
				
			||||||
	uint32_t pixels_per_scanline;
 | 
						uint32_t pixels_per_scanline;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pixel {
 | 
					struct pixel {
 | 
				
			||||||
	uint8_t pos;
 | 
						uint8_t pos;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,13 +9,14 @@
 | 
				
			|||||||
 * (at your option) any later version.
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <fsp/util.h>
 | 
					#include <fsp/util.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct hob_type_name {
 | 
					struct hob_type_name {
 | 
				
			||||||
	uint16_t type;
 | 
						uint16_t type;
 | 
				
			||||||
	const char *name;
 | 
						const char *name;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const struct hob_type_name hob_type_names[] = {
 | 
					static const struct hob_type_name hob_type_names[] = {
 | 
				
			||||||
	{ HOB_TYPE_HANDOFF, "HOB_TYPE_HANDOFF" },
 | 
						{ HOB_TYPE_HANDOFF, "HOB_TYPE_HANDOFF" },
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,8 @@
 | 
				
			|||||||
#ifndef _FSP2_0_UPD_H_
 | 
					#ifndef _FSP2_0_UPD_H_
 | 
				
			||||||
#define _FSP2_0_UPD_H_
 | 
					#define _FSP2_0_UPD_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct FSP_UPD_HEADER {
 | 
					struct FSP_UPD_HEADER {
 | 
				
			||||||
	///
 | 
						///
 | 
				
			||||||
	/// UPD Region Signature. This signature will be
 | 
						/// UPD Region Signature. This signature will be
 | 
				
			||||||
@@ -26,7 +28,7 @@ struct FSP_UPD_HEADER {
 | 
				
			|||||||
	///
 | 
						///
 | 
				
			||||||
	uint8_t                       Revision;
 | 
						uint8_t                       Revision;
 | 
				
			||||||
	uint8_t                       Reserved[23];
 | 
						uint8_t                       Reserved[23];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct FSPM_ARCH_UPD {
 | 
					struct FSPM_ARCH_UPD {
 | 
				
			||||||
	///
 | 
						///
 | 
				
			||||||
@@ -59,6 +61,6 @@ struct FSPM_ARCH_UPD {
 | 
				
			|||||||
	///
 | 
						///
 | 
				
			||||||
	uint32_t                      BootMode;
 | 
						uint32_t                      BootMode;
 | 
				
			||||||
	uint8_t                       Reserved1[8];
 | 
						uint8_t                       Reserved1[8];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* _FSP2_0_UPD_H_ */
 | 
					#endif /* _FSP2_0_UPD_H_ */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
#ifndef _FSP2_0_UTIL_H_
 | 
					#ifndef _FSP2_0_UTIL_H_
 | 
				
			||||||
#define _FSP2_0_UTIL_H_
 | 
					#define _FSP2_0_UTIL_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <boot/coreboot_tables.h>
 | 
					#include <boot/coreboot_tables.h>
 | 
				
			||||||
#include <commonlib/region.h>
 | 
					#include <commonlib/region.h>
 | 
				
			||||||
#include <arch/cpu.h>
 | 
					#include <arch/cpu.h>
 | 
				
			||||||
@@ -23,7 +24,7 @@
 | 
				
			|||||||
struct hob_header {
 | 
					struct hob_header {
 | 
				
			||||||
	uint16_t type;
 | 
						uint16_t type;
 | 
				
			||||||
	uint16_t length;
 | 
						uint16_t length;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct fsp_notify_params {
 | 
					struct fsp_notify_params {
 | 
				
			||||||
	enum fsp_notify_phase phase;
 | 
						enum fsp_notify_phase phase;
 | 
				
			||||||
@@ -35,7 +36,7 @@ struct hob_resource {
 | 
				
			|||||||
	uint32_t attribute_type;
 | 
						uint32_t attribute_type;
 | 
				
			||||||
	uint64_t addr;
 | 
						uint64_t addr;
 | 
				
			||||||
	uint64_t length;
 | 
						uint64_t length;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum resource_type {
 | 
					enum resource_type {
 | 
				
			||||||
	EFI_RESOURCE_SYSTEM_MEMORY		= 0,
 | 
						EFI_RESOURCE_SYSTEM_MEMORY		= 0,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * (at your option) any later version.
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <antirollback.h>
 | 
					#include <antirollback.h>
 | 
				
			||||||
#include <arch/io.h>
 | 
					#include <arch/io.h>
 | 
				
			||||||
#include <arch/cpu.h>
 | 
					#include <arch/cpu.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,8 @@
 | 
				
			|||||||
#ifndef _I830_BIOS_H_
 | 
					#ifndef _I830_BIOS_H_
 | 
				
			||||||
#define _I830_BIOS_H_
 | 
					#define _I830_BIOS_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct vbt_header {
 | 
					struct vbt_header {
 | 
				
			||||||
	u8 signature[20];		/**< Always starts with 'VBT$' */
 | 
						u8 signature[20];		/**< Always starts with 'VBT$' */
 | 
				
			||||||
	u16 version;			/**< decimal */
 | 
						u16 version;			/**< decimal */
 | 
				
			||||||
@@ -37,7 +39,7 @@ struct vbt_header {
 | 
				
			|||||||
	u8 reserved0;
 | 
						u8 reserved0;
 | 
				
			||||||
	u32 bdb_offset;			/**< from beginning of VBT */
 | 
						u32 bdb_offset;			/**< from beginning of VBT */
 | 
				
			||||||
	u32 aim_offset[4];		/**< from beginning of VBT */
 | 
						u32 aim_offset[4];		/**< from beginning of VBT */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_header {
 | 
					struct bdb_header {
 | 
				
			||||||
	u8 signature[16];		/**< Always 'BIOS_DATA_BLOCK' */
 | 
						u8 signature[16];		/**< Always 'BIOS_DATA_BLOCK' */
 | 
				
			||||||
@@ -63,7 +65,7 @@ struct vbios_data {
 | 
				
			|||||||
	u8 rsvd4; /* popup memory size */
 | 
						u8 rsvd4; /* popup memory size */
 | 
				
			||||||
	u8 resize_pci_bios;
 | 
						u8 resize_pci_bios;
 | 
				
			||||||
	u8 rsvd5; /* is crt already on ddc2 */
 | 
						u8 rsvd5; /* is crt already on ddc2 */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * There are several types of BIOS data blocks (BDBs), each block has
 | 
					 * There are several types of BIOS data blocks (BDBs), each block has
 | 
				
			||||||
@@ -140,7 +142,7 @@ struct bdb_general_features {
 | 
				
			|||||||
	u8 dp_ssc_enb:1;	/* PCH attached eDP supports SSC */
 | 
						u8 dp_ssc_enb:1;	/* PCH attached eDP supports SSC */
 | 
				
			||||||
	u8 dp_ssc_freq:1;	/* SSC freq for PCH attached eDP */
 | 
						u8 dp_ssc_freq:1;	/* SSC freq for PCH attached eDP */
 | 
				
			||||||
	u8 rsvd11:3; /* finish byte */
 | 
						u8 rsvd11:3; /* finish byte */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* pre-915 */
 | 
					/* pre-915 */
 | 
				
			||||||
#define GPIO_PIN_DVI_LVDS	0x03 /* "DVI/LVDS DDC GPIO pins" */
 | 
					#define GPIO_PIN_DVI_LVDS	0x03 /* "DVI/LVDS DDC GPIO pins" */
 | 
				
			||||||
@@ -223,7 +225,7 @@ struct old_child_dev_config {
 | 
				
			|||||||
	u8  dvo2_wiring;
 | 
						u8  dvo2_wiring;
 | 
				
			||||||
	u16 extended_type;
 | 
						u16 extended_type;
 | 
				
			||||||
	u8  dvo_function;
 | 
						u8  dvo_function;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This one contains field offsets that are known to be common for all BDB
 | 
					/* This one contains field offsets that are known to be common for all BDB
 | 
				
			||||||
 * versions. Notice that the meaning of the contents contents may still change,
 | 
					 * versions. Notice that the meaning of the contents contents may still change,
 | 
				
			||||||
@@ -236,7 +238,7 @@ struct common_child_dev_config {
 | 
				
			|||||||
	u8 not_common2[2];
 | 
						u8 not_common2[2];
 | 
				
			||||||
	u8 ddc_pin;
 | 
						u8 ddc_pin;
 | 
				
			||||||
	u16 edid_ptr;
 | 
						u16 edid_ptr;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This field changes depending on the BDB version, so the most reliable way to
 | 
					/* This field changes depending on the BDB version, so the most reliable way to
 | 
				
			||||||
 * read it is by checking the BDB version and reading the raw pointer. */
 | 
					 * read it is by checking the BDB version and reading the raw pointer. */
 | 
				
			||||||
@@ -277,7 +279,7 @@ struct bdb_general_definitions {
 | 
				
			|||||||
	 *	     sizeof(child_device_config);
 | 
						 *	     sizeof(child_device_config);
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	union child_device_config devices[0];
 | 
						union child_device_config devices[0];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_lvds_options {
 | 
					struct bdb_lvds_options {
 | 
				
			||||||
	u8 panel_type;
 | 
						u8 panel_type;
 | 
				
			||||||
@@ -291,7 +293,7 @@ struct bdb_lvds_options {
 | 
				
			|||||||
	u8 lvds_edid:1;
 | 
						u8 lvds_edid:1;
 | 
				
			||||||
	u8 rsvd2:1;
 | 
						u8 rsvd2:1;
 | 
				
			||||||
	u8 rsvd4;
 | 
						u8 rsvd4;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* LFP pointer table contains entries to the struct below */
 | 
					/* LFP pointer table contains entries to the struct below */
 | 
				
			||||||
struct bdb_lvds_lfp_data_ptr {
 | 
					struct bdb_lvds_lfp_data_ptr {
 | 
				
			||||||
@@ -301,12 +303,12 @@ struct bdb_lvds_lfp_data_ptr {
 | 
				
			|||||||
	u8 dvo_table_size;
 | 
						u8 dvo_table_size;
 | 
				
			||||||
	u16 panel_pnp_id_offset;
 | 
						u16 panel_pnp_id_offset;
 | 
				
			||||||
	u8 pnp_table_size;
 | 
						u8 pnp_table_size;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_lvds_lfp_data_ptrs {
 | 
					struct bdb_lvds_lfp_data_ptrs {
 | 
				
			||||||
	u8 lvds_entries; /* followed by one or more lvds_data_ptr structs */
 | 
						u8 lvds_entries; /* followed by one or more lvds_data_ptr structs */
 | 
				
			||||||
	struct bdb_lvds_lfp_data_ptr ptr[16];
 | 
						struct bdb_lvds_lfp_data_ptr ptr[16];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* LFP data has 3 blocks per entry */
 | 
					/* LFP data has 3 blocks per entry */
 | 
				
			||||||
struct lvds_fp_timing {
 | 
					struct lvds_fp_timing {
 | 
				
			||||||
@@ -323,7 +325,7 @@ struct lvds_fp_timing {
 | 
				
			|||||||
	u32 pfit_reg;
 | 
						u32 pfit_reg;
 | 
				
			||||||
	u32 pfit_reg_val;
 | 
						u32 pfit_reg_val;
 | 
				
			||||||
	u16 terminator;
 | 
						u16 terminator;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct lvds_dvo_timing {
 | 
					struct lvds_dvo_timing {
 | 
				
			||||||
	u16 clock;		/**< In 10khz */
 | 
						u16 clock;		/**< In 10khz */
 | 
				
			||||||
@@ -351,7 +353,7 @@ struct lvds_dvo_timing {
 | 
				
			|||||||
	u8 vsync_positive:1;
 | 
						u8 vsync_positive:1;
 | 
				
			||||||
	u8 hsync_positive:1;
 | 
						u8 hsync_positive:1;
 | 
				
			||||||
	u8 rsvd2:1;
 | 
						u8 rsvd2:1;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct lvds_pnp_id {
 | 
					struct lvds_pnp_id {
 | 
				
			||||||
	u16 mfg_name;
 | 
						u16 mfg_name;
 | 
				
			||||||
@@ -359,17 +361,17 @@ struct lvds_pnp_id {
 | 
				
			|||||||
	u32 serial;
 | 
						u32 serial;
 | 
				
			||||||
	u8 mfg_week;
 | 
						u8 mfg_week;
 | 
				
			||||||
	u8 mfg_year;
 | 
						u8 mfg_year;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_lvds_lfp_data_entry {
 | 
					struct bdb_lvds_lfp_data_entry {
 | 
				
			||||||
	struct lvds_fp_timing fp_timing;
 | 
						struct lvds_fp_timing fp_timing;
 | 
				
			||||||
	struct lvds_dvo_timing dvo_timing;
 | 
						struct lvds_dvo_timing dvo_timing;
 | 
				
			||||||
	struct lvds_pnp_id pnp_id;
 | 
						struct lvds_pnp_id pnp_id;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_lvds_lfp_data {
 | 
					struct bdb_lvds_lfp_data {
 | 
				
			||||||
	struct bdb_lvds_lfp_data_entry data[16];
 | 
						struct bdb_lvds_lfp_data_entry data[16];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct aimdb_header {
 | 
					struct aimdb_header {
 | 
				
			||||||
	char signature[16];
 | 
						char signature[16];
 | 
				
			||||||
@@ -377,12 +379,12 @@ struct aimdb_header {
 | 
				
			|||||||
	u16 aimdb_version;
 | 
						u16 aimdb_version;
 | 
				
			||||||
	u16 aimdb_header_size;
 | 
						u16 aimdb_header_size;
 | 
				
			||||||
	u16 aimdb_size;
 | 
						u16 aimdb_size;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct aimdb_block {
 | 
					struct aimdb_block {
 | 
				
			||||||
	u8 aimdb_id;
 | 
						u8 aimdb_id;
 | 
				
			||||||
	u16 aimdb_size;
 | 
						u16 aimdb_size;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct vch_panel_data {
 | 
					struct vch_panel_data {
 | 
				
			||||||
	u16 fp_timing_offset;
 | 
						u16 fp_timing_offset;
 | 
				
			||||||
@@ -393,12 +395,12 @@ struct vch_panel_data {
 | 
				
			|||||||
	u8 text_fitting_size;
 | 
						u8 text_fitting_size;
 | 
				
			||||||
	u16 graphics_fitting_offset;
 | 
						u16 graphics_fitting_offset;
 | 
				
			||||||
	u8 graphics_fitting_size;
 | 
						u8 graphics_fitting_size;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct vch_bdb_22 {
 | 
					struct vch_bdb_22 {
 | 
				
			||||||
	struct aimdb_block aimdb_block;
 | 
						struct aimdb_block aimdb_block;
 | 
				
			||||||
	struct vch_panel_data panels[16];
 | 
						struct vch_panel_data panels[16];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_sdvo_lvds_options {
 | 
					struct bdb_sdvo_lvds_options {
 | 
				
			||||||
	u8 panel_backlight;
 | 
						u8 panel_backlight;
 | 
				
			||||||
@@ -414,7 +416,7 @@ struct bdb_sdvo_lvds_options {
 | 
				
			|||||||
	u8 panel_misc_bits_2;
 | 
						u8 panel_misc_bits_2;
 | 
				
			||||||
	u8 panel_misc_bits_3;
 | 
						u8 panel_misc_bits_3;
 | 
				
			||||||
	u8 panel_misc_bits_4;
 | 
						u8 panel_misc_bits_4;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define BDB_DRIVER_FEATURE_NO_LVDS		0
 | 
					#define BDB_DRIVER_FEATURE_NO_LVDS		0
 | 
				
			||||||
@@ -460,7 +462,7 @@ struct bdb_driver_features {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	u8 hdmi_termination;
 | 
						u8 hdmi_termination;
 | 
				
			||||||
	u8 custom_vbt_version;
 | 
						u8 custom_vbt_version;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define EDP_18BPP	0
 | 
					#define EDP_18BPP	0
 | 
				
			||||||
#define EDP_24BPP	1
 | 
					#define EDP_24BPP	1
 | 
				
			||||||
@@ -485,14 +487,14 @@ struct edp_power_seq {
 | 
				
			|||||||
	u16 t9;
 | 
						u16 t9;
 | 
				
			||||||
	u16 t10;
 | 
						u16 t10;
 | 
				
			||||||
	u16 t11_t12;
 | 
						u16 t11_t12;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct edp_link_params {
 | 
					struct edp_link_params {
 | 
				
			||||||
	u8 rate:4;
 | 
						u8 rate:4;
 | 
				
			||||||
	u8 lanes:4;
 | 
						u8 lanes:4;
 | 
				
			||||||
	u8 preemphasis:4;
 | 
						u8 preemphasis:4;
 | 
				
			||||||
	u8 vswing:4;
 | 
						u8 vswing:4;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct bdb_edp {
 | 
					struct bdb_edp {
 | 
				
			||||||
	struct edp_power_seq power_seqs[16];
 | 
						struct edp_power_seq power_seqs[16];
 | 
				
			||||||
@@ -503,7 +505,7 @@ struct bdb_edp {
 | 
				
			|||||||
	/* ith bit indicates enabled/disabled for (i+1)th panel */
 | 
						/* ith bit indicates enabled/disabled for (i+1)th panel */
 | 
				
			||||||
	u16 edp_s3d_feature;
 | 
						u16 edp_s3d_feature;
 | 
				
			||||||
	u16 edp_t3_optimization;
 | 
						u16 edp_t3_optimization;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Driver<->VBIOS interaction occurs through scratch bits in
 | 
					 * Driver<->VBIOS interaction occurs through scratch bits in
 | 
				
			||||||
@@ -728,7 +730,7 @@ struct bdb_mipi {
 | 
				
			|||||||
	u32 hl_switch_cnt;
 | 
						u32 hl_switch_cnt;
 | 
				
			||||||
	u32 lp_byte_clk;
 | 
						u32 lp_byte_clk;
 | 
				
			||||||
	u32 clk_lane_switch_cnt;
 | 
						u32 clk_lane_switch_cnt;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define VBT_SIGNATURE 0x54425624
 | 
					#define VBT_SIGNATURE 0x54425624
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@
 | 
				
			|||||||
#define _COMMON_GMA_H_
 | 
					#define _COMMON_GMA_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <commonlib/helpers.h>
 | 
					#include <commonlib/helpers.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* IGD PCI Configuration register */
 | 
					/* IGD PCI Configuration register */
 | 
				
			||||||
@@ -40,7 +41,7 @@ typedef struct {
 | 
				
			|||||||
	u32	pcon;		    /* Offset 96   Platform Capabilities */
 | 
						u32	pcon;		    /* Offset 96   Platform Capabilities */
 | 
				
			||||||
	u16	dver[16];	    /* Offset 100  GOP Version */
 | 
						u16	dver[16];	    /* Offset 100  GOP Version */
 | 
				
			||||||
	u8	reserved[124];	    /* Offset 132  Reserved */
 | 
						u8	reserved[124];	    /* Offset 132  Reserved */
 | 
				
			||||||
} __attribute__((packed)) opregion_header_t;
 | 
					} __packed opregion_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
 | 
					#define IGD_OPREGION_SIGNATURE "IntelGraphicsMem"
 | 
				
			||||||
#define IGD_OPREGION_VERSION  2
 | 
					#define IGD_OPREGION_VERSION  2
 | 
				
			||||||
@@ -121,7 +122,7 @@ typedef struct {
 | 
				
			|||||||
	u32	cp14;	/* Offset 244  Extended Currently present device 6 */
 | 
						u32	cp14;	/* Offset 244  Extended Currently present device 6 */
 | 
				
			||||||
	u32	cp15;	/* Offset 248  Extended Currently present device 7 */
 | 
						u32	cp15;	/* Offset 248  Extended Currently present device 7 */
 | 
				
			||||||
	u8	reserved2[4];	/* Offset 252  Reserved 4 bytes */
 | 
						u8	reserved2[4];	/* Offset 252  Reserved 4 bytes */
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox1_t;
 | 
					} __packed opregion_mailbox1_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* mailbox 2: software sci interface */
 | 
					/* mailbox 2: software sci interface */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -129,7 +130,7 @@ typedef struct {
 | 
				
			|||||||
	u32	parm;	/* Offset 4  Software SCI function number parameters */
 | 
						u32	parm;	/* Offset 4  Software SCI function number parameters */
 | 
				
			||||||
	u32	dslp;	/* Offset 8  Driver sleep timeout */
 | 
						u32	dslp;	/* Offset 8  Driver sleep timeout */
 | 
				
			||||||
	u8	reserved[244];	/* Offset 12   Reserved */
 | 
						u8	reserved[244];	/* Offset 12   Reserved */
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox2_t;
 | 
					} __packed opregion_mailbox2_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* mailbox 3: power conservation */
 | 
					/* mailbox 3: power conservation */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -163,7 +164,7 @@ typedef struct {
 | 
				
			|||||||
				 *            Size of Raw VBT data
 | 
									 *            Size of Raw VBT data
 | 
				
			||||||
				 */
 | 
									 */
 | 
				
			||||||
	u8	reserved[58];	/* Offset 198 Reserved */
 | 
						u8	reserved[58];	/* Offset 198 Reserved */
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox3_t;
 | 
					} __packed opregion_mailbox3_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IGD_BACKLIGHT_BRIGHTNESS 0xff
 | 
					#define IGD_BACKLIGHT_BRIGHTNESS 0xff
 | 
				
			||||||
#define IGD_INITIAL_BRIGHTNESS 0x64
 | 
					#define IGD_INITIAL_BRIGHTNESS 0x64
 | 
				
			||||||
@@ -175,14 +176,14 @@ typedef struct {
 | 
				
			|||||||
/* mailbox 4: vbt */
 | 
					/* mailbox 4: vbt */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u8 gvd1[6*KiB];
 | 
						u8 gvd1[6*KiB];
 | 
				
			||||||
} __attribute__((packed)) opregion_vbt_t;
 | 
					} __packed opregion_vbt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Mailbox 5: BIOS to Driver Notification Extension */
 | 
					/* Mailbox 5: BIOS to Driver Notification Extension */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u32	phed;		/* Offset 7168 Panel Header */
 | 
						u32	phed;		/* Offset 7168 Panel Header */
 | 
				
			||||||
	u8	bddc[256];	/* Offset 7172 Panel EDID */
 | 
						u8	bddc[256];	/* Offset 7172 Panel EDID */
 | 
				
			||||||
	u8	reserved[764];	/* Offset 7428 764 bytes */
 | 
						u8	reserved[764];	/* Offset 7428 764 bytes */
 | 
				
			||||||
} __attribute__((packed)) opregion_mailbox5_t;
 | 
					} __packed opregion_mailbox5_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* IGD OpRegion */
 | 
					/* IGD OpRegion */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -193,7 +194,7 @@ typedef struct {
 | 
				
			|||||||
	opregion_vbt_t vbt;
 | 
						opregion_vbt_t vbt;
 | 
				
			||||||
	opregion_mailbox5_t	mailbox5;
 | 
						opregion_mailbox5_t	mailbox5;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__((packed)) igd_opregion_t;
 | 
					} __packed igd_opregion_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Intel Video BIOS (Option ROM) */
 | 
					/* Intel Video BIOS (Option ROM) */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -202,7 +203,7 @@ typedef struct {
 | 
				
			|||||||
	u8	reserved[21];
 | 
						u8	reserved[21];
 | 
				
			||||||
	u16	pcir_offset;
 | 
						u16	pcir_offset;
 | 
				
			||||||
	u16	vbt_offset;
 | 
						u16	vbt_offset;
 | 
				
			||||||
} __attribute__((packed)) optionrom_header_t;
 | 
					} __packed optionrom_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define OPROM_SIGNATURE 0xaa55
 | 
					#define OPROM_SIGNATURE 0xaa55
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -219,7 +220,7 @@ typedef struct {
 | 
				
			|||||||
	u8	codetype;
 | 
						u8	codetype;
 | 
				
			||||||
	u8	indicator;
 | 
						u8	indicator;
 | 
				
			||||||
	u16	reserved2;
 | 
						u16	reserved2;
 | 
				
			||||||
} __attribute__((packed)) optionrom_pcir_t;
 | 
					} __packed optionrom_pcir_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u8	hdr_signature[20];
 | 
						u8	hdr_signature[20];
 | 
				
			||||||
@@ -243,7 +244,7 @@ typedef struct {
 | 
				
			|||||||
	u8	coreblock_integratedhw;
 | 
						u8	coreblock_integratedhw;
 | 
				
			||||||
	u8	coreblock_biosbuild[4];
 | 
						u8	coreblock_biosbuild[4];
 | 
				
			||||||
	u8	coreblock_biossignon[155];
 | 
						u8	coreblock_biossignon[155];
 | 
				
			||||||
} __attribute__((packed)) optionrom_vbt_t;
 | 
					} __packed optionrom_vbt_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void intel_gma_opregion_register(uintptr_t opregion);
 | 
					void intel_gma_opregion_register(uintptr_t opregion);
 | 
				
			||||||
void intel_gma_restore_opregion(void);
 | 
					void intel_gma_restore_opregion(void);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
#define __INTEL_MIPI_CAMERA_CHIP_H__
 | 
					#define __INTEL_MIPI_CAMERA_CHIP_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MAX_PWDB_ENTRIES 12
 | 
					#define MAX_PWDB_ENTRIES 12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -83,7 +84,7 @@ struct intel_ssdb {
 | 
				
			|||||||
	uint8_t mipi_data_format;		/* MIPI data format */
 | 
						uint8_t mipi_data_format;		/* MIPI data format */
 | 
				
			||||||
	uint8_t silicon_version;		/* Silicon version */
 | 
						uint8_t silicon_version;		/* Silicon version */
 | 
				
			||||||
	uint8_t customer_id;			/* Customer ID */
 | 
						uint8_t customer_id;			/* Customer ID */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct intel_pwdb {
 | 
					struct intel_pwdb {
 | 
				
			||||||
	char name[32];		/* Name of the resource required by the power
 | 
						char name[32];		/* Name of the resource required by the power
 | 
				
			||||||
@@ -92,7 +93,7 @@ struct intel_pwdb {
 | 
				
			|||||||
	uint32_t entry_type;	/* The type of the current power action */
 | 
						uint32_t entry_type;	/* The type of the current power action */
 | 
				
			||||||
	uint32_t delay_usec;	/* The delay time after which power action is
 | 
						uint32_t delay_usec;	/* The delay time after which power action is
 | 
				
			||||||
				performed and this is in unit of usec */
 | 
									performed and this is in unit of usec */
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct drivers_intel_mipi_camera_config {
 | 
					struct drivers_intel_mipi_camera_config {
 | 
				
			||||||
	struct intel_ssdb ssdb;
 | 
						struct intel_ssdb ssdb;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <arch/acpi_device.h>
 | 
					#include <arch/acpi_device.h>
 | 
				
			||||||
#include <arch/acpigen.h>
 | 
					#include <arch/acpigen.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
@@ -36,7 +37,7 @@ static int smbios_write_wifi(struct device *dev, int *handle,
 | 
				
			|||||||
		u16 handle;
 | 
							u16 handle;
 | 
				
			||||||
		u8 str;
 | 
							u8 str;
 | 
				
			||||||
		char eos[2];
 | 
							char eos[2];
 | 
				
			||||||
	} __attribute__((packed));
 | 
						} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct smbios_type_intel_wifi *t =
 | 
						struct smbios_type_intel_wifi *t =
 | 
				
			||||||
		(struct smbios_type_intel_wifi *)*current;
 | 
							(struct smbios_type_intel_wifi *)*current;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,8 @@
 | 
				
			|||||||
#ifndef _SIEMENS_NC_FPGA_H_
 | 
					#ifndef _SIEMENS_NC_FPGA_H_
 | 
				
			||||||
#define _SIEMENS_NC_FPGA_H_
 | 
					#define _SIEMENS_NC_FPGA_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define NC_MAGIC_OFFSET			0x020
 | 
					#define NC_MAGIC_OFFSET			0x020
 | 
				
			||||||
#define  NC_FPGA_MAGIC			0x4E433746
 | 
					#define  NC_FPGA_MAGIC			0x4E433746
 | 
				
			||||||
#define NC_CAP1_OFFSET			0x080
 | 
					#define NC_CAP1_OFFSET			0x080
 | 
				
			||||||
@@ -64,6 +66,6 @@ typedef struct {
 | 
				
			|||||||
	uint16_t	hystthreshold;
 | 
						uint16_t	hystthreshold;
 | 
				
			||||||
	uint16_t	res9[4];
 | 
						uint16_t	res9[4];
 | 
				
			||||||
	uint32_t	fanmon;
 | 
						uint32_t	fanmon;
 | 
				
			||||||
} __attribute__ ((packed)) fan_ctrl_t;
 | 
					} __packed fan_ctrl_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* _SIEMENS_NC_FPGA_H_ */
 | 
					#endif /* _SIEMENS_NC_FPGA_H_ */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,8 @@
 | 
				
			|||||||
#ifndef EHCI_H
 | 
					#ifndef EHCI_H
 | 
				
			||||||
#define EHCI_H
 | 
					#define EHCI_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
 | 
					/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Section 2.2 Host Controller Capability Registers */
 | 
					/* Section 2.2 Host Controller Capability Registers */
 | 
				
			||||||
@@ -52,7 +54,7 @@ struct ehci_caps {
 | 
				
			|||||||
#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1))  /* true: periodic_size changes*/
 | 
					#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1))  /* true: periodic_size changes*/
 | 
				
			||||||
#define HCC_64BIT_ADDR(p)       ((p)&(1))       /* true: can use 64-bit addr */
 | 
					#define HCC_64BIT_ADDR(p)       ((p)&(1))       /* true: can use 64-bit addr */
 | 
				
			||||||
	u8		portroute[8];	 /* nibbles for routing - offset 0xC */
 | 
						u8		portroute[8];	 /* nibbles for routing - offset 0xC */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Section 2.3 Host Controller Operational Registers */
 | 
					/* Section 2.3 Host Controller Operational Registers */
 | 
				
			||||||
@@ -148,7 +150,7 @@ struct ehci_regs {
 | 
				
			|||||||
#define PORT_CSC	(1<<1)		/* connect status change */
 | 
					#define PORT_CSC	(1<<1)		/* connect status change */
 | 
				
			||||||
#define PORT_CONNECT	(1<<0)		/* device connected */
 | 
					#define PORT_CONNECT	(1<<0)		/* device connected */
 | 
				
			||||||
#define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
 | 
					#define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define USBMODE		0x68		/* USB Device mode */
 | 
					#define USBMODE		0x68		/* USB Device mode */
 | 
				
			||||||
#define USBMODE_SDIS	(1<<3)		/* Stream disable */
 | 
					#define USBMODE_SDIS	(1<<3)		/* Stream disable */
 | 
				
			||||||
@@ -192,7 +194,7 @@ struct ehci_dbg_port {
 | 
				
			|||||||
	u32	data47;
 | 
						u32	data47;
 | 
				
			||||||
	u32	address;
 | 
						u32	address;
 | 
				
			||||||
#define DBGP_EPADDR(dev, ep)	(((dev)<<8)|(ep))
 | 
					#define DBGP_EPADDR(dev, ep)	(((dev)<<8)|(ep))
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define USB_DEBUG_DEVNUM 127
 | 
					#define USB_DEBUG_DEVNUM 127
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,8 @@
 | 
				
			|||||||
#ifndef USB_CH9_H
 | 
					#ifndef USB_CH9_H
 | 
				
			||||||
#define USB_CH9_H
 | 
					#define USB_CH9_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define USB_DIR_OUT                     0               /* to device */
 | 
					#define USB_DIR_OUT                     0               /* to device */
 | 
				
			||||||
#define USB_DIR_IN                      0x80            /* to host */
 | 
					#define USB_DIR_IN                      0x80            /* to host */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -111,7 +113,7 @@ struct usb_ctrlrequest {
 | 
				
			|||||||
        u16 wValue;
 | 
					        u16 wValue;
 | 
				
			||||||
        u16 wIndex;
 | 
					        u16 wIndex;
 | 
				
			||||||
        u16 wLength;
 | 
					        u16 wLength;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct usb_debug_descriptor {
 | 
					struct usb_debug_descriptor {
 | 
				
			||||||
        u8  bLength;
 | 
					        u8  bLength;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										28
									
								
								src/include/compiler.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								src/include/compiler.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * This file is part of the coreboot project.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright 2017 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.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef __COMPILER_H__
 | 
				
			||||||
 | 
					#define __COMPILER_H__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(__WIN32) || defined(__WIN64)
 | 
				
			||||||
 | 
					#define __packed __attribute__((gcc_struct, packed))
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#define __packed __attribute__((packed))
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define __aligned(x) __attribute__((aligned(x)))
 | 
				
			||||||
 | 
					#define __always_unused __attribute__((unused))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
@@ -18,6 +18,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <rules.h>
 | 
					#include <rules.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void spiconsole_init(void);
 | 
					void spiconsole_init(void);
 | 
				
			||||||
void spiconsole_tx_byte(unsigned char c);
 | 
					void spiconsole_tx_byte(unsigned char c);
 | 
				
			||||||
@@ -59,12 +60,12 @@ struct em100_msg_header {
 | 
				
			|||||||
	uint32_t	msg_signature;
 | 
						uint32_t	msg_signature;
 | 
				
			||||||
	uint8_t		msg_type;
 | 
						uint8_t		msg_type;
 | 
				
			||||||
	uint8_t		msg_length;
 | 
						uint8_t		msg_length;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct em100_msg {
 | 
					struct em100_msg {
 | 
				
			||||||
	struct em100_msg_header header;
 | 
						struct em100_msg_header header;
 | 
				
			||||||
	char data[MAX_MSG_LENGTH];
 | 
						char data[MAX_MSG_LENGTH];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <arch/cpu.h>
 | 
					#include <arch/cpu.h>
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SMM_DEFAULT_BASE 0x30000
 | 
					#define SMM_DEFAULT_BASE 0x30000
 | 
				
			||||||
#define SMM_DEFAULT_SIZE 0x10000
 | 
					#define SMM_DEFAULT_SIZE 0x10000
 | 
				
			||||||
@@ -129,7 +130,7 @@ typedef struct {
 | 
				
			|||||||
	u64	rdx;
 | 
						u64	rdx;
 | 
				
			||||||
	u64	rcx;
 | 
						u64	rcx;
 | 
				
			||||||
	u64	rax;
 | 
						u64	rax;
 | 
				
			||||||
} __attribute__((packed)) amd64_smm_state_save_area_t;
 | 
					} __packed amd64_smm_state_save_area_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Intel Core 2 (EM64T) SMM State-Save Area
 | 
					/* Intel Core 2 (EM64T) SMM State-Save Area
 | 
				
			||||||
@@ -211,7 +212,7 @@ typedef struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	u64	cr3;
 | 
						u64	cr3;
 | 
				
			||||||
	u64	cr0;
 | 
						u64	cr0;
 | 
				
			||||||
} __attribute__((packed)) em64t_smm_state_save_area_t;
 | 
					} __packed em64t_smm_state_save_area_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Intel Revision 30100 SMM State-Save Area
 | 
					/* Intel Revision 30100 SMM State-Save Area
 | 
				
			||||||
@@ -298,7 +299,7 @@ typedef struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	u64	cr3;
 | 
						u64	cr3;
 | 
				
			||||||
	u64	cr0;
 | 
						u64	cr0;
 | 
				
			||||||
} __attribute__((packed)) em64t100_smm_state_save_area_t;
 | 
					} __packed em64t100_smm_state_save_area_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Intel Revision 30101 SMM State-Save Area
 | 
					/* Intel Revision 30101 SMM State-Save Area
 | 
				
			||||||
 * The following processor architectures use this:
 | 
					 * The following processor architectures use this:
 | 
				
			||||||
@@ -397,7 +398,7 @@ typedef struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	u64	cr3;
 | 
						u64	cr3;
 | 
				
			||||||
	u64	cr0;
 | 
						u64	cr0;
 | 
				
			||||||
} __attribute__((packed)) em64t101_smm_state_save_area_t;
 | 
					} __packed em64t101_smm_state_save_area_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Legacy x86 SMM State-Save Area
 | 
					/* Legacy x86 SMM State-Save Area
 | 
				
			||||||
@@ -438,7 +439,7 @@ typedef struct {
 | 
				
			|||||||
	u32	eflags;
 | 
						u32	eflags;
 | 
				
			||||||
	u32	cr3;
 | 
						u32	cr3;
 | 
				
			||||||
	u32	cr0;
 | 
						u32	cr0;
 | 
				
			||||||
} __attribute__((packed)) legacy_smm_state_save_area_t;
 | 
					} __packed legacy_smm_state_save_area_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum {
 | 
					typedef enum {
 | 
				
			||||||
	AMD64,
 | 
						AMD64,
 | 
				
			||||||
@@ -514,7 +515,7 @@ struct smm_runtime {
 | 
				
			|||||||
	 * contiguous like the 1:1 mapping it is up to the caller of the stub
 | 
						 * contiguous like the 1:1 mapping it is up to the caller of the stub
 | 
				
			||||||
	 * loader to adjust this mapping. */
 | 
						 * loader to adjust this mapping. */
 | 
				
			||||||
	u8 apic_id_to_cpu[CONFIG_MAX_CPUS];
 | 
						u8 apic_id_to_cpu[CONFIG_MAX_CPUS];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smm_module_params {
 | 
					struct smm_module_params {
 | 
				
			||||||
	void *arg;
 | 
						void *arg;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,8 @@
 | 
				
			|||||||
#ifndef ELOG_H_
 | 
					#ifndef ELOG_H_
 | 
				
			||||||
#define ELOG_H_
 | 
					#define ELOG_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* SMI command code for GSMI event logging */
 | 
					/* SMI command code for GSMI event logging */
 | 
				
			||||||
#define ELOG_GSMI_APM_CNT                 0xEF
 | 
					#define ELOG_GSMI_APM_CNT                 0xEF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -151,7 +153,7 @@
 | 
				
			|||||||
struct elog_event_data_wake {
 | 
					struct elog_event_data_wake {
 | 
				
			||||||
	u8 source;
 | 
						u8 source;
 | 
				
			||||||
	u32 instance;
 | 
						u32 instance;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Chrome OS related events */
 | 
					/* Chrome OS related events */
 | 
				
			||||||
#define ELOG_TYPE_CROS_DEVELOPER_MODE     0xa0
 | 
					#define ELOG_TYPE_CROS_DEVELOPER_MODE     0xa0
 | 
				
			||||||
@@ -169,7 +171,7 @@ struct elog_event_data_me_extended {
 | 
				
			|||||||
	u8 progress_code;
 | 
						u8 progress_code;
 | 
				
			||||||
	u8 current_pmevent;
 | 
						u8 current_pmevent;
 | 
				
			||||||
	u8 current_state;
 | 
						u8 current_state;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Last post code from previous boot */
 | 
					/* Last post code from previous boot */
 | 
				
			||||||
#define ELOG_TYPE_LAST_POST_CODE          0xa3
 | 
					#define ELOG_TYPE_LAST_POST_CODE          0xa3
 | 
				
			||||||
@@ -195,7 +197,7 @@ struct elog_event_data_me_extended {
 | 
				
			|||||||
struct elog_event_mem_cache_update {
 | 
					struct elog_event_mem_cache_update {
 | 
				
			||||||
	u8 slot;
 | 
						u8 slot;
 | 
				
			||||||
	u8 status;
 | 
						u8 status;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* CPU Thermal Trip */
 | 
					/* CPU Thermal Trip */
 | 
				
			||||||
#define ELOG_TYPE_THERM_TRIP              0xab
 | 
					#define ELOG_TYPE_THERM_TRIP              0xab
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
#define _MEMORY_INFO_H_
 | 
					#define _MEMORY_INFO_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * If this table is filled and put in CBMEM,
 | 
					 * If this table is filled and put in CBMEM,
 | 
				
			||||||
@@ -37,12 +38,12 @@ struct dimm_info {
 | 
				
			|||||||
	uint16_t mod_id;
 | 
						uint16_t mod_id;
 | 
				
			||||||
	uint8_t mod_type;
 | 
						uint8_t mod_type;
 | 
				
			||||||
	uint8_t bus_width;
 | 
						uint8_t bus_width;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct memory_info {
 | 
					struct memory_info {
 | 
				
			||||||
	uint8_t dimm_cnt;
 | 
						uint8_t dimm_cnt;
 | 
				
			||||||
	/* Maximum num of dimm is 8 */
 | 
						/* Maximum num of dimm is 8 */
 | 
				
			||||||
	struct dimm_info dimm[8];
 | 
						struct dimm_info dimm[8];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@
 | 
				
			|||||||
#define SMBIOS_H
 | 
					#define SMBIOS_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long smbios_write_tables(unsigned long start);
 | 
					unsigned long smbios_write_tables(unsigned long start);
 | 
				
			||||||
int smbios_add_string(char *start, const char *str);
 | 
					int smbios_add_string(char *start, const char *str);
 | 
				
			||||||
@@ -230,7 +231,7 @@ struct smbios_entry {
 | 
				
			|||||||
	u32 struct_table_address;
 | 
						u32 struct_table_address;
 | 
				
			||||||
	u16 struct_count;
 | 
						u16 struct_count;
 | 
				
			||||||
	u8 smbios_bcd_revision;
 | 
						u8 smbios_bcd_revision;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type0 {
 | 
					struct smbios_type0 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -249,7 +250,7 @@ struct smbios_type0 {
 | 
				
			|||||||
	u8 ec_major_release;
 | 
						u8 ec_major_release;
 | 
				
			||||||
	u8 ec_minor_release;
 | 
						u8 ec_minor_release;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type1 {
 | 
					struct smbios_type1 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -264,7 +265,7 @@ struct smbios_type1 {
 | 
				
			|||||||
	u8 sku;
 | 
						u8 sku;
 | 
				
			||||||
	u8 family;
 | 
						u8 family;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type2 {
 | 
					struct smbios_type2 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -275,7 +276,7 @@ struct smbios_type2 {
 | 
				
			|||||||
	u8 version;
 | 
						u8 version;
 | 
				
			||||||
	u8 serial_number;
 | 
						u8 serial_number;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
	SMBIOS_ENCLOSURE_OTHER = 0x01,
 | 
						SMBIOS_ENCLOSURE_OTHER = 0x01,
 | 
				
			||||||
@@ -336,7 +337,7 @@ struct smbios_type3 {
 | 
				
			|||||||
	u8 element_record_length;
 | 
						u8 element_record_length;
 | 
				
			||||||
	u8 sku_number;
 | 
						u8 sku_number;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type4 {
 | 
					struct smbios_type4 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -366,7 +367,7 @@ struct smbios_type4 {
 | 
				
			|||||||
	u16 processor_characteristics;
 | 
						u16 processor_characteristics;
 | 
				
			||||||
	u16 processor_family2;
 | 
						u16 processor_family2;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type11 {
 | 
					struct smbios_type11 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -374,7 +375,7 @@ struct smbios_type11 {
 | 
				
			|||||||
	u16 handle;
 | 
						u16 handle;
 | 
				
			||||||
	u8 count;
 | 
						u8 count;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type15 {
 | 
					struct smbios_type15 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -391,7 +392,7 @@ struct smbios_type15 {
 | 
				
			|||||||
	u8 log_type_descriptors;
 | 
						u8 log_type_descriptors;
 | 
				
			||||||
	u8 log_type_descriptor_length;
 | 
						u8 log_type_descriptor_length;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
	SMBIOS_EVENTLOG_ACCESS_METHOD_IO8 = 0,
 | 
						SMBIOS_EVENTLOG_ACCESS_METHOD_IO8 = 0,
 | 
				
			||||||
@@ -418,7 +419,7 @@ struct smbios_type16 {
 | 
				
			|||||||
	u16 number_of_memory_devices;
 | 
						u16 number_of_memory_devices;
 | 
				
			||||||
	u64 extended_maximum_capacity;
 | 
						u64 extended_maximum_capacity;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type17 {
 | 
					struct smbios_type17 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -447,7 +448,7 @@ struct smbios_type17 {
 | 
				
			|||||||
	u16 maximum_voltage;
 | 
						u16 maximum_voltage;
 | 
				
			||||||
	u16 configured_voltage;
 | 
						u16 configured_voltage;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type32 {
 | 
					struct smbios_type32 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -456,7 +457,7 @@ struct smbios_type32 {
 | 
				
			|||||||
	u8 reserved[6];
 | 
						u8 reserved[6];
 | 
				
			||||||
	u8 boot_status;
 | 
						u8 boot_status;
 | 
				
			||||||
	u8 eos[2];
 | 
						u8 eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type38 {
 | 
					struct smbios_type38 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
@@ -469,7 +470,7 @@ struct smbios_type38 {
 | 
				
			|||||||
	u64 base_address;
 | 
						u64 base_address;
 | 
				
			||||||
	u8 base_address_modifier;
 | 
						u8 base_address_modifier;
 | 
				
			||||||
	u8 irq;
 | 
						u8 irq;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum {
 | 
					typedef enum {
 | 
				
			||||||
	SMBIOS_DEVICE_TYPE_OTHER = 0x01,
 | 
						SMBIOS_DEVICE_TYPE_OTHER = 0x01,
 | 
				
			||||||
@@ -497,14 +498,14 @@ struct smbios_type41 {
 | 
				
			|||||||
	u8 function_number: 3;
 | 
						u8 function_number: 3;
 | 
				
			||||||
	u8 device_number: 5;
 | 
						u8 device_number: 5;
 | 
				
			||||||
	char eos[2];
 | 
						char eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct smbios_type127 {
 | 
					struct smbios_type127 {
 | 
				
			||||||
	u8 type;
 | 
						u8 type;
 | 
				
			||||||
	u8 length;
 | 
						u8 length;
 | 
				
			||||||
	u16 handle;
 | 
						u16 handle;
 | 
				
			||||||
	u8 eos[2];
 | 
						u8 eos[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id,
 | 
					void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id,
 | 
				
			||||||
	struct smbios_type17 *t);
 | 
						struct smbios_type17 *t);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
#ifndef VBE_H
 | 
					#ifndef VBE_H
 | 
				
			||||||
#define VBE_H
 | 
					#define VBE_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <boot/coreboot_tables.h>
 | 
					#include <boot/coreboot_tables.h>
 | 
				
			||||||
// these structs are for input from and output to OF
 | 
					// these structs are for input from and output to OF
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
@@ -24,7 +25,7 @@ typedef struct {
 | 
				
			|||||||
	u8 color_depth;	// color depth in bits per pixel
 | 
						u8 color_depth;	// color depth in bits per pixel
 | 
				
			||||||
	u32 framebuffer_address;
 | 
						u32 framebuffer_address;
 | 
				
			||||||
	u8 edid_block_zero[128];
 | 
						u8 edid_block_zero[128];
 | 
				
			||||||
} __attribute__ ((__packed__)) screen_info_t;
 | 
					} __packed screen_info_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u8 signature[4];
 | 
						u8 signature[4];
 | 
				
			||||||
@@ -32,7 +33,7 @@ typedef struct {
 | 
				
			|||||||
	u8 monitor_number;
 | 
						u8 monitor_number;
 | 
				
			||||||
	u16 max_screen_width;
 | 
						u16 max_screen_width;
 | 
				
			||||||
	u8 color_depth;
 | 
						u8 color_depth;
 | 
				
			||||||
} __attribute__ ((__packed__)) screen_info_input_t;
 | 
					} __packed screen_info_input_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// these structs only store a subset of the VBE defined fields
 | 
					// these structs only store a subset of the VBE defined fields
 | 
				
			||||||
// only those needed.
 | 
					// only those needed.
 | 
				
			||||||
@@ -80,7 +81,7 @@ typedef struct {
 | 
				
			|||||||
	u32 offscreen_mem_offset;
 | 
						u32 offscreen_mem_offset;
 | 
				
			||||||
	u16 offscreen_mem_size;
 | 
						u16 offscreen_mem_size;
 | 
				
			||||||
	u8 reserved[206];
 | 
						u8 reserved[206];
 | 
				
			||||||
} __attribute__ ((__packed__)) vesa_mode_info_t;
 | 
					} __packed vesa_mode_info_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u16 video_mode;
 | 
						u16 video_mode;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <console/cbmem_console.h>
 | 
					#include <console/cbmem_console.h>
 | 
				
			||||||
#include <console/uart.h>
 | 
					#include <console/uart.h>
 | 
				
			||||||
@@ -43,7 +44,7 @@ struct cbmem_console {
 | 
				
			|||||||
	u32 size;
 | 
						u32 size;
 | 
				
			||||||
	u32 cursor;
 | 
						u32 cursor;
 | 
				
			||||||
	u8  body[0];
 | 
						u8  body[0];
 | 
				
			||||||
}  __attribute__ ((__packed__));
 | 
					}  __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MAX_SIZE (1 << 28)	/* can't be changed without breaking readers! */
 | 
					#define MAX_SIZE (1 << 28)	/* can't be changed without breaking readers! */
 | 
				
			||||||
#define CURSOR_MASK (MAX_SIZE - 1)	/* bits 31-28 are reserved for flags */
 | 
					#define CURSOR_MASK (MAX_SIZE - 1)	/* bits 31-28 are reserved for flags */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <assert.h>
 | 
					#include <assert.h>
 | 
				
			||||||
#include <cbmem.h>
 | 
					#include <cbmem.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
@@ -32,7 +33,7 @@ struct imd_root_pointer {
 | 
				
			|||||||
	uint32_t magic;
 | 
						uint32_t magic;
 | 
				
			||||||
	/* Relative to upper limit/offset. */
 | 
						/* Relative to upper limit/offset. */
 | 
				
			||||||
	int32_t root_offset;
 | 
						int32_t root_offset;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct imd_entry {
 | 
					struct imd_entry {
 | 
				
			||||||
	uint32_t magic;
 | 
						uint32_t magic;
 | 
				
			||||||
@@ -40,7 +41,7 @@ struct imd_entry {
 | 
				
			|||||||
	int32_t start_offset;
 | 
						int32_t start_offset;
 | 
				
			||||||
	uint32_t size;
 | 
						uint32_t size;
 | 
				
			||||||
	uint32_t id;
 | 
						uint32_t id;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct imd_root {
 | 
					struct imd_root {
 | 
				
			||||||
	uint32_t max_entries;
 | 
						uint32_t max_entries;
 | 
				
			||||||
@@ -50,7 +51,7 @@ struct imd_root {
 | 
				
			|||||||
	/* Used for fixing the size of an imd. Relative to the root. */
 | 
						/* Used for fixing the size of an imd. Relative to the root. */
 | 
				
			||||||
	int32_t max_offset;
 | 
						int32_t max_offset;
 | 
				
			||||||
	struct imd_entry entries[0];
 | 
						struct imd_entry entries[0];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IMD_FLAG_LOCKED 1
 | 
					#define IMD_FLAG_LOCKED 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#include <assert.h>
 | 
					#include <assert.h>
 | 
				
			||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <cbmem.h>
 | 
					#include <cbmem.h>
 | 
				
			||||||
#include <symbols.h>
 | 
					#include <symbols.h>
 | 
				
			||||||
@@ -30,7 +31,7 @@
 | 
				
			|||||||
/* When changing this number, adjust TIMESTAMP() size ASSERT() in memlayout.h */
 | 
					/* When changing this number, adjust TIMESTAMP() size ASSERT() in memlayout.h */
 | 
				
			||||||
#define MAX_BSS_TIMESTAMP_CACHE 16
 | 
					#define MAX_BSS_TIMESTAMP_CACHE 16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct __attribute__((__packed__)) timestamp_cache {
 | 
					struct __packed timestamp_cache {
 | 
				
			||||||
	uint32_t cache_state;
 | 
						uint32_t cache_state;
 | 
				
			||||||
	struct timestamp_table table;
 | 
						struct timestamp_table table;
 | 
				
			||||||
	/* The struct timestamp_table has a 0 length array as its last field.
 | 
						/* The struct timestamp_table has a 0 length array as its last field.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,7 @@
 | 
				
			|||||||
 * constants and structures needed for functions used in coreboot.
 | 
					 * constants and structures needed for functions used in coreboot.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <tpm_lite/tlcl.h>
 | 
					#include <tpm_lite/tlcl.h>
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -56,7 +57,7 @@ struct tpm_header {
 | 
				
			|||||||
	uint16_t tpm_tag;
 | 
						uint16_t tpm_tag;
 | 
				
			||||||
	uint32_t tpm_size;
 | 
						uint32_t tpm_size;
 | 
				
			||||||
	TPM_CC tpm_code;
 | 
						TPM_CC tpm_code;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* TPM command codes. */
 | 
					/* TPM command codes. */
 | 
				
			||||||
#define TPM2_Hierarchy_Control ((TPM_CC)0x00000121)
 | 
					#define TPM2_Hierarchy_Control ((TPM_CC)0x00000121)
 | 
				
			||||||
@@ -318,7 +319,7 @@ struct tpm2_session_header {
 | 
				
			|||||||
	union {
 | 
						union {
 | 
				
			||||||
		struct tpm2_session_attrs session_attr_bits;
 | 
							struct tpm2_session_attrs session_attr_bits;
 | 
				
			||||||
		uint8_t session_attrs;
 | 
							uint8_t session_attrs;
 | 
				
			||||||
	}  __attribute__((packed));
 | 
						}  __packed;
 | 
				
			||||||
	uint16_t auth_size;
 | 
						uint16_t auth_size;
 | 
				
			||||||
	uint8_t *auth;
 | 
						uint8_t *auth;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <swab.h>
 | 
					#include <swab.h>
 | 
				
			||||||
#include <smbios.h>
 | 
					#include <smbios.h>
 | 
				
			||||||
@@ -186,7 +187,7 @@ struct BiosLinkerLoaderEntry {
 | 
				
			|||||||
		/* padding */
 | 
							/* padding */
 | 
				
			||||||
		char pad[124];
 | 
							char pad[124];
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
typedef struct BiosLinkerLoaderEntry BiosLinkerLoaderEntry;
 | 
					typedef struct BiosLinkerLoaderEntry BiosLinkerLoaderEntry;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
#define PTN3460_H_
 | 
					#define PTN3460_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PTN_SLAVE_ADR		0x20
 | 
					#define PTN_SLAVE_ADR		0x20
 | 
				
			||||||
#define PTN_I2C_CONTROLLER	0
 | 
					#define PTN_I2C_CONTROLLER	0
 | 
				
			||||||
@@ -74,7 +75,7 @@ struct ptn_3460_config {
 | 
				
			|||||||
	uint8_t t4_timing;
 | 
						uint8_t t4_timing;
 | 
				
			||||||
	/* Panel T5 delay. */
 | 
						/* Panel T5 delay. */
 | 
				
			||||||
	uint8_t t5_delay;
 | 
						uint8_t t5_delay;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ptn_3460_flash {
 | 
					struct ptn_3460_flash {
 | 
				
			||||||
	/* Flash command (erase or erase and flash). */
 | 
						/* Flash command (erase or erase and flash). */
 | 
				
			||||||
@@ -83,7 +84,7 @@ struct ptn_3460_flash {
 | 
				
			|||||||
	uint16_t magic;
 | 
						uint16_t magic;
 | 
				
			||||||
	/* Trigger for starting flash operation. */
 | 
						/* Trigger for starting flash operation. */
 | 
				
			||||||
	uint8_t trigger;
 | 
						uint8_t trigger;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int ptn3460_init(const char *hwi_block);
 | 
					int ptn3460_init(const char *hwi_block);
 | 
				
			||||||
int ptn3460_write_edid(uint8_t edid_num, const uint8_t data[PTN_EDID_LEN]);
 | 
					int ptn3460_write_edid(uint8_t edid_num, const uint8_t data[PTN_EDID_LEN]);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#ifndef PTN3460_H_
 | 
					#ifndef PTN3460_H_
 | 
				
			||||||
#define PTN3460_H_
 | 
					#define PTN3460_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <delay.h>
 | 
					#include <delay.h>
 | 
				
			||||||
#include "lcd_panel.h"
 | 
					#include "lcd_panel.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -56,13 +57,13 @@ struct ptn_3460_config{
 | 
				
			|||||||
	u8	t2_delay;		/* Panel T2 delay */
 | 
						u8	t2_delay;		/* Panel T2 delay */
 | 
				
			||||||
	u8	t4_timing;		/* Panel T4 timing value */
 | 
						u8	t4_timing;		/* Panel T4 timing value */
 | 
				
			||||||
	u8	t5_delay;		/* Panel T5 delay */
 | 
						u8	t5_delay;		/* Panel T5 delay */
 | 
				
			||||||
}__attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ptn_3460_flash{
 | 
					struct ptn_3460_flash{
 | 
				
			||||||
	u8	cmd;			/* Flash command (erase or erase and flash) */
 | 
						u8	cmd;			/* Flash command (erase or erase and flash) */
 | 
				
			||||||
	u16	magic;			/* Magic number needed by the flash algorithm */
 | 
						u16	magic;			/* Magic number needed by the flash algorithm */
 | 
				
			||||||
	u8	trigger;		/* Trigger for starting flash operation */
 | 
						u8	trigger;		/* Trigger for starting flash operation */
 | 
				
			||||||
}__attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int ptn3460_init(char *hwi_block);
 | 
					int ptn3460_init(char *hwi_block);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <arch/acpi.h>
 | 
					#include <arch/acpi.h>
 | 
				
			||||||
@@ -39,7 +40,7 @@ typedef struct {
 | 
				
			|||||||
	u32	pcba;
 | 
						u32	pcba;
 | 
				
			||||||
	u8  mpen;
 | 
						u8  mpen;
 | 
				
			||||||
	u8 reserv[247];
 | 
						u8 reserv[247];
 | 
				
			||||||
} __attribute__((packed)) global_vars_t;
 | 
					} __packed global_vars_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void acpi_write_gvars(global_vars_t *gvars)
 | 
					static void acpi_write_gvars(global_vars_t *gvars)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,6 +26,7 @@
 | 
				
			|||||||
 * acpi_jump_wake().
 | 
					 * acpi_jump_wake().
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <arch/io.h>
 | 
					#include <arch/io.h>
 | 
				
			||||||
@@ -52,9 +53,9 @@ static unsigned long long real_mode_gdt_entries[3] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
struct Xgt_desc_struct {
 | 
					struct Xgt_desc_struct {
 | 
				
			||||||
	unsigned short size;
 | 
						unsigned short size;
 | 
				
			||||||
	unsigned long address __attribute__ ((packed));
 | 
						unsigned long address __packed;
 | 
				
			||||||
	unsigned short pad;
 | 
						unsigned short pad;
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct Xgt_desc_struct real_mode_gdt = {
 | 
					static struct Xgt_desc_struct real_mode_gdt = {
 | 
				
			||||||
	sizeof(real_mode_gdt_entries) - 1,
 | 
						sizeof(real_mode_gdt_entries) - 1,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@
 | 
				
			|||||||
#define AMDFAM10_H
 | 
					#define AMDFAM10_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <inttypes.h>
 | 
					#include <inttypes.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <arch/io.h>
 | 
					#include <arch/io.h>
 | 
				
			||||||
#include <device/device.h>
 | 
					#include <device/device.h>
 | 
				
			||||||
#include "early_ht.h"
 | 
					#include "early_ht.h"
 | 
				
			||||||
@@ -934,14 +935,14 @@ struct link_pair_t {
 | 
				
			|||||||
	u8 nodeid;
 | 
						u8 nodeid;
 | 
				
			||||||
	u8 linkn;
 | 
						u8 linkn;
 | 
				
			||||||
	u8 rsv;
 | 
						u8 rsv;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct nodes_info_t {
 | 
					struct nodes_info_t {
 | 
				
			||||||
	u32 nodes_in_group; // could be 2, 3, 4, 5, 6, 7, 8
 | 
						u32 nodes_in_group; // could be 2, 3, 4, 5, 6, 7, 8
 | 
				
			||||||
	u32 groups_in_plane; // could be 1, 2, 3, 4, 5
 | 
						u32 groups_in_plane; // could be 1, 2, 3, 4, 5
 | 
				
			||||||
	u32 planes; // could be 1, 2
 | 
						u32 planes; // could be 1, 2
 | 
				
			||||||
	u32 up_planes; // down planes will be [up_planes, planes)
 | 
						u32 up_planes; // down planes will be [up_planes, planes)
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ht_link_config {
 | 
					struct ht_link_config {
 | 
				
			||||||
	uint32_t ht_speed_limit; // Speed in MHz; 0 for autodetect (default)
 | 
						uint32_t ht_speed_limit; // Speed in MHz; 0 for autodetect (default)
 | 
				
			||||||
@@ -977,7 +978,7 @@ struct sys_info {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	struct MCTStatStruc MCTstat;
 | 
						struct MCTStatStruc MCTstat;
 | 
				
			||||||
	struct DCTStatStruc DCTstatA[NODE_NUMS];
 | 
						struct DCTStatStruc DCTstatA[NODE_NUMS];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,8 @@
 | 
				
			|||||||
#ifndef AMDK8_F_H
 | 
					#ifndef AMDK8_F_H
 | 
				
			||||||
#define AMDK8_F_H
 | 
					#define AMDK8_F_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Definitions of various K8 registers */
 | 
					/* Definitions of various K8 registers */
 | 
				
			||||||
/* Function 0 */
 | 
					/* Function 0 */
 | 
				
			||||||
#define HT_TRANSACTION_CONTROL 0x68
 | 
					#define HT_TRANSACTION_CONTROL 0x68
 | 
				
			||||||
@@ -465,7 +467,7 @@ struct dimm_size {
 | 
				
			|||||||
	uint8_t col;
 | 
						uint8_t col;
 | 
				
			||||||
	uint8_t bank; //1, 2, 3 mean 2, 4, 8
 | 
						uint8_t bank; //1, 2, 3 mean 2, 4, 8
 | 
				
			||||||
	uint8_t rank;
 | 
						uint8_t rank;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mem_info { // pernode
 | 
					struct mem_info { // pernode
 | 
				
			||||||
	uint32_t dimm_mask;
 | 
						uint32_t dimm_mask;
 | 
				
			||||||
@@ -483,7 +485,7 @@ struct mem_info { // pernode
 | 
				
			|||||||
	uint8_t is_64MuxMode;
 | 
						uint8_t is_64MuxMode;
 | 
				
			||||||
	uint8_t memclk_set; // we need to use this to retrieve the mem param
 | 
						uint8_t memclk_set; // we need to use this to retrieve the mem param
 | 
				
			||||||
	uint8_t rsv[2];
 | 
						uint8_t rsv[2];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct link_pair_st {
 | 
					struct link_pair_st {
 | 
				
			||||||
	pci_devfn_t udev;
 | 
						pci_devfn_t udev;
 | 
				
			||||||
@@ -493,7 +495,7 @@ struct link_pair_st {
 | 
				
			|||||||
	uint32_t pos;
 | 
						uint32_t pos;
 | 
				
			||||||
	uint32_t offs;
 | 
						uint32_t offs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sys_info {
 | 
					struct sys_info {
 | 
				
			||||||
	uint8_t ctrl_present[NODE_NUMS];
 | 
						uint8_t ctrl_present[NODE_NUMS];
 | 
				
			||||||
@@ -516,7 +518,7 @@ struct sys_info {
 | 
				
			|||||||
	uint32_t sbdn;
 | 
						uint32_t sbdn;
 | 
				
			||||||
	uint32_t sblk;
 | 
						uint32_t sblk;
 | 
				
			||||||
	uint32_t sbbusn;
 | 
						uint32_t sbbusn;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __PRE_RAM__
 | 
					#ifdef __PRE_RAM__
 | 
				
			||||||
#include <arch/early_variables.h>
 | 
					#include <arch/early_variables.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,8 @@
 | 
				
			|||||||
#ifndef AMDK8_PRE_F_H
 | 
					#ifndef AMDK8_PRE_F_H
 | 
				
			||||||
#define AMDK8_PRE_F_H
 | 
					#define AMDK8_PRE_F_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Definitions of various K8 registers */
 | 
					/* Definitions of various K8 registers */
 | 
				
			||||||
/* Function 0 */
 | 
					/* Function 0 */
 | 
				
			||||||
#define HT_TRANSACTION_CONTROL 0x68
 | 
					#define HT_TRANSACTION_CONTROL 0x68
 | 
				
			||||||
@@ -247,7 +249,7 @@ struct link_pair_st {
 | 
				
			|||||||
	uint32_t pos;
 | 
						uint32_t pos;
 | 
				
			||||||
	uint32_t offs;
 | 
						uint32_t offs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sys_info {
 | 
					struct sys_info {
 | 
				
			||||||
	uint8_t ctrl_present[NODE_NUMS];
 | 
						uint8_t ctrl_present[NODE_NUMS];
 | 
				
			||||||
@@ -260,7 +262,7 @@ struct sys_info {
 | 
				
			|||||||
	uint32_t sbdn;
 | 
						uint32_t sbdn;
 | 
				
			||||||
	uint32_t sblk;
 | 
						uint32_t sblk;
 | 
				
			||||||
	uint32_t sbbusn;
 | 
						uint32_t sbbusn;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __PRE_RAM__
 | 
					#ifdef __PRE_RAM__
 | 
				
			||||||
#include <arch/early_variables.h>
 | 
					#include <arch/early_variables.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,7 @@
 | 
				
			|||||||
#define DQS_TRAIN_DEBUG 0
 | 
					#define DQS_TRAIN_DEBUG 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <inttypes.h>
 | 
					#include <inttypes.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include "mct_d_gcc.h"
 | 
					#include "mct_d_gcc.h"
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <northbridge/amd/amdfam10/debug.h>
 | 
					#include <northbridge/amd/amdfam10/debug.h>
 | 
				
			||||||
@@ -275,7 +276,7 @@ struct MCTStatStruc {
 | 
				
			|||||||
				      of sub 4GB dram hole for HW remapping.*/
 | 
									      of sub 4GB dram hole for HW remapping.*/
 | 
				
			||||||
	u32 Sub4GCacheTop;	/* If not zero, the 32-bit top of cacheable memory.*/
 | 
						u32 Sub4GCacheTop;	/* If not zero, the 32-bit top of cacheable memory.*/
 | 
				
			||||||
	u32 SysLimit;		/* LIMIT[39:8] (system address)*/
 | 
						u32 SysLimit;		/* LIMIT[39:8] (system address)*/
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*=============================================================================
 | 
					/*=============================================================================
 | 
				
			||||||
	Global MCT Configuration Status Word (GStatus)
 | 
						Global MCT Configuration Status Word (GStatus)
 | 
				
			||||||
@@ -321,7 +322,7 @@ struct DCTPersistentStatStruc {
 | 
				
			|||||||
		/* CHB DIMM 0 - 4 Check Byte Receiver Enable Delay*/
 | 
							/* CHB DIMM 0 - 4 Check Byte Receiver Enable Delay*/
 | 
				
			||||||
	u16 HostBiosSrvc1;	/* Word sized general purpose field for use by host BIOS.  Scratch space.*/
 | 
						u16 HostBiosSrvc1;	/* Word sized general purpose field for use by host BIOS.  Scratch space.*/
 | 
				
			||||||
	u32 HostBiosSrvc2;	/* Dword sized general purpose field for use by host BIOS.  Scratch space.*/
 | 
						u32 HostBiosSrvc2;	/* Dword sized general purpose field for use by host BIOS.  Scratch space.*/
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct DCTStatStruc {		/* A per Node structure*/
 | 
					struct DCTStatStruc {		/* A per Node structure*/
 | 
				
			||||||
@@ -549,7 +550,7 @@ struct DCTStatStruc {		/* A per Node structure*/
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/* NOTE: This must remain the last entry in this structure */
 | 
						/* NOTE: This must remain the last entry in this structure */
 | 
				
			||||||
	struct DCTPersistentStatStruc persistentData;
 | 
						struct DCTPersistentStatStruc persistentData;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*===============================================================================
 | 
					/*===============================================================================
 | 
				
			||||||
	Local Error Status Codes (DCTStatStruc.ErrCode)
 | 
						Local Error Status Codes (DCTStatStruc.ErrCode)
 | 
				
			||||||
@@ -717,7 +718,7 @@ struct amdmct_memory_info {
 | 
				
			|||||||
	struct DCTStatStruc dct_stat[MAX_NODES_SUPPORTED];
 | 
						struct DCTStatStruc dct_stat[MAX_NODES_SUPPORTED];
 | 
				
			||||||
	uint16_t ecc_enabled;
 | 
						uint16_t ecc_enabled;
 | 
				
			||||||
	uint16_t ecc_scrub_rate;
 | 
						uint16_t ecc_scrub_rate;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u32 Get_NB32(u32 dev, u32 reg);
 | 
					u32 Get_NB32(u32 dev, u32 reg);
 | 
				
			||||||
void Set_NB32(u32 dev, u32 reg, u32 val);
 | 
					void Set_NB32(u32 dev, u32 reg, u32 val);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,8 @@
 | 
				
			|||||||
#ifndef NORTHBRIDGE_INTEL_COMMON_MRC_CACHE_H
 | 
					#ifndef NORTHBRIDGE_INTEL_COMMON_MRC_CACHE_H
 | 
				
			||||||
#define NORTHBRIDGE_INTEL_COMMON_MRC_CACHE_H
 | 
					#define NORTHBRIDGE_INTEL_COMMON_MRC_CACHE_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MRC_DATA_ALIGN           0x1000
 | 
					#define MRC_DATA_ALIGN           0x1000
 | 
				
			||||||
#define MRC_DATA_SIGNATURE       (('M'<<0)|('R'<<8)|('C'<<16)|('D'<<24))
 | 
					#define MRC_DATA_SIGNATURE       (('M'<<0)|('R'<<8)|('C'<<16)|('D'<<24))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -10,7 +12,7 @@ struct mrc_data_container {
 | 
				
			|||||||
	u32	mrc_checksum;	// IP style checksum
 | 
						u32	mrc_checksum;	// IP style checksum
 | 
				
			||||||
	u32	reserved;	// For header alignment
 | 
						u32	reserved;	// For header alignment
 | 
				
			||||||
	u8	mrc_data[0];	// Variable size, platform/run time dependent.
 | 
						u8	mrc_data[0];	// Variable size, platform/run time dependent.
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mrc_data_container *find_current_mrc_cache(void);
 | 
					struct mrc_data_container *find_current_mrc_cache(void);
 | 
				
			||||||
struct mrc_data_container *store_current_mrc_cache(void *data, unsigned length);
 | 
					struct mrc_data_container *store_current_mrc_cache(void *data, unsigned length);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -186,13 +186,14 @@
 | 
				
			|||||||
#define DMIDRCCFG	0xeb4	/* 32bit */
 | 
					#define DMIDRCCFG	0xeb4	/* 32bit */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef __ASSEMBLER__
 | 
					#ifndef __ASSEMBLER__
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
static inline void barrier(void) { asm("" ::: "memory"); }
 | 
					static inline void barrier(void) { asm("" ::: "memory"); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ied_header {
 | 
					struct ied_header {
 | 
				
			||||||
	char signature[10];
 | 
						char signature[10];
 | 
				
			||||||
	u32 size;
 | 
						u32 size;
 | 
				
			||||||
	u8 reserved[34];
 | 
						u8 reserved[34];
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCI_DEVICE_ID_HSW_MOBILE 0x0c04
 | 
					#define PCI_DEVICE_ID_HSW_MOBILE 0x0c04
 | 
				
			||||||
#define PCI_DEVICE_ID_HSW_ULT 0x0a04
 | 
					#define PCI_DEVICE_ID_HSW_ULT 0x0a04
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,8 @@
 | 
				
			|||||||
#ifndef PEI_DATA_H
 | 
					#ifndef PEI_DATA_H
 | 
				
			||||||
#define PEI_DATA_H
 | 
					#define PEI_DATA_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef void (*tx_byte_func)(unsigned char byte);
 | 
					typedef void (*tx_byte_func)(unsigned char byte);
 | 
				
			||||||
#define PEI_VERSION 15
 | 
					#define PEI_VERSION 15
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -56,12 +58,12 @@ struct usb2_port_setting {
 | 
				
			|||||||
	uint8_t enable;
 | 
						uint8_t enable;
 | 
				
			||||||
	uint8_t over_current_pin;
 | 
						uint8_t over_current_pin;
 | 
				
			||||||
	uint8_t location;
 | 
						uint8_t location;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct usb3_port_setting {
 | 
					struct usb3_port_setting {
 | 
				
			||||||
	uint8_t enable;
 | 
						uint8_t enable;
 | 
				
			||||||
	uint8_t over_current_pin;
 | 
						uint8_t over_current_pin;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct pei_data
 | 
					struct pei_data
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -110,6 +112,6 @@ struct pei_data
 | 
				
			|||||||
	struct usb3_port_setting usb3_ports[MAX_USB3_PORTS];
 | 
						struct usb3_port_setting usb3_ports[MAX_USB3_PORTS];
 | 
				
			||||||
	uint8_t spd_data[4][256];
 | 
						uint8_t spd_data[4][256];
 | 
				
			||||||
	tx_byte_func tx_byte;
 | 
						tx_byte_func tx_byte;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <types.h>
 | 
					#include <types.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <arch/io.h>
 | 
					#include <arch/io.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
@@ -51,7 +52,7 @@ typedef struct {
 | 
				
			|||||||
	u32 function;
 | 
						u32 function;
 | 
				
			||||||
	u32 retsts;
 | 
						u32 retsts;
 | 
				
			||||||
	u32 rfu;
 | 
						u32 rfu;
 | 
				
			||||||
} __attribute__((packed)) banner_id_t;
 | 
					} __packed banner_id_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MSH_OK			0x0000
 | 
					#define MSH_OK			0x0000
 | 
				
			||||||
#define MSH_OK_RESTART		0x0001
 | 
					#define MSH_OK_RESTART		0x0001
 | 
				
			||||||
@@ -111,7 +112,7 @@ typedef struct {
 | 
				
			|||||||
	u16 versionmajor;
 | 
						u16 versionmajor;
 | 
				
			||||||
	u16 versionminor;
 | 
						u16 versionminor;
 | 
				
			||||||
	u32 smicombuffersize;
 | 
						u32 smicombuffersize;
 | 
				
			||||||
} __attribute__((packed)) version_t;
 | 
					} __packed version_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	u16 header_id;
 | 
						u16 header_id;
 | 
				
			||||||
@@ -122,14 +123,14 @@ typedef struct {
 | 
				
			|||||||
	u32 type;
 | 
						u32 type;
 | 
				
			||||||
	u32 header_ext;
 | 
						u32 header_ext;
 | 
				
			||||||
	u8 name[0];
 | 
						u8 name[0];
 | 
				
			||||||
} __attribute__((packed)) mbi_header_t;
 | 
					} __packed mbi_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	banner_id_t banner;
 | 
						banner_id_t banner;
 | 
				
			||||||
	u64 handle;
 | 
						u64 handle;
 | 
				
			||||||
	u32 objnum;
 | 
						u32 objnum;
 | 
				
			||||||
	mbi_header_t header;
 | 
						mbi_header_t header;
 | 
				
			||||||
} __attribute__((packed)) obj_header_t;
 | 
					} __packed obj_header_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	banner_id_t banner;
 | 
						banner_id_t banner;
 | 
				
			||||||
@@ -139,7 +140,7 @@ typedef struct {
 | 
				
			|||||||
	u32 numbytes;
 | 
						u32 numbytes;
 | 
				
			||||||
	u32 buflen;
 | 
						u32 buflen;
 | 
				
			||||||
	u32 buffer;
 | 
						u32 buffer;
 | 
				
			||||||
} __attribute__((packed)) get_object_t;
 | 
					} __packed get_object_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void mbi_call(u8 subf, banner_id_t *banner_id)
 | 
					static void mbi_call(u8 subf, banner_id_t *banner_id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,8 @@
 | 
				
			|||||||
#ifndef RAMINIT_H
 | 
					#ifndef RAMINIT_H
 | 
				
			||||||
#define RAMINIT_H
 | 
					#define RAMINIT_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DIMM_SOCKETS 2
 | 
					#define DIMM_SOCKETS 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DIMM_TCO_BASE 0x30
 | 
					#define DIMM_TCO_BASE 0x30
 | 
				
			||||||
@@ -61,7 +63,7 @@ struct sys_info {
 | 
				
			|||||||
	u8 banksize[2 * 2 * DIMM_SOCKETS];
 | 
						u8 banksize[2 * 2 * DIMM_SOCKETS];
 | 
				
			||||||
	const u8 *spd_addresses;
 | 
						const u8 *spd_addresses;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void receive_enable_adjust(struct sys_info *sysinfo);
 | 
					void receive_enable_adjust(struct sys_info *sysinfo);
 | 
				
			||||||
void sdram_initialize(int boot_path, const u8 *sdram_addresses);
 | 
					void sdram_initialize(int boot_path, const u8 *sdram_addresses);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if REAL
 | 
					#if REAL
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <arch/io.h>
 | 
					#include <arch/io.h>
 | 
				
			||||||
@@ -1906,7 +1907,7 @@ static void send_heci_uma_message(struct raminfo *info)
 | 
				
			|||||||
		u8 result;
 | 
							u8 result;
 | 
				
			||||||
		u8 field2;
 | 
							u8 field2;
 | 
				
			||||||
		u8 unk3[0x48 - 4 - 1];
 | 
							u8 unk3[0x48 - 4 - 1];
 | 
				
			||||||
	} __attribute__ ((packed)) reply;
 | 
						} __packed reply;
 | 
				
			||||||
	struct uma_message {
 | 
						struct uma_message {
 | 
				
			||||||
		u8 group_id;
 | 
							u8 group_id;
 | 
				
			||||||
		u8 cmd;
 | 
							u8 cmd;
 | 
				
			||||||
@@ -1916,7 +1917,7 @@ static void send_heci_uma_message(struct raminfo *info)
 | 
				
			|||||||
		u64 heci_uma_addr;
 | 
							u64 heci_uma_addr;
 | 
				
			||||||
		u32 memory_reserved_for_heci_mb;
 | 
							u32 memory_reserved_for_heci_mb;
 | 
				
			||||||
		u16 c3;
 | 
							u16 c3;
 | 
				
			||||||
	} __attribute__ ((packed)) msg = {
 | 
						} __packed msg = {
 | 
				
			||||||
	0, MKHI_SET_UMA, 0, 0,
 | 
						0, MKHI_SET_UMA, 0, 0,
 | 
				
			||||||
		    0x82,
 | 
							    0x82,
 | 
				
			||||||
		    info->heci_uma_addr, info->memory_reserved_for_heci_mb, 0};
 | 
							    info->heci_uma_addr, info->memory_reserved_for_heci_mb, 0};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,8 @@
 | 
				
			|||||||
#ifndef PEI_DATA_H
 | 
					#ifndef PEI_DATA_H
 | 
				
			||||||
#define PEI_DATA_H
 | 
					#define PEI_DATA_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
	uint16_t mode;                // 0: Disable, 1: Enable, 2: Auto, 3: Smart Auto
 | 
						uint16_t mode;                // 0: Disable, 1: Enable, 2: Auto, 3: Smart Auto
 | 
				
			||||||
	uint16_t hs_port_switch_mask; // 4 bit mask, 1: switchable, 0: not switchable
 | 
						uint16_t hs_port_switch_mask; // 4 bit mask, 1: switchable, 0: not switchable
 | 
				
			||||||
@@ -129,6 +131,6 @@ struct pei_data
 | 
				
			|||||||
	 * 2 Always enable double rate
 | 
						 * 2 Always enable double rate
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	int ddr_refresh_rate_config;
 | 
						int ddr_refresh_rate_config;
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
#ifndef RAMINIT_H
 | 
					#ifndef RAMINIT_H
 | 
				
			||||||
#define RAMINIT_H
 | 
					#define RAMINIT_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include "pei_data.h"
 | 
					#include "pei_data.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sys_info {
 | 
					struct sys_info {
 | 
				
			||||||
@@ -23,7 +24,7 @@ struct sys_info {
 | 
				
			|||||||
#define BOOT_PATH_NORMAL	0
 | 
					#define BOOT_PATH_NORMAL	0
 | 
				
			||||||
#define BOOT_PATH_RESET		1
 | 
					#define BOOT_PATH_RESET		1
 | 
				
			||||||
#define BOOT_PATH_RESUME	2
 | 
					#define BOOT_PATH_RESUME	2
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void sdram_initialize(struct pei_data *pei_data);
 | 
					void sdram_initialize(struct pei_data *pei_data);
 | 
				
			||||||
void save_mrc_data(struct pei_data *pei_data);
 | 
					void save_mrc_data(struct pei_data *pei_data);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 * GNU General Public License for more details.
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <console/console.h>
 | 
					#include <console/console.h>
 | 
				
			||||||
#include <console/usb.h>
 | 
					#include <console/usb.h>
 | 
				
			||||||
#include <bootmode.h>
 | 
					#include <bootmode.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@
 | 
				
			|||||||
#define AMD_PSP_H
 | 
					#define AMD_PSP_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
#include <Porting.h>
 | 
					#include <Porting.h>
 | 
				
			||||||
#include <Proc/Psp/PspBaseLib/PspBaseLib.h>
 | 
					#include <Proc/Psp/PspBaseLib/PspBaseLib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -48,7 +49,7 @@ struct psp_mbox {
 | 
				
			|||||||
	u32 mbox_command;
 | 
						u32 mbox_command;
 | 
				
			||||||
	u32 mbox_status;
 | 
						u32 mbox_status;
 | 
				
			||||||
	u64 cmd_response; /* definition conflicts w/BKDG but matches agesa */
 | 
						u64 cmd_response; /* definition conflicts w/BKDG but matches agesa */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* command/response format, BIOS builds this in memory
 | 
					/* command/response format, BIOS builds this in memory
 | 
				
			||||||
 *   mbox_buffer_header: generic header
 | 
					 *   mbox_buffer_header: generic header
 | 
				
			||||||
@@ -59,7 +60,7 @@ struct psp_mbox {
 | 
				
			|||||||
struct mbox_buffer_header {
 | 
					struct mbox_buffer_header {
 | 
				
			||||||
	u32 size;	/* total size of buffer */
 | 
						u32 size;	/* total size of buffer */
 | 
				
			||||||
	u32 status;	/* command status, filled by PSP if applicable */
 | 
						u32 status;	/* command status, filled by PSP if applicable */
 | 
				
			||||||
} __attribute__ ((packed));
 | 
					} __packed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* command-specific buffer definitions:  see NDA document #54267
 | 
					/* command-specific buffer definitions:  see NDA document #54267
 | 
				
			||||||
 *   todo: create new definitions here for additional c2p_mbox_command commands
 | 
					 *   todo: create new definitions here for additional c2p_mbox_command commands
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@
 | 
				
			|||||||
#include <intelblocks/cse.h>
 | 
					#include <intelblocks/cse.h>
 | 
				
			||||||
#include <soc/pci_devs.h>
 | 
					#include <soc/pci_devs.h>
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <compiler.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PCI_ME_HFSTS1	0x40
 | 
					#define PCI_ME_HFSTS1	0x40
 | 
				
			||||||
#define PCI_ME_HFSTS2	0x48
 | 
					#define PCI_ME_HFSTS2	0x48
 | 
				
			||||||
@@ -69,7 +70,7 @@ static int read_cse_file(const char *path, void *buff, size_t *size,
 | 
				
			|||||||
			uint32_t is_response: 1;
 | 
								uint32_t is_response: 1;
 | 
				
			||||||
			uint32_t reserved: 8;
 | 
								uint32_t reserved: 8;
 | 
				
			||||||
			uint32_t result: 8;
 | 
								uint32_t result: 8;
 | 
				
			||||||
		} __attribute__ ((packed)) fields;
 | 
							} __packed fields;
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct mca_command {
 | 
						struct mca_command {
 | 
				
			||||||
@@ -78,13 +79,13 @@ static int read_cse_file(const char *path, void *buff, size_t *size,
 | 
				
			|||||||
		uint32_t offset;
 | 
							uint32_t offset;
 | 
				
			||||||
		uint32_t data_size;
 | 
							uint32_t data_size;
 | 
				
			||||||
		uint8_t flags;
 | 
							uint8_t flags;
 | 
				
			||||||
	} __attribute__ ((packed)) msg;
 | 
						} __packed msg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct mca_response {
 | 
						struct mca_response {
 | 
				
			||||||
		union mkhi_header mkhi_hdr;
 | 
							union mkhi_header mkhi_hdr;
 | 
				
			||||||
		uint32_t data_size;
 | 
							uint32_t data_size;
 | 
				
			||||||
		uint8_t buffer[128];
 | 
							uint8_t buffer[128];
 | 
				
			||||||
	} __attribute__ ((packed)) rmsg;
 | 
						} __packed rmsg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (sizeof(rmsg.buffer) < *size) {
 | 
						if (sizeof(rmsg.buffer) < *size) {
 | 
				
			||||||
		printk(BIOS_ERR, "internal buffer is too small\n");
 | 
							printk(BIOS_ERR, "internal buffer is too small\n");
 | 
				
			||||||
 
 | 
				
			|||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user