summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 667bb76)
raw | patch | inline | side by side (parent: 667bb76)
author | Suman Anna <s-anna@ti.com> | |
Sat, 28 Sep 2019 00:00:46 +0000 (19:00 -0500) | ||
committer | Suman Anna <s-anna@ti.com> | |
Wed, 2 Oct 2019 02:38:15 +0000 (21:38 -0500) |
A R5F remote processor can access its TCMs either using its local address
views at address 0x0 and/or 0x41010000 depending on the LOCZRAMA setting,
or using the corresponding SoC-bus address views (one-to-one views since
there are no MMUs).
The K3 R5F remoteproc driver provides the translations for the TCMs
through the k3_r5_rproc_da_to_va() function to allow loading into TCMs.
This function is translating the SoC-view addresses just fine, but is
only translating ATCMs at address 0x0 at present. This results in a
failure to load any segments into BTCMs when using the R5 local address
range at 0x41010000. Update the logic in this function to fix these
BTCM load issues.
Fixes: 80d807f572e9 ("remoteproc/k3-r5: add a remoteproc driver for R5F subsystem")
Signed-off-by: Suman Anna <s-anna@ti.com>
views at address 0x0 and/or 0x41010000 depending on the LOCZRAMA setting,
or using the corresponding SoC-bus address views (one-to-one views since
there are no MMUs).
The K3 R5F remoteproc driver provides the translations for the TCMs
through the k3_r5_rproc_da_to_va() function to allow loading into TCMs.
This function is translating the SoC-view addresses just fine, but is
only translating ATCMs at address 0x0 at present. This results in a
failure to load any segments into BTCMs when using the R5 local address
range at 0x41010000. Update the logic in this function to fix these
BTCM load issues.
Fixes: 80d807f572e9 ("remoteproc/k3-r5: add a remoteproc driver for R5F subsystem")
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/remoteproc/ti_k3_r5_remoteproc.c | patch | blob | history |
index 429bcb7a2609e8e939f36b2a821102ace4857f11..4e915b62342c3cadd644672bbd4c08e5d2773135 100644 (file)
if (len <= 0)
return NULL;
if (len <= 0)
return NULL;
- /* handle R5-view of ATCM addresses first using address 0 */
- size = core->mem[0].size;
- if (da >= 0 && ((da + len) <= size)) {
- offset = da;
- va = core->mem[0].cpu_addr + offset;
- return (__force void *)va;
- }
-
- /* handle SoC-view addresses for ATCM and BTCM */
+ /* handle both R5 and SoC views of ATCM and BTCM */
for (i = 0; i < core->num_mems; i++) {
bus_addr = core->mem[i].bus_addr;
dev_addr = core->mem[i].dev_addr;
size = core->mem[i].size;
for (i = 0; i < core->num_mems; i++) {
bus_addr = core->mem[i].bus_addr;
dev_addr = core->mem[i].dev_addr;
size = core->mem[i].size;
- if (da >= bus_addr &&
- ((da + len) <= (bus_addr + size))) {
+ /* handle R5-view addresses of TCMs */
+ if (da >= dev_addr && ((da + len) <= (dev_addr + size))) {
+ offset = da - dev_addr;
+ va = core->mem[i].cpu_addr + offset;
+ return (__force void *)va;
+ }
+
+ /* handle SoC-view addresses of TCMs */
+ if (da >= bus_addr && ((da + len) <= (bus_addr + size))) {
offset = da - bus_addr;
va = core->mem[i].cpu_addr + offset;
return (__force void *)va;
offset = da - bus_addr;
va = core->mem[i].cpu_addr + offset;
return (__force void *)va;