From patchwork Fri Sep 3 09:29:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 506499 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp850297jai; Fri, 3 Sep 2021 02:52:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6HdNX+vMb+L0uzV5NLp+UctfmWwUUCzNFKzDt0SEGgrVWDe/lI9ESKfF85CwKBFW6FBJb X-Received: by 2002:a17:906:32ce:: with SMTP id k14mr3189165ejk.503.1630662752185; Fri, 03 Sep 2021 02:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630662752; cv=none; d=google.com; s=arc-20160816; b=HRroF2P6uukaH6K4o6jdBQek7rEH3vsYuHMamYpL+YSXWj4UvEBhJDeKGm+9Iz65J6 eRiDoQgMj/dGdyEDbh1pzxJXTP23Ldh3DO4jAtqgDMZcYzlXoS4SRhvaCkORc3Nzo7bJ bC3QEMqOJw9BrM4QDCY9bTgOBVNb1kEEapTbAc0DsHObsLifq66uyRx20pJVkFSeFwxg fzehx+E07zs2FnogYDux0enJQTNJMtQ+Xf9wsa2dOYViDTXIFHfIEmabK1QBAkYhOLkn kCh82TY+DisDF44NHimA1w9MjuDFyDLYEzahXhy6TFlm3eWHcZ/sjw+gCfk6gsoYpFu2 kMAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=9yHo6I18JrAYnRkcbiAIrzpMsh4AQ+G0sYtgO4h9fiU=; b=isF5XMAoOOrWrsJKyr1Tw0r/WRpPsk1/v7m481n5Orr8p6agI7tJrvobom3mwdRriA fdTsCPMWOpo9TPv99kryEk/Jpmo3BnAQ5crLOzoW5+OXzojvinqDkDcam2LKRbVRXiaW YFAsZfKI3As42of3/WBom5jZc1MbDd1Ujefd9JSXVG8q3BLnnBca2GOPWGegrxlkxU1N YKWcWC7IkaOWFx8z0Mn4XfyzUutKpOYA1fc/wjoJNn7Iw1lNxwHjRkkFnH3Fl/3FihAm 3zOVHmcWzljIdv5EGwN8bBg1lJio2eg7T8PAVLgssbJT63zgSQJPZ+wKrM0MYqWo83H4 K8+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg17si4554905edb.308.2021.09.03.02.52.31; Fri, 03 Sep 2021 02:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348937AbhICJx3 (ORCPT + 6 others); Fri, 3 Sep 2021 05:53:29 -0400 Received: from inva021.nxp.com ([92.121.34.21]:37448 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232273AbhICJx2 (ORCPT ); Fri, 3 Sep 2021 05:53:28 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1425920304C; Fri, 3 Sep 2021 11:52:28 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id CF280203044; Fri, 3 Sep 2021 11:52:27 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2906C183AC8B; Fri, 3 Sep 2021 17:52:26 +0800 (+08) From: Shengjiu Wang To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com Subject: [PATCH v3 1/4] remoteproc: imx_rproc: Move common structure to header file Date: Fri, 3 Sep 2021 17:29:34 +0800 Message-Id: <1630661377-31244-2-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1630661377-31244-1-git-send-email-shengjiu.wang@nxp.com> References: <1630661377-31244-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Move common structure imx_rproc_att, imx_rproc_method and imx_rproc_dcfg to header file which can be shared with imx_dsp_rproc driver. Signed-off-by: Shengjiu Wang --- drivers/remoteproc/imx_rproc.c | 28 +------------------------ drivers/remoteproc/imx_rproc.h | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 27 deletions(-) create mode 100644 drivers/remoteproc/imx_rproc.h -- 2.17.1 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index d88f76f5305e..b0da0130c3b6 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -19,6 +19,7 @@ #include #include +#include "imx_rproc.h" #include "remoteproc_internal.h" #define IMX7D_SRC_SCR 0x0C @@ -72,33 +73,6 @@ struct imx_rproc_mem { /* M4 own area. Can be mapped at probe */ #define ATT_OWN BIT(1) -/* address translation table */ -struct imx_rproc_att { - u32 da; /* device address (From Cortex M4 view)*/ - u32 sa; /* system bus address */ - u32 size; /* size of reg range */ - int flags; -}; - -/* Remote core start/stop method */ -enum imx_rproc_method { - IMX_RPROC_NONE, - /* Through syscon regmap */ - IMX_RPROC_MMIO, - /* Through ARM SMCCC */ - IMX_RPROC_SMC, -}; - -struct imx_rproc_dcfg { - u32 src_reg; - u32 src_mask; - u32 src_start; - u32 src_stop; - const struct imx_rproc_att *att; - size_t att_size; - enum imx_rproc_method method; -}; - struct imx_rproc { struct device *dev; struct regmap *regmap; diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h new file mode 100644 index 000000000000..23d8e808d27f --- /dev/null +++ b/drivers/remoteproc/imx_rproc.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2017 Pengutronix, Oleksij Rempel + * Copyright 2021 NXP + */ + +#ifndef _IMX_RPROC_H +#define _IMX_RPROC_H + +/* address translation table */ +struct imx_rproc_att { + u32 da; /* device address (From Cortex M4 view)*/ + u32 sa; /* system bus address */ + u32 size; /* size of reg range */ + int flags; +}; + +/* Remote core start/stop method */ +enum imx_rproc_method { + IMX_RPROC_NONE, + /* Through syscon regmap */ + IMX_RPROC_MMIO, + /* Through ARM SMCCC */ + IMX_RPROC_SMC, +}; + +struct imx_rproc_dcfg { + u32 src_reg; + u32 src_mask; + u32 src_start; + u32 src_stop; + const struct imx_rproc_att *att; + size_t att_size; + enum imx_rproc_method method; +}; + +#endif /* _IMX_RPROC_H */