summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTinku Mannan2018-07-31 16:54:01 -0500
committerTinku Mannan2018-07-31 16:54:01 -0500
commit9145daffac02e3e9d66475e08a671c2124afab7c (patch)
tree10301138cd88a5f45cbdd01f0267895ebe7023c7
parent661dfc321c017fba2157138406a8eaf3e97a02cb (diff)
parenta11714517887bda62fab76941f2f32207fad2b05 (diff)
downloadpruss-lld-9145daffac02e3e9d66475e08a671c2124afab7c.tar.gz
pruss-lld-9145daffac02e3e9d66475e08a671c2124afab7c.tar.xz
pruss-lld-9145daffac02e3e9d66475e08a671c2124afab7c.zip
Merge branch 'master' into rtos-next-merge
-rw-r--r--docs/ReleaseNotes_PRUSS_LLD.docbin127488 -> 127488 bytes
-rw-r--r--docs/ReleaseNotes_PRUSS_LLD.pdfbin392676 -> 393042 bytes
-rw-r--r--example/apps/sorte/firmware/src/master/firm_main.asm14
-rw-r--r--example/apps/sorte/master/makefile_armv7151
-rw-r--r--example/apps/sorte/slave/makefile_armv7157
-rw-r--r--example/apps/sorte/src/main.c111
-rwxr-xr-xmakefile_armv712
-rw-r--r--package.xdc4
-rw-r--r--pruicss_ver.h4
-rw-r--r--src/pruicss_drv.c1
-rw-r--r--src/pruicss_intc.c10
-rw-r--r--test/am571x/armv7/linux/makefile2
-rw-r--r--test/am572x/armv7/linux/makefile2
-rw-r--r--test/am574x/armv7/linux/makefile2
-rw-r--r--test/src/armv7/linux/mmap_helper.c8
15 files changed, 448 insertions, 30 deletions
diff --git a/docs/ReleaseNotes_PRUSS_LLD.doc b/docs/ReleaseNotes_PRUSS_LLD.doc
index a931714..5feb24b 100644
--- a/docs/ReleaseNotes_PRUSS_LLD.doc
+++ b/docs/ReleaseNotes_PRUSS_LLD.doc
Binary files differ
diff --git a/docs/ReleaseNotes_PRUSS_LLD.pdf b/docs/ReleaseNotes_PRUSS_LLD.pdf
index fca4ea6..b1ba657 100644
--- a/docs/ReleaseNotes_PRUSS_LLD.pdf
+++ b/docs/ReleaseNotes_PRUSS_LLD.pdf
Binary files differ
diff --git a/example/apps/sorte/firmware/src/master/firm_main.asm b/example/apps/sorte/firmware/src/master/firm_main.asm
index 7793ef0..353f38f 100644
--- a/example/apps/sorte/firmware/src/master/firm_main.asm
+++ b/example/apps/sorte/firmware/src/master/firm_main.asm
@@ -135,12 +135,10 @@ firm_main:
135 135
136; starting with idle state 136; starting with idle state
137; test if there is an active link on the port using mdio interface 137; test if there is an active link on the port using mdio interface
138
139; test if there is an active link on the port using mdio interface
140 lbco &TEMP_REG_2.b0, ICSS_SHARED_RAM_CONST, MDIO_PHY_CONFIG_OFFSET, 1
141IDLE_WAIT_FOR_LINK_ACTIVE: 138IDLE_WAIT_FOR_LINK_ACTIVE:
139 lbco &TEMP_REG_2.b0, ICSS_SHARED_RAM_CONST, MDIO_PHY_CONFIG_OFFSET, 1
142 lbco &TEMP_REG_1, ICSS_MDIO_CONST, ICSS_MDIO_LINK, 4 140 lbco &TEMP_REG_1, ICSS_MDIO_CONST, ICSS_MDIO_LINK, 4
143 qbbc IDLE_WAIT_FOR_LINK_ACTIVE, TEMP_REG_1.b0, TEMP_REG_2.b0 141 qbbc IDLE_WAIT_FOR_LINK_ACTIVE, TEMP_REG_1, TEMP_REG_2.b0
144 142
145; check if enabled, enabling done at startup of pru firmware. 143; check if enabled, enabling done at startup of pru firmware.
146 lbco &TEMP_REG_1.b0, PRU0_DMEM_CONST, CTRL_REG_OFFSET , 1 144 lbco &TEMP_REG_1.b0, PRU0_DMEM_CONST, CTRL_REG_OFFSET , 1
@@ -461,11 +459,17 @@ STATE_PARAM_SEND:
461; end packet with crc generated by PRU 459; end packet with crc generated by PRU
462 M_CMD16 D_PUSH_CRC_MSWORD_CMD | D_PUSH_CRC_LSWORD_CMD | D_TX_EOF 460 M_CMD16 D_PUSH_CRC_MSWORD_CMD | D_PUSH_CRC_LSWORD_CMD | D_TX_EOF
463 461
462 ldi R2.w0, 0
463 ldi R2.w2, 1000
464; receive packet and check if all accepted 464; receive packet and check if all accepted
465STATE_PARAM_WAIT_BANK0: 465STATE_PARAM_WAIT_BANK0:
466 add R2.w0, R2.w0, 1
466 xin RXL2_BANK0, &R18, 1 467 xin RXL2_BANK0, &R18, 1
468 qbeq STATE_PARAM_WAIT, R2.w0, R2.w2
467 qbgt STATE_PARAM_WAIT_BANK0, r18.b0, 32 469 qbgt STATE_PARAM_WAIT_BANK0, r18.b0, 32
468 470
471
472
469 xin RXL2_BANK0, &r2, 32+16 473 xin RXL2_BANK0, &r2, 32+16
470 474
471; received packet has PA? 475; received packet has PA?
@@ -488,6 +492,7 @@ STATE_PARAM_PA_CONT:
488; qba STATE_DISCOVERY 492; qba STATE_DISCOVERY
489STATE_PARAM_RCV_OK: 493STATE_PARAM_RCV_OK:
490 494
495 sub TEMP_REG_4.b0,TEMP_REG_4.b0,1
491; todo: read and verify rest of packet 496; todo: read and verify rest of packet
492; wait for end of 1 ms period 497; wait for end of 1 ms period
493STATE_PARAM_WAIT: 498STATE_PARAM_WAIT:
@@ -495,7 +500,6 @@ STATE_PARAM_WAIT:
495 lbbo &PRU_CC_REG, r27, 0x0c , 4 500 lbbo &PRU_CC_REG, r27, 0x0c , 4
496 qblt STATE_PARAM_WAIT, TEMP_REG_1, PRU_CC_REG 501 qblt STATE_PARAM_WAIT, TEMP_REG_1, PRU_CC_REG
497 502
498 sub TEMP_REG_4.b0,TEMP_REG_4.b0,1
499 qbne STATE_PARAM_ITERATION,TEMP_REG_4.b0, 0 503 qbne STATE_PARAM_ITERATION,TEMP_REG_4.b0, 0
500 504
501 505
diff --git a/example/apps/sorte/master/makefile_armv7 b/example/apps/sorte/master/makefile_armv7
new file mode 100644
index 0000000..0e3ee75
--- /dev/null
+++ b/example/apps/sorte/master/makefile_armv7
@@ -0,0 +1,151 @@
1#
2# Macro definitions referenced below
3#
4
5empty =
6space =$(empty) $(empty)
7
8ARMV7OBJDIR ?= ./obj/$(DEVICE)
9ARMV7BINDIR ?= ./bin/$(DEVICE)
10ARMV7LIBDIR ?= ./lib
11
12ARMV7OBJDIR := $(ARMV7OBJDIR)/pruss/example/apps/sorte/master
13ARMV7BINDIR := $(ARMV7BINDIR)/pruss/example/apps/sorte/master
14
15#Cross tools
16ifdef CROSS_TOOL_INSTALL_PATH
17# Support backwards compatibility with KeyStone1 approach
18 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
19 AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
20 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
21 LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
22endif
23
24# INCLUDE Directories
25PRUSS_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/pruss
26
27PRUSS_SRC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/pruss
28PRUSS_TEST_DIR = $(PRUSS_SRC_DIR)/test
29PRUSS_EXAMPLE_SORTE_DIR = $(PRUSS_SRC_DIR)/example/apps/sorte
30PRUSS_ARM_LIN_TEST_DIR = $(PRUSS_TEST_DIR)/src/armv7/linux
31PRUSS_DEVICE_DIR = $(PRUSS_SRC_DIR)/soc/$(DEVICE)
32
33INCDIR := $(PDK_INSTALL_PATH);$(PRUSS_INC_DIR);$(PRUSS_EXAMPLE_SORTE_DIR)/src;$(PRUSS_ARM_LIN_TEST_DIR);$(PRUSS_DEVICE_DIR);$(PRUSS_SRC_DIR)/../../..
34
35# Libraries
36PRUSS_LIB = -lpruss
37OSAL_LIB = -L $(PDK_INSTALL_PATH)/ti/osal/lib/linux -losal
38
39
40FW_LNK_CMD_REV1 = $(PDK_PKG_PATH)/ti/build/pruss/lnk_a8_a9_a15_REV1_linux.cmd
41FW_LNK_CMD_REV2 = $(PDK_PKG_PATH)/ti/build/pruss/lnk_a8_a9_a15_REV2_linux.cmd
42FW_BIN_PATH_A15 = $(PDK_PKG_PATH)/ti/drv/pruss/example/apps/sorte/firmware/bin/$(DEVICE)/a15_0/REV2
43FW_BIN_PATH_A9 = $(PDK_PKG_PATH)/ti/drv/pruss/example/apps/sorte/firmware/bin/$(DEVICE)/a9host/REV1
44FW_BIN_PATH_A8 = $(PDK_PKG_PATH)/ti/drv/pruss/example/apps/sorte/firmware/bin/$(DEVICE)/a8host/REV1
45
46ifeq ($(DEVICE), am571x)
47 TARGET = SOC_AM571x
48 BOARD = idkAM571x
49 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
50 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_master_PRU0.bin
51endif
52
53ifeq ($(DEVICE), am572x)
54 TARGET = SOC_AM572x
55 BOARD = idkAM572x
56 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
57 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_master_PRU0.bin
58endif
59
60ifeq ($(DEVICE), am574x)
61 TARGET = SOC_AM574x
62 BOARD = idkAM574x
63 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
64 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_master_PRU0.bin
65endif
66
67ifeq ($(DEVICE), am335x)
68 TARGET = SOC_AM335x
69 BOARD = icev2AM335x
70 FW_LNK_CMD = $(FW_LNK_CMD_REV1)
71 FW_LIB_PRU0 = $(FW_BIN_PATH_A8)/sorte_master_PRU0.bin
72endif
73
74ifeq ($(DEVICE), am437x)
75 TARGET = SOC_AM437x
76 BOARD = idkAM437x
77 FW_LNK_CMD = $(FW_LNK_CMD_REV1)
78 FW_LIB_PRU0 = $(FW_BIN_PATH_A9)/sorte_master_PRU0.bin
79endif
80
81ifeq ($(DEVICE), k2g)
82 TARGET = SOC_K2G
83 BOARD = iceK2G
84 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
85 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_master_PRU0.bin
86endif
87
88ifeq ($(USEDYNAMIC_LIB), yes)
89#presuming ARM executable would depend on dynamic library dependency
90EXE_EXTN = _so
91LIBS = $(PRUSS_LIB) $(OSAL_LIB)
92else
93#forcing ARM executable to depend on static LLD libraries
94EXE_EXTN =
95LIBS = -Wl,-Bstatic $(PRUSS_LIB) $(OSAL_LIB) -Wl,-Bdynamic
96endif
97
98
99# Compiler options
100INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${BOARD} -D${TARGET} -DUIO_INTERRUPT_ONE_SHOT_MODE -DSORTE_MASTER
101
102# Linker options
103INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
104
105MAIN_TEST_EXE=pruss_app_sorte_master$(EXE_EXTN).out
106
107OBJEXT = o
108
109SRCDIR = $(PRUSS_EXAMPLE_SORTE_DIR)/src:$(PRUSS_ARM_LIN_TEST_DIR):$(PRUSS_DEVICE_DIR):
110
111INCS = -I. -I$(strip $(subst ;, -I,$(INCDIR)))
112
113VPATH=$(SRCDIR)
114
115#List the Source Files
116OSAL_TEST_SRC = \
117 mmap_helper.c \
118 pruicss_soc.c
119
120MAIN_TEST_SRC = \
121 main.c
122
123# FLAGS for the SourceFiles
124SRC_CFLAGS = -I. $(CFLAGS)
125
126# Make Rule for the SRC Files
127OSAL_TEST_SRC_OBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(OSAL_TEST_SRC))
128MAIN_TEST_SRC_OBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(MAIN_TEST_SRC))
129
130all:$(ARMV7BINDIR)/$(MAIN_TEST_EXE)
131
132$(ARMV7BINDIR)/$(MAIN_TEST_EXE): $(MAIN_TEST_SRC_OBJS) $(OSAL_TEST_SRC_OBJS) $(ARMV7BINDIR)/.created
133 @echo linking $(MAIN_TEST_SRC_OBJS) $(OSAL_TEST_SRC_OBJS) ${FW_LIB_PRU0} ${FW_LNK_CMD} into $@ ...
134 @$(CC) $(MAIN_TEST_SRC_OBJS) $(OSAL_TEST_SRC_OBJS) ${FW_LIB_PRU0} ${FW_LNK_CMD} $(INTERNALLINKDEFS) -o $@
135
136$(ARMV7OBJDIR)/%.$(OBJEXT): %.c $(ARMV7OBJDIR)/.created
137 @echo compiling $< ...
138 @$(CC) -c $(SRC_CFLAGS) $(INTERNALDEFS) $(INCS) $< -o $@
139
140$(ARMV7OBJDIR)/.created:
141 @mkdir -p $(ARMV7OBJDIR)
142 @touch $(ARMV7OBJDIR)/.created
143
144$(ARMV7BINDIR)/.created:
145 @mkdir -p $(ARMV7BINDIR)
146 @touch $(ARMV7BINDIR)/.created
147
148clean:
149 @rm -fr $(ARMV7OBJDIR)
150 @rm -fr $(ARMV7BINDIR)
151
diff --git a/example/apps/sorte/slave/makefile_armv7 b/example/apps/sorte/slave/makefile_armv7
new file mode 100644
index 0000000..7172a10
--- /dev/null
+++ b/example/apps/sorte/slave/makefile_armv7
@@ -0,0 +1,157 @@
1#
2# Macro definitions referenced below
3#
4
5empty =
6space =$(empty) $(empty)
7
8ARMV7OBJDIR ?= ./obj/$(DEVICE)
9ARMV7BINDIR ?= ./bin/$(DEVICE)
10ARMV7LIBDIR ?= ./lib
11
12ARMV7OBJDIR := $(ARMV7OBJDIR)/pruss/example/apps/sorte/slave
13ARMV7BINDIR := $(ARMV7BINDIR)/pruss/example/apps/sorte/slave
14
15#Cross tools
16ifdef CROSS_TOOL_INSTALL_PATH
17# Support backwards compatibility with KeyStone1 approach
18 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
19 AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
20 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
21 LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
22endif
23
24# INCLUDE Directories
25PRUSS_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/pruss
26
27PRUSS_SRC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/pruss
28PRUSS_TEST_DIR = $(PRUSS_SRC_DIR)/test
29PRUSS_EXAMPLE_SORTE_DIR = $(PRUSS_SRC_DIR)/example/apps/sorte
30PRUSS_ARM_LIN_TEST_DIR = $(PRUSS_TEST_DIR)/src/armv7/linux
31PRUSS_DEVICE_DIR = $(PRUSS_SRC_DIR)/soc/$(DEVICE)
32
33INCDIR := $(PDK_INSTALL_PATH);$(PRUSS_INC_DIR);$(PRUSS_EXAMPLE_SORTE_DIR)/src;$(PRUSS_ARM_LIN_TEST_DIR);$(PRUSS_DEVICE_DIR);$(PRUSS_SRC_DIR)/../../..
34
35# Libraries
36PRUSS_LIB = -lpruss
37OSAL_LIB = -L $(PDK_INSTALL_PATH)/ti/osal/lib/linux -losal
38
39
40FW_LNK_CMD_REV1 = $(PDK_PKG_PATH)/ti/build/pruss/lnk_a8_a9_a15_REV1_linux.cmd
41FW_LNK_CMD_REV2 = $(PDK_PKG_PATH)/ti/build/pruss/lnk_a8_a9_a15_REV2_linux.cmd
42FW_BIN_PATH_A15 = $(PDK_PKG_PATH)/ti/drv/pruss/example/apps/sorte/firmware/bin/$(DEVICE)/a15_0/REV2
43FW_BIN_PATH_A9 = $(PDK_PKG_PATH)/ti/drv/pruss/example/apps/sorte/firmware/bin/$(DEVICE)/a9host/REV1
44FW_BIN_PATH_A8 = $(PDK_PKG_PATH)/ti/drv/pruss/example/apps/sorte/firmware/bin/$(DEVICE)/a8host/REV1
45
46ifeq ($(DEVICE), am571x)
47 TARGET = SOC_AM571x
48 BOARD = idkAM571x
49 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
50 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_slave_PRU0.bin
51 FW_LIB_PRU1 = $(FW_BIN_PATH_A15)/sorte_slave_PRU1.bin
52endif
53
54ifeq ($(DEVICE), am572x)
55 TARGET = SOC_AM572x
56 BOARD = idkAM572x
57 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
58 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_slave_PRU0.bin
59 FW_LIB_PRU1 = $(FW_BIN_PATH_A15)/sorte_slave_PRU1.bin
60endif
61
62ifeq ($(DEVICE), am574x)
63 TARGET = SOC_AM574x
64 BOARD = idkAM574x
65 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
66 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_slave_PRU0.bin
67 FW_LIB_PRU1 = $(FW_BIN_PATH_A15)/sorte_slave_PRU1.bin
68endif
69
70ifeq ($(DEVICE), am335x)
71 TARGET = SOC_AM335x
72 BOARD = icev2AM335x
73 FW_LNK_CMD = $(FW_LNK_CMD_REV1)
74 FW_LIB_PRU0 = $(FW_BIN_PATH_A8)/sorte_slave_PRU0.bin
75 FW_LIB_PRU1 = $(FW_BIN_PATH_A8)/sorte_slave_PRU1.bin
76endif
77
78ifeq ($(DEVICE), am437x)
79 TARGET = SOC_AM437x
80 BOARD = idkAM437x
81 FW_LNK_CMD = $(FW_LNK_CMD_REV1)
82 FW_LIB_PRU0 = $(FW_BIN_PATH_A9)/sorte_slave_PRU0.bin
83 FW_LIB_PRU1 = $(FW_BIN_PATH_A9)/sorte_slave_PRU1.bin
84endif
85
86ifeq ($(DEVICE), k2g)
87 TARGET = SOC_K2G
88 BOARD = iceK2G
89 FW_LNK_CMD = $(FW_LNK_CMD_REV2)
90 FW_LIB_PRU0 = $(FW_BIN_PATH_A15)/sorte_slave_PRU0.bin
91 FW_LIB_PRU1 = $(FW_BIN_PATH_A15)/sorte_slave_PRU1.bin
92endif
93
94ifeq ($(USEDYNAMIC_LIB), yes)
95#presuming ARM executable would depend on dynamic library dependency
96EXE_EXTN = _so
97LIBS = $(PRUSS_LIB) $(OSAL_LIB)
98else
99#forcing ARM executable to depend on static LLD libraries
100EXE_EXTN =
101LIBS = -Wl,-Bstatic $(PRUSS_LIB) $(OSAL_LIB) -Wl,-Bdynamic
102endif
103
104
105# Compiler options
106INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${BOARD} -D${TARGET} -DUIO_INTERRUPT_ONE_SHOT_MODE -DSORTE_SLAVE
107
108# Linker options
109INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
110
111MAIN_TEST_EXE=pruss_app_sorte_slave$(EXE_EXTN).out
112
113OBJEXT = o
114
115SRCDIR = $(PRUSS_EXAMPLE_SORTE_DIR)/src:$(PRUSS_ARM_LIN_TEST_DIR):$(PRUSS_DEVICE_DIR):
116
117INCS = -I. -I$(strip $(subst ;, -I,$(INCDIR)))
118
119VPATH=$(SRCDIR)
120
121#List the Source Files
122OSAL_TEST_SRC = \
123 mmap_helper.c \
124 pruicss_soc.c
125
126MAIN_TEST_SRC = \
127 main.c
128
129# FLAGS for the SourceFiles
130SRC_CFLAGS = -I. $(CFLAGS)
131
132# Make Rule for the SRC Files
133OSAL_TEST_SRC_OBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(OSAL_TEST_SRC))
134MAIN_TEST_SRC_OBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(MAIN_TEST_SRC))
135
136all:$(ARMV7BINDIR)/$(MAIN_TEST_EXE)
137
138$(ARMV7BINDIR)/$(MAIN_TEST_EXE): $(MAIN_TEST_SRC_OBJS) $(OSAL_TEST_SRC_OBJS) $(ARMV7BINDIR)/.created
139 @echo linking $(MAIN_TEST_SRC_OBJS) $(OSAL_TEST_SRC_OBJS) ${FW_LIB_PRU0} ${FW_LIB_PRU1} ${FW_LNK_CMD} into $@ ...
140 @$(CC) $(MAIN_TEST_SRC_OBJS) $(OSAL_TEST_SRC_OBJS) ${FW_LIB_PRU0} ${FW_LIB_PRU1} ${FW_LNK_CMD} $(INTERNALLINKDEFS) -o $@
141
142$(ARMV7OBJDIR)/%.$(OBJEXT): %.c $(ARMV7OBJDIR)/.created
143 @echo compiling $< ...
144 @$(CC) -c $(SRC_CFLAGS) $(INTERNALDEFS) $(INCS) $< -o $@
145
146$(ARMV7OBJDIR)/.created:
147 @mkdir -p $(ARMV7OBJDIR)
148 @touch $(ARMV7OBJDIR)/.created
149
150$(ARMV7BINDIR)/.created:
151 @mkdir -p $(ARMV7BINDIR)
152 @touch $(ARMV7BINDIR)/.created
153
154clean:
155 @rm -fr $(ARMV7OBJDIR)
156 @rm -fr $(ARMV7BINDIR)
157
diff --git a/example/apps/sorte/src/main.c b/example/apps/sorte/src/main.c
index 9e7f81b..768fcce 100644
--- a/example/apps/sorte/src/main.c
+++ b/example/apps/sorte/src/main.c
@@ -42,6 +42,12 @@
42 42
43#include <string.h> 43#include <string.h>
44 44
45#ifdef __LINUX_USER_SPACE
46#include <sys/mman.h>
47#include <stdint.h>
48#include <unistd.h>
49#include "mmap_helper.h"
50#else
45#include <xdc/std.h> 51#include <xdc/std.h>
46#include <xdc/runtime/System.h> 52#include <xdc/runtime/System.h>
47#include <xdc/runtime/Error.h> 53#include <xdc/runtime/Error.h>
@@ -53,6 +59,7 @@
53#include <ti/sysbios/BIOS.h> 59#include <ti/sysbios/BIOS.h>
54#include <ti/sysbios/knl/Task.h> 60#include <ti/sysbios/knl/Task.h>
55 61
62#endif
56 63
57#include <ti/csl/hw_types.h> 64#include <ti/csl/hw_types.h>
58 65
@@ -64,11 +71,25 @@
64 71
65#include <ti/csl/src/ip/mdio/V2/cslr_mdio.h> 72#include <ti/csl/src/ip/mdio/V2/cslr_mdio.h>
66 73
74#ifdef __LINUX_USER_SPACE
75/* ICSS EMAC PHY address definitions */
76#define BOARD_ICSS_EMAC_PORT0_PHY_ADDR (0U)
77#if defined(icev2AM335x)
78#define BOARD_ICSS_EMAC_PORT1_PHY_ADDR (3U)
79#elif defined(idkAM437x) || defined(idkAM571x) || defined(idkAM572x) || defined(iceK2G) || defined(idkAM574x)
80#define BOARD_ICSS_EMAC_PORT1_PHY_ADDR (1U)
81#endif
82#if defined(iceK2G)
83#define BOARD_ICSS_EMAC_PORT2_PHY_ADDR (2U)
84#define BOARD_ICSS_EMAC_PORT3_PHY_ADDR (3U)
85#endif
86#else
67#include <ti/board/board.h> 87#include <ti/board/board.h>
68 88
69#include <ti/drv/uart/UART.h> 89#include <ti/drv/uart/UART.h>
70#include <ti/drv/uart/UART_stdio.h> 90#include <ti/drv/uart/UART_stdio.h>
71 91
92#endif
72 93
73#include <ti/drv/pruss/soc/pruicss_v1.h> 94#include <ti/drv/pruss/soc/pruicss_v1.h>
74#include <ti/drv/pruss/example/apps/sorte/src/ti_pruss_intc_mapping.h> 95#include <ti/drv/pruss/example/apps/sorte/src/ti_pruss_intc_mapping.h>
@@ -104,6 +125,36 @@ uint32_t sorteDeviceType = SORTE_MASTER_DEVICE;
104uint32_t sorteDeviceType = SORTE_SLAVE_DEVICE; 125uint32_t sorteDeviceType = SORTE_SLAVE_DEVICE;
105#endif 126#endif
106 127
128#ifdef __LINUX_USER_SPACE
129tprussdrv *pruss_drv_handle;
130PRUICSS_HwAttrs linux_prussHwAttrs[PRUICCSS_INSTANCE_MAX-1];
131PRUICSS_V1_Object linux_prussObjects[PRUICCSS_INSTANCE_MAX-1];
132PRUICSS_Config linux_pruss_config[PRUICCSS_INSTANCE_MAX] = {
133 {
134 &(linux_prussObjects[0]),
135 &(linux_prussHwAttrs[0])
136 },
137 {
138 &(linux_prussObjects[1]),
139 &(linux_prussHwAttrs[1])
140 },
141 {NULL, NULL}
142 };
143
144static inline void linux_sleep_ms(unsigned long ms) {
145 struct timespec ts;
146 ts.tv_sec = (ms)/1000;
147 ms = ms - ts.tv_sec*1000;
148 ts.tv_nsec = (ms*1000000);
149 nanosleep(&ts, NULL);
150}
151#define SLEEP(t) linux_sleep_ms(t)
152#define PRINT printf
153#else
154#define SLEEP Task_sleep
155#define PRINT UART_printf
156#endif
157
107void prussAppSorteInitCrc8Table(void); 158void prussAppSorteInitCrc8Table(void);
108void prussAppSorteRestartMaster(void); 159void prussAppSorteRestartMaster(void);
109void prussAppSorteDrvInit(void); 160void prussAppSorteDrvInit(void);
@@ -272,7 +323,7 @@ HWREG(hwAttrs->prussSharedDramBase+ CSL_MDIO_CONTROL_REG) = (uint32_t) \
272 (0<<16) | \ 323 (0<<16) | \
273 (0<<24)); 324 (0<<24));
274/*Enable MDIO link interrupts for pru-icss PHY's, clear any pending interrupt */ 325/*Enable MDIO link interrupts for pru-icss PHY's, clear any pending interrupt */
275UART_printf("PHY2: %d, PHY3: %d\n", BOARD_ICSS_EMAC_PORT2_PHY_ADDR, BOARD_ICSS_EMAC_PORT3_PHY_ADDR); 326PRINT("PHY2: %d, PHY3: %d\n", BOARD_ICSS_EMAC_PORT2_PHY_ADDR, BOARD_ICSS_EMAC_PORT3_PHY_ADDR);
276HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL0) = 0x40 | BOARD_ICSS_EMAC_PORT2_PHY_ADDR; 327HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL0) = 0x40 | BOARD_ICSS_EMAC_PORT2_PHY_ADDR;
277HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL1) = 0x40 | BOARD_ICSS_EMAC_PORT3_PHY_ADDR; 328HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL1) = 0x40 | BOARD_ICSS_EMAC_PORT3_PHY_ADDR;
278HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERINTMASKED) = (1<<BOARD_ICSS_EMAC_PORT2_PHY_ADDR) | (1<<BOARD_ICSS_EMAC_PORT3_PHY_ADDR); 329HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERINTMASKED) = (1<<BOARD_ICSS_EMAC_PORT2_PHY_ADDR) | (1<<BOARD_ICSS_EMAC_PORT3_PHY_ADDR);
@@ -284,7 +335,7 @@ HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERINTMASKED) = (1<<BOARD_
284 (0<<16) | \ 335 (0<<16) | \
285 (0<<24)); 336 (0<<24));
286 /*Enable MDIO link interrupts for pru-icss PHY's, clear any pending interrupt */ 337 /*Enable MDIO link interrupts for pru-icss PHY's, clear any pending interrupt */
287 UART_printf("PHY0: %d, PHY1: %d\n", BOARD_ICSS_EMAC_PORT0_PHY_ADDR, BOARD_ICSS_EMAC_PORT1_PHY_ADDR); 338 PRINT("PHY0: %d, PHY1: %d\n", BOARD_ICSS_EMAC_PORT0_PHY_ADDR, BOARD_ICSS_EMAC_PORT1_PHY_ADDR);
288 HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL0) = 0x40 | BOARD_ICSS_EMAC_PORT0_PHY_ADDR; 339 HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL0) = 0x40 | BOARD_ICSS_EMAC_PORT0_PHY_ADDR;
289 HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL1) = 0x40 | BOARD_ICSS_EMAC_PORT1_PHY_ADDR; 340 HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERPHYSEL1) = 0x40 | BOARD_ICSS_EMAC_PORT1_PHY_ADDR;
290 HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERINTMASKED) = (1<<BOARD_ICSS_EMAC_PORT0_PHY_ADDR) | (1<<BOARD_ICSS_EMAC_PORT1_PHY_ADDR); 341 HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERINTMASKED) = (1<<BOARD_ICSS_EMAC_PORT0_PHY_ADDR) | (1<<BOARD_ICSS_EMAC_PORT1_PHY_ADDR);
@@ -306,8 +357,11 @@ HWREG(hwAttrs->prussMiiMdioRegBase + CSL_ICSSMIIMDIO_USERINTMASKED) = (1<<BOARD_
306 * @retval 357 * @retval
307 * none 358 * none
308 */ 359 */
309 360#ifdef __LINUX_USER_SPACE
361void *sorteTaskPRU(void *a0)
362#else
310void sorteTaskPRU(UArg a0, UArg a1) 363void sorteTaskPRU(UArg a0, UArg a1)
364#endif
311{ 365{
312 PRUICSS_HwAttrs const *hwAttrs = pruIcss1Handle->hwAttrs; 366 PRUICSS_HwAttrs const *hwAttrs = pruIcss1Handle->hwAttrs;
313 367
@@ -316,7 +370,7 @@ void sorteTaskPRU(UArg a0, UArg a1)
316 PRUICSS_pruDisable(pruIcss1Handle, PRUICCSS_PRU0); 370 PRUICSS_pruDisable(pruIcss1Handle, PRUICCSS_PRU0);
317 PRUICSS_pruDisable(pruIcss1Handle, PRUICCSS_PRU1); 371 PRUICSS_pruDisable(pruIcss1Handle, PRUICCSS_PRU1);
318 372
319 UART_printf("\n\rTI SORTE Demo Application\n"); 373 PRINT("\n\rTI SORTE Demo Application\n");
320 374
321 PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA; 375 PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA;
322 PRUICSS_pruIntcInit(pruIcss1Handle, &pruss_intc_initdata); 376 PRUICSS_pruIntcInit(pruIcss1Handle, &pruss_intc_initdata);
@@ -340,16 +394,16 @@ void sorteTaskPRU(UArg a0, UArg a1)
340 &pru_imem0_rev1_end - &pru_imem0_rev1_start); 394 &pru_imem0_rev1_end - &pru_imem0_rev1_start);
341#endif 395#endif
342 PRUICSS_pruEnable(pruIcss1Handle, PRUICCSS_PRU0); 396 PRUICSS_pruEnable(pruIcss1Handle, PRUICCSS_PRU0);
343 Task_sleep(1000); 397 SLEEP(1000);
344 /* check to see if there are atleast 2 slaves before downloading firmware */ 398 /* check to see if there are atleast 2 slaves before downloading firmware */
345 while((HW_RD_REG16(hwAttrs->prussPru0DramBase + SORTE_DISCOV_NUM_SLAVE_OFFSET)) <SORTE_MIN_NUM_SLAVE_DEVICES) 399 while((HW_RD_REG16(hwAttrs->prussPru0DramBase + SORTE_DISCOV_NUM_SLAVE_OFFSET)) <SORTE_MIN_NUM_SLAVE_DEVICES)
346 { 400 {
347 UART_printf("sorte master: waiting for atleast 2 SLAVE devices connected\n"); 401 PRINT("sorte master: waiting for atleast 2 SLAVE devices connected\n");
348 prussAppSorteRestartMaster(); 402 prussAppSorteRestartMaster();
349 Task_sleep(1000); 403 SLEEP(1000);
350 404
351 } 405 }
352 UART_printf("sorte master: 2 SLAVE devices connected\n"); 406 PRINT("sorte master: 2 SLAVE devices connected\n");
353 } 407 }
354 else /* slave device */ 408 else /* slave device */
355 { 409 {
@@ -379,16 +433,16 @@ void sorteTaskPRU(UArg a0, UArg a1)
379 uint16_t rxPkts = HW_RD_REG16(hwAttrs->prussSharedDramBase + SORTE_RX_NO_CRC_ERR_PKT_OFFSET); 433 uint16_t rxPkts = HW_RD_REG16(hwAttrs->prussSharedDramBase + SORTE_RX_NO_CRC_ERR_PKT_OFFSET);
380 if(rxPkts >= SORT_SLAVE_PASS_CRITERIA) 434 if(rxPkts >= SORT_SLAVE_PASS_CRITERIA)
381 { 435 {
382 UART_printf("sorte slave: receive packet count: %d\n", rxPkts); 436 PRINT("sorte slave: receive packet count: %d\n", rxPkts);
383 UART_printf("All tests have passed\n"); 437 PRINT("All tests have passed\n");
384 break; 438 break;
385 } 439 }
386 else 440 else
387 { 441 {
388 UART_printf("sorte slave: test in progress: current receive packet count: %d\n", rxPkts); 442 PRINT("sorte slave: test in progress: current receive packet count: %d\n", rxPkts);
389 } 443 }
390 } 444 }
391 Task_sleep(1000); 445 SLEEP(1000);
392 } 446 }
393 while(1); 447 while(1);
394} 448}
@@ -396,6 +450,36 @@ void sorteTaskPRU(UArg a0, UArg a1)
396/* 450/*
397 * ======== main ======== 451 * ======== main ========
398 */ 452 */
453#ifdef __LINUX_USER_SPACE
454int main(int argc, char **argv)
455{
456
457 PRUICSS_Config *pruIcssCfg;
458 int status;
459 int priority = 20;
460 pthread_attr_t pthread_attr;
461 struct sched_param sched_param;
462 pthread_t sorte_task_th;
463
464 linux_init((void**)&pruss_drv_handle, linux_prussHwAttrs, pruIcssInstance);
465 pruIcssCfg = linux_pruss_config;
466
467 pruIcss1Handle = PRUICSS_create((PRUICSS_Config*) pruIcssCfg, pruIcssInstance);
468
469 pthread_attr_init(&pthread_attr);
470 sched_param.sched_priority = priority;
471 pthread_attr_setschedparam(&pthread_attr, &sched_param);
472
473 if ((status = pthread_create(&sorte_task_th, &pthread_attr, sorteTaskPRU, NULL))) {
474 printf("ERROR: \"sorteTaskPRU\" task-create failed (%d)\n", status);
475 return (-1);
476 }
477
478 pthread_join(sorte_task_th, NULL);
479
480 return(0);
481}
482#else // RTOS
399int main() 483int main()
400{ 484{
401 Board_initCfg cfg; 485 Board_initCfg cfg;
@@ -416,7 +500,7 @@ int main()
416 } 500 }
417 else 501 else
418 { 502 {
419 UART_printf("main: BOARD_init success\n"); 503 PRINT("main: BOARD_init success\n");
420 } 504 }
421 ret = PRUICSS_socGetInitCfg(&pruIcssCfg); 505 ret = PRUICSS_socGetInitCfg(&pruIcssCfg);
422 if (ret != PRUICSS_RETURN_SUCCESS) 506 if (ret != PRUICSS_RETURN_SUCCESS)
@@ -435,5 +519,6 @@ int main()
435 return(0); 519 return(0);
436} 520}
437 521
522#endif
438 523
439 524
diff --git a/makefile_armv7 b/makefile_armv7
index 64a80f8..eb8784d 100755
--- a/makefile_armv7
+++ b/makefile_armv7
@@ -49,7 +49,7 @@ export MAKE = make
49endif 49endif
50 50
51# PHONY Targets 51# PHONY Targets
52.PHONY: all clean lib tests install installbin .libraries .executables 52.PHONY: all clean lib tests apps install installbin installapp.libraries .executables
53 53
54# all rule 54# all rule
55all: .executables 55all: .executables
@@ -62,6 +62,11 @@ lib: .libraries
62tests: 62tests:
63 @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/makefile all 63 @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/makefile all
64 64
65#apps:
66apps:
67 @$(MAKE) -f ./example/apps/sorte/master/makefile_armv7 all
68 @$(MAKE) -f ./example/apps/sorte/slave/makefile_armv7 all
69
65# Make rule to create $(ARMV7LIBDIR)/libpruss.a library 70# Make rule to create $(ARMV7LIBDIR)/libpruss.a library
66.libraries: $(ARMV7LIBDIR)/libpruss.a libpruss.so 71.libraries: $(ARMV7LIBDIR)/libpruss.a libpruss.so
67 72
@@ -85,6 +90,11 @@ installbin:
85 install -d $(INSTALL_BIN_BASE_DIR) 90 install -d $(INSTALL_BIN_BASE_DIR)
86 install -c -m 755 $(ARMV7BINDIR)/pruss/test/prussMainTest.out $(INSTALL_BIN_BASE_DIR)/prussMainTest_$(DEVICE).out 91 install -c -m 755 $(ARMV7BINDIR)/pruss/test/prussMainTest.out $(INSTALL_BIN_BASE_DIR)/prussMainTest_$(DEVICE).out
87 92
93installapp:
94 install -d $(INSTALL_BIN_BASE_DIR)
95 install -c -m 755 $(ARMV7BINDIR)/pruss/example/apps/sorte/master/pruss_app_sorte_master.out $(INSTALL_BIN_BASE_DIR)/pruss_app_sorte_master_$(DEVICE).out
96 install -c -m 755 $(ARMV7BINDIR)/pruss/example/apps/sorte/slave/pruss_app_sorte_slave.out $(INSTALL_BIN_BASE_DIR)/pruss_app_sorte_slave_$(DEVICE).out
97
88install: 98install:
89 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/pruss/include 99 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/pruss/include
90 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/pruss/soc 100 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/pruss/soc
diff --git a/package.xdc b/package.xdc
index a2efdec..1fab957 100644
--- a/package.xdc
+++ b/package.xdc
@@ -6,11 +6,11 @@
6 * DESCRIPTION: 6 * DESCRIPTION:
7 * This file contains the package specification for the pruss Driver 7 * This file contains the package specification for the pruss Driver
8 * 8 *
9 * Copyright (C) 2009-2017, Texas Instruments, Inc. 9 * Copyright (C) 2009-2018, Texas Instruments, Inc.
10 *****************************************************************************/ 10 *****************************************************************************/
11 11
12 12
13package ti.drv.pruss[1, 0, 0, 9] { 13package ti.drv.pruss[1, 0, 0, 10] {
14 module Settings; 14 module Settings;
15} 15}
16 16
diff --git a/pruicss_ver.h b/pruicss_ver.h
index bbd655f..e5e1875 100644
--- a/pruicss_ver.h
+++ b/pruicss_ver.h
@@ -51,13 +51,13 @@ extern "C" {
51 * format: 51 * format:
52 * 0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD) 52 * 0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
53 */ 53 */
54#define PRUICSS_DRV_VERSION_ID (0x01000009) 54#define PRUICSS_DRV_VERSION_ID (0x0100000A)
55 55
56/** 56/**
57 * @brief This is the version string which describes the PRUICSS driver along with the 57 * @brief This is the version string which describes the PRUICSS driver along with the
58 * date and build information. 58 * date and build information.
59 */ 59 */
60#define PRUICSS_DRV_VERSION_STR "pruss Driver Revision: 01.00.00.09" 60#define PRUICSS_DRV_VERSION_STR "pruss Driver Revision: 01.00.00.10"
61 61
62 62
63#ifdef __cplusplus 63#ifdef __cplusplus
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c
index 0e53d4b..5794d1a 100644
--- a/src/pruicss_drv.c
+++ b/src/pruicss_drv.c
@@ -814,7 +814,6 @@ int32_t PRUICSS_pruExecProgram(PRUICSS_Handle handle,int32_t pruNum)
814 { 814 {
815 PRUICSS_pruDisable(handle,(uint8_t)pruNum); 815 PRUICSS_pruDisable(handle,(uint8_t)pruNum);
816 PRUICSS_pruInitMemory(handle,PRU_ICSS_IRAM((uint32_t)pruNum)); 816 PRUICSS_pruInitMemory(handle,PRU_ICSS_IRAM((uint32_t)pruNum));
817 PRUICSS_pruInitMemory(handle,PRU_ICSS_DATARAM((uint32_t)pruNum));
818 PRUICSS_pruWriteMemory(handle,PRU_ICSS_IRAM((uint32_t)pruNum),0U,(uint32_t *) object->pruBinBuff[pruNum],object->buffLen[pruNum]); 817 PRUICSS_pruWriteMemory(handle,PRU_ICSS_IRAM((uint32_t)pruNum),0U,(uint32_t *) object->pruBinBuff[pruNum],object->buffLen[pruNum]);
819 PRUICSS_pruReset(handle,(uint8_t)pruNum); 818 PRUICSS_pruReset(handle,(uint8_t)pruNum);
820 PRUICSS_pruEnable(handle,(uint8_t)pruNum); 819 PRUICSS_pruEnable(handle,(uint8_t)pruNum);
diff --git a/src/pruicss_intc.c b/src/pruicss_intc.c
index 7f5b804..d681dd4 100644
--- a/src/pruicss_intc.c
+++ b/src/pruicss_intc.c
@@ -298,7 +298,10 @@ int32_t PRUICSS_registerIrqHandler(PRUICSS_Handle handle,
298 298
299 if ((hwiHandle == NULL) && (ret_val == PRUICSS_RETURN_SUCCESS)) 299 if ((hwiHandle == NULL) && (ret_val == PRUICSS_RETURN_SUCCESS))
300 { 300 {
301 PRUICSS_osalDeleteBlockingLock(semHandle); 301 if(NULL != semHandle)
302 {
303 PRUICSS_osalDeleteBlockingLock(semHandle);
304 }
302 ret_val = PRUICSS_RETURN_FAILURE; 305 ret_val = PRUICSS_RETURN_FAILURE;
303 } 306 }
304 307
@@ -400,7 +403,10 @@ int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle,
400 403
401 if ((hwiHandle == NULL) && (ret_val == PRUICSS_RETURN_SUCCESS)) 404 if ((hwiHandle == NULL) && (ret_val == PRUICSS_RETURN_SUCCESS))
402 { 405 {
403 PRUICSS_osalDeleteBlockingLock(semHandle); 406 if(NULL != semHandle)
407 {
408 PRUICSS_osalDeleteBlockingLock(semHandle);
409 }
404 ret_val = PRUICSS_RETURN_FAILURE; 410 ret_val = PRUICSS_RETURN_FAILURE;
405 } 411 }
406 412
diff --git a/test/am571x/armv7/linux/makefile b/test/am571x/armv7/linux/makefile
index edc5a52..3f5b0c2 100644
--- a/test/am571x/armv7/linux/makefile
+++ b/test/am571x/armv7/linux/makefile
@@ -47,7 +47,7 @@ endif
47 47
48 48
49# Compiler options 49# Compiler options
50INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${TARGET} 50INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${TARGET} -DUIO_INTERRUPT_ONE_SHOT_MODE
51 51
52# Linker options 52# Linker options
53INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS) 53INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
diff --git a/test/am572x/armv7/linux/makefile b/test/am572x/armv7/linux/makefile
index edc5a52..3f5b0c2 100644
--- a/test/am572x/armv7/linux/makefile
+++ b/test/am572x/armv7/linux/makefile
@@ -47,7 +47,7 @@ endif
47 47
48 48
49# Compiler options 49# Compiler options
50INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${TARGET} 50INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${TARGET} -DUIO_INTERRUPT_ONE_SHOT_MODE
51 51
52# Linker options 52# Linker options
53INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS) 53INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
diff --git a/test/am574x/armv7/linux/makefile b/test/am574x/armv7/linux/makefile
index edc5a52..3f5b0c2 100644
--- a/test/am574x/armv7/linux/makefile
+++ b/test/am574x/armv7/linux/makefile
@@ -47,7 +47,7 @@ endif
47 47
48 48
49# Compiler options 49# Compiler options
50INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${TARGET} 50INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -D_GNU_SOURCE -D${TARGET} -DUIO_INTERRUPT_ONE_SHOT_MODE
51 51
52# Linker options 52# Linker options
53INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS) 53INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
diff --git a/test/src/armv7/linux/mmap_helper.c b/test/src/armv7/linux/mmap_helper.c
index 2a2f498..be16771 100644
--- a/test/src/armv7/linux/mmap_helper.c
+++ b/test/src/armv7/linux/mmap_helper.c
@@ -440,6 +440,7 @@ int prussdrv_open(void *prussdrv_handle, unsigned int pru_evtout_num)
440 return PRUSSDRV_ERROR_OPEN_DISABLE_INTRPT; 440 return PRUSSDRV_ERROR_OPEN_DISABLE_INTRPT;
441 } 441 }
442 442
443#ifndef UIO_INTERRUPT_ONE_SHOT_MODE
443 /* Enable interrupt */ 444 /* Enable interrupt */
444 value = 1; 445 value = 1;
445 ret = write(prussdrv_p->fd[pru_evtout_num], &value, sizeof(uint32_t)); 446 ret = write(prussdrv_p->fd[pru_evtout_num], &value, sizeof(uint32_t));
@@ -449,6 +450,7 @@ int prussdrv_open(void *prussdrv_handle, unsigned int pru_evtout_num)
449#endif 450#endif
450 return PRUSSDRV_ERROR_OPEN_ENABLE_INTRPT; 451 return PRUSSDRV_ERROR_OPEN_ENABLE_INTRPT;
451 } 452 }
453#endif
452 454
453 return 0; 455 return 0;
454 } else { 456 } else {
@@ -507,7 +509,7 @@ int prussdrv_pru_wait_event(void *prussdrv_handle, unsigned int pru_evtout_num)
507 unsigned int *pruintc_io = (unsigned int *) prussdrv_p->intc_base; 509 unsigned int *pruintc_io = (unsigned int *) prussdrv_p->intc_base;
508 int ret; 510 int ret;
509 511
510#if 1 512#ifdef UIO_INTERRUPT_ONE_SHOT_MODE
511 /* This is needed only if the interrupt-mode is configured for one-shot mode */ 513 /* This is needed only if the interrupt-mode is configured for one-shot mode */
512 uint32_t value; 514 uint32_t value;
513 515
@@ -536,7 +538,11 @@ void linux_init(void **pruss_drv_handle_dptr, void *linux_prussInitCfg, int pru_
536 int hwAttrs_index = pru_num - 1; 538 int hwAttrs_index = pru_num - 1;
537 539
538 //Initialize PRUSS UIO userspace 540 //Initialize PRUSS UIO userspace
541#ifdef icev2AM335x
542 char *pru_dev_name = "pruss";
543#else
539 char *pru_dev_name = (pru_num == 1 ? "pruss1" : "pruss2"); 544 char *pru_dev_name = (pru_num == 1 ? "pruss1" : "pruss2");
545#endif
540 prussdrv_init(pruss_drv_handle_dptr, pru_dev_name); 546 prussdrv_init(pruss_drv_handle_dptr, pru_dev_name);
541 pruss_handle = *((tprussdrv **)pruss_drv_handle_dptr); 547 pruss_handle = *((tprussdrv **)pruss_drv_handle_dptr);
542 548