Skip to content

Commit c6cd2b8

Browse files
Dimitar DimitrovRobertCNelson
authored andcommitted
Really Fix remoteproc to work with the PRU GNU Binutils port
The original patch has been mistakenly applied to DRAM addresses, whereas IRAM are the ones needing a fixup. This patch fixes the following error: [ 1672.917602] remoteproc remoteproc1: Booting fw image pru-core0.elf, size 7104 [ 1672.917632] remoteproc remoteproc1: bad phdr da 0x20000000 mem 0x8f4 [ 1672.929347] remoteproc remoteproc1: Failed to load program segments: -22 [ 1672.938733] remoteproc remoteproc1: Boot failed: -22 Signed-off-by: Dimitar Dimitrov <[email protected]>
1 parent db85ed4 commit c6cd2b8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/remoteproc/pru_rproc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -891,14 +891,6 @@ static void *pru_d_da_to_va(struct pru_rproc *pru, u32 da, int len)
891891
u32 offset;
892892
void *va = NULL;
893893

894-
/* GNU binutils do not support multiple address spaces. The
895-
* default linker script from the official GNU pru-ld places
896-
* IRAM at an arbitrary high offset, in order to differentiate it
897-
* from DRAM. Hence we need to strip the artificial offset
898-
* from the IRAM address.
899-
*/
900-
da &= ~0xf0000000u;
901-
902894
if (len <= 0)
903895
return NULL;
904896

@@ -937,6 +929,14 @@ static void *pru_i_da_to_va(struct pru_rproc *pru, u32 da, int len)
937929
u32 offset;
938930
void *va = NULL;
939931

932+
/* GNU binutils do not support multiple address spaces. The
933+
* default linker script from the official GNU pru-ld places
934+
* IRAM at an arbitrary high offset, in order to differentiate it
935+
* from DRAM. Hence we need to strip the artificial offset
936+
* from the IRAM address.
937+
*/
938+
da &= ~0xf0000000u;
939+
940940
if (len <= 0)
941941
return NULL;
942942

0 commit comments

Comments
 (0)