ifdtool.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * ifdtool - Manage Intel Firmware Descriptor information
  4. *
  5. * Copyright (C) 2011 The ChromiumOS Authors.
  6. *
  7. * From Coreboot project
  8. */
  9. #include <stdint.h>
  10. #define __packed __attribute__((packed))
  11. #define IFDTOOL_VERSION "1.1-U-Boot"
  12. #define WRITE_MAX 16
  13. enum spi_frequency {
  14. SPI_FREQUENCY_20MHZ = 0,
  15. SPI_FREQUENCY_33MHZ = 1,
  16. SPI_FREQUENCY_50MHZ = 4,
  17. };
  18. enum component_density {
  19. COMPONENT_DENSITY_512KB = 0,
  20. COMPONENT_DENSITY_1MB = 1,
  21. COMPONENT_DENSITY_2MB = 2,
  22. COMPONENT_DENSITY_4MB = 3,
  23. COMPONENT_DENSITY_8MB = 4,
  24. COMPONENT_DENSITY_16MB = 5,
  25. };
  26. /* flash descriptor */
  27. struct __packed fdbar_t {
  28. uint32_t flvalsig;
  29. uint32_t flmap0;
  30. uint32_t flmap1;
  31. uint32_t flmap2;
  32. uint8_t reserved[0xefc - 0x20];
  33. uint32_t flumap1;
  34. };
  35. #define MAX_REGIONS 5
  36. /* regions */
  37. struct __packed frba_t {
  38. uint32_t flreg[MAX_REGIONS];
  39. };
  40. /* component section */
  41. struct __packed fcba_t {
  42. uint32_t flcomp;
  43. uint32_t flill;
  44. uint32_t flpb;
  45. };
  46. #define MAX_STRAPS 18
  47. /* pch strap */
  48. struct __packed fpsba_t {
  49. uint32_t pchstrp[MAX_STRAPS];
  50. };
  51. /* master */
  52. struct __packed fmba_t {
  53. uint32_t flmstr1;
  54. uint32_t flmstr2;
  55. uint32_t flmstr3;
  56. };
  57. /* processor strap */
  58. struct __packed fmsba_t {
  59. uint32_t data[8];
  60. };
  61. /* ME VSCC */
  62. struct vscc_t {
  63. uint32_t jid;
  64. uint32_t vscc;
  65. };
  66. struct vtba_t {
  67. /* Actual number of entries specified in vtl */
  68. struct vscc_t entry[8];
  69. };
  70. struct region_t {
  71. int base, limit, size;
  72. };