summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@ti.com>2019-08-07 07:04:28 +0000
committerDenys Dmytriyenko <denys@ti.com>2019-08-07 01:50:50 +0000
commit108509e80ee20bf39e05442615b243a66fc42e6d (patch)
tree6bf3ab87d84d8619fcc0584b53a9e840a8dea994
parent661bbc892b2ca41e04dd2492d46ec129e0780cc4 (diff)
downloadmeta-ti-108509e80ee20bf39e05442615b243a66fc42e6d.tar.gz
pru-swuart-fw: add PRU Software UART Firmware recipeti2019.03-rc1
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch145
-rw-r--r--recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-remove-dependency-on-PDK-CSL.patch54
-rw-r--r--recipes-bsp/pru/pru-swuart-fw_git.bb40
3 files changed, 239 insertions, 0 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
new file mode 100644
index 00000000..8414d945
--- /dev/null
+++ b/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-add-Makefile-for-building-firmware.patch
@@ -0,0 +1,145 @@
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
diff --git a/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-remove-dependency-on-PDK-CSL.patch b/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-remove-dependency-on-PDK-CSL.patch
new file mode 100644
index 00000000..b565ba0e
--- /dev/null
+++ b/recipes-bsp/pru/pru-swuart-fw/0001-icss_uart-remove-dependency-on-PDK-CSL.patch
@@ -0,0 +1,54 @@
1From 1b853cfd6194d3855310f47d43cb8c9f498b6182 Mon Sep 17 00:00:00 2001
2From: Bin Liu <b-liu@ti.com>
3Date: Wed, 27 Feb 2019 14:38:43 -0600
4Subject: [PATCH] icss_uart: remove dependency on PDK/CSL
5
6Signed-off-by: Bin Liu <b-liu@ti.com>
7---
8 firmware/icss_uart/src/icss_ctrl_regs.h | 32 ++++----------------------------
9 1 file changed, 4 insertions(+), 28 deletions(-)
10
11diff --git a/firmware/icss_uart/src/icss_ctrl_regs.h b/firmware/icss_uart/src/icss_ctrl_regs.h
12index ce640f5..99ec90d 100644
13--- a/firmware/icss_uart/src/icss_ctrl_regs.h
14+++ b/firmware/icss_uart/src/icss_ctrl_regs.h
15@@ -39,32 +39,8 @@
16 .if !$isdefed("__icss_ctrl_regs_h")
17 __icss_ctrl_regs_h .set 1
18
19- .cdecls C,NOLIST
20-%{
21-#include "cslr_icss.h"
22-%}
23-
24- .if $defined("ICSS_REV1")
25-ICSS_PRU_CTRL_CONTROL .set (CSL_ICSSM_PRU_CTRL_CONTROL)
26-ICSS_PRU_CTRL_STATUS .set (CSL_ICSSM_PRU_CTRL_STATUS)
27-ICSS_PRU_CTRL_WAKEUP_EN .set (CSL_ICSSM_PRU_CTRL_WAKEUP_EN)
28-ICSS_PRU_CTRL_CYCLE .set (CSL_ICSSM_PRU_CTRL_CYCLE)
29-ICSS_PRU_CTRL_STALL .set (CSL_ICSSM_PRU_CTRL_STALL)
30-ICSS_PRU_CTRL_CTBIR0 .set (CSL_ICSSM_PRU_CTRL_CTBIR0)
31-ICSS_PRU_CTRL_CTBIR1 .set (CSL_ICSSM_PRU_CTRL_CTBIR1)
32-ICSS_PRU_CTRL_CTPPR0 .set (CSL_ICSSM_PRU_CTRL_CTPPR0)
33-ICSS_PRU_CTRL_CTPPR1 .set (CSL_ICSSM_PRU_CTRL_CTPPR1)
34- .endif ;ICSS_REV1
35-
36- .if $defined("ICSS_REV2")
37-ICSS_PRU_CTRL_CONTROL .set (CSL_ICSSPRUCTRL_CONTROL)
38-ICSS_PRU_CTRL_STATUS .set (CSL_ICSSPRUCTRL_STATUS)
39-ICSS_PRU_CTRL_WAKEUP_EN .set (CSL_ICSSPRUCTRL_WAKEUP_EN)
40-ICSS_PRU_CTRL_CYCLE .set (CSL_ICSSPRUCTRL_CYCLE)
41-ICSS_PRU_CTRL_STALL .set (CSL_ICSSPRUCTRL_STALL)
42-ICSS_PRU_CTRL_CTBIR0 .set (CSL_ICSSPRUCTRL_CTBIR0)
43-ICSS_PRU_CTRL_CTBIR1 .set (CSL_ICSSPRUCTRL_CTBIR1)
44-ICSS_PRU_CTRL_CTPPR0 .set (CSL_ICSSPRUCTRL_CTPPR0)
45-ICSS_PRU_CTRL_CTPPR1 .set (CSL_ICSSPRUCTRL_CTPPR1)
46- .endif ;ICSS_REV2
47+ICSS_PRU_CTRL_CONTROL .set (0x0U)
48+ICSS_PRU_CTRL_STATUS .set (0x4U)
49+ICSS_PRU_CTRL_WAKEUP_EN .set (0x8U)
50+ICSS_PRU_CTRL_CYCLE .set (0xcU)
51 .endif
52--
532.7.4
54
diff --git a/recipes-bsp/pru/pru-swuart-fw_git.bb b/recipes-bsp/pru/pru-swuart-fw_git.bb
new file mode 100644
index 00000000..e22b3bea
--- /dev/null
+++ b/recipes-bsp/pru/pru-swuart-fw_git.bb
@@ -0,0 +1,40 @@
1SUMMARY = "Programmable Real-time Unit Software UART Firmware"
2LICENSE = "BSD-3-Clause"
3
4LIC_FILES_CHKSUM = "file://COPYING.txt;beginline=1;endline=31;md5=94b6a199da1caf777f6756cb70aca4a7"
5
6require recipes-ti/includes/ti-paths.inc
7
8COMPATIBLE_MACHINE = "ti33x"
9PACKAGE_ARCH = "${MACHINE_ARCH}"
10
11# Below commit ID corresponds to "DEV.UART_LLD.01.00.00.15"
12SRCREV = "4493f456549c85749a05b1f46bf0b75d23976db1"
13
14PV = "01.00.00.15"
15
16BRANCH = "master"
17SRC_URI = "git://git.ti.com/keystone-rtos/uart-lld.git;protocol=git;branch=${BRANCH} \
18 file://0001-icss_uart-add-Makefile-for-building-firmware.patch \
19 file://0001-icss_uart-remove-dependency-on-PDK-CSL.patch \
20"
21
22DEPENDS = "ti-cgt-pru-native pru-icss"
23
24S = "${WORKDIR}/git"
25
26export PRU_CGT = "${TI_CGT_PRU_INSTALL_DIR}"
27export PRU_SSP = "${STAGING_DIR_TARGET}/usr"
28
29do_compile() {
30 oe_runmake -C firmware/icss_uart/src
31}
32
33do_install() {
34 install -d ${D}/lib/firmware/ti-pruss
35 install -m 0644 ${S}/firmware/icss_uart/src/gen/src.out ${D}/lib/firmware/ti-pruss/pru_swuart-fw.elf
36}
37
38FILES_${PN} = "/lib/firmware"
39
40INSANE_SKIP_${PN} = "arch"