ventana_eeprom.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2013 Gateworks Corporation
  4. */
  5. #ifndef _VENTANA_EEPROM_
  6. #define _VENTANA_EEPROM_
  7. struct ventana_board_info {
  8. u8 mac0[6]; /* 0x00: MAC1 */
  9. u8 mac1[6]; /* 0x06: MAC2 */
  10. u8 res0[12]; /* 0x0C: reserved */
  11. u32 serial; /* 0x18: Serial Number (read only) */
  12. u8 res1[4]; /* 0x1C: reserved */
  13. u8 mfgdate[4]; /* 0x20: MFG date (read only) */
  14. u8 res2[7]; /* 0x24 */
  15. /* sdram config */
  16. u8 sdram_size; /* 0x2B: (16 << n) MB */
  17. u8 sdram_speed; /* 0x2C: (33.333 * n) MHz */
  18. u8 sdram_width; /* 0x2D: (8 << n) bit */
  19. /* cpu config */
  20. u8 cpu_speed; /* 0x2E: (33.333 * n) MHz */
  21. u8 cpu_type; /* 0x2F: 7=imx6q, 8=imx6dl */
  22. u8 model[16]; /* 0x30: model string */
  23. /* FLASH config */
  24. u8 nand_flash_size; /* 0x40: (8 << (n-1)) MB */
  25. u8 spi_flash_size; /* 0x41: (4 << (n-1)) MB */
  26. /* Config1: SoC Peripherals */
  27. u8 config[8]; /* 0x42: loading options */
  28. u8 res3[4]; /* 0x4A */
  29. u8 chksum[2]; /* 0x4E */
  30. };
  31. /* config bits */
  32. enum {
  33. EECONFIG_ETH0,
  34. EECONFIG_ETH1,
  35. EECONFIG_HDMI_OUT,
  36. EECONFIG_SATA,
  37. EECONFIG_PCIE,
  38. EECONFIG_SSI0,
  39. EECONFIG_SSI1,
  40. EECONFIG_LCD,
  41. EECONFIG_LVDS0,
  42. EECONFIG_LVDS1,
  43. EECONFIG_USB0,
  44. EECONFIG_USB1,
  45. EECONFIG_SD0,
  46. EECONFIG_SD1,
  47. EECONFIG_SD2,
  48. EECONFIG_SD3,
  49. EECONFIG_UART0,
  50. EECONFIG_UART1,
  51. EECONFIG_UART2,
  52. EECONFIG_UART3,
  53. EECONFIG_UART4,
  54. EECONFIG_IPU0,
  55. EECONFIG_IPU1,
  56. EECONFIG_FLEXCAN,
  57. EECONFIG_MIPI_DSI,
  58. EECONFIG_MIPI_CSI,
  59. EECONFIG_TZASC0,
  60. EECONFIG_TZASC1,
  61. EECONFIG_I2C0,
  62. EECONFIG_I2C1,
  63. EECONFIG_I2C2,
  64. EECONFIG_VPU,
  65. EECONFIG_CSI0,
  66. EECONFIG_CSI1,
  67. EECONFIG_CAAM,
  68. EECONFIG_MEZZ,
  69. EECONFIG_RES1,
  70. EECONFIG_RES2,
  71. EECONFIG_RES3,
  72. EECONFIG_RES4,
  73. EECONFIG_ESPCI0,
  74. EECONFIG_ESPCI1,
  75. EECONFIG_ESPCI2,
  76. EECONFIG_ESPCI3,
  77. EECONFIG_ESPCI4,
  78. EECONFIG_ESPCI5,
  79. EECONFIG_RES5,
  80. EECONFIG_RES6,
  81. EECONFIG_GPS,
  82. EECONFIG_SPIFL0,
  83. EECONFIG_SPIFL1,
  84. EECONFIG_GSPBATT,
  85. EECONFIG_HDMI_IN,
  86. EECONFIG_VID_OUT,
  87. EECONFIG_VID_IN,
  88. EECONFIG_NAND,
  89. EECONFIG_RES8,
  90. EECONFIG_RES9,
  91. EECONFIG_RES10,
  92. EECONFIG_RES11,
  93. EECONFIG_RES12,
  94. EECONFIG_RES13,
  95. EECONFIG_RES14,
  96. EECONFIG_RES15,
  97. };
  98. enum {
  99. GW54proto, /* original GW5400-A prototype */
  100. GW51xx,
  101. GW52xx,
  102. GW53xx,
  103. GW54xx,
  104. GW551x,
  105. GW552x,
  106. GW553x,
  107. GW560x,
  108. GW5901,
  109. GW5902,
  110. GW5903,
  111. GW5904,
  112. GW5905,
  113. GW5906,
  114. GW5907,
  115. GW5908,
  116. GW5909,
  117. GW_UNKNOWN,
  118. GW_BADCRC,
  119. };
  120. /* config items */
  121. struct ventana_eeprom_config {
  122. const char *name; /* name of item */
  123. const char *dtalias; /* name of dt node to remove if not set */
  124. int bit; /* bit within config */
  125. };
  126. extern struct ventana_eeprom_config econfig[];
  127. extern struct ventana_board_info ventana_info;
  128. int read_eeprom(int bus, struct ventana_board_info *);
  129. #endif