Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp34851pxf; Wed, 7 Apr 2021 19:11:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyviVKtNhEhNWbJ9LwuwIAVNUeGVUUyxz7VhQjb3uOZ/nnrDCL+wKXeLFAdhb87gCSBSrJQ X-Received: by 2002:a05:6402:2787:: with SMTP id b7mr8178898ede.225.1617847913265; Wed, 07 Apr 2021 19:11:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617847913; cv=pass; d=google.com; s=arc-20160816; b=ZQADzmJ3m5WfDVUt5Glgbi9OlGzBZTr8plzh1ZNPCLEhzRDBR0yV/wLjGu7Et+Yzqj 7WjC1MdGRUTIuM2EPiI06PbDy1/8hNmhOLsEPvs/Z3yplkyG/M1cnMN27PiolrKh1HCB LmpXOx/bvM60DoLbSlYXYKreKNdUettOqb7igN+Y8GA3a2jQpqsaGcCh9dp0cz1YMLRJ m78QDzKEM3L7b9Cad4lZHTGmKbjM5etFyaNqGXZVUFYiBummPeeyH9zs6zf4vBg6jrUt /ch/bsaLs8hWvYyvWRJyHV44bYVDNKrx8iEV+Un2p7FHVHCOLKeWCma6EklmouBam5fk e8RQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Lrd3+a3w5VU5RkFSHvyqw7S/H36dGznhA87ifuQCLOA=; b=MUxXgy2weti11VOJRTNrcdCf2Gk4X4C0Ngcx3xba5uzDiQHXVxfOLpMSzGx3RgzC2F DwSvgsLfp/jP1JrzOUcG14PMij+1i56k2bTLP8AqFGVFYOza068TXpEtgA019XQsAs+S g3MH6PqHGsDfP8PbHjz/ZnQIfkSx7OKxZkuvzyls+AhIZ+k0bXGqXB2FeJv3zt/7agtB ZL9P2FMWAR3NSaR30O62ejpjveF8+UeTWicV4NhZZ82O4wVIvSxxXf9brj+FnKj1Irk+ rwvsfUaRnc0JWMEvfdCbJhjzRaxRwHlFlHHu7HhD8L+F47ElSmL8yIzGhYu8HQuR6Rli 33Yg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=P9fLYYum; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); 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=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 l10si21183978edb.348.2021.04.07.19.11.29; Wed, 07 Apr 2021 19:11:53 -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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=P9fLYYum; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbhDHCKV (ORCPT + 99 others); Wed, 7 Apr 2021 22:10:21 -0400 Received: from mail-eopbgr80087.outbound.protection.outlook.com ([40.107.8.87]:53176 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230305AbhDHCKU (ORCPT ); Wed, 7 Apr 2021 22:10:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPkxL8LC1xvdbPvUzUIkI5GSASen6xzR4XwwNfzYY4F0fx6AfTX4CZo7u+SEHCA246MGSyD5lJL6OoeVcFgZp+B7H87zvIdIT6+2LFr4P+IjfPShbhkcEzO90olTX6AYfWfH/2qyij7Rk1NrcVGqDknnbE5lknp0NwJmKhisAWMYtCz0KOqTIJ/81m16b/xUYHhjgOWbk7m2QaipAfn5JhrXJBfX9h/OyHCqUPX8+TI4RUtXWKNevFpDYW0qMuhd9+jtPn97NRdb7aViB8JvE/yTORQt0Gr60peAd4wDDuDXHz5uIVhtt4YJml5Th3AvxRy1qShAMAIX1dbpj9/iEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lrd3+a3w5VU5RkFSHvyqw7S/H36dGznhA87ifuQCLOA=; b=RPdDR/GZ6LF1Fn1l7hdP17KqJ+pWyOy8r0n/eT5QSx4uxfdUc1ZVmzD2hSbK646+JzHyLxi83U1UxCXT3JNEBIdPmjfUl1WElg3uCw5eNy+kMy0G3YQSGzGmNCcDoE7MWOUTHtdUMrKJHawRChssAzAOz6XpLNKXGuoMadn2v6NGYF/WOFKeY6V3OviTmG4POhepFjOKvub4Ry0dH1DX4HUdVeHOfsrYIpkCWLlEb+zNdRNXopdKEsLTpoCt3KSGgqd0C3qQCiEZCtrTG9fWOHOFEUGExwg8JAqvwMV7aQlgMdQeWDW91Y7uO1cfUx+MfIYI1R5qmpdyfymJ82MgxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lrd3+a3w5VU5RkFSHvyqw7S/H36dGznhA87ifuQCLOA=; b=P9fLYYumcMdAt1AI9ejdZ3285DPSvM+RJeYnRG2wa6V4j5Fip632WaMvJbsy0BbmnDLlMstz+TBL87shCTUzdLrB63bO4GX2+p6eOHwlEfkZ8m1Dl1oxk/1dkDGh/zcSeLR8rUlXrwyCHhYCpfHuvS3QWF0sl8XMGJhD4dbdvbQ= Authentication-Results: wizery.com; dkim=none (message not signed) header.d=none;wizery.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB8PR04MB6857.eurprd04.prod.outlook.com (2603:10a6:10:114::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.32; Thu, 8 Apr 2021 02:10:05 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf%11]) with mapi id 15.20.3999.032; Thu, 8 Apr 2021 02:10:05 +0000 From: peng.fan@oss.nxp.com To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, o.rempel@pengutronix.de, robh+dt@kernel.org, devicetree@vger.kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 5/8] remoteproc: imx_rproc: parse fsl,auto-boot Date: Thu, 8 Apr 2021 09:54:55 +0800 Message-Id: <1617846898-13662-6-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617846898-13662-1-git-send-email-peng.fan@oss.nxp.com> References: <1617846898-13662-1-git-send-email-peng.fan@oss.nxp.com> Content-Type: text/plain X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0019.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::29) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0019.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4042.4 via Frontend Transport; Thu, 8 Apr 2021 02:10:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e16a9c6-3a66-4e0b-1ee1-08d8fa336cf6 X-MS-TrafficTypeDiagnostic: DB8PR04MB6857: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ugYIUX4TxZmay6Zm8XQ5MyPkwlugO2jAxmgpXcTXYWiRiHlyGFEJSmjZm3pcIedb68FFGH5N4yEeoO+naEY/rWlqOLtiZCHbWmEymiVYSioZn3kpwKq46KSdnjtovkPV9pRMzLveWTipgW8A93Wek5hj7ydo8LtGogkTj3qtnn5krkrdCVkv0FknmQgtvMgkYTAE+J3himXGNUreegmeQOZgnxCsLT6uYWjf4rpEtkwgAlPYnM4wdH8cs4icppsm6CreLUPALE6L1Ybnqu8cywyHEA3CYfNx9/hKXR9rKC+jxQj6lnfrp/kLRhNtqgnSX9nH4oly9VIrAPSXT1cN83fnEfv3HbOYNhBPVPVUKf8lzyjBwyjfGGKqU/ArSZiRsvtP7w5AFUemP7c6LF1JfNIQEhaFlitPAhrXdoSTomKkKgb/cELKPGAkROs0qidR5YRGDllyifrKdHZNqgW78KVTWfUC3QnUEWWZz78fCSRPeU7aZ6f8VJh2aYI5yeQOGLuPsEQ72rgN7EZLKyrJ5cLXhrpMTNmW43RadrfXBFB60275IhdqgadyFqPnlelJ6i28X2V2nnOwPaGyZvhgh/9lRwKe3zjKjCSSq/Se3UuxmiW/LYx5/Z3A90tdJaekZn25ko3gJsnU8fuhb+Qe2Cc4rZqE0MPN9JTBFzTEmvnUBCJA7wTWbcj5LzfllbSviz7NroDhYzbgozOaCE/V2I86acxjyuH71J0jv+M+eQM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR0402MB2760.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39860400002)(376002)(346002)(366004)(396003)(38350700001)(8936002)(6486002)(4326008)(6506007)(52116002)(9686003)(6512007)(8676002)(2906002)(316002)(478600001)(86362001)(69590400012)(2616005)(7416002)(956004)(186003)(16526019)(26005)(6666004)(66476007)(5660300002)(66946007)(66556008)(38100700001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?/8Z4FAhpaEaGGdmWVhcmXEqsu53IfbXGxIS8KJ1X/ZJS3bCIRHGgiC1tZNVy?= =?us-ascii?Q?OvCQ8wdrC6wwAe6W7i1PVQ0vdcr8v1WaaLoYIaUt7tU3gkfT98spErdCD9ke?= =?us-ascii?Q?gdA5pHdUhvD5m+xrB2vxJLMqn9zQy0Aona3lGc5oTBgTs3S3q4G7VSOioVJ9?= =?us-ascii?Q?nSF15BrXjKp2N1Q/rSy+Ul2LjsK/sSbMNswkIYnheF6qHVC6RhJzpiUVvdm2?= =?us-ascii?Q?lwOtwgwMFqi3dTZOcvM3t01gCeh5iilHeaYjLa5/kAOSDA1PtNXKeI0G3IT1?= =?us-ascii?Q?nrfXlDqBLzsnNynK8b67PHeaDlc/6SVbHJGQdGosDADusZdfn+zLbl6iQtJz?= =?us-ascii?Q?pVym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OB0ANMRnnqriE0Cxl6wr?= =?us-ascii?Q?h4NFyQ46hQl+3rluA5uuYJCbes86Bm37LQmA775Cs31+nRwbAIrQY6aIV1WD?= =?us-ascii?Q?/Tlh/S8HCwlge1TOH9ZX78mWUVXarapjX8uMt/4ts8ekVg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e16a9c6-3a66-4e0b-1ee1-08d8fa336cf6 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 02:10:05.2749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rOrdlihMWJ/2qnEd8YNfqLYyPCiIMAaOmwWN6P1Gbqdf8tE4I1s1/Ow3pMvLqgyI63kXdClEd5VkN6pnhCKjRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6857 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan Parse fsl,auto-boot to indicate whether need remoteproc framework auto boot or not. When remote processor is booted before Linux Kernel up, do not parse fsl,auto-boot. So add an entry to store the working mode of remote processor. Currently only IMX_RPROC_NORMAL, IMX_RPROC_EARLY_BOOT. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index ca17f520d904..c576e12d3817 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -83,6 +83,16 @@ struct imx_rproc_dcfg { size_t att_size; }; +enum imx_rproc_mode { + /* Linux load/kick remote core */ + IMX_RPROC_NORMAL, + /* + * remote core booted before kicking Linux, and remote core + * could be stopped & restarted by Linux + */ + IMX_RPROC_EARLY_BOOT, +}; + struct imx_rproc { struct device *dev; struct regmap *regmap; @@ -96,6 +106,7 @@ struct imx_rproc { struct work_struct rproc_work; struct workqueue_struct *workqueue; void __iomem *rsc_table; + enum imx_rproc_mode mode; }; static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { @@ -565,14 +576,18 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) int ret; u32 val; + priv->mode = IMX_RPROC_NORMAL; + ret = regmap_read(priv->regmap, dcfg->src_reg, &val); if (ret) { dev_err(dev, "Failed to read src\n"); return ret; } - if (!(val & dcfg->src_stop)) + if (!(val & dcfg->src_stop)) { + priv->mode = IMX_RPROC_EARLY_BOOT; priv->rproc->state = RPROC_DETACHED; + } return 0; } @@ -654,6 +669,9 @@ static int imx_rproc_probe(struct platform_device *pdev) INIT_WORK(&priv->rproc_work, imx_rproc_vq_work); + if (priv->mode == IMX_RPROC_NORMAL) + rproc->auto_boot = of_property_read_bool(np, "fsl,auto-boot"); + ret = rproc_add(rproc); if (ret) { dev_err(dev, "rproc_add failed\n"); -- 2.30.0