Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp9181ybt; Tue, 7 Jul 2020 14:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC/1COQ8AXH9M7jFjUqFMEhM+l79qc8rzf0IFd9tj8eHyRCeF7QSzAj9fQdyuOkEY29FqV X-Received: by 2002:a17:906:81d2:: with SMTP id e18mr47620647ejx.341.1594157528719; Tue, 07 Jul 2020 14:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594157528; cv=none; d=google.com; s=arc-20160816; b=cOkaQz51NiX3SZjdWu2eLfvEyB0GDTS2mMfjthAJICP94NJGJW+krpAKr3F/bEPbsa qi4sn35HviEvkiUJFpdGjtcjYgDO54f61/YypnMUPBpkVF6nuprQLRAIFjgu0yq6xmbq ayyTrFAtnFnBzb/27Z5Ps1NMiaOlOxensiI3MUpxaECk/jAbcSSx/U0fxyBdUQfIMZCd HE72vCSa8ZuxE8BPbU3TETSmEKDOThkPFzNSGgkkl8cO6Q9KysTSWH8dr/4+Tf/3UaDt 7Ux+/pHAHCg/Bkx5wtT6IuYaUxaDwAOe9OwJ47eIBkU4ufpGPRoVxX3SLZibcg8tXqbx 59CQ== 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=SLaqUlqIXEKDw6i85lizbwO407gGhXi2WgUCdFT1Ou4=; b=ilJ5cdhrK0Eu+fAuC6XANvFZwHopZFRwvPKFjGcoNExTQ21xqrU8sAvo5HmJ1Jt52Y P9s4NRzn7TI2W9TiE/rX+ZrUZxUd044BmkdDkdmjQIfymft+SxKAgTv4AGHOaoI85dt5 H0B1iISj65Z4NNlJ0EnWZzngd95RrrVrVuCyeG8oNbKWLNkhzP/07Q1CJ666CCwTKgfm VQJnJ+NsUQLqa1fTumKTryuE7RKDeWUYs3At06l9E+YKMGhi5C8AoDkUjwym3pIqxtZX bk9QoVF4Ks+Ksu129Up7J7NUWtbFnKuvE5/qjov7s8cU8AcMoAvyHM2d92Pol3YayHTR nJ/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vlg4YzlY; 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 t27si10887074eji.205.2020.07.07.14.31.45; Tue, 07 Jul 2020 14:32:08 -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=vlg4YzlY; 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 S1729314AbgGGVbX (ORCPT + 99 others); Tue, 7 Jul 2020 17:31:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbgGGVbV (ORCPT ); Tue, 7 Jul 2020 17:31:21 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6053FC08C5DC for ; Tue, 7 Jul 2020 14:31:21 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id l63so20582895pge.12 for ; Tue, 07 Jul 2020 14:31:21 -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=SLaqUlqIXEKDw6i85lizbwO407gGhXi2WgUCdFT1Ou4=; b=vlg4YzlYmvKnq0oZiRA/WZQZV9aTD1HT5uRwu7wRIjrPwUyorhubGe1al5Kz0My1np ez3h7UKM28lZ9RHgN/nlSWooHmU7ppDl1sWqV/scpmPN7++XuCidW7Iz/WaKmnzOqR/a JHup0M8XeOQor04qjakUv+rAg76hp/7PLXJtNwOYvpk6DJZPtnVOO2XTXl55D/WTuyXU CHEUkEad2ljkpoWL8pmAriaHw2iwphdwQKTc8oz71DDXXf31ZpgjUy6XQ5lEp1d774mZ 8Ar0GR4BTEvkI+BW1tLbmyuftnYt4DfgzMurlZ8PNATS8qjnVjQnIfe/9wfi+7Gs/YEV /ZtQ== 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=SLaqUlqIXEKDw6i85lizbwO407gGhXi2WgUCdFT1Ou4=; b=jYyGdk1DUUcx8BqwTTW6jEtNoRO48w7FGddqQOfEU+3DETz0c+RpfrRgJvGNvlvhaO 8LqdecIAFHBBFbPqRooUlTZtMaNluwtBfZaRAw0z9lBRnkb3LYhvPa49c8fTF+sRGVE0 l7oDJMbzLCMsGhUfPWyZTlATNRpQMz9XEGbDNjb3VGMrFwssI6iT3w1bgvTqe5znsRd4 rUtM9WDtpICSAl+PrEMX0PdVRWAbSddatuMWZkEk96uOadB/HTU6MtrAH9cpWYMSOZL7 y4gvTgzMBSW8uXJ8g98aCIhj6lVbq0siQeNfj+MaxnbVq1GqPK3/nhicOb9weOw1WNYs yYRQ== X-Gm-Message-State: AOAM533oEdirY7RUTEYh2rF526wKLL7LU4qAi8e0+gRFrm3vrHW/iUU8 WjnpmQ+9a7HdLpw2mqvOJTXOPw== X-Received: by 2002:a63:7cf:: with SMTP id 198mr45501912pgh.309.1594157480837; Tue, 07 Jul 2020 14:31:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 14:31:20 -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 05/11] remoteproc: stm32: Parse syscon that will manage M4 synchronisation Date: Tue, 7 Jul 2020 15:31:06 -0600 Message-Id: <20200707213112.928383-6-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 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 Reviewed-by: Bjorn Andersson --- 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 986f34a336a7..961a53f67ec5 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -71,6 +71,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; @@ -607,6 +609,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.25.1