############################################################################
# arch/arm64/src/imx9/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.  The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

include common/Make.defs

ifeq ($(CONFIG_IMX9_DDR_TRAINING),y)
  include imx9/ddr/Make.defs
endif

# i.MX9-specific C source files

CHIP_CSRCS  = imx9_boot.c imx9_ccm.c imx9_clockconfig.c imx9_gpio.c
CHIP_CSRCS += imx9_iomuxc.c

ifeq ($(CONFIG_ARCH_CHIP_IMX93),y)
  CHIP_CSRCS += imx9_lpuart.c imx9_lowputc.c
endif

ifeq ($(CONFIG_IMX9_GPIO_IRQ),y)
  CHIP_CSRCS += imx9_gpioirq.c
endif

ifeq ($(CONFIG_IMX9_FLEXIO_PWM),y)
  CHIP_CSRCS += imx9_flexio_pwm.c
endif

ifeq ($(CONFIG_IMX9_TPM_PWM),y)
  CHIP_CSRCS += imx9_tpm_pwm.c
endif

ifeq ($(CONFIG_IMX9_USBDEV),y)
  CHIP_CSRCS += imx9_usbdev.c
endif

ifeq ($(CONFIG_IMX9_LPI2C),y)
  CHIP_CSRCS += imx9_lpi2c.c
endif

ifeq ($(CONFIG_IMX9_LPSPI),y)
  CHIP_CSRCS += imx9_lpspi.c
endif

ifeq ($(CONFIG_IMX9_EDMA), y)
  CHIP_CSRCS += imx9_edma.c
endif

ifeq ($(CONFIG_IMX9_DMA_ALLOC),y)
  CHIP_CSRCS += imx9_dma_alloc.c
endif

ifeq ($(CONFIG_IMX9_ENET),y)
  CHIP_CSRCS += imx9_enet.c
endif

ifeq ($(CONFIG_IMX9_USDHC),y)
  CHIP_CSRCS += imx9_usdhc.c
endif

ifeq ($(CONFIG_IMX9_FLEXSPI), y)
  CHIP_CSRCS += imx9_flexspi.c
endif

ifeq ($(CONFIG_IMX9_FLEXSPI_NOR), y)
  CHIP_CSRCS += imx9_flexspi_nor.c
endif

ifeq ($(CONFIG_IMX9_BOOTLOADER), y)
  CHIP_CSRCS += imx9_system_ctl.c
  CHIP_CSRCS += imx9_trdc.c
endif

ifeq ($(CONFIG_IMX9_DDR_TRAINING),y)
  CHIP_CSRCS += $(DDR_CSRCS)
endif

ifeq ($(CONFIG_IMX9_FLEXCAN), y)
  CHIP_CSRCS += imx9_flexcan.c
endif