From patchwork Tue Mar 30 09:12:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 411697 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4300002jai; Tue, 30 Mar 2021 02:28:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0J2poKKk7gLK+ZgUjzG9PDRX0RgeUaY5PrFRQXcyT2IGNuadSATwX50dEZ+dEeWMBq0kd X-Received: by 2002:aa7:d0c2:: with SMTP id u2mr32473011edo.158.1617096503512; Tue, 30 Mar 2021 02:28:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617096503; cv=pass; d=google.com; s=arc-20160816; b=HwW6vF/yrTV5ZN7JqrisPF1NltTcyu3gtk9W2Hwwe3e52TCm6jWuq4SYXeNJa2dAOR X8w5E32BIZJoVr+JAUyHvYcFOFZgOVBVXAytyaFqqKDXKuBAcByLzUR1nG4FK6UDeEp1 9UFUrUT1rZ2ulmlNh70ov/zd7d3lb7AkyYktoy1T6UxDCe+Gd2J7QmMpwglVn2FlOcsN DKPadjoS0FfsJJjwI3mZQFTMq+Th3tQYLY1hW5iroo5mtweBTz/xfck2mcjKK6KNNetb gG25jetpV/a3B/1sqQytnqltbSf8wXDjSxBiQKoUv/4G304XE9FwtJ1uL8puCkV4SjZg RuYQ== 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=ktwdax96pFwXnk6lBfiqoYaR9vkb92hLcZsDEySZ++I=; b=EtfqtL61kk7y0ynsl2TLFm+BneBd6Tyr/h/e2TJA0wLxK1AI2y2KwgMn3o1Jz45nYp ra+798bOiKt5ARZ6sh5o/rAu76EvJ0Jq/kSid1h+XGExY5UYUz09dkE9RDt7Zudye2u5 6lm2Lqmn2TktVytrqMHESjCsqJzXv+unlodtA8SnmdO/K5kGJUGjFSUJP5zYDFDnK18i 7P7JjiZUeuVOmAibKKCUWfcFtQmf0MXNSVc+YAXJiuGs4YPpp4U0DKUc3vx5y7tNlxb2 KOK2GqITMQhppEFfMf9S4rOSBwl5bzoaVO/Go/Js/BQ0S4iteKNQ9tExph6Xs5u6L1LT kXLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Luh8TQuv; 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 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 bx3si15364312edb.594.2021.03.30.02.28.23; Tue, 30 Mar 2021 02:28:23 -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; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Luh8TQuv; 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 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 S231853AbhC3J1t (ORCPT + 6 others); Tue, 30 Mar 2021 05:27:49 -0400 Received: from mail-db8eur05on2060.outbound.protection.outlook.com ([40.107.20.60]:61664 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231731AbhC3J1g (ORCPT ); Tue, 30 Mar 2021 05:27:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ABVjJSEyDchB4Rx+sEl2tg7neKpHCVh6vT3YSJ2dWIZu+eMtnnwWFw7zf07Yi4rb+PZQ3htzq9aHfHrSaJ3nL3WZpfePhCnVWKj+2YFm1UbnUBunzGNRhPIxnTQOVxb9ovUg8H63/uhIh6XlKhS0VEx53GOrTnnbwu1Ys65/w4Visf9LkwOVzAaIJ5dZhxcUJzn/Qo2RUmGCkmTvoFV+0UGWpw6G/B8V9hrllrn0RomRPEqD/OOCHwPYFIqeXrIGxb7LC5ilfpmAtkxL/wMshOIBXws3waDopVy3kpXN/icDTKQ4e3PoNJBRp/afa8qu6ThfHSBOouJw1vGmPMzZgw== 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=ktwdax96pFwXnk6lBfiqoYaR9vkb92hLcZsDEySZ++I=; b=NXbBsv3KFIFSgEf04GWBgBRp+QrV7I2uvyXYVfm1WKq7cXwt3qZhwriB+C4TuLWfYrYi+ni4f7u2CoOWYwDAQChCqsQgd8rESk0xb0GGU/DFaqBVZtXG4XRAsxLRwoswlNKajLYUPR2z/YP9o0LJa3r4OMduJYTm5VqW3Jy93NHU4nhBjyRGygDLGwZnHiSPy9f6q6b5O470swit1Qb+DO4MC/UYMZ+8l5LRpl9Agm/5BCNz4HfcYlzhRm5rH8if+qlViIFqqK1M0XGzo1gPKHiebVdmVlavM934q6WcfDYrmi8tfEepOfSo2i8+rZDZAbbWlg+9WR8aNXxmFtYgHw== 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=ktwdax96pFwXnk6lBfiqoYaR9vkb92hLcZsDEySZ++I=; b=Luh8TQuv0OF0PDe3oCsNH9aJpWUwV8PlHH+Sm169ueTlD+lJCxggeGDncYt6D4KBn0eI76duJyv/ZlzwZKwT1i+4aAC8/7AZyfg8EYdEx0GKVdm3ypgfNO1HvkgfsEM97vmCz5s8zpEZyCDb7OPaVpDqU4oSMbz3PDcvqr4DeOE= 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 DBBPR04MB7595.eurprd04.prod.outlook.com (2603:10a6:10:20d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Tue, 30 Mar 2021 09:27:34 +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.3977.033; Tue, 30 Mar 2021 09:27:34 +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 V2 7/8] remoteproc: imx_rproc: support i.MX7ULP Date: Tue, 30 Mar 2021 17:12:53 +0800 Message-Id: <1617095574-6764-8-git-send-email-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617095574-6764-1-git-send-email-peng.fan@oss.nxp.com> References: <1617095574-6764-1-git-send-email-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0011.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::21) 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 HK2P15301CA0011.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.0 via Frontend Transport; Tue, 30 Mar 2021 09:27:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5162df0d-4de1-4b4b-baa3-08d8f35e0d0f X-MS-TrafficTypeDiagnostic: DBBPR04MB7595: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:118; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c+KniEEM5VIgH/UDnPyClXeinBa5d9nkHJj08cbX1HjdWlMxOfXiV+Q4MEtdzIlt5dN4KIST4w1HDC7L4A2RZVkcuB/k+5E5Mm/GkYOCML1Na/nVNAIj33cEsns5xjXGXQO4yboPBIi/3RgDMhR4X0BqypPdi1G3DEE300H6ZGjQFBywXAgVdSyL1UjEVMegUYn1mvZ+fh8GiRQ2/xk78fsP87zmF5wzIdi6iiJ6K0wDofzcpWHIjRXulJF5jRYnRoERXQrD2GNQmeJ9O9DkcoLhVK5b6qcfqpSE7XZO1twZg6q5BMB/GeQ8rGuJbyfLdhQHTJwPaTf3JRtU+gFb/lus5gYPlaX76s10MEx2qm6uVrJurOffpe1EnsbuuFh3ri/YcafNPRs9W4U2AGt4H+6PviuJNfrfgYZt6i9axv2JBXUWgzQ23Y3vvVPur3lXL6vuNmzcHs+xBO5aPwjZsdYcwcf0eWW26wRsBVOrExwEqGcqyvuOoNH7ga32ped7TnCeHC+3fLfgxA47TyXSdJE+jP4sw2eTgZ6zkcWv8Z+ki0Cd76E6i1aKy/uxti/eaOoZXOLZbpsqowNg4uB7khBmfhiBfHR9dML5gn7aiZOHnAV/2zuAhF99L7cP7HXduk8OJ2QQKnqsoVSI/5uJsyQ7HEZRlwsJF5RVB6h1TggbmyjIuk7DBYF/esVOqSNu 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)(376002)(366004)(39860400002)(346002)(136003)(396003)(9686003)(66556008)(2616005)(86362001)(6666004)(6486002)(52116002)(956004)(8936002)(66476007)(38100700001)(26005)(4326008)(6506007)(186003)(83380400001)(16526019)(478600001)(7416002)(6512007)(2906002)(69590400012)(5660300002)(316002)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ubYqHjav40AmDo+LbTpDtalumy2b3pDZlkUZyRytO2obOuPDbX7XnPGPxsLh49lyYJv6nQ6ka/TT6XdWxIUUbbkRdWdxdi/P8O2nXHZRnVgh8/Xvq+D0d4JkotOzJ60Ez/EEZaSiaKWPeZE0gV3dzDltvoRzDyflCZFUqSpg6+7Ga1GiPnlsQehrFoyB42MxbLYBFUcI1DvVX2mHKisDjh3w8HdJEjzjkdRIlKa4CNxKd0pAkNDSAvQZhZFor5Z27YXVZQ4ZnY2iDozIX3/ez2T5aF22x44ZCqt65l2b46+E+vlbw8nlTdwn76xX9QqNZmDqQd0993RhfVc1RIWj5856fwqOsj6OEEs0pv7Ardk8AJNw1T2cNw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AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2021 09:27:34.6354 (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: DHwiXHiHbSWSm5/I9L6fmhOZx6tWD8jRaCUrz1uKJ9TEvYryVAMiuMIZmn7sGccBNQmY+utdE/WwbKaTxCNDQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7595 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan i.MX7ULP A7 core runs under control of M4 core, M4 core starts by ROM and powers most serivces used by A7 core, so A7 core has no power to start and stop M4 core. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) -- 2.30.0 diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index a7fa9d7fc2d1..b911a7539897 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -147,6 +147,14 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { { 0x40000000, 0x40000000, 0x80000000, 0 }, }; +static const struct imx_rproc_att imx_rproc_att_imx7ulp[] = { + {0x1FFD0000, 0x1FFD0000, 0x30000, ATT_OWN}, + {0x20000000, 0x20000000, 0x10000, ATT_OWN}, + {0x2F000000, 0x2F000000, 0x20000, ATT_OWN}, + {0x2F020000, 0x2F020000, 0x20000, ATT_OWN}, + {0x60000000, 0x60000000, 0x40000000, 0} +}; + static const struct imx_rproc_att imx_rproc_att_imx7d[] = { /* dev addr , sys addr , size , flags */ /* OCRAM_S (M4 Boot code) - alias */ @@ -207,6 +215,12 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { .method = IMX_RPROC_MMIO, }; +static const struct imx_rproc_dcfg imx_rproc_cfg_imx7ulp = { + .att = imx_rproc_att_imx7ulp, + .att_size = ARRAY_SIZE(imx_rproc_att_imx7ulp), + .method = IMX_RPROC_NONE, +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx7d = { .src_reg = IMX7D_SRC_SCR, .src_mask = IMX7D_M4_RST_MASK, @@ -598,12 +612,16 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) return ret; } - if (!(val & dcfg->src_stop)) { - priv->rproc->state = RPROC_DETACHED; + if (!(val & dcfg->src_stop)) priv->mode = IMX_RPROC_EARLY_BOOT; - } } + if (dcfg->method == IMX_RPROC_NONE) + priv->mode = IMX_RPROC_EARLY_BOOT; + + if (priv->mode == IMX_RPROC_EARLY_BOOT) + priv->rproc->state = RPROC_DETACHED; + return 0; } @@ -724,6 +742,7 @@ static int imx_rproc_remove(struct platform_device *pdev) } static const struct of_device_id imx_rproc_of_match[] = { + { .compatible = "fsl,imx7ulp-cm4", .data = &imx_rproc_cfg_imx7ulp }, { .compatible = "fsl,imx7d-cm4", .data = &imx_rproc_cfg_imx7d }, { .compatible = "fsl,imx6sx-cm4", .data = &imx_rproc_cfg_imx6sx }, { .compatible = "fsl,imx8mq-cm4", .data = &imx_rproc_cfg_imx8mq },