Skip to content

Commit f8ecb6d

Browse files
committed
conf/genconf.py: use core key in the json config if present
Signed-off-by: Huaqi Fang <578567190@qq.com>
1 parent b0174b3 commit f8ecb6d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

conf/genconf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/python3
1+
#!/bin/env python3
22
import re
33
import json
44
import glob
@@ -342,12 +342,16 @@ def update_openocd_config(file_path, **kwargs):
342342
board_timer_freq = None
343343
board_irqmax = None
344344

345+
board_cpucore = "ux900fd"
345346
try:
346347
cust_file = args.custsoc
347348

348349
with open(args.conf, 'r') as conf_file:
349350
conf_data = json.load(conf_file)
350351

352+
if 'cpu_config' in conf_data:
353+
board_cpucore = conf_data['cpu_config'].get("core", "ux900fd")
354+
351355
if 'general_config' in conf_data:
352356
general_config = conf_data['general_config']
353357
if 'ddr' in general_config:
@@ -583,10 +587,10 @@ def update_openocd_config(file_path, **kwargs):
583587

584588
print("\n===generate successfully!===\n")
585589
print("Here are the reference build commands for compiling Linux SDK for you:")
586-
print("$cd ..")
587-
print("$make SOC=%s CORE=ux900fd BOOT_MODE=sd freeloader bootimages" % args.custsoc)
588-
print("$make SOC=%s CORE=ux900fd BOOT_MODE=sd run_qemu" % args.custsoc)
589-
print("Please adjust the compilation parameters according to your real environment.")
590+
print("$ cd ..")
591+
print("$ make SOC=%s CORE=%s BOOT_MODE=sd freeloader bootimages" % (args.custsoc, board_cpucore))
592+
print("$ make SOC=%s CORE=%s BOOT_MODE=sd run_qemu" % (args.custsoc, board_cpucore))
593+
print("Please adjust the compilation parameters according to your real hardware environment.")
590594
except Exception as e:
591595
print(f'Exception occur: {e}')
592596
# back to orgin working directory,remote generated files

0 commit comments

Comments
 (0)