Thread (9 messages) flat view 9 messages, 4 authors, 2021-01-08

Re: [PATCH 2/2] remoteproc/mediatek: support L1TCM

From: Mathieu Poirier <mathieu.poirier@linaro.org>
Date: 2021-01-07 17:54:54
Also in: linux-mediatek, linux-remoteproc

On Thu, Jan 07, 2021 at 09:50:21AM +0800, Tzung-Bi Shih wrote:
On Thu, Jan 7, 2021 at 7:15 AM Mathieu Poirier
[off-list ref] wrote:
quoted
quoted
 static void mt8183_scp_stop(struct mtk_scp *scp)
 {
      /* Disable SCP watchdog */
@@ -714,6 +749,19 @@ static int scp_probe(struct platform_device *pdev)
              goto free_rproc;
      }
      scp->sram_size = resource_size(res);
+     scp->sram_phys = res->start;
+
+     res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "l1tcm");
+     if (res) {
As far as I can tell the if() condition isn't needed since
platform_get_resource_byname() returns NULL on error and devm_ioremap_resource()
is capable of handling that condition.  As such the code to parse "l1tcm" can be
the same as what is done for "sram".
The "l1tcm" memory region is optional.  The if() condition is for: if
DTS doesn't provide the memory region, kernel can skip the code block.
Very well - thanks for the clarification.
quoted
With the above:

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
quoted
+             scp->l1tcm_base = devm_ioremap_resource(dev, res);
+             if (IS_ERR((__force void *)scp->l1tcm_base)) {
+                     dev_err(dev, "Failed to parse and map l1tcm memory\n");
+                     ret = PTR_ERR((__force void *)scp->l1tcm_base);
+                     goto free_rproc;
+             }
+             scp->l1tcm_size = resource_size(res);
+             scp->l1tcm_phys = res->start;
+     }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help