From a81fcc23083e80e066c1062f04a4ee235944cac1 Mon Sep 17 00:00:00 2001 From: Vijay Dhanraj Date: Tue, 25 Feb 2020 17:34:06 -0800 Subject: [PATCH] acrn-config: Set/Unset RDT support in the <$BOARD$>.config file This patch checks if RDT feature is supported by platform and updates the CONFIG_RDT_ENABLED flag in the <$BOARD$>.config file accordingly. Tracked-On: #3715 Signed-off-by: Vijay Dhanraj Acked-by: Victor Sun --- .../board_config/new_board_kconfig.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/misc/acrn-config/board_config/new_board_kconfig.py b/misc/acrn-config/board_config/new_board_kconfig.py index 1b2c019c0..88b986ec5 100644 --- a/misc/acrn-config/board_config/new_board_kconfig.py +++ b/misc/acrn-config/board_config/new_board_kconfig.py @@ -4,6 +4,7 @@ # import sys +import subprocess import board_cfg_lib @@ -104,6 +105,17 @@ def get_serial_type(): return (ttys_type, ttys_value) +def is_rdt_supported(): + """ + Returns True if platform supports RDT else False + """ + (rdt_resources, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(board_cfg_lib.BOARD_INFO_FILE) + if len(rdt_resources) == 0 or len(rdt_res_clos_max) == 0: + return False + else: + return True + + def generate_file(config): """Start to generate board.c :param config: it is a file pointer of board information for writing to @@ -150,4 +162,9 @@ def generate_file(config): print("# KATA VM is not supported on dual-core systems", file=config) print("CONFIG_MAX_KATA_VM_NUM=0", file=config) + if is_rdt_supported(): + print("CONFIG_RDT_ENABLED=y", file=config) + else: + print("CONFIG_RDT_ENABLED=n", file=config) + return err_dic