#
# Copyright (C) 2021. Hisilicon Technologies Co., Ltd.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
# only version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#

-include $(HVGR_PATH)/dm/fcp/driver/$(CHIP_VER_DIR)/Kbuild

INCLUDE_DIR += \
	-I$(HVGR_PATH)/dm \
	-I$(HVGR_PATH)/dm/driver \
	-I$(HVGR_PATH)/dm/driver/$(CHIP_VER_DIR) \
	-I$(HVGR_PATH)/dm/fcp \
	-I$(HVGR_PATH)/dm/fcp/driver/$(CHIP_VER_DIR) \
	-I$(HVGR_PATH)/dm/dmd \
	-I$(HVGR_PATH)/dm/bbox

SRC += \
	$(HVGR_ROOT)/dm/hvgr_dm.c \
	$(HVGR_ROOT)/dm/hvgr_dm_ioctl.c \
	$(HVGR_ROOT)/dm/hvgr_dm_ctx.c \
	$(HVGR_ROOT)/dm/hvgr_dm_dfx.c \
	$(HVGR_ROOT)/dm/driver/hvgr_dm_driver_base.c \
	$(HVGR_ROOT)/dm/driver/$(CHIP_VER_DIR)/hvgr_dm_driver_adapt.c \
	$(HVGR_ROOT)/dm/fcp/hvgr_fcp.c \
	$(HVGR_ROOT)/dm/fcp/driver/$(CHIP_VER_DIR)/hvgr_fcp_driver_adapt.c \
	$(HVGR_ROOT)/dm/dmd/hvgr_dmd.c \
	$(HVGR_ROOT)/dm/hvgr_dm_comm_ctx.c \
	$(HVGR_ROOT)/dm/bbox/hvgr_bbox.c

ifeq ($(CONFIG_HVGR_DFX_SH), y)
	SRC += $(HVGR_ROOT)/dm/dmd/hvgr_dmd_dfx.c
endif

ifeq ($(CONFIG_HVGR_PERI_SH), y)
	SRC += $(HVGR_ROOT)/dm/hvgr_dm_peri_sh.c
endif

ifeq ($(CONFIG_HVGR_STATE_BUNDLE2), y)
	SRC += $(HVGR_ROOT)/dm/fcp/driver/$(CHIP_VER_DIR)/hvgr_mcu_common.c
ifeq ($(CONFIG_DFX_DEBUG_FS), y)
	SRC += $(HVGR_ROOT)/dm/fcp/driver/$(CHIP_VER_DIR)/hvgr_mcu_debug_switch.c
endif
endif

ifeq ($(HVGR_USE_PCIE), 1)
	SRC += $(HVGR_ROOT)/dm/driver/hvgr_pcie.c
else
	SRC += $(HVGR_ROOT)/dm/driver/hvgr_soc.c
endif

ifeq ($(CONFIG_HVGR_VIRTUAL_HOST), y)
	SRC += $(HVGR_ROOT)/dm/driver/hvgr_norda_soc.c
endif
