mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 10:04:42 +00:00
acrn-config: grab Processor CPU number from board information
The value of CONFIG_MAX_PCPU_NUM is stands for Processor CPU number and it is grabed from board information. Tracked-On: #3798 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
fcbf9d7b2c
commit
ee66a94ccf
@@ -18,9 +18,6 @@ import new_board_kconfig
|
||||
ACRN_PATH = board_cfg_lib.SOURCE_ROOT_DIR
|
||||
ACRN_CONFIG = ACRN_PATH + "hypervisor/arch/x86/configs/"
|
||||
|
||||
BOARD_NAMES = ['apl-mrb', 'apl-nuc', 'apl-up2', 'dnv-cb2', 'nuc6cayh',
|
||||
'nuc7i7dnb', 'kbl-nuc-i7', 'icl-rvp']
|
||||
|
||||
ACRN_DEFAULT_PLATFORM = ACRN_PATH + "hypervisor/include/arch/x86/default_acpi_info.h"
|
||||
GEN_FILE = ["pci_devices.h", "board.c", "_acpi_info.h", "misc_cfg.h", "ve820.c", ".config"]
|
||||
|
||||
@@ -55,7 +52,7 @@ def main(args):
|
||||
return err_dic
|
||||
|
||||
config_dirs.append(ACRN_CONFIG + board)
|
||||
if board not in BOARD_NAMES:
|
||||
if board not in board_cfg_lib.BOARD_NAMES:
|
||||
for config_dir in config_dirs:
|
||||
if not os.path.exists(config_dir):
|
||||
os.makedirs(config_dir)
|
||||
@@ -101,7 +98,7 @@ def main(args):
|
||||
return err_dic
|
||||
|
||||
# generate new board_name.config
|
||||
if board not in BOARD_NAMES:
|
||||
if board not in board_cfg_lib.BOARD_NAMES:
|
||||
with open(config_board_kconfig, 'w+') as config:
|
||||
err_dic = new_board_kconfig.generate_file(config)
|
||||
if err_dic:
|
||||
@@ -110,7 +107,7 @@ def main(args):
|
||||
# move changes to patch, and apply to the source code
|
||||
err_dic = board_cfg_lib.gen_patch(config_srcs, board)
|
||||
|
||||
if board not in BOARD_NAMES and not err_dic:
|
||||
if board not in board_cfg_lib.BOARD_NAMES and not err_dic:
|
||||
print("Config patch for NEW board {} is committed successfully!".format(board))
|
||||
elif not err_dic:
|
||||
print("Config patch for {} is committed successfully!".format(board))
|
||||
|
||||
@@ -85,6 +85,10 @@ def generate_file(config):
|
||||
"""
|
||||
board_cfg_lib.get_valid_irq(board_cfg_lib.BOARD_INFO_FILE)
|
||||
|
||||
# get cpu processor list
|
||||
cpu_list = board_cfg_lib.get_processor_info()
|
||||
max_cpu_num = len(cpu_list)
|
||||
|
||||
# get the vuart0/vuart1 which user chosed from scenario.xml of board_private section
|
||||
(err_dic, ttys_n) = board_cfg_lib.parser_vuart_console()
|
||||
if err_dic:
|
||||
@@ -117,6 +121,9 @@ def generate_file(config):
|
||||
print("{0}".format(board_cfg_lib.HEADER_LICENSE), file=config)
|
||||
print("{}".format(MISC_CFG_HEADER), file=config)
|
||||
|
||||
# define CONFIG_MAX_PCPCU_NUM
|
||||
print("#define CONFIG_MAX_PCPU_NUM\t{}U".format(max_cpu_num), file=config)
|
||||
|
||||
# define rootfs with macro
|
||||
for i in range(root_dev_num):
|
||||
print('#define ROOTFS_{}\t\t"root={} "'.format(i, root_devs[i]), file=config)
|
||||
|
||||
Reference in New Issue
Block a user