summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch')
-rw-r--r--recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch145
1 files changed, 0 insertions, 145 deletions
diff --git a/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch b/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch
deleted file mode 100644
index 8414d945..00000000
--- a/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch
+++ /dev/null
@@ -1,145 +0,0 @@
1From d37359e7b2bd26da4d04fc97a94967cf457558e9 Mon Sep 17 00:00:00 2001
2From: Denys Dmytriyenko <denys@ti.com>
3Date: Tue, 6 Aug 2019 19:50:59 -0400
4Subject: [PATCH] icss_uart: add Makefile for building firmware
5
6Signed-off-by: Denys Dmytriyenko <denys@ti.com>
7---
8 firmware/icss_uart/src/Makefile | 125 ++++++++++++++++++++++++++++++++++++++++
9 1 file changed, 125 insertions(+)
10 create mode 100644 firmware/icss_uart/src/Makefile
11
12diff --git a/firmware/icss_uart/src/Makefile b/firmware/icss_uart/src/Makefile
13new file mode 100644
14index 0000000..4764622
15--- /dev/null
16+++ b/firmware/icss_uart/src/Makefile
17@@ -0,0 +1,125 @@
18+# PRU_CGT environment variable must point to the TI PRU code gen tools directory. E.g.:
19+#(Desktop Linux) export PRU_CGT=/path/to/pru/code/gen/tools/ti-cgt-pru_2.x.y
20+#(Windows) set PRU_CGT=C:/path/to/pru/code/gen/tools/ti-cgt-pru_2.x.y
21+#(ARM Linux*) export PRU_CGT=/usr/share/ti/cgt-pru
22+#
23+# *ARM Linux also needs to create a symbolic link to the /usr/bin/ directory in
24+# order to use the same Makefile
25+#(ARM Linux) ln -s /usr/bin/ /usr/share/ti/cgt-pru/bin
26+
27+ifndef PRU_CGT
28+define ERROR_BODY
29+
30+*******************************************************************************
31+PRU_CGT environment variable is not set. Examples given:
32+(Desktop Linux) export PRU_CGT=/path/to/pru/code/gen/tools/ti-cgt-pru_2.1.2
33+(Windows) set PRU_CGT=C:/path/to/pru/code/gen/tools/ti-cgt-pru_2.1.2
34+(ARM Linux*) export PRU_CGT=/usr/share/ti/cgt-pru
35+
36+*ARM Linux also needs to create a symbolic link to the /usr/bin/ directory in
37+order to use the same Makefile
38+(ARM Linux) ln -s /usr/bin/ /usr/share/ti/cgt-pru/bin
39+*******************************************************************************
40+
41+endef
42+$(error $(ERROR_BODY))
43+endif
44+
45+# PRU_SSP environment variable must point to the PRU Software Support Package. E.g.:
46+#(Desktop Linux) export PRU_SSP=/path/to/pru_software_support_package
47+#(Windows) set PRU_SSP=C:/path/to/pru_software_support_package
48+#(ARM Linux*) export PRU_SSP=/path/to/pru_software_support_package
49+
50+ifndef PRU_SSP
51+define ERROR_BODY
52+
53+*******************************************************************************
54+PRU_SSP environment variable must point to the PRU Software Support Package. E.g.:
55+(Desktop Linux) export PRU_SSP=/path/to/pru_software_support_package
56+(Windows) set PRU_SSP=C:/path/to/pru_software_support_package
57+(ARM Linux*) export PRU_SSP=/path/to/pru_software_support_package
58+PRU_CGT environment variable is not set. Examples given:
59+*******************************************************************************
60+
61+endef
62+$(error $(ERROR_BODY))
63+endif
64+
65+MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
66+CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
67+PROJ_NAME=$(CURRENT_DIR)
68+LINKER_COMMAND_FILE=./AM335x_PRU.cmd
69+LIBS=--library=$(PRU_SSP)/lib/rpmsg_lib.lib
70+INCLUDE=--include_path=$(PRU_SSP)/include --include_path=$(PRU_SSP)/include/am335x
71+STACK_SIZE=0x100
72+HEAP_SIZE=0x100
73+GEN_DIR=gen
74+
75+#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
76+CFLAGS=-v3 -o2 --display_error_number --endian=little --hardware_mac=on --asm_directory=$(GEN_DIR) --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa -DICSS_REV2
77+#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
78+LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
79+
80+TARGET=$(GEN_DIR)/$(PROJ_NAME).out
81+MAP=$(GEN_DIR)/$(PROJ_NAME).map
82+OBJECTS=$(patsubst %.asm,$(GEN_DIR)/%.object,$(wildcard *.asm))
83+OBJECTS+=$(patsubst %.c,$(GEN_DIR)/%.object,$(wildcard *.c))
84+
85+
86+all: printStart $(TARGET) printEnd
87+
88+printStart:
89+ @echo ''
90+ @echo '************************************************************'
91+ @echo 'Building project: $(PROJ_NAME)'
92+
93+printEnd:
94+ @echo ''
95+ @echo 'Output files can be found in the "$(GEN_DIR)" directory'
96+ @echo ''
97+ @echo 'Finished building project: $(PROJ_NAME)'
98+ @echo '************************************************************'
99+ @echo ''
100+
101+# Invokes the linker (-z flag) to make the .out file
102+$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
103+ @echo ''
104+ @echo 'Building target: $@'
105+ @echo 'Invoking: PRU Linker'
106+ $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
107+ @echo 'Finished building target: $@'
108+
109+# Invokes the compiler on all assembly files in the directory to create the object files
110+$(GEN_DIR)/%.object: %.asm
111+ @mkdir -p $(GEN_DIR)
112+ @echo ''
113+ @echo 'Building file: $<'
114+ @echo 'Invoking: PRU Compiler'
115+ $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
116+
117+# Invokes the compiler on all c files in the directory to create the object files
118+$(GEN_DIR)/%.object: %.c
119+ @mkdir -p $(GEN_DIR)
120+ @echo ''
121+ @echo 'Building file: $<'
122+ @echo 'Invoking: PRU Compiler'
123+ $(PRU_CGT)/bin/clpru -k --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
124+
125+.PHONY: all clean
126+
127+# Remove the $(GEN_DIR) directory
128+clean:
129+ @echo ''
130+ @echo '************************************************************'
131+ @echo 'Cleaning project: $(PROJ_NAME)'
132+ @echo ''
133+ @echo 'Removing files in the "$(GEN_DIR)" directory'
134+ @rm -rf $(GEN_DIR)
135+ @echo ''
136+ @echo 'Finished cleaning project: $(PROJ_NAME)'
137+ @echo '************************************************************'
138+ @echo ''
139+
140+# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
141+-include $(OBJECTS:%.object=%.pp)
142+
143--
1442.7.4
145