acrn-config: refine p2sb mmio pass-thru macro definitions

Always use P2SB_ as a prefix for all macro definitions related to P2SB
MMIO passthru. And introduce the new P2SB_VGPIO_DM_ENABLED macro to
indicate the presence of the pre-launched VM which requires the feature.
This macro intends to be used to enclose source files with ifdef where
macros defined by config-tool being used which are available only when
the feature is enabled. It is required to avoid causing compilation
errors when users build HV without enabling the feature.

Tracked-On: #5246

Signed-off-by: Toshiki Nishioka <toshiki.nishioka@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Toshiki Nishioka 2020-09-02 18:45:45 +09:00 committed by wenlingz
parent ba99984f69
commit 19f74d84a6
1 changed files with 3 additions and 2 deletions

View File

@ -95,11 +95,12 @@ def generate_file(config):
scenario_cfg_lib.VM_DB[common.VM_TYPES[0]]['load_type'] == "PRE_LAUNCHED_VM"
and board_cfg_lib.is_p2sb_passthru_possible()):
print("", file=config)
print("#define P2SB_VGPIO_DM_ENABLED", file=config)
print("#define P2SB_BAR_ADDR\t\t\t0x{:X}UL".format(board_cfg_lib.find_p2sb_bar_addr()), file=config)
if board_cfg_lib.is_matched_board(("ehl-crb-b")):
print("", file=config)
print("#define BASE_GPIO_PORT_ID\t\t0x69U", file=config)
print("#define MAX_GPIO_COMMUNITIES\t0x6U", file=config)
print("#define P2SB_BASE_GPIO_PORT_ID\t\t0x69U", file=config)
print("#define P2SB_MAX_GPIO_COMMUNITIES\t0x6U", file=config)
print(BOARD_INFO_ENDIF, file=config)