summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d2a2dce)
raw | patch | inline | side by side (parent: d2a2dce)
author | Suman Anna <s-anna@ti.com> | |
Tue, 4 Aug 2020 22:02:05 +0000 (17:02 -0500) | ||
committer | Suman Anna <s-anna@ti.com> | |
Tue, 4 Aug 2020 22:23:47 +0000 (17:23 -0500) |
Cleanup the K3 R5F remoteproc driver to include various minor
miscellaneous items incorporating some of the comments from the
latest upstream reviewed version. These include:
- Reorder the header files in alphabetical order
- Fix a kerneldoc warning in struct k3_r5_core
- Remove a stale no-op condition check in the cleanup path in
k3_r5_reserved_mem_init().
- Add some extra comments for additional clarifications
- Use dev_of_node() instead of directly referencing dev->of_node
- Revise couple of debug trace statement formats
- Drop the debug trace around devm_of_platform_populate()
Signed-off-by: Suman Anna <s-anna@ti.com>
miscellaneous items incorporating some of the comments from the
latest upstream reviewed version. These include:
- Reorder the header files in alphabetical order
- Fix a kerneldoc warning in struct k3_r5_core
- Remove a stale no-op condition check in the cleanup path in
k3_r5_reserved_mem_init().
- Add some extra comments for additional clarifications
- Use dev_of_node() instead of directly referencing dev->of_node
- Revise couple of debug trace statement formats
- Drop the debug trace around devm_of_platform_populate()
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/remoteproc/ti_k3_r5_remoteproc.c | patch | blob | history |
index 919c8896e5d22f22f110c472c33ee6dc152ab5d6..817850b48d9f2b1d620809b46f55b179fd33d292 100644 (file)
#include <linux/kernel.h>
#include <linux/mailbox_client.h>
#include <linux/module.h>
-#include <linux/of_device.h>
#include <linux/of_address.h>
+#include <linux/of_device.h>
#include <linux/of_reserved_mem.h>
+#include <linux/omap-mailbox.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/remoteproc.h>
-#include <linux/omap-mailbox.h>
#include <linux/reset.h>
#include "omap_remoteproc.h"
/**
* struct k3_r5_core - K3 R5 core structure
+ * @elem: linked list item
* @dev: cached device pointer
* @rproc: rproc handle representing this core
* @mem: internal memory regions data
static int k3_r5_reserved_mem_init(struct k3_r5_rproc *kproc)
{
struct device *dev = kproc->dev;
- struct device_node *np = dev->of_node;
+ struct device_node *np = dev_of_node(dev);
struct device_node *rmem_np;
struct reserved_mem *rmem;
int num_rmems;
of_node_put(rmem_np);
kproc->rmem[i].bus_addr = rmem->base;
- /* 64-bit address regions currently not supported */
+ /*
+ * R5Fs do not have an MMU, but have a Region Address Translator
+ * (RAT) module that provides a fixed entry translation between
+ * the 32-bit processor addresses to 64-bit bus addresses. The
+ * RAT is programmable only by the R5F cores. Support for RAT
+ * is currently not supported, so 64-bit address regions are not
+ * supported. The absence of MMUs implies that the R5F device
+ * addresses/supported memory regions are restricted to 32-bit
+ * bus addresses, and are identical
+ */
kproc->rmem[i].dev_addr = (u32)rmem->base;
kproc->rmem[i].size = rmem->size;
kproc->rmem[i].cpu_addr = ioremap_wc(rmem->base, rmem->size);
return 0;
unmap_rmem:
- for (i--; i >= 0; i--) {
- if (kproc->rmem[i].cpu_addr)
- iounmap(kproc->rmem[i].cpu_addr);
- }
+ for (i--; i >= 0; i--)
+ iounmap(kproc->rmem[i].cpu_addr);
kfree(kproc->rmem);
release_rmem:
of_reserved_mem_device_release(dev);
}
core->mem[i].size = resource_size(res);
- dev_dbg(dev, "memory %8s: bus addr %pa size 0x%zx va %pK da 0x%x\n",
+ dev_dbg(dev, "memory %5s: bus addr %pa size 0x%zx va %pK da 0x%x\n",
mem_names[i], &core->mem[i].bus_addr,
core->mem[i].size, core->mem[i].cpu_addr,
core->mem[i].dev_addr);
return -ENOMEM;
}
- dev_dbg(dev, "memory sram%d: bus addr %pa size 0x%zx va %pK da 0x%x\n",
+ dev_dbg(dev, "memory sram%d: bus addr %pa size 0x%zx va %pK da 0x%x\n",
i, &core->sram[i].bus_addr,
core->sram[i].size, core->sram[i].cpu_addr,
core->sram[i].dev_addr);
u32 temp[2];
int ret;
- ret = of_property_read_u32_array(dev->of_node, "ti,sci-proc-ids",
+ ret = of_property_read_u32_array(dev_of_node(dev), "ti,sci-proc-ids",
temp, 2);
if (ret < 0)
return ERR_PTR(ret);
static int k3_r5_core_of_init(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
+ struct device_node *np = dev_of_node(dev);
struct k3_r5_core *core;
int ret;
}
core->dev = dev;
+ /*
+ * Use SoC Power-on-Reset values as default if no DT properties are
+ * used to dictate the TCM configurations
+ */
core->atcm_enable = 0;
core->btcm_enable = 1;
core->loczrama = 1;
{
struct k3_r5_cluster *cluster = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
+ struct device_node *np = dev_of_node(dev);
struct platform_device *cpdev;
struct device_node *child;
struct k3_r5_core *core;
static int k3_r5_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
+ struct device_node *np = dev_of_node(dev);
struct k3_r5_cluster *cluster;
int ret;
int num_cores;
platform_set_drvdata(pdev, cluster);
- dev_dbg(dev, "creating child devices for R5F cores\n");
ret = devm_of_platform_populate(dev);
if (ret) {
dev_err(dev, "devm_of_platform_populate failed, ret = %d\n",