]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/blob - packages/ti/drv/emac/firmware/icss_dualmac/src/makefile
Merge pull request #19 in PROCESSOR-SDK/pdk from prsdk-7325 to master
[processor-sdk/pdk.git] / packages / ti / drv / emac / firmware / icss_dualmac / src / makefile
1 #
2 #  TEXAS INSTRUMENTS TEXT FILE LICENSE
3 #
4 #   Copyright (c) 2018-2019 Texas Instruments Incorporated
5 #
6 #  All rights reserved not granted herein.
7 #
8 #  Limited License.
9 #
10 #  Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
11 #  license under copyrights and patents it now or hereafter owns or controls to
12 #  make, have made, use, import, offer to sell and sell ("Utilize") this software
13 #  subject to the terms herein.  With respect to the foregoing patent license,
14 #  such license is granted  solely to the extent that any such patent is necessary
15 #  to Utilize the software alone.  The patent license shall not apply to any
16 #  combinations which include this software, other than combinations with devices
17 #  manufactured by or for TI (“TI Devices”).  No hardware patent is licensed hereunder.
18 #
19 #  Redistributions must preserve existing copyright notices and reproduce this license
20 #  (including the above copyright notice and the disclaimer and (if applicable) source
21 #  code license limitations below) in the documentation and/or other materials provided
22 #  with the distribution.
23 #
24 #  Redistribution and use in binary form, without modification, are permitted provided
25 #  that the following conditions are met:
26 #       No reverse engineering, decompilation, or disassembly of this software is
27 #   permitted with respect to any software provided in binary form.
28 #       Any redistribution and use are licensed by TI for use only with TI Devices.
29 #       Nothing shall obligate TI to provide you with source code for the software
30 #   licensed and provided to you in object code.
31 #
32 #  If software source code is provided to you, modification and redistribution of the
33 #  source code are permitted provided that the following conditions are met:
34 #       Any redistribution and use of the source code, including any resulting derivative
35 #   works, are licensed by TI for use only with TI Devices.
36 #       Any redistribution and use of any object code compiled from the source code
37 #   and any resulting derivative works, are licensed by TI for use only with TI Devices.
38 #
39 #  Neither the name of Texas Instruments Incorporated nor the names of its suppliers
40 #  may be used to endorse or promote products derived from this software without
41 #  specific prior written permission.
42 #
43 #  DISCLAIMER.
44 #
45 #  THIS SOFTWARE IS PROVIDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED
46 #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
47 #  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI’S
48 #  LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
49 #  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
50 #  GOODS OR SERVICES# LOSS OF USE, DATA, OR PROFITS# OR BUSINESS INTERRUPTION) HOWEVER
51 #  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
53 #  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 #------------------------
56 #make pru&rtu f/w
57 #  flags:
58 #  -DSLICE0,SLICE1 -> tell f/w which slice he is
59 #  -DSWITCH  -> for switch mode
60 #  -DMAC     -> for macA
61 #  -DWAIT_FOR_DEBUGGER -> f.w will wait for debugger to attach and poke r11 to continue
62 #  -DPSA - IET scheduler and reciever
63 #  -DPSILOOP  - f/w will loop packets received from host back to host via psi
64 #  -DFORCEALL  - (switch only) must be defined to use helper functions on rtu
65 #  -DNO_CLASS -> disable classifier use for pkt->flow mapping
66 #  -DDO_PSI_ABORT  (define to enable psi abort sequence on bad pkts. this requires
67 #               rx free ring to be in message mode!.  if not define, bad pkts
68 #               will be delivered to host with word 3 of protocol specific area 
69 #               set to 0xBAD0)
70 #-----------------------
71 include $(RULES_MAKE)
73 CLPRU = $(CL_PRU_INSTALL_PATH)/bin/clpru
74 HEXPRU = $(CL_PRU_INSTALL_PATH)/bin/hexpru
75 WIN_BIN = $(SDK_INSTALL_PATH)/pdk_$(PDK_SOC)_$(PDK_VERSION)/packages/ti/drv/emac/firmware/icss_dualmac/bin
77 all:
78         $(MAKE) mkversion
79   ifeq ($(OS),Windows_NT)
80         $(MAKE) BLDT=$(WIN_BIN) all_bins
81   else
82         $(MAKE) BLDT="../bin" all_bins
83   endif
85 all_bins: $(BLDT)/rxl2_txl2_rgmii0_bin.h $(BLDT)/rxl2_txl2_rgmii1_bin.h \
86                 $(BLDT)/rtu_test0_bin.h $(BLDT)/rtu_test1_bin.h
88 CL_FLAGS = --endian=little \
89            -v4 \
90            -g \
91            --diag_wrap=off \
92            --diag_warning=225 \
93            --display_error_number \
94            --hardware_mac=on \
95            --code_address_listing_unit=word \
97 FLAGS = -al \
98         --preproc_with_compile \
99         -eo.opru \
101 EF_PRU0 = -DMAC  -DSLICE0 
102 EF_PRU1 = -DMAC  -DSLICE1
103 EF_RTU0 = -DMAC  -DSLICE0 -DDO_PSI_ABORT
104 EF_RTU1 = -DMAC  -DSLICE1 -DDO_PSI_ABORT
106 APP_DEFS = --define=RGMII \
107            -z \
108            --stack_size=0 \
109            --heap_size=0 \
110            --reread_libs \
111            --warn_sections
113 PRUS = rxl2_txl2
114 PRU0 = $(PRUS)_rgmii0
115 PRU1 = $(PRUS)_rgmii1
116 RTU = rtu
117 RTUS = rtu_v2
118 RTU0 = rtu_test0
119 RTU1 = rtu_test1
121 .PHONY: mkversion
123 mkversion:
124   ifeq ($(OS),Windows_NT)
125 #               @echo ;there is no version scring when building from Windows > version_file.h
126   else
127         ./makeversion.sh
128   endif
130 $(BLDT)/$(PRU0)_bin.h: $(PRUS).asm pru.cmd
131         mkdir -p $(BLDT)/$(PRU0)
132         $(CLPRU) $(CL_FLAGS) $(FLAGS) \
133                 -DRGMII $(EF_PRU0) -fr=$(BLDT)/$(PRU0) \
134                 -fs=$(BLDT)/$(PRU0) --preproc_dependency="$(PRUS).d" $(PRUS).asm
135         $(CLPRU) $(CL_FLAGS) $(APP_DEFS) \
136                 --entry_point=Start $(BLDT)/$(PRU0)/$(PRUS).opru pru.cmd \
137                 -o $(BLDT)/$(PRU0)/$(PRUS).out -m $(BLDT)/$(PRU0)/$(PRUS).map \
138                 --xml_link_info="$(BLDT)/$(PRU0)/$(PRUS)_linkInfo.xml"
139         $(HEXPRU) --array --array:name_prefix=PDSPcode --array:page0_type_size=32 \
140                                               --exclude=.resource_table \
141                                               $(BLDT)/$(PRU0)/$(PRUS).out -o $(BLDT)/$(PRU0)_bin.h
143 $(BLDT)/$(PRU1)_bin.h: $(PRUS).asm pru.cmd
144         mkdir -p $(BLDT)/$(PRU1)
145         $(CLPRU) $(CL_FLAGS) $(FLAGS) \
146                 -DRGMII $(EF_PRU1) -fr=$(BLDT)/$(PRU1) \
147                 -fs=$(BLDT)/$(PRU1) --preproc_dependency="$(PRUS).d" $(PRUS).asm
148         $(CLPRU) $(CL_FLAGS) $(APP_DEFS) \
149                 --entry_point=Start $(BLDT)/$(PRU1)/$(PRUS).opru pru.cmd \
150                 -o $(BLDT)/$(PRU1)/$(PRUS).out -m $(BLDT)/$(PRU1)/$(PRUS).map \
151                 --xml_link_info="$(BLDT)/$(PRU1)/$(PRUS)_linkInfo.xml"
152         $(HEXPRU) --array --array:name_prefix=PDSP3code --array:page0_type_size=32 \
153                                               --exclude=.resource_table \
154                                               $(BLDT)/$(PRU1)/$(PRUS).out -o $(BLDT)/$(PRU1)_bin.h
156 $(BLDT)/$(RTU0)_bin.h: $(RTUS).asm pru.cmd
157         mkdir -p $(BLDT)/$(RTU0)
158         $(CLPRU) $(CL_FLAGS) $(FLAGS) \
159                 -ss \
160                 -DRGMII $(EF_RTU0) -fr=$(BLDT)/$(RTU0) \
161                 -fs=$(BLDT)/$(RTU0) --preproc_dependency="$(RTUS).d" $(RTUS).asm
162         $(CLPRU) $(CL_FLAGS) $(APP_DEFS) \
163                 --entry_point=Start $(BLDT)/$(RTU0)/$(RTUS).opru pru.cmd \
164                 -o $(BLDT)/$(RTU0)/$(RTUS).out -m $(BLDT)/$(RTU0)/$(RTUS).map \
165                 --xml_link_info="$(BLDT)/$(RTU0)/$(RTUS)_linkInfo.xml"
166         $(HEXPRU) --array --array:name_prefix=PDSP2code --array:page0_type_size=32 \
167                                               --exclude=.resource_table \
168                                               $(BLDT)/$(RTU0)/$(RTUS).out -o $(BLDT)/$(RTU0)_bin.h
170 $(BLDT)/$(RTU1)_bin.h: $(RTUS).asm pru.cmd
171         mkdir -p $(BLDT)/$(RTU1)
172         $(CLPRU) $(CL_FLAGS) $(FLAGS) \
173                 -ss \
174                 -DRGMII $(EF_RTU1) -fr=$(BLDT)/$(RTU1) \
175                 -fs=$(BLDT)/$(RTU1) --preproc_dependency="$(RTUS).d" $(RTUS).asm
176         $(CLPRU) $(CL_FLAGS) $(APP_DEFS) \
177                 --entry_point=Start $(BLDT)/$(RTU1)/$(RTUS).opru pru.cmd \
178                 -o $(BLDT)/$(RTU1)/$(RTUS).out -m $(BLDT)/$(RTU1)/$(RTUS).map \
179                 --xml_link_info="$(BLDT)/$(RTU1)/$(RTUS)_linkInfo.xml"
180         $(HEXPRU) --array --array:name_prefix=PDSP4code --array:page0_type_size=32 \
181                                               --exclude=.resource_table \
182                                               $(BLDT)/$(RTU1)/$(RTUS).out -o $(BLDT)/$(RTU1)_bin.h
184 clean:  
185 ifeq ($(OS),Windows_NT)
186         cmd /c "rmdir /Q /S ..\bin"
187 else
188         rm -rf ../bin
189 endif