pei_data.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2011, Google Inc.
  4. */
  5. #ifndef ASM_ARCH_PEI_DATA_H
  6. #define ASM_ARCH_PEI_DATA_H
  7. #include <linux/linkage.h>
  8. struct pch_usb3_controller_settings {
  9. /* 0: Disable, 1: Enable, 2: Auto, 3: Smart Auto */
  10. uint16_t mode;
  11. /* 4 bit mask, 1: switchable, 0: not switchable */
  12. uint16_t hs_port_switch_mask;
  13. /* 0: No xHCI preOS driver, 1: xHCI preOS driver */
  14. uint16_t preboot_support;
  15. /* 0: Disable, 1: Enable */
  16. uint16_t xhci_streams;
  17. };
  18. typedef asmlinkage void (*tx_byte_func)(unsigned char byte);
  19. #define PEI_VERSION 6
  20. struct __packed pei_data {
  21. uint32_t pei_version;
  22. uint32_t mchbar;
  23. uint32_t dmibar;
  24. uint32_t epbar;
  25. uint32_t pciexbar;
  26. uint16_t smbusbar;
  27. uint32_t wdbbar;
  28. uint32_t wdbsize;
  29. uint32_t hpet_address;
  30. uint32_t rcba;
  31. uint32_t pmbase;
  32. uint32_t gpiobase;
  33. uint32_t thermalbase;
  34. uint32_t system_type; /* 0 Mobile, 1 Desktop/Server */
  35. uint32_t tseg_size;
  36. uint8_t spd_addresses[4];
  37. uint8_t ts_addresses[4];
  38. int boot_mode;
  39. int ec_present;
  40. int gbe_enable;
  41. /*
  42. * 0 = leave channel enabled
  43. * 1 = disable dimm 0 on channel
  44. * 2 = disable dimm 1 on channel
  45. * 3 = disable dimm 0+1 on channel
  46. */
  47. int dimm_channel0_disabled;
  48. int dimm_channel1_disabled;
  49. /* Seed values saved in CMOS */
  50. uint32_t scrambler_seed;
  51. uint32_t scrambler_seed_s3;
  52. /* Data read from flash and passed into MRC */
  53. unsigned char *mrc_input;
  54. unsigned int mrc_input_len;
  55. /* Data from MRC that should be saved to flash */
  56. unsigned char *mrc_output;
  57. unsigned int mrc_output_len;
  58. /*
  59. * Max frequency DDR3 could be ran at. Could be one of four values:
  60. * 800, 1067, 1333, 1600
  61. */
  62. uint32_t max_ddr3_freq;
  63. /*
  64. * USB Port Configuration:
  65. * [0] = enable
  66. * [1] = overcurrent pin
  67. * [2] = length
  68. *
  69. * Ports 0-7 can be mapped to OC0-OC3
  70. * Ports 8-13 can be mapped to OC4-OC7
  71. *
  72. * Port Length
  73. * MOBILE:
  74. * < 0x050 = Setting 1 (back panel, 1-5in, lowest tx amplitude)
  75. * < 0x140 = Setting 2 (back panel, 5-14in, highest tx amplitude)
  76. * DESKTOP:
  77. * < 0x080 = Setting 1 (front/back panel, <8in, lowest tx amplitude)
  78. * < 0x130 = Setting 2 (back panel, 8-13in, higher tx amplitude)
  79. * < 0x150 = Setting 3 (back panel, 13-15in, higest tx amplitude)
  80. */
  81. uint16_t usb_port_config[16][3];
  82. /* See the usb3 struct above for details */
  83. struct pch_usb3_controller_settings usb3;
  84. /*
  85. * SPD data array for onboard RAM. Specify address 0xf0,
  86. * 0xf1, 0xf2, 0xf3 to index one of the 4 slots in
  87. * spd_address for a given "DIMM".
  88. */
  89. uint8_t spd_data[4][256];
  90. tx_byte_func tx_byte;
  91. int ddr3lv_support;
  92. /*
  93. * pcie_init needs to be set to 1 to have the system agent initialise
  94. * PCIe. Note: This should only be required if your system has Gen3
  95. * devices and it will increase your boot time by at least 100ms.
  96. */
  97. int pcie_init;
  98. /*
  99. * N mode functionality. Leave this setting at 0.
  100. * 0 Auto
  101. * 1 1N
  102. * 2 2N
  103. */
  104. int nmode;
  105. /*
  106. * DDR refresh rate config. JEDEC Standard No.21-C Annex K allows
  107. * for DIMM SPD data to specify whether double-rate is required for
  108. * extended operating temperature range.
  109. * 0 Enable double rate based upon temperature thresholds
  110. * 1 Normal rate
  111. * 2 Always enable double rate
  112. */
  113. int ddr_refresh_rate_config;
  114. };
  115. #endif