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.

363 lines
9.4 KiB

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