Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp158828ybz; Fri, 24 Apr 2020 13:36:30 -0700 (PDT) X-Google-Smtp-Source: APiQypJ3VeFlYwh7oxb+nOolV8I8MKwPukIYBz5JAnf8rXDE5dye8T1Dh5D7U75A/6aR6iUp2mB6 X-Received: by 2002:a17:906:2ad4:: with SMTP id m20mr9187329eje.324.1587760590359; Fri, 24 Apr 2020 13:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587760590; cv=none; d=google.com; s=arc-20160816; b=LFUHVD0lt98DEjxDQRWQHNc9ItkB5yahQS5kN7ZlnnUG8tKa8Kke7wnt7hl6hQ7DuN SPSdyXctuHjUw3wAxe5pzHmuXZbNdx7pxoZRILijL8dnrfzTm8V3QkCQgGIVVQPiBiWE kzCk33L/dxowaM2psURtbvoaHusXM+wckzmIHVBayZBEc+820TycDfgAl3YaUviAsvNQ zZnszGzqDMjF/vw0S5vFYyK3046c1uKilHx1zJAg+oEkB6AoMdyyPheMk4ENet0v8kk9 WBHAJxPkwvPUE6ZowcP2z6lhFUVJkce5Y+PT/1QBrTLPgG2h+Dj0P5hH8QIp4RF7YV/k sIjw== 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=8pkHvjPLwA96bIGz2NSSF7mXbbhD0VV71pWPGube4rE=; b=P9QvERWA3xEtuWlKAAxZQTSKYIr0tktFTK9KumCpnsg+90OmKBH4yKBkf0wShMFRFX AX+Lz2+zri9FyaJ4je2355H2ZaIFeHhdxbUyRN+GJZcBFrR8aLrBgt3iN6532Xdnunz3 UDXp9atD6gj1Vsu4Rc92TuVNatCm+U+r6x2ESU6fND0UXrwZsUxDbD9KFGeeFcdOsRzb 6I7Nuz6L0DVO5IKxOYspzz9+r6yN7IBW22SCUozLUC2eqjnO1Cli0G2khNLrkaoF8Iau Puc+5FYbiYSjkFHdPoHe0Ipg4xXdvNxhcafOCL1mXls970lsioaH84xOmgXehFK1hw1h HHcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bBYjk7oG; 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 5si3552836edx.30.2020.04.24.13.36.06; Fri, 24 Apr 2020 13:36:30 -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=bBYjk7oG; 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 S1729470AbgDXUZP (ORCPT + 99 others); Fri, 24 Apr 2020 16:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729461AbgDXUZN (ORCPT ); Fri, 24 Apr 2020 16:25:13 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977E3C09B04D for ; Fri, 24 Apr 2020 13:25:13 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id t9so4343708pjw.0 for ; Fri, 24 Apr 2020 13:25:13 -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=8pkHvjPLwA96bIGz2NSSF7mXbbhD0VV71pWPGube4rE=; b=bBYjk7oGchLHLu2fhyb+5w8E3eMQmDXLajYwnSEoNKZRaYmkH0vi8FbFTDbUvVRsr8 1kQ/9bmhSE9nEd0h8GciZnigyFT77H7YY3aEtLzrHHMfMG/paQO+0fWET24ArhZqHg3c vqdwlGoPskGInUqnaGxRnd2S8rBW6Fmj3W7VsY8JPtJkKnY/T5nKIfI7iR74vB69yuvV LmlaLQ8SiaFPpCkXS+0veavIxJ+YUQQsis25rSSvRTKWi/soBPN2Bdaf8IYVJ0TNJuqM zs5BXVrG20QdavJxkRWBiRJ0w9dkN4jxu1vN6mAggY6wBIiWECeO1jFR6r+iMr8S6B1k HarA== 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=8pkHvjPLwA96bIGz2NSSF7mXbbhD0VV71pWPGube4rE=; b=KOVqYh+ptuNUuptNhl2njOAgxHxHf9BF2SG/2RH6bb1CuJyVNTAEmxjr173eoNeDFP 0zPKygdEf2CidI1dlwdz42evGUQBAv3LP5G2PnNqTBzHrLh/2BWJBw1W10+ta4NNC5fq 0o4nYh7LwTB0OZQB39QAZTXeiyRc/tGdPiGGnnNgCLHglfZPBvtzpMV8p/dN8HVaPtNk APraKsPOFtKbbwHAXASnMCwfVlt4mn/ecG99PZAXRcZYVAYDQuuivXrIzRfQYbhA77c2 mApa0/HrtkLGKJU/CcpNIqfeDHyQNHZlcXiXJlKrLBZmVlKI84RIfjwPvDhQPqbFV0wA E9rA== X-Gm-Message-State: AGi0PuarLIwxl8ZzpgCNXEGoFp6BEo5lFafUaO1cyL37Ff+oQtOu3X4C 7oAwBqRwNpnoqpCmlDmCYsoqhw== X-Received: by 2002:a17:90a:101:: with SMTP id b1mr8385987pjb.154.1587759913129; Fri, 24 Apr 2020 13:25:13 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c1sm6553245pfc.94.2020.04.24.13.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 13:25:12 -0700 (PDT) From: Mathieu Poirier To: bjorn.andersson@linaro.org, ohad@wizery.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com Cc: loic.pallardy@st.com, arnaud.pouliquen@st.com, linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/12] remoteproc: stm32: Parse syscon that will manage M4 synchronisation Date: Fri, 24 Apr 2020 14:24:58 -0600 Message-Id: <20200424202505.29562-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424202505.29562-1-mathieu.poirier@linaro.org> References: <20200424202505.29562-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 Get from the DT the syncon to probe the state of the remote processor and the location of the resource table. Mainly based on the work published by Arnaud Pouliquen [1]. [1]. https://patchwork.kernel.org/project/linux-remoteproc/list/?series=239877 Signed-off-by: Mathieu Poirier Reviewed-by: Loic Pallardy --- drivers/remoteproc/stm32_rproc.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 658439d4b00a..a285f338bed8 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -70,6 +70,8 @@ struct stm32_rproc { struct reset_control *rst; struct stm32_syscon hold_boot; struct stm32_syscon pdds; + struct stm32_syscon m4_state; + struct stm32_syscon rsctbl; int wdg_irq; u32 nb_rmems; struct stm32_rproc_mem *rmems; @@ -606,6 +608,30 @@ static int stm32_rproc_parse_dt(struct platform_device *pdev, *auto_boot = of_property_read_bool(np, "st,auto-boot"); + /* + * See if we can check the M4 status, i.e if it was started + * from the boot loader or not. + */ + err = stm32_rproc_get_syscon(np, "st,syscfg-m4-state", + &ddata->m4_state); + if (err) { + /* remember this */ + ddata->m4_state.map = NULL; + /* no coprocessor state syscon (optional) */ + dev_warn(dev, "m4 state not supported\n"); + + /* no need to go further */ + return 0; + } + + /* See if we can get the resource table */ + err = stm32_rproc_get_syscon(np, "st,syscfg-rsc-tbl", + &ddata->rsctbl); + if (err) { + /* no rsc table syscon (optional) */ + dev_warn(dev, "rsc tbl syscon not supported\n"); + } + return 0; } -- 2.20.1