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.

330 lines
8.7 KiB

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