Lakka-LibreELEC/scripts/uboot_helper

76 lines
2.3 KiB
Plaintext
Raw Normal View History

2017-05-01 01:45:00 +00:00
#!/usr/bin/env python
import sys
devices = {
'project' : {
'device' : {
'board_name' : { 'dtb' : 'board_name.dtb', 'config' : 'board_name_defconfig' },
},
},
2017-11-01 21:57:41 +00:00
'Rockchip' : {
2017-11-02 22:33:10 +00:00
'MiQi' : { 'rk3288' : { 'dtb' : 'rk3288-miqi.dtb', 'config' : 'miqi-rk3288_config' }, },
2018-02-11 22:00:03 +00:00
'Renegade' : { 'rk3328' : { 'dtb' : 'rk3328-roc-cc.dtb', 'config' : 'evb-rk3328_defconfig' }, },
2017-11-01 21:57:41 +00:00
'ROCK64' : { 'rk3328' : { 'dtb' : 'rk3328-rock64.dtb', 'config' : 'evb-rk3328_defconfig' }, },
2017-12-16 10:15:39 +00:00
'RockBox' : { 'rk3328' : { 'dtb' : 'rk3328-rockbox.dtb', 'config' : 'evb-rk3328_defconfig' }, },
2017-11-01 21:57:41 +00:00
'TinkerBoard' : { 'rk3288' : { 'dtb' : 'rk3288-miniarm.dtb', 'config' : 'tinker-rk3288_config' }, },
2017-11-01 21:57:41 +00:00
},
2017-05-01 01:45:00 +00:00
}
def usage():
print(' '.join(['Usage:', sys.argv[0], '<project>', '<soc>', '<board-name>', 'dtb|config']))
print(' '.join([' ', sys.argv[0], '<project>', '<soc>']))
print(' '.join([' ', sys.argv[0], '<project>']) + '\n')
print('Projects:' + '\n')
for project in devices:
print(' ' + project + ':')
for soc in devices[project]:
print(' ' + soc + ':')
for board in devices[project][soc]:
print(' ' + board)
print('')
print('')
# Get dtb or u-boot config for a given project, soc, and board
# ./scripts/uboot_helper project device board_name dtb
if len(sys.argv) == 5:
if sys.argv[1] in devices:
if sys.argv[2] in devices[sys.argv[1]]:
if sys.argv[3] in devices[sys.argv[1]][sys.argv[2]]:
if sys.argv[4] in ['dtb', 'config']:
print(devices[sys.argv[1]][sys.argv[2]][sys.argv[3]][sys.argv[4]])
sys.exit(0)
# List boards supported by a given project and soc
# ./scripts/uboot_helper project device
elif len(sys.argv) == 3:
if sys.argv[1] in devices:
if sys.argv[2] in devices[sys.argv[1]]:
boards = []
for board in devices[sys.argv[1]][sys.argv[2]]:
boards.append(board)
print(' '.join(boards))
sys.exit(0)
# List socs supported by a given project
# ./scripts/uboot_helper project
elif len(sys.argv) == 2:
if sys.argv[1] in devices:
socs = []
for soc in devices[sys.argv[1]]:
socs.append(soc)
print(' '.join(socs))
sys.exit(0)
# List projects
# ./scripts/uboot_helper
elif len(sys.argv) == 1:
projects = []
for project in devices:
projects.append(project)
print(' '.join(projects))
sys.exit(0)
usage()