blob: ed8f440bd1de9f9f0b91fcb4dca781f81a8b23d4 [file] [log] [blame]
Stefan Reinauer1c795ad12011-10-14 12:49:41 -07001/*
2 * ifdtool - dump Intel Firmware Descriptor information
3 *
4 * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
18 */
19
20#include <stdint.h>
Stefan Reinauer3c53d332012-09-26 17:33:39 -070021#define IFDTOOL_VERSION "1.1"
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070022
Chris Douglass03ce0142014-02-26 13:30:13 -050023#define LAYOUT_LINELEN 80
24
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070025enum spi_frequency {
26 SPI_FREQUENCY_20MHZ = 0,
27 SPI_FREQUENCY_33MHZ = 1,
28 SPI_FREQUENCY_50MHZ = 4,
29};
30
Stefan Reinauer1b1309f2012-05-11 15:53:43 -070031enum component_density {
32 COMPONENT_DENSITY_512KB = 0,
33 COMPONENT_DENSITY_1MB = 1,
34 COMPONENT_DENSITY_2MB = 2,
35 COMPONENT_DENSITY_4MB = 3,
36 COMPONENT_DENSITY_8MB = 4,
37 COMPONENT_DENSITY_16MB = 5,
38};
39
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070040// flash descriptor
41typedef struct {
42 uint32_t flvalsig;
43 uint32_t flmap0;
44 uint32_t flmap1;
45 uint32_t flmap2;
46 uint8_t reserved[0xefc - 0x20];
47 uint32_t flumap1;
48} __attribute__((packed)) fdbar_t;
49
50// regions
51typedef struct {
52 uint32_t flreg0;
53 uint32_t flreg1;
54 uint32_t flreg2;
55 uint32_t flreg3;
56 uint32_t flreg4;
57} __attribute__((packed)) frba_t;
58
59// component section
60typedef struct {
61 uint32_t flcomp;
62 uint32_t flill;
63 uint32_t flpb;
64} __attribute__((packed)) fcba_t;
65
66// pch strap
67typedef struct {
68 uint32_t pchstrp0;
69 uint32_t pchstrp1;
70 uint32_t pchstrp2;
71 uint32_t pchstrp3;
72 uint32_t pchstrp4;
73 uint32_t pchstrp5;
74 uint32_t pchstrp6;
75 uint32_t pchstrp7;
76 uint32_t pchstrp8;
77 uint32_t pchstrp9;
78 uint32_t pchstrp10;
79 uint32_t pchstrp11;
80 uint32_t pchstrp12;
81 uint32_t pchstrp13;
82 uint32_t pchstrp14;
83 uint32_t pchstrp15;
Stefan Reinauer4a17d292012-09-27 12:42:15 -070084 uint32_t pchstrp16;
85 uint32_t pchstrp17;
Stefan Reinauer1c795ad12011-10-14 12:49:41 -070086} __attribute__((packed)) fpsba_t;
87
88// master
89typedef struct {
90 uint32_t flmstr1;
91 uint32_t flmstr2;
92 uint32_t flmstr3;
93} __attribute__((packed)) fmba_t;
94
95// processor strap
96typedef struct {
97 uint32_t data[8];
98} __attribute__((packed)) fmsba_t;
99
Stefan Reinauer4a17d292012-09-27 12:42:15 -0700100// ME VSCC
101typedef struct {
102 uint32_t jid;
103 uint32_t vscc;
104} vscc_t;
Stefan Reinauer1c795ad12011-10-14 12:49:41 -0700105
Stefan Reinauer4a17d292012-09-27 12:42:15 -0700106typedef struct {
107 // Actual number of entries specified in vtl
108 vscc_t entry[8];
109} vtba_t;
110
111typedef struct {
112 int base, limit, size;
113} region_t;
Chris Douglass03ce0142014-02-26 13:30:13 -0500114
115struct region_name {
116 char *pretty;
117 char *terse;
118};