Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp11465ybt; Tue, 7 Jul 2020 14:36:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5bgEtJYsVtJ0e6YkrWw056c+VRXtmtplSMNDx6+4S4YFVT1xYMlyHL91dSIss922CLh1Q X-Received: by 2002:a17:906:240d:: with SMTP id z13mr46496533eja.346.1594157767326; Tue, 07 Jul 2020 14:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594157767; cv=none; d=google.com; s=arc-20160816; b=O3txsP7lDmGL3RKA+Ju0RU0qB3iBguLazRcOStZ/Ou+gws1RaFm4i8oNYbDvuJE87G IwMptQOf4ue3Y/oY1n1ovKastWVffHyi6BEgIlWOj+hUrlgBX9iq56WZ0nlkjCEddglr 8LdtiYKV34WSOs9eMROcwseggbuVSM45iH8s3TAJ5PaCcXffBUfbwh2RqQ2NgAQpr+1J pP7xc5vPJql3mq9N8FW3/psGTakbiBKtEb+DxZx4ojtqNVsaNXkjzIQDWiQqkzmZi6wj scg07XJpe3TgOhmVStYl+XzZnonZ9LQcfoYkREYRZHfrbZOjoqPt9wD5IknM0pnxIGRI jDkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+L0m/PbK8aAeOqWVeHEDiQMGUfIG8Y+7XMpTLF4upOo=; b=w+aNLq9n2kF2eJxStFKunkrY/pvC/Y6j94wApDXQukm15kpG24kX4zHIL8QFWtguOl udTD/DdV3n556BT82f14tU1zEQPSYkmoxfi+v/IuBLJfrs+BQvOOwM+0gMDRaBJ10YOQ +v7Pt4J6/+wNTLEWZs7YtT0aGY7hmvqg+sFfnmH/B7cqlZfvncvQGuviX7/26I6ar2M9 JOF+wAeYXeOSlEZeuYfN3xd8KTJg/lWZh7bTlYdprVRoUKW5cab8l/9HESA9zgihozBZ UsipFIpoIVdPC1f0F/YkADHipjVsRKDpr/tKPHcpYtgC+LEEGjEKIim/ArtYtePoDuB8 oXAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hO5KQZfd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si15348690ejj.80.2020.07.07.14.35.44; Tue, 07 Jul 2020 14:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hO5KQZfd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729408AbgGGVbs (ORCPT + 99 others); Tue, 7 Jul 2020 17:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729268AbgGGVbT (ORCPT ); Tue, 7 Jul 2020 17:31:19 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC11DC061755 for ; Tue, 7 Jul 2020 14:31:18 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id 207so18792619pfu.3 for ; Tue, 07 Jul 2020 14:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+L0m/PbK8aAeOqWVeHEDiQMGUfIG8Y+7XMpTLF4upOo=; b=hO5KQZfdIYV9UKLk8tm/GVrR9qniYpxEpiWAOkGK6bNh7bMsV12fLzXgF1oZwkyEmf EeRitVug9C20gBfxS902ydj/2iwb3Lb7aIyGVIixOP+HfS6PVVK3XSjc0Cr5F30t9tJq ujornd12j3tHjWuqHiltfQpRmg/B5UAAzcymoqmqjswEf/qFRcZynG2Bmx/TgOBR5NzM su8L6AZs11QiYOWYiYoKnKHTZ4DnMHlEgHwz8uARF9rZTv6K080jyE8K/epp1Rq6Qrk/ JKEA1Bxl+LJtTFmIVY1f88BEuOOug/0vd3bel1r+/qTjlP4pRLSFcSXNpyK+IxcuxT+G jtbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+L0m/PbK8aAeOqWVeHEDiQMGUfIG8Y+7XMpTLF4upOo=; b=FpJtOx1EQztH2RiDe5G2nJEbpwnrw/h8/WdUCYBQfLeQNNmPgxR4+d34beo+8nskez XLddFamGkJeJhsHwpNHdyiGCWwKXdVaRcKqdP5FCzYC9Prh0YBN+geqaiNcjbT9xnrnt PxVdMTzwcWeZDJ1OqVtkHpepyuFrKslLatTOv0+g34RieIZeKpf1jrt3k5MLvaRkloMK eInaMxXkmd2XnHd/xmTYNxiTlpW8IbGKVLKkmxChXWns39leGof6wBdipALvmEG98HFt D0a3LM5vX6t5vvKPb6dK7ZtWd2kXYHankceHzYtEHELRj35drsAGmTjI7bki/n9pF+3r OPGQ== X-Gm-Message-State: AOAM533ELO8hMs60OYNulgoXs6xCS1r2UqDEt248SE0ZgN6S9AOmoP06 ZVF9iRpp5iwyF1lkdyRDANUUKw== X-Received: by 2002:a62:fb06:: with SMTP id x6mr51125770pfm.28.1594157478432; Tue, 07 Jul 2020 14:31:18 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o128sm23560832pfg.127.2020.07.07.14.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 14:31:17 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org, loic.pallardy@st.com, arnaud.pouliquen@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v5 03/11] remoteproc: stm32: Decouple rproc from DT parsing Date: Tue, 7 Jul 2020 15:31:04 -0600 Message-Id: <20200707213112.928383-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200707213112.928383-1-mathieu.poirier@linaro.org> References: <20200707213112.928383-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the remote processor from the process of parsing the device tree since (1) there is no correlation between them and (2) to use the information that was gathered to make a decision on whether to synchronise with the M4 or not. Signed-off-by: Mathieu Poirier Reviewed-by: Bjorn Andersson --- drivers/remoteproc/stm32_rproc.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index c00f60d42ab6..cbba995a80a2 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -539,12 +539,11 @@ static int stm32_rproc_get_syscon(struct device_node *np, const char *prop, return err; } -static int stm32_rproc_parse_dt(struct platform_device *pdev) +static int stm32_rproc_parse_dt(struct platform_device *pdev, + struct stm32_rproc *ddata, bool *auto_boot) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct rproc *rproc = platform_get_drvdata(pdev); - struct stm32_rproc *ddata = rproc->priv; struct stm32_syscon tz; unsigned int tzen; int err, irq; @@ -590,7 +589,7 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev) err = regmap_read(tz.map, tz.reg, &tzen); if (err) { - dev_err(&rproc->dev, "failed to read tzen\n"); + dev_err(dev, "failed to read tzen\n"); return err; } ddata->secured_soc = tzen & tz.mask; @@ -606,7 +605,7 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev) if (err) dev_info(dev, "failed to get pdds\n"); - rproc->auto_boot = of_property_read_bool(np, "st,auto-boot"); + *auto_boot = of_property_read_bool(np, "st,auto-boot"); return stm32_rproc_of_memory_translations(pdev, ddata); } @@ -627,9 +626,15 @@ static int stm32_rproc_probe(struct platform_device *pdev) if (!rproc) return -ENOMEM; + ddata = rproc->priv; + rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE); + + ret = stm32_rproc_parse_dt(pdev, ddata, &rproc->auto_boot); + if (ret) + goto free_rproc; + rproc->has_iommu = false; - ddata = rproc->priv; ddata->workqueue = create_workqueue(dev_name(dev)); if (!ddata->workqueue) { dev_err(dev, "cannot create workqueue\n"); @@ -639,13 +644,9 @@ static int stm32_rproc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rproc); - ret = stm32_rproc_parse_dt(pdev); - if (ret) - goto free_wkq; - ret = stm32_rproc_request_mbox(rproc); if (ret) - goto free_rproc; + goto free_wkq; ret = rproc_add(rproc); if (ret) -- 2.25.1