2019-11-07 09:20:34 +00:00
|
|
|
#!/usr/bin/env python3
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2019-08-12 23:21:43 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
import argparse
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2019-07-08 18:59:37 +00:00
|
|
|
# When adding new devices to the list please keep them in alphabetical order
|
|
|
|
# board-name should contain 'dashes' (-) not 'underscores' (_) and shouldn't contain capitals
|
|
|
|
# you can check the formating using an online tool such as https://codebeautify.org/python-formatter-beautifier
|
|
|
|
|
2019-05-01 16:27:06 +00:00
|
|
|
# 'project' : {
|
|
|
|
# 'device' : {
|
2019-07-08 18:59:37 +00:00
|
|
|
# 'board-name' : {
|
|
|
|
# 'dtb' : 'board-name.dtb',
|
|
|
|
# 'config' : 'board_name_defconfig'
|
|
|
|
# },
|
2019-05-01 16:27:06 +00:00
|
|
|
# },
|
|
|
|
# },
|
2019-07-08 18:59:37 +00:00
|
|
|
|
|
|
|
devices = \
|
|
|
|
{
|
|
|
|
'Allwinner': {
|
|
|
|
'A64': {
|
|
|
|
'orangepi-win': {
|
|
|
|
'dtb': 'sun50i-a64-orangepi-win.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_win_defconfig',
|
|
|
|
'crust_config': 'orangepi_win_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'pine64': {
|
|
|
|
'dtb': 'sun50i-a64-pine64.dtb',
|
2021-01-17 20:14:07 +00:00
|
|
|
'config': 'pine64_plus_defconfig',
|
|
|
|
'crust_config': 'pine64_plus_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'pine64-lts': {
|
|
|
|
'dtb': 'sun50i-a64-pine64-lts.dtb',
|
2021-01-17 20:14:07 +00:00
|
|
|
'config': 'pine64-lts_defconfig',
|
|
|
|
'crust_config': 'pine64_plus_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'pine64-plus': {
|
|
|
|
'dtb': 'sun50i-a64-pine64-plus.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'pine64_plus_defconfig',
|
|
|
|
'crust_config': 'pine64_plus_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2017-11-11 19:32:31 +00:00
|
|
|
},
|
2020-11-04 21:05:07 +00:00
|
|
|
'H2-plus': {
|
|
|
|
'bananapi-m2-zero': {
|
|
|
|
'dtb': 'sun8i-h2-plus-bananapi-m2-zero.dtb',
|
2021-11-20 21:37:57 +00:00
|
|
|
'config': 'bananapi_m2_zero_defconfig',
|
|
|
|
'crust_config': 'orangepi_one_defconfig'
|
2020-11-04 21:05:07 +00:00
|
|
|
},
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'H3': {
|
|
|
|
'bananapi-m2p': {
|
|
|
|
'dtb': 'sun8i-h3-bananapi-m2-plus.dtb',
|
2021-01-30 17:19:01 +00:00
|
|
|
'config': 'bananapi_m2_plus_h3_defconfig',
|
|
|
|
'crust_config': 'bananapi_m2_plus_h3_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'beelink-x2': {
|
|
|
|
'dtb': 'sun8i-h3-beelink-x2.dtb',
|
2021-01-30 17:19:01 +00:00
|
|
|
'config': 'beelink_x2_defconfig',
|
|
|
|
'crust_config': 'beelink_x2_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'libretech-h3': {
|
|
|
|
'dtb': 'sun8i-h3-libretech-all-h3-cc.dtb',
|
2021-01-30 17:19:01 +00:00
|
|
|
'config': 'libretech_all_h3_cc_h3_defconfig',
|
|
|
|
'crust_config': 'libretech_all_h3_cc_h3_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'nanopi-m1': {
|
|
|
|
'dtb': 'sun8i-h3-nanopi-m1.dtb',
|
2021-01-30 17:19:01 +00:00
|
|
|
'config': 'nanopi_m1_defconfig',
|
|
|
|
'crust_config': 'nanopi_m1_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'orangepi-2': {
|
|
|
|
'dtb': 'sun8i-h3-orangepi-2.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_2_defconfig',
|
|
|
|
'crust_config': 'orangepi_2_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'orangepi-pc': {
|
|
|
|
'dtb': 'sun8i-h3-orangepi-pc.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_pc_defconfig',
|
|
|
|
'crust_config': 'orangepi_pc_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'orangepi-pc-plus': {
|
|
|
|
'dtb': 'sun8i-h3-orangepi-pc-plus.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_pc_plus_defconfig',
|
|
|
|
'crust_config': 'orangepi_pc_plus_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'orangepi-plus2e': {
|
|
|
|
'dtb': 'sun8i-h3-orangepi-plus2e.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_plus2e_defconfig',
|
|
|
|
'crust_config': 'orangepi_plus2e_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'orangepi-plus': {
|
|
|
|
'dtb': 'sun8i-h3-orangepi-plus.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_plus_defconfig',
|
|
|
|
'crust_config': 'orangepi_plus_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2017-11-11 19:32:31 +00:00
|
|
|
},
|
2019-04-14 10:31:11 +00:00
|
|
|
'H5' : {
|
|
|
|
'orangepi-pc2': {
|
|
|
|
'dtb': 'sun50i-h5-orangepi-pc2.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_pc2_defconfig',
|
|
|
|
'crust_config': 'orangepi_pc2_defconfig',
|
2019-04-14 10:31:11 +00:00
|
|
|
},
|
2020-02-20 21:50:12 +00:00
|
|
|
'tritium-h5': {
|
|
|
|
'dtb': 'sun50i-h5-libretech-all-h3-cc.dtb',
|
2021-01-30 17:19:01 +00:00
|
|
|
'config': 'libretech_all_h3_cc_h5_defconfig',
|
|
|
|
'crust_config': 'libretech_all_h3_cc_h5_defconfig'
|
2020-02-20 21:50:12 +00:00
|
|
|
},
|
2019-04-14 10:31:11 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'H6': {
|
2019-08-11 18:12:53 +00:00
|
|
|
'beelink-gs1' : {
|
|
|
|
'dtb' : 'sun50i-h6-beelink-gs1.dtb',
|
2021-01-10 11:15:10 +00:00
|
|
|
'config' : 'beelink_gs1_defconfig',
|
|
|
|
'crust_config' : 'beelink_gs1_defconfig'
|
2019-08-11 18:12:53 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'orangepi-3': {
|
|
|
|
'dtb': 'sun50i-h6-orangepi-3.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'orangepi_3_defconfig',
|
2021-01-02 18:36:45 +00:00
|
|
|
'crust_config': 'orangepi_3_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2020-04-04 19:25:43 +00:00
|
|
|
'orangepi-lite2': {
|
|
|
|
'dtb': 'sun50i-h6-orangepi-lite2.dtb',
|
2021-01-02 18:36:45 +00:00
|
|
|
'config': 'orangepi_lite2_defconfig',
|
|
|
|
'crust_config': 'orangepi_3_defconfig'
|
2020-04-04 19:25:43 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'orangepi-one-plus': {
|
|
|
|
'dtb': 'sun50i-h6-orangepi-one-plus.dtb',
|
2021-01-02 18:36:45 +00:00
|
|
|
'config': 'orangepi_one_plus_defconfig',
|
|
|
|
'crust_config': 'orangepi_3_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
'pine-h64': {
|
|
|
|
'dtb': 'sun50i-h6-pine-h64.dtb',
|
2020-12-13 07:18:31 +00:00
|
|
|
'config': 'pine_h64_defconfig',
|
|
|
|
'crust_config': 'pine_h64_defconfig',
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2020-05-21 16:23:48 +00:00
|
|
|
'pine-h64-model-b': {
|
2020-05-21 15:51:20 +00:00
|
|
|
'dtb': 'sun50i-h6-pine-h64-model-b.dtb',
|
2021-01-02 18:36:45 +00:00
|
|
|
'config': 'pine_h64_defconfig',
|
|
|
|
'crust_config': 'pine_h64_defconfig'
|
2020-05-21 15:51:20 +00:00
|
|
|
},
|
2019-06-15 16:03:15 +00:00
|
|
|
'tanix-tx6' : {
|
|
|
|
'dtb' : 'sun50i-h6-tanix-tx6.dtb',
|
2021-01-10 10:44:58 +00:00
|
|
|
'config' : 'tanix_tx6_defconfig',
|
|
|
|
'crust_config' : 'tanix_tx6_defconfig'
|
2019-06-15 16:03:15 +00:00
|
|
|
},
|
2017-11-11 19:32:31 +00:00
|
|
|
},
|
2020-09-05 09:16:47 +00:00
|
|
|
'R40' : {
|
|
|
|
'bananapi-m2u' : {
|
|
|
|
'dtb' : 'sun8i-r40-bananapi-m2-ultra.dtb',
|
|
|
|
'config' : 'Bananapi_M2_Ultra_defconfig'
|
|
|
|
},
|
|
|
|
},
|
2017-11-11 19:32:31 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'Amlogic': {
|
|
|
|
'AMLGX': {
|
|
|
|
'box': {
|
2020-01-08 23:14:54 +00:00
|
|
|
'dtb': '',
|
2019-07-08 18:59:37 +00:00
|
|
|
'config': 'p212_defconfig'
|
|
|
|
},
|
2021-10-29 12:40:55 +00:00
|
|
|
'bananapi-m5': {
|
|
|
|
'dtb': 'meson-sm1-bananapi-m5.dtb',
|
2021-12-09 10:54:40 +00:00
|
|
|
'config': 'bananapi-m5_defconfig'
|
2021-10-29 12:40:55 +00:00
|
|
|
},
|
|
|
|
'beelink-s922x': {
|
|
|
|
'dtb': 'meson-g12b-gtking.dtb',
|
|
|
|
'config': 'beelink-gtking_defconfig'
|
|
|
|
},
|
2019-10-04 13:35:09 +00:00
|
|
|
'khadas-vim': {
|
|
|
|
'dtb': 'meson-gxl-s905x-khadas-vim.dtb',
|
|
|
|
'config': 'khadas-vim_defconfig'
|
|
|
|
},
|
|
|
|
'khadas-vim2': {
|
|
|
|
'dtb': 'meson-gxm-khadas-vim2.dtb',
|
|
|
|
'config': 'khadas-vim2_defconfig'
|
|
|
|
},
|
2020-09-19 15:11:45 +00:00
|
|
|
'khadas-vim3': {
|
|
|
|
'dtb': 'meson-g12b-a311d-khadas-vim3.dtb',
|
|
|
|
'config': 'khadas-vim3_defconfig'
|
|
|
|
},
|
|
|
|
'khadas-vim3l': {
|
|
|
|
'dtb': 'meson-sm1-khadas-vim3l.dtb',
|
|
|
|
'config': 'khadas-vim3l_defconfig'
|
|
|
|
},
|
2019-10-04 13:35:09 +00:00
|
|
|
'lafrite': {
|
|
|
|
'dtb': 'meson-gxl-s805x-libretech-ac.dtb',
|
|
|
|
'config': 'libretech-ac_defconfig'
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'lepotato': {
|
|
|
|
'dtb': 'meson-gxl-s905x-libretech-cc.dtb',
|
|
|
|
'config': 'libretech-cc_defconfig'
|
|
|
|
},
|
|
|
|
'nanopi-k2': {
|
|
|
|
'dtb': 'meson-gxbb-nanopi-k2.dtb',
|
|
|
|
'config': 'nanopi-k2_defconfig'
|
|
|
|
},
|
|
|
|
'odroid-c2': {
|
|
|
|
'dtb': 'meson-gxbb-odroidc2.dtb',
|
|
|
|
'config': 'odroid-c2_defconfig'
|
|
|
|
},
|
2020-04-24 10:54:28 +00:00
|
|
|
'odroid-c4': {
|
|
|
|
'dtb': 'meson-sm1-odroid-c4.dtb',
|
|
|
|
'config': 'odroid-c4_defconfig'
|
|
|
|
},
|
2021-01-29 07:28:28 +00:00
|
|
|
'odroid-hc4': {
|
|
|
|
'dtb': 'meson-sm1-odroid-hc4.dtb',
|
2021-10-29 12:40:55 +00:00
|
|
|
'config': 'odroid-hc4_defconfig'
|
2021-01-29 07:28:28 +00:00
|
|
|
},
|
2019-06-14 19:53:45 +00:00
|
|
|
'odroid-n2': {
|
|
|
|
'dtb': 'meson-g12b-odroid-n2.dtb',
|
|
|
|
'config': 'odroid-n2_defconfig'
|
|
|
|
},
|
2021-10-29 12:40:55 +00:00
|
|
|
'radxa-zero': {
|
|
|
|
'dtb': 'meson-g12a-radxa-zero.dtb',
|
|
|
|
'config': 'radxa-zero_defconfig'
|
|
|
|
},
|
|
|
|
'wetek-core2': {
|
|
|
|
'dtb': 'meson-gxm-wetek-core2.dtb',
|
|
|
|
'config': 'wetek-core2_defconfig'
|
|
|
|
},
|
|
|
|
'wetek-hub': {
|
|
|
|
'dtb': 'meson-gxbb-wetek-hub.dtb',
|
|
|
|
'config': 'wetek-hub_defconfig'
|
|
|
|
},
|
|
|
|
'wetek-play2': {
|
|
|
|
'dtb': 'meson-gxbb-wetek-play2.dtb',
|
|
|
|
'config': 'wetek-play2_defconfig'
|
|
|
|
},
|
2018-09-26 06:00:51 +00:00
|
|
|
},
|
|
|
|
},
|
2017-11-03 18:57:49 +00:00
|
|
|
'NXP': {
|
|
|
|
'iMX6': {
|
2021-01-17 15:36:01 +00:00
|
|
|
'cubox': {
|
|
|
|
'dtb': '',
|
2017-11-03 18:57:49 +00:00
|
|
|
'config': 'mx6cuboxi_defconfig'
|
|
|
|
},
|
2021-01-17 15:36:01 +00:00
|
|
|
'udoo': {
|
|
|
|
'dtb': '',
|
2017-11-03 18:57:49 +00:00
|
|
|
'config': 'udoo_defconfig'
|
|
|
|
},
|
2021-01-17 15:36:01 +00:00
|
|
|
'wandboard': {
|
|
|
|
'dtb': '',
|
2017-11-03 18:57:49 +00:00
|
|
|
'config': 'wandboard_defconfig'
|
|
|
|
},
|
|
|
|
},
|
2019-07-04 17:17:21 +00:00
|
|
|
'iMX8' : {
|
|
|
|
'mq-evk' : {
|
|
|
|
'dtb' : 'imx8mq-evk.dtb',
|
|
|
|
'config' : 'imx8mq_evk_defconfig'
|
|
|
|
},
|
|
|
|
'pico-mq' : {
|
|
|
|
'dtb' : 'imx8mq-pico-pi.dtb',
|
|
|
|
'config' : 'pico-imx8mq_defconfig'
|
|
|
|
},
|
|
|
|
},
|
2017-11-03 18:57:49 +00:00
|
|
|
},
|
2019-07-05 01:31:48 +00:00
|
|
|
'Qualcomm': {
|
|
|
|
'Dragonboard': {
|
|
|
|
'410c': {
|
|
|
|
'dtb': 'apq8016-sbc.dtb',
|
|
|
|
'config': 'dragonboard410c_defconfig'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'Rockchip': {
|
2019-12-31 09:09:33 +00:00
|
|
|
'RK3288': {
|
|
|
|
'miqi': {
|
|
|
|
'dtb': 'rk3288-miqi.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'miqi-rk3288_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
|
|
|
'tinker': {
|
|
|
|
'dtb': 'rk3288-tinker-s.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'tinker-rk3288_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'RK3328': {
|
2019-12-31 09:09:33 +00:00
|
|
|
'a1': {
|
|
|
|
'dtb': 'rk3328-a1.dtb',
|
|
|
|
'config': 'evb-rk3328_defconfig'
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'roc-cc': {
|
|
|
|
'dtb': 'rk3328-roc-cc.dtb',
|
|
|
|
'config': 'evb-rk3328_defconfig'
|
|
|
|
},
|
|
|
|
'rock64': {
|
|
|
|
'dtb': 'rk3328-rock64.dtb',
|
|
|
|
'config': 'evb-rk3328_defconfig'
|
|
|
|
},
|
2018-02-11 22:00:03 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'RK3399': {
|
2019-12-31 09:09:33 +00:00
|
|
|
'hugsun-x99': {
|
|
|
|
'dtb': 'rk3399-hugsun-x99.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'khadas-edge': {
|
|
|
|
'dtb': 'rk3399-khadas-edge.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2019-12-31 09:09:33 +00:00
|
|
|
'nanopc-t4': {
|
|
|
|
'dtb': 'rk3399-nanopc-t4.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
|
|
|
'nanopi-m4': {
|
|
|
|
'dtb': 'rk3399-nanopi-m4.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
|
|
|
'orangepi': {
|
|
|
|
'dtb': 'rk3399-orangepi.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'rock960': {
|
|
|
|
'dtb': 'rk3399-rock960.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2021-02-27 18:56:01 +00:00
|
|
|
'rock-pi-4': {
|
2021-06-02 07:53:17 +00:00
|
|
|
'dtb': 'rk3399-rock-pi-4b.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2020-12-06 21:51:57 +00:00
|
|
|
},
|
2021-10-11 13:26:36 +00:00
|
|
|
'rock-pi-4-plus': {
|
|
|
|
'dtb': 'rk3399-rock-pi-4b-plus.dtb',
|
|
|
|
'config': 'evb-rk3399_defconfig'
|
|
|
|
},
|
2021-03-27 04:35:42 +00:00
|
|
|
'rock-pi-n10': {
|
|
|
|
'dtb': 'rk3399pro-rock-pi-n10.dtb',
|
|
|
|
'config': 'evb-rk3399_defconfig'
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'rockpro64': {
|
|
|
|
'dtb': 'rk3399-rockpro64.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
2019-12-31 09:09:33 +00:00
|
|
|
'roc-pc': {
|
2021-06-02 07:53:17 +00:00
|
|
|
'dtb': 'rk3399-roc-pc-mezzanine.dtb',
|
2021-06-04 20:16:41 +00:00
|
|
|
'config': 'firefly-rk3399_defconfig'
|
2019-12-31 09:09:33 +00:00
|
|
|
},
|
2021-10-11 13:26:21 +00:00
|
|
|
'roc-pc-plus': {
|
|
|
|
'dtb': 'rk3399-roc-pc-plus.dtb',
|
|
|
|
'config': 'firefly-rk3399_defconfig'
|
|
|
|
},
|
2019-07-08 18:59:37 +00:00
|
|
|
'sapphire': {
|
|
|
|
'dtb': 'rk3399-sapphire.dtb',
|
2021-02-17 15:53:12 +00:00
|
|
|
'config': 'evb-rk3399_defconfig'
|
2019-07-08 18:59:37 +00:00
|
|
|
},
|
|
|
|
},
|
2017-11-01 21:57:41 +00:00
|
|
|
},
|
2020-04-25 09:28:22 +00:00
|
|
|
'Samsung': {
|
|
|
|
'Exynos': {
|
|
|
|
'odroid-xu4': {
|
|
|
|
'dtb': 'exynos5422-odroidxu4.dtb',
|
|
|
|
'config': 'odroid-xu4_defconfig'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-05-01 01:45:00 +00:00
|
|
|
}
|
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
class OptionsAction(argparse.Action):
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
|
|
message = None
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if self.dest == 'project':
|
|
|
|
if values is None:
|
|
|
|
print(' '.join(project for project in sorted(devices)))
|
|
|
|
parser.exit()
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if values not in devices.keys():
|
|
|
|
message = "invalid choice: {0!r} (choose from {1})".format(values, ', '.join([repr(project) for project in devices]))
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if self.dest == 'soc':
|
|
|
|
project = getattr(namespace, 'project')
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if values is None:
|
|
|
|
print(' '.join(soc for soc in sorted(devices[project])))
|
|
|
|
parser.exit()
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if values not in devices[project].keys():
|
|
|
|
message = "invalid choice: {0!r} (choose from {1})".format(values, ', '.join([repr(soc) for soc in devices[project]]))
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if self.dest == 'board':
|
|
|
|
project = getattr(namespace, 'project')
|
|
|
|
soc = getattr(namespace, 'soc')
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if values is None:
|
|
|
|
print(' '.join(board for board in sorted(devices[project][soc])))
|
|
|
|
parser.exit()
|
2019-08-12 23:21:43 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if values not in devices[project][soc].keys():
|
|
|
|
message = "invalid choice: {0!r} (choose from {1})".format(values, ', '.join([repr(board) for board in devices[project][soc]]))
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if self.dest == 'value':
|
|
|
|
project = getattr(namespace, 'project')
|
|
|
|
soc = getattr(namespace, 'soc')
|
|
|
|
board = getattr(namespace, 'board')
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2021-01-27 21:23:26 +00:00
|
|
|
if values is None:
|
|
|
|
print(' '.join(value for value in sorted(devices[project][soc][board].keys())))
|
|
|
|
parser.exit()
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2021-01-27 21:23:26 +00:00
|
|
|
if values not in devices[project][soc][board].keys():
|
|
|
|
parser.exit()
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
if message is not None:
|
|
|
|
raise argparse.ArgumentError(self, message)
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2021-01-19 03:40:04 +00:00
|
|
|
setattr(namespace, self.dest, values)
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description='Script to help with u-boot configuration')
|
|
|
|
|
|
|
|
parser.add_argument('project', nargs='?', action=OptionsAction)
|
|
|
|
|
|
|
|
parser.add_argument('soc', nargs='?', action=OptionsAction)
|
|
|
|
|
|
|
|
parser.add_argument('board', nargs='?', action=OptionsAction)
|
|
|
|
|
2021-01-27 21:23:26 +00:00
|
|
|
parser.add_argument('value', nargs='?', action=OptionsAction)
|
2021-01-19 03:40:04 +00:00
|
|
|
|
|
|
|
options = parser.parse_args()
|
|
|
|
|
|
|
|
print(devices[options.project][options.soc][options.board][options.value])
|
|
|
|
|
|
|
|
parser.exit()
|