Skip to content

Commit

Permalink
Fix remoteproc to work with the PRU GNU Binutils port
Browse files Browse the repository at this point in the history
merge: beagleboard/linux#47

fixes: dinuxbg/pru-gcc-examples#2
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
  • Loading branch information
RobertCNelson committed Oct 16, 2015
1 parent 5c0a6aa commit 4f93274
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 2 additions & 0 deletions patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ fixes () {
start_cleanup
fi

${git} "${DIR}/patches/fixes/0001-Fix-remoteproc-to-work-with-the-PRU-GNU-Binutils-por.patch"

if [ "x${regenerate}" = "xenable" ] ; then
number=1
cleanup
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 848d67b7b9810319f60f589e9dc4aa002824c14d Mon Sep 17 00:00:00 2001
From: Dimitar Dimitrov <dinuxbg@gmail.com>
Date: Sun, 11 Oct 2015 10:22:42 +0300
Subject: [PATCH] Fix remoteproc to work with the PRU GNU Binutils port

PRU IRAM addresses need to be masked before being handled to
remoteproc. This is due to PRU Binutils' lack of separate address
spaces for IRAM and DRAM.

Signed-off-by: Dimitar Dimitrov <dinuxbg@gmail.com>
---
drivers/remoteproc/pruss_remoteproc.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/remoteproc/pruss_remoteproc.c b/drivers/remoteproc/pruss_remoteproc.c
index c465dea..3752378 100644
--- a/drivers/remoteproc/pruss_remoteproc.c
+++ b/drivers/remoteproc/pruss_remoteproc.c
@@ -313,6 +313,14 @@ static void *pru_i_da_to_va(struct pru_rproc *pru, u32 da, int len)
{
u32 offset;

+ /* GNU binutils do not support multiple address spaces. The
+ * default linker script from the unofficial GNU pru-ld places
+ * IRAM at an arbitrary high offset, in order to differentiate it
+ * from DRAM. Hence we need to strip the artificial offset
+ * from the IRAM address.
+ */
+ da &= ~0xf0000000u;
+
if (len > 0 && da >= pru->iram_da &&
da + len <= pru->iram_da + pru->mem_size[PRU_MEM_IRAM]) {
offset = da - pru->iram_da;
--
2.6.1

2 changes: 1 addition & 1 deletion version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ toolchain="gcc_linaro_gnueabihf_4_9"
#Kernel/Build
KERNEL_REL=4.1
KERNEL_TAG=${KERNEL_REL}.10
BUILD=${build_prefix}-r23
BUILD=${build_prefix}-r23.1
kernel_rt=".7-rt8"

#v4.X-rcX + upto SHA
Expand Down

0 comments on commit 4f93274

Please sign in to comment.