|
7 | 7 | # SPDX-License-Identifier: BSD-2-Clause
|
8 | 8 |
|
9 | 9 | import os
|
| 10 | +import re |
10 | 11 | import sys
|
11 | 12 | import argparse
|
12 | 13 |
|
|
17 | 18 | from soc_linux import SoCLinux
|
18 | 19 |
|
19 | 20 | #---------------------------------------------------------------------------------------------------
|
20 |
| -# Build |
| 21 | +# Helpers |
21 | 22 | #---------------------------------------------------------------------------------------------------
|
22 | 23 |
|
23 |
| -supported_boards = { |
24 |
| - # Xilinx |
25 |
| - "acorn" : Acorn, |
26 |
| - "acorn_pcie" : AcornPCIe, |
27 |
| - "aesku40" : AESKU40, |
28 |
| - "arty" : Arty, |
29 |
| - "arty_a7" : ArtyA7, |
30 |
| - "arty_s7" : ArtyS7, |
31 |
| - "netv2" : NeTV2, |
32 |
| - "genesys2" : Genesys2, |
33 |
| - "kc705" : KC705, |
34 |
| - "vc707" : VC707, |
35 |
| - "kcu105" : KCU105, |
36 |
| - "zcu104" : ZCU104, |
37 |
| - "nexys4ddr" : Nexys4DDR, |
38 |
| - "nexys_video" : NexysVideo, |
39 |
| - "minispartan6" : MiniSpartan6, |
40 |
| - "pipistrello" : Pipistrello, |
41 |
| - "xcu1525" : XCU1525, |
42 |
| - "alveo_u280" : AlveoU280, |
43 |
| - "alveo_u250" : AlveoU250, |
44 |
| - "qmtech_wukong" : Qmtech_WuKong, |
45 |
| - "sds1104xe" : SDS1104XE, |
46 |
| - "mnt_rkx7" : MNT_RKX7, |
47 |
| - "stlv7325" : STLV7325, |
48 |
| - "stlv7325_v2" : STLV7325_v2, |
49 |
| - "decklink_quad_hdmi_recorder" : DecklinkQuadHDMIRecorder, |
50 |
| - "hseda_xc7a35t" : HSEDA_xc7a35t, |
51 |
| - |
52 |
| - # Lattice |
53 |
| - "versa_ecp5" : VersaECP5, |
54 |
| - "ulx3s" : ULX3S, |
55 |
| - "ulx4m_ld_v2" : ULX4M_LD_V2, |
56 |
| - "hadbadge" : HADBadge, |
57 |
| - "orangecrab" : OrangeCrab, |
58 |
| - "butterstick" : ButterStick, |
59 |
| - "camlink_4k" : CamLink4K, |
60 |
| - "trellisboard" : TrellisBoard, |
61 |
| - "ecpix5" : ECPIX5, |
62 |
| - "colorlight_i5" : Colorlight_i5, |
63 |
| - "icesugar_pro" : IcesugarPro, |
64 |
| - "schoko" : Schoko, |
65 |
| - "konfekt" : Konfekt, |
66 |
| - "noir" : Noir, |
67 |
| - |
68 |
| - # Altera/Intel |
69 |
| - "de0nano" : De0Nano, |
70 |
| - "de10nano" : De10Nano, |
71 |
| - "de1soc" : De1SoC, |
72 |
| - "qmtech_ep4ce15" : Qmtech_EP4CE15, |
73 |
| - "qmtech_ep4ce55" : Qmtech_EP4CE55, |
74 |
| - "qmtech_5cefa2" : Qmtech_5CEFA2, |
75 |
| - |
76 |
| - # Efinix |
77 |
| - "trion_t120_bga576_dev_kit" : TrionT120BGA576DevKit, |
78 |
| - "titanium_ti60_f225_dev_kit" : TitaniumTi60F225DevKit, |
79 |
| - |
80 |
| - # Gowin |
81 |
| - "sipeed_tang_nano_20k" : Sipeed_tang_nano_20k, |
82 |
| - "sipeed_tang_primer_20k" : Sipeed_tang_primer_20k, |
83 |
| - } |
| 24 | +def get_supported_boards(): |
| 25 | + board_classes = {} |
| 26 | + for name, obj in globals().items(): |
| 27 | + if isinstance(obj, type) and issubclass(obj, Board) and obj is not Board: |
| 28 | + board_classes[name] = obj |
| 29 | + return board_classes |
| 30 | + |
| 31 | +supported_boards = get_supported_boards() |
| 32 | + |
| 33 | +#--------------------------------------------------------------------------------------------------- |
| 34 | +# Build |
| 35 | +#--------------------------------------------------------------------------------------------------- |
84 | 36 |
|
85 | 37 | def main():
|
86 | 38 | description = "Linux on LiteX-VexRiscv\n\n"
|
@@ -109,8 +61,6 @@ def main():
|
109 | 61 | if args.board == "all":
|
110 | 62 | board_names = list(supported_boards.keys())
|
111 | 63 | else:
|
112 |
| - args.board = args.board.lower() |
113 |
| - args.board = args.board.replace(" ", "_") |
114 | 64 | board_names = [args.board]
|
115 | 65 |
|
116 | 66 | # Board(s) iteration ---------------------------------------------------------------------------
|
@@ -177,15 +127,15 @@ def main():
|
177 | 127 | soc.add_constant(k, v)
|
178 | 128 |
|
179 | 129 | # SoC peripherals --------------------------------------------------------------------------
|
180 |
| - if board_name in ["arty", "arty_a7"]: |
| 130 | + if board_name in ["Arty", "ArtyA7"]: |
181 | 131 | from litex_boards.platforms.digilent_arty import _sdcard_pmod_io
|
182 | 132 | board.platform.add_extension(_sdcard_pmod_io)
|
183 | 133 |
|
184 |
| - if board_name in ["aesku40"]: |
| 134 | + if board_name in ["AESKU40"]: |
185 | 135 | from litex_boards.platforms.avnet_aesku40 import _sdcard_pmod_io
|
186 | 136 | board.platform.add_extension(_sdcard_pmod_io)
|
187 | 137 |
|
188 |
| - if board_name in ["orangecrab"]: |
| 138 | + if board_name in ["OrangeCrab"]: |
189 | 139 | from litex_boards.platforms.gsd_orangecrab import feather_i2c
|
190 | 140 | board.platform.add_extension(feather_i2c)
|
191 | 141 |
|
|
0 commit comments