2011-10-14 21:49:41 +02:00
|
|
|
/*
|
|
|
|
* 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
|
Remove address from GPLv2 headers
As per discussion with lawyers[tm], it's not a good idea to
shorten the license header too much - not for legal reasons
but because there are tools that look for them, and giving
them a standard pattern simplifies things.
However, we got confirmation that we don't have to update
every file ever added to coreboot whenever the FSF gets a
new lease, but can drop the address instead.
util/kconfig is excluded because that's imported code that
we may want to synchronize every now and then.
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} +
$ find * -type f
-a \! -name \*.patch \
-a \! -name \*_shipped \
-a \! -name LICENSE_GPL \
-a \! -name LGPL.txt \
-a \! -name COPYING \
-a \! -name DISCLAIMER \
-exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} +
Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9233
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2015-03-26 15:17:45 +01:00
|
|
|
* Foundation, Inc.
|
2011-10-14 21:49:41 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2012-09-27 02:33:39 +02:00
|
|
|
#define IFDTOOL_VERSION "1.1"
|
2011-10-14 21:49:41 +02:00
|
|
|
|
2014-02-26 19:30:13 +01:00
|
|
|
#define LAYOUT_LINELEN 80
|
|
|
|
|
2011-10-14 21:49:41 +02:00
|
|
|
enum spi_frequency {
|
|
|
|
SPI_FREQUENCY_20MHZ = 0,
|
|
|
|
SPI_FREQUENCY_33MHZ = 1,
|
|
|
|
SPI_FREQUENCY_50MHZ = 4,
|
|
|
|
};
|
|
|
|
|
2012-05-12 00:53:43 +02:00
|
|
|
enum component_density {
|
|
|
|
COMPONENT_DENSITY_512KB = 0,
|
|
|
|
COMPONENT_DENSITY_1MB = 1,
|
|
|
|
COMPONENT_DENSITY_2MB = 2,
|
|
|
|
COMPONENT_DENSITY_4MB = 3,
|
|
|
|
COMPONENT_DENSITY_8MB = 4,
|
|
|
|
COMPONENT_DENSITY_16MB = 5,
|
|
|
|
};
|
|
|
|
|
2011-10-14 21:49:41 +02:00
|
|
|
// 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;
|
2012-09-27 21:42:15 +02:00
|
|
|
uint32_t pchstrp16;
|
|
|
|
uint32_t pchstrp17;
|
2011-10-14 21:49:41 +02:00
|
|
|
} __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;
|
|
|
|
|
2012-09-27 21:42:15 +02:00
|
|
|
// ME VSCC
|
|
|
|
typedef struct {
|
|
|
|
uint32_t jid;
|
|
|
|
uint32_t vscc;
|
|
|
|
} vscc_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
// Actual number of entries specified in vtl
|
|
|
|
vscc_t entry[8];
|
|
|
|
} vtba_t;
|
2011-10-14 21:49:41 +02:00
|
|
|
|
2012-09-27 21:42:15 +02:00
|
|
|
typedef struct {
|
|
|
|
int base, limit, size;
|
|
|
|
} region_t;
|
2014-02-26 19:30:13 +01:00
|
|
|
|
|
|
|
struct region_name {
|
|
|
|
char *pretty;
|
|
|
|
char *terse;
|
|
|
|
};
|