summaryrefslogtreecommitdiff
path: root/util/ifdtool/ifdtool.h
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2011-10-14 12:49:41 -0700
committerPatrick Georgi <patrick@georgi-clan.de>2011-10-22 10:40:18 +0200
commit1c795ad109bd382ff75e92d83f5721b8ed7c3be1 (patch)
treea1db7ff85704000af2b3916bb689a17454e79216 /util/ifdtool/ifdtool.h
parentc31c4de681738fc264333cb12aecdb995b119a94 (diff)
downloadcoreboot-1c795ad109bd382ff75e92d83f5721b8ed7c3be1.tar.xz
Add ifdtool, utility to read / modify Intel Firmware Descriptor images
Change-Id: Ie78b97bf573d238d0dff9a663e774deb1b7dea44 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/272 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'util/ifdtool/ifdtool.h')
-rw-r--r--util/ifdtool/ifdtool.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h
new file mode 100644
index 0000000000..057153434d
--- /dev/null
+++ b/util/ifdtool/ifdtool.h
@@ -0,0 +1,87 @@
+/*
+ * ifdtool - dump Intel Firmware Descriptor information
+ *
+ * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ */
+
+#include <stdint.h>
+#define IFDTOOL_VERSION "1.0"
+
+enum spi_frequency {
+ SPI_FREQUENCY_20MHZ = 0,
+ SPI_FREQUENCY_33MHZ = 1,
+ SPI_FREQUENCY_50MHZ = 4,
+};
+
+// flash descriptor
+typedef struct {
+ uint32_t flvalsig;
+ uint32_t flmap0;
+ uint32_t flmap1;
+ uint32_t flmap2;
+ uint8_t reserved[0xefc - 0x20];
+ uint32_t flumap1;
+} __attribute__((packed)) fdbar_t;
+
+// regions
+typedef struct {
+ uint32_t flreg0;
+ uint32_t flreg1;
+ uint32_t flreg2;
+ uint32_t flreg3;
+ uint32_t flreg4;
+} __attribute__((packed)) frba_t;
+
+// component section
+typedef struct {
+ uint32_t flcomp;
+ uint32_t flill;
+ uint32_t flpb;
+} __attribute__((packed)) fcba_t;
+
+// pch strap
+typedef struct {
+ uint32_t pchstrp0;
+ uint32_t pchstrp1;
+ uint32_t pchstrp2;
+ uint32_t pchstrp3;
+ uint32_t pchstrp4;
+ uint32_t pchstrp5;
+ uint32_t pchstrp6;
+ uint32_t pchstrp7;
+ uint32_t pchstrp8;
+ uint32_t pchstrp9;
+ uint32_t pchstrp10;
+ uint32_t pchstrp11;
+ uint32_t pchstrp12;
+ uint32_t pchstrp13;
+ uint32_t pchstrp14;
+ uint32_t pchstrp15;
+} __attribute__((packed)) fpsba_t;
+
+// master
+typedef struct {
+ uint32_t flmstr1;
+ uint32_t flmstr2;
+ uint32_t flmstr3;
+} __attribute__((packed)) fmba_t;
+
+// processor strap
+typedef struct {
+ uint32_t data[8];
+} __attribute__((packed)) fmsba_t;
+
+