You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

364 lines
9.5 KiB

4 years ago
3 years ago
4 years ago
  1. """Definition of boards and/or ids"""
  2. # Allow for aligned constant definitions:
  3. BEAGLEBONE = "BEAGLEBONE"
  4. BEAGLEBONE_BLACK = "BEAGLEBONE_BLACK"
  5. BEAGLEBONE_BLUE = "BEAGLEBONE_BLUE"
  6. BEAGLEBONE_BLACK_WIRELESS = "BEAGLEBONE_BLACK_WIRELESS"
  7. BEAGLEBONE_POCKETBEAGLE = "BEAGLEBONE_POCKETBEAGLE"
  8. BEAGLEBONE_GREEN = "BEAGLEBONE_GREEN"
  9. BEAGLEBONE_GREEN_WIRELESS = "BEAGLEBONE_GREEN_WIRELESS"
  10. BEAGLEBONE_BLACK_INDUSTRIAL = "BEAGLEBONE_BLACK_INDUSTRIAL"
  11. BEAGLEBONE_ENHANCED = "BEAGLEBONE_ENHANCED"
  12. BEAGLEBONE_USOMIQ = "BEAGLEBONE_USOMIQ"
  13. BEAGLEBONE_AIR = "BEAGLEBONE_AIR"
  14. BEAGLEBONE_POCKETBONE = "BEAGLEBONE_POCKETBONE"
  15. BEAGLELOGIC_STANDALONE = "BEAGLELOGIC_STANDALONE"
  16. OSD3358_DEV_BOARD = "OSD3358_DEV_BOARD"
  17. OSD3358_SM_RED = "OSD3358_SM_RED"
  18. FEATHER_HUZZAH = "FEATHER_HUZZAH"
  19. FEATHER_M0_EXPRESS = "FEATHER_M0_EXPRESS"
  20. GENERIC_LINUX_PC = "GENERIC_LINUX_PC"
  21. PYBOARD = "PYBOARD"
  22. NODEMCU = "NODEMCU"
  23. GIANT_BOARD = "GIANT_BOARD"
  24. # ASUS Tinker Boards
  25. ASUS_TINKER_BOARD = "ASUS_TINKER_BOARD"
  26. # Clockwork Pi boards
  27. CLOCKWORK_CPI3 = "CLOCKWORK_CPI3"
  28. # Orange Pi boards
  29. ORANGE_PI_PC = "ORANGE_PI_PC"
  30. ORANGE_PI_R1 = "ORANGE_PI_R1"
  31. ORANGE_PI_ZERO = "ORANGE_PI_ZERO"
  32. ORANGE_PI_ONE = "ORANGE_PI_ONE"
  33. ORANGE_PI_LITE = "ORANGE_PI_LITE"
  34. ORANGE_PI_PC_PLUS = "ORANGE_PI_PC_PLUS"
  35. ORANGE_PI_PLUS_2E = "ORANGE_PI_PLUS_2E"
  36. ORANGE_PI_2 = "ORANGE_PI_2"
  37. # NVIDIA Jetson boards
  38. JETSON_TX1 = "JETSON_TX1"
  39. JETSON_TX2 = "JETSON_TX2"
  40. JETSON_XAVIER = "JETSON_XAVIER"
  41. JETSON_NANO = "JETSON_NANO"
  42. JETSON_NX = "JETSON_NX"
  43. # Google Coral dev board
  44. CORAL_EDGE_TPU_DEV = "CORAL_EDGE_TPU_DEV"
  45. # Xilinx PYNQ FPGA dev boards
  46. PYNQ_Z1 = "PYNQ_Z1"
  47. PYNQ_Z2 = "PYNQ_Z2"
  48. # STM32 MPU boards
  49. STM32MP157C_DK2 = "STM32MP157C_DK2"
  50. # Various Raspberry Pi models
  51. RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
  52. RASPBERRY_PI_B_REV2 = "RASPBERRY_PI_B_REV2"
  53. RASPBERRY_PI_B_PLUS = "RASPBERRY_PI_B_PLUS"
  54. RASPBERRY_PI_A = "RASPBERRY_PI_A"
  55. RASPBERRY_PI_A_PLUS = "RASPBERRY_PI_A_PLUS"
  56. RASPBERRY_PI_CM1 = "RASPBERRY_PI_CM1"
  57. RASPBERRY_PI_ZERO = "RASPBERRY_PI_ZERO"
  58. RASPBERRY_PI_ZERO_W = "RASPBERRY_PI_ZERO_W"
  59. RASPBERRY_PI_2B = "RASPBERRY_PI_2B"
  60. RASPBERRY_PI_3B = "RASPBERRY_PI_3B"
  61. RASPBERRY_PI_3B_PLUS = "RASPBERRY_PI_3B_PLUS"
  62. RASPBERRY_PI_CM3 = "RASPBERRY_PI_CM3"
  63. RASPBERRY_PI_3A_PLUS = "RASPBERRY_PI_3A_PLUS"
  64. RASPBERRY_PI_CM3_PLUS = "RASPBERRY_PI_CM3_PLUS"
  65. RASPBERRY_PI_4B = "RASPBERRY_PI_4B"
  66. RASPBERRY_PI_AVNET_IIOT_GW = "RASPBERY_PI_AVNET_IIOT_GW"
  67. ODROID_C1 = "ODROID_C1"
  68. ODROID_C1_PLUS = "ODROID_C1_PLUS"
  69. ODROID_C2 = "ODROID_C2"
  70. ODROID_C4 = "ODROID_C4"
  71. ODROID_N2 = "ODROID_N2"
  72. ODROID_XU4 = "ODROID_XU4"
  73. FTDI_FT232H = "FTDI_FT232H"
  74. DRAGONBOARD_410C = "DRAGONBOARD_410C"
  75. SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED"
  76. MICROCHIP_MCP2221 = "MICROCHIP_MCP2221"
  77. BINHO_NOVA = "BINHO_NOVA"
  78. ONION_OMEGA = "ONION_OMEGA"
  79. ONION_OMEGA2 = "ONION_OMEGA2"
  80. PINE64 = "PINE64"
  81. PINEBOOK = "PINEBOOK"
  82. PINEPHONE = "PINEPHONE"
  83. ROCK_PI_S = "ROCK_PI_S"
  84. GREATFET_ONE = "GREATFET_ONE"
  85. # Udoo boards
  86. UDOO_BOLT_V3 = "UDOO_BOLT_V3"
  87. UDOO_BOLT_V8 = "UDOO_BOLT_V8"
  88. UDOO_X86 = "UDOO_X86"
  89. # Asus Tinkerboard
  90. _ASUS_TINKER_BOARD_IDS = (ASUS_TINKER_BOARD,)
  91. # STM32MP1
  92. _STM32MP1_IDS = (STM32MP157C_DK2,)
  93. # OrangePI
  94. _ORANGE_PI_IDS = (
  95. ORANGE_PI_PC,
  96. ORANGE_PI_R1,
  97. ORANGE_PI_ZERO,
  98. ORANGE_PI_ONE,
  99. ORANGE_PI_LITE,
  100. ORANGE_PI_PC_PLUS,
  101. ORANGE_PI_PLUS_2E,
  102. ORANGE_PI_2,
  103. )
  104. _CORAL_IDS = (CORAL_EDGE_TPU_DEV,)
  105. _PYNQ_IDS = (PYNQ_Z1, PYNQ_Z2)
  106. _JETSON_IDS = {
  107. JETSON_TX1: ("nvidia,p2371-2180", "nvidia,jetson-cv"),
  108. JETSON_TX2: (
  109. "nvidia,p2771-0000",
  110. "nvidia,p2771-0888",
  111. "nvidia,p3489-0000",
  112. "nvidia,lightning",
  113. "nvidia,quill",
  114. "nvidia,storm",
  115. ),
  116. JETSON_XAVIER: ("nvidia,p2972-0000", "nvidia,p2972-0006", "nvidia,jetson-xavier"),
  117. JETSON_NANO: ("nvidia,p3450-0000", "nvidia,p3450-0002", "nvidia,jetson-nano"),
  118. JETSON_NX: (
  119. "nvidia,p3509-0000+p3668-0000",
  120. "nvidia,p3509-0000+p3668-0001",
  121. "nvidia,p3449-0000+p3668-0000",
  122. "nvidia,p3449-0000+p3668-0001",
  123. ),
  124. }
  125. _RASPBERRY_PI_40_PIN_IDS = (
  126. RASPBERRY_PI_B_PLUS,
  127. RASPBERRY_PI_A_PLUS,
  128. RASPBERRY_PI_ZERO,
  129. RASPBERRY_PI_ZERO_W,
  130. RASPBERRY_PI_2B,
  131. RASPBERRY_PI_3B,
  132. RASPBERRY_PI_3B_PLUS,
  133. RASPBERRY_PI_3A_PLUS,
  134. RASPBERRY_PI_4B,
  135. RASPBERRY_PI_AVNET_IIOT_GW,
  136. )
  137. _RASPBERRY_PI_CM_IDS = (RASPBERRY_PI_CM1, RASPBERRY_PI_CM3, RASPBERRY_PI_CM3_PLUS)
  138. _ODROID_40_PIN_IDS = (
  139. ODROID_C1,
  140. ODROID_C1_PLUS,
  141. ODROID_C2,
  142. ODROID_C4,
  143. ODROID_N2,
  144. ODROID_XU4,
  145. )
  146. _BEAGLEBONE_IDS = (
  147. BEAGLEBONE,
  148. BEAGLEBONE_BLACK,
  149. BEAGLEBONE_BLUE,
  150. BEAGLEBONE_BLACK_WIRELESS,
  151. BEAGLEBONE_POCKETBEAGLE,
  152. BEAGLEBONE_GREEN,
  153. BEAGLEBONE_GREEN_WIRELESS,
  154. BEAGLEBONE_BLACK_INDUSTRIAL,
  155. BEAGLEBONE_ENHANCED,
  156. BEAGLEBONE_USOMIQ,
  157. BEAGLEBONE_AIR,
  158. BEAGLEBONE_POCKETBONE,
  159. BEAGLELOGIC_STANDALONE,
  160. OSD3358_DEV_BOARD,
  161. OSD3358_SM_RED,
  162. )
  163. _LINARO_96BOARDS_IDS = (DRAGONBOARD_410C,)
  164. _SIFIVE_IDS = (SIFIVE_UNLEASHED,)
  165. # BeagleBone eeprom board ids from:
  166. # https://github.com/beagleboard/image-builder
  167. # Thanks to zmatt on freenode #beagle for pointers.
  168. _BEAGLEBONE_BOARD_IDS = {
  169. # Original bone/white:
  170. BEAGLEBONE: (
  171. ("A4", "A335BONE00A4"),
  172. ("A5", "A335BONE00A5"),
  173. ("A6", "A335BONE00A6"),
  174. ("A6A", "A335BONE0A6A"),
  175. ("A6B", "A335BONE0A6B"),
  176. ("B", "A335BONE000B"),
  177. ),
  178. BEAGLEBONE_BLACK: (
  179. ("A5", "A335BNLT00A5"),
  180. ("A5A", "A335BNLT0A5A"),
  181. ("A5B", "A335BNLT0A5B"),
  182. ("A5C", "A335BNLT0A5C"),
  183. ("A6", "A335BNLT00A6"),
  184. ("B", "A335BNLT000B"),
  185. ("C", "A335BNLT000C"),
  186. ("C", "A335BNLT00C0"),
  187. ),
  188. BEAGLEBONE_BLUE: (("A2", "A335BNLTBLA2"),),
  189. BEAGLEBONE_BLACK_WIRELESS: (("A5", "A335BNLTBWA5"),),
  190. BEAGLEBONE_POCKETBEAGLE: (("A2", "A335PBGL00A2"),),
  191. BEAGLEBONE_GREEN: (("1A", "A335BNLT...."), ("UNKNOWN", "A335BNLTBBG1")),
  192. BEAGLEBONE_GREEN_WIRELESS: (("W1A", "A335BNLTGW1A"),),
  193. BEAGLEBONE_BLACK_INDUSTRIAL: (
  194. ("A0", "A335BNLTAIA0"), # Arrow
  195. ("A0", "A335BNLTEIA0"), # Element14
  196. ),
  197. BEAGLEBONE_ENHANCED: (("A", "A335BNLTSE0A"),),
  198. BEAGLEBONE_USOMIQ: (("6", "A335BNLTME06"),),
  199. BEAGLEBONE_AIR: (("A0", "A335BNLTNAD0"),),
  200. BEAGLEBONE_POCKETBONE: (("0", "A335BNLTBP00"),),
  201. OSD3358_DEV_BOARD: (("0.1", "A335BNLTGH01"),),
  202. OSD3358_SM_RED: (("0", "A335BNLTOS00"),),
  203. BEAGLELOGIC_STANDALONE: (("A", "A335BLGC000A"),),
  204. }
  205. # Pi revision codes from:
  206. # https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
  207. # Each tuple here contains both the base codes, and the versions that indicate
  208. # the Pi is overvolted / overclocked - for 4-digit codes, this will be prefixed
  209. # with 1000, and for 6-digit codes it'll be prefixed with 1. These are placed
  210. # on separate lines.
  211. _PI_REV_CODES = {
  212. RASPBERRY_PI_B_REV1: (
  213. # Regular codes:
  214. "0002",
  215. "0003",
  216. # Overvolted/clocked versions:
  217. "1000002",
  218. "1000003",
  219. ),
  220. RASPBERRY_PI_B_REV2: (
  221. "0005",
  222. "0006",
  223. "000d",
  224. "000e",
  225. "000f",
  226. "1000005",
  227. "1000006",
  228. "100000d",
  229. "100000e",
  230. "100000f",
  231. ),
  232. RASPBERRY_PI_B_PLUS: ("0010", "0013", "900032", "1000010", "1000013", "1900032"),
  233. RASPBERRY_PI_A: ("0007", "0008", "0009", "1000007", "1000008", "1000009"),
  234. RASPBERRY_PI_A_PLUS: ("0012", "0015", "900021", "1000012", "1000015", "1900021"),
  235. RASPBERRY_PI_CM1: ("0011", "0014", "10000011", "10000014"),
  236. RASPBERRY_PI_ZERO: (
  237. "900092",
  238. "920092",
  239. "900093",
  240. "920093",
  241. "1900092",
  242. "1920092",
  243. "1900093",
  244. "1920093", # warranty bit 24
  245. "2900092",
  246. "2920092",
  247. "2900093",
  248. "2920093", # warranty bit 25
  249. ),
  250. RASPBERRY_PI_ZERO_W: ("9000c1", "19000c1", "29000c1"), # warranty bits
  251. RASPBERRY_PI_2B: (
  252. "a01040",
  253. "a01041",
  254. "a02042",
  255. "a21041",
  256. "a22042",
  257. "1a01040",
  258. "1a01041",
  259. "1a02042",
  260. "1a21041",
  261. "1a22042", # warranty bit 24
  262. "2a01040",
  263. "2a01041",
  264. "2a02042",
  265. "2a21041",
  266. "2a22042", # warranty bit 25
  267. "3a01040",
  268. "3a01041",
  269. "3a02042",
  270. "3a21041",
  271. "3a22042",
  272. ),
  273. RASPBERRY_PI_3B: (
  274. "a02082",
  275. "a22082",
  276. "a32082",
  277. "a52082",
  278. "1a02082",
  279. "1a22082",
  280. "1a32082",
  281. "1a52082", # warranty bit 24
  282. "2a02082",
  283. "2a22082",
  284. "2a32082",
  285. "2a52082", # warranty bit 25
  286. ),
  287. RASPBERRY_PI_3B_PLUS: ("a020d3", "1a020d3", "2a020d3"), # warranty bits
  288. RASPBERRY_PI_AVNET_IIOT_GW: ("60a220b0",),
  289. RASPBERRY_PI_CM3: (
  290. "a020a0",
  291. "a220a0",
  292. "1a020a0",
  293. "2a020a0", # warranty bits
  294. "1a220a0",
  295. "2a220a0",
  296. ),
  297. RASPBERRY_PI_3A_PLUS: ("9020e0", "19020e0", "29020e0"), # warranty bits
  298. RASPBERRY_PI_CM3_PLUS: ("a02100", "1a02100", "2a02100"), # warranty bits
  299. RASPBERRY_PI_4B: (
  300. "a03111",
  301. "b03111",
  302. "c03111",
  303. "a03112",
  304. "b03112",
  305. "c03112",
  306. "d03114",
  307. "1a03111",
  308. "2a03111",
  309. "1b03111",
  310. "2b03111", # warranty bits
  311. "1c03111",
  312. "2c03111",
  313. "1a03112",
  314. "2a03112",
  315. "1b03112",
  316. "2b03112",
  317. "1c03112",
  318. "2c03112",
  319. ),
  320. }
  321. # Onion omega boards
  322. _ONION_OMEGA_BOARD_IDS = (ONION_OMEGA, ONION_OMEGA2)
  323. # Pine64 boards and devices
  324. _PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE)
  325. # UDOO
  326. _UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)}