Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 1 | /* |
| 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 Reinauer | 3c53d33 | 2012-09-26 17:33:39 -0700 | [diff] [blame^] | 21 | #define IFDTOOL_VERSION "1.1" |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 22 | |
| 23 | enum spi_frequency { |
| 24 | SPI_FREQUENCY_20MHZ = 0, |
| 25 | SPI_FREQUENCY_33MHZ = 1, |
| 26 | SPI_FREQUENCY_50MHZ = 4, |
| 27 | }; |
| 28 | |
Stefan Reinauer | 1b1309f | 2012-05-11 15:53:43 -0700 | [diff] [blame] | 29 | enum component_density { |
| 30 | COMPONENT_DENSITY_512KB = 0, |
| 31 | COMPONENT_DENSITY_1MB = 1, |
| 32 | COMPONENT_DENSITY_2MB = 2, |
| 33 | COMPONENT_DENSITY_4MB = 3, |
| 34 | COMPONENT_DENSITY_8MB = 4, |
| 35 | COMPONENT_DENSITY_16MB = 5, |
| 36 | }; |
| 37 | |
Stefan Reinauer | 1c795ad1 | 2011-10-14 12:49:41 -0700 | [diff] [blame] | 38 | // flash descriptor |
| 39 | typedef struct { |
| 40 | uint32_t flvalsig; |
| 41 | uint32_t flmap0; |
| 42 | uint32_t flmap1; |
| 43 | uint32_t flmap2; |
| 44 | uint8_t reserved[0xefc - 0x20]; |
| 45 | uint32_t flumap1; |
| 46 | } __attribute__((packed)) fdbar_t; |
| 47 | |
| 48 | // regions |
| 49 | typedef struct { |
| 50 | uint32_t flreg0; |
| 51 | uint32_t flreg1; |
| 52 | uint32_t flreg2; |
| 53 | uint32_t flreg3; |
| 54 | uint32_t flreg4; |
| 55 | } __attribute__((packed)) frba_t; |
| 56 | |
| 57 | // component section |
| 58 | typedef struct { |
| 59 | uint32_t flcomp; |
| 60 | uint32_t flill; |
| 61 | uint32_t flpb; |
| 62 | } __attribute__((packed)) fcba_t; |
| 63 | |
| 64 | // pch strap |
| 65 | typedef struct { |
| 66 | uint32_t pchstrp0; |
| 67 | uint32_t pchstrp1; |
| 68 | uint32_t pchstrp2; |
| 69 | uint32_t pchstrp3; |
| 70 | uint32_t pchstrp4; |
| 71 | uint32_t pchstrp5; |
| 72 | uint32_t pchstrp6; |
| 73 | uint32_t pchstrp7; |
| 74 | uint32_t pchstrp8; |
| 75 | uint32_t pchstrp9; |
| 76 | uint32_t pchstrp10; |
| 77 | uint32_t pchstrp11; |
| 78 | uint32_t pchstrp12; |
| 79 | uint32_t pchstrp13; |
| 80 | uint32_t pchstrp14; |
| 81 | uint32_t pchstrp15; |
| 82 | } __attribute__((packed)) fpsba_t; |
| 83 | |
| 84 | // master |
| 85 | typedef struct { |
| 86 | uint32_t flmstr1; |
| 87 | uint32_t flmstr2; |
| 88 | uint32_t flmstr3; |
| 89 | } __attribute__((packed)) fmba_t; |
| 90 | |
| 91 | // processor strap |
| 92 | typedef struct { |
| 93 | uint32_t data[8]; |
| 94 | } __attribute__((packed)) fmsba_t; |
| 95 | |
| 96 | |