[WIP][PDK-8726] Separate OSPI tests keeping memory cached/non-cached
[processor-sdk/pdk.git] / packages / ti / drv / spi / test / ospi_flash / makefile
1 # Makefile for SPI unit test app
2 include $(PDK_INSTALL_PATH)/ti/build/Rules.make
4 ifeq ($(IS_BAREMETAL),yes)
5 BUILD_OS_TYPE = baremetal
6 CFLAGS_OS_DEFINES =
7 LNKFLAGS_LOCAL_mpu1_0  += --entry Entry
8 COMP_LIST_COMMON  = $(PDK_COMMON_BAREMETAL_COMP) 
9 EXTERNAL_INTERFACES =
10 XDC_CFG_FILE_mpu1_0 =
11 XDC_CFG_FILE_mcu1_0 =
12 else
13 BUILD_OS_TYPE = tirtos
14 CFLAGS_OS_DEFINES = -DUSE_BIOS
15 EXTERNAL_INTERFACES = bios xdc
16 COMP_LIST_COMMON  = $(PDK_COMMON_TIRTOS_COMP) 
18 SRCDIR = . src
19 INCDIR = . src
22 ifeq ($(SOC),$(filter $(SOC), am65xx))
23 XDC_CFG_FILE_mpu1_0 = ./$(SOC)/ospiFlashTest_a53.cfg
24 XDC_CFG_FILE_mcu1_0 = ./$(SOC)/ospiFlashTest_r5.cfg
25 endif
26 ifeq ($(SOC),$(filter $(SOC), j7200 j721e am64x))
27     ifeq ($(CACHE), enable)
28         XDC_CFG_FILE_$(CORE) = ./$(SOC)/cached/sysbios_$(ISA).cfg
29     else
30         XDC_CFG_FILE_$(CORE) = ./$(SOC)/non_cached/sysbios_$(ISA).cfg
31     endif
32 endif
34 endif
36 # Common source files across all platforms and cores
37 SRCDIR += . src
38 SRCS_COMMON += main_ospi_flash_test.c
40 ifeq ($(BUILD_OS_TYPE), tirtos)
41 OSPI_OS_TESTPREFIX=
42 else
43 OSPI_OS_TESTPREFIX=_Baremetal
44 endif
48 # List all the external components/interfaces, whose interface header files
49 # need to be included for this component
50 INCLUDE_EXTERNAL_INTERFACES = pdk $(EXTERNAL_INTERFACES)
52 ifeq ($(CACHE), enable)
53     ifeq ($(DMA), enable)
54         ifeq ($(SMP), enable)
55             #Name of the directory created under packages/ti/binary/
56             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_SMP_Cache_TestApp
57             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
58             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_$(BOARD)_$(CORE)_SMP_Cache_TestApp
59             ifeq ($(SOC),$(filter $(SOC), am65xx j721e j7200))
60                 LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_SMP_Cache_TestApp_$(CORE)
61             endif
63         else
64             #Name of the directory created under packages/ti/binary/
65             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_Cache_TestApp
66             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
67             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_Cache_$(BOARD)_$(CORE)TestApp
68             ifeq ($(SOC),$(filter $(SOC), am65xx j721e j7200))
69                 LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_Cache_TestApp_$(CORE)
70             endif
71         endif
73     COMP_LIST_COMMON += spi_dma
74     #COMP_LIST_COMMON += spi_dma_profile
75     CFLAGS_SPI_DMA    = -DSPI_DMA_ENABLE 
76     else
77         ifeq ($(SMP), enable)
78             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_SMP_Cache_TestApp
79             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
80             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_$(BOARD)_$(CORE)_SMP_Cache_TestApp
81         else
82             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_Cache_TestApp
83             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
84             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Cache_$(BOARD)_$(CORE)TestApp
85         endif
87     COMP_LIST_COMMON += spi 
88     #COMP_LIST_COMMON += spi_profile
89     CFLAGS_SPI_DMA    =
90     endif
92 else
93     ifeq ($(DMA), enable)
94         ifeq ($(SMP), enable)
95             #Name of the directory created under packages/ti/binary/
96             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_SMP_TestApp
97             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
98             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_$(BOARD)_$(CORE)_SMP_TestApp
99             ifeq ($(SOC),$(filter $(SOC), am65xx j721e j7200))
100                 LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_SMP_TestApp_$(CORE)
101             endif
103         else
104             #Name of the directory created under packages/ti/binary/
105             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_TestApp
106             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
107             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_$(BOARD)_$(CORE)TestApp
108             ifeq ($(SOC),$(filter $(SOC), am65xx j721e j7200))
109                 LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_Dma_TestApp_$(CORE)
110             endif
111         endif
113     COMP_LIST_COMMON += spi_dma
114     #COMP_LIST_COMMON += spi_dma_profile
115     CFLAGS_SPI_DMA    = -DSPI_DMA_ENABLE 
116     else
117         ifeq ($(SMP), enable)
118             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_SMP_TestApp
119             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
120             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_$(BOARD)_$(CORE)_SMP_TestApp
121         else
122             APP_NAME = OSPI$(OSPI_OS_TESTPREFIX)_Flash_TestApp
123             # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
124             LOCAL_APP_NAME =  OSPI$(OSPI_OS_TESTPREFIX)_Flash_$(BOARD)_$(CORE)TestApp
125         endif
127     COMP_LIST_COMMON += spi 
128     #COMP_LIST_COMMON += spi_profile
129     CFLAGS_SPI_DMA    =
130     endif
131 endif
133 PACKAGE_SRCS_COMMON = .
134 PACKAGE_SRCS_COMMON += ../src/SPI_log.h ../src/SPI_log.c
135 CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_SPI_DMA) $(CFLAGS_OS_DEFINES)
137 # Core/SoC/platform specific source files and CFLAGS
138 # Example:
139 #   SRCS_<core/SoC/platform-name> =
140 #   CFLAGS_LOCAL_<core/SoC/platform-name> =
142 # Include common make files
143 ifeq ($(MAKERULEDIR), )
144 #Makerule path not defined, define this and assume relative path from ROOTDIR
145   MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
146   export MAKERULEDIR
147 endif
148 include $(MAKERULEDIR)/common.mk
150 # OBJs and libraries are built by using rule defined in rules_<target>.mk
151 #     and need not be explicitly specified here
153 # Nothing beyond this point