Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6848999imu; Thu, 31 Jan 2019 00:18:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Gki9H9G9quQXzCFhWIxn2A1awpD51iKPcRLss8ioqh+9wGNn4gPOj21b4lg1xM8btpRHf X-Received: by 2002:a17:902:690c:: with SMTP id j12mr33524602plk.206.1548922728062; Thu, 31 Jan 2019 00:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548922728; cv=none; d=google.com; s=arc-20160816; b=IfNT8vowvMSXA0uItATB1pKgSKEurfiwIfdoevKPIOtYZrMnP9bl4pHeQY8eektWhM y8i2x9XT5QQtyni2ZK1+8V+86ceEsoOwnklWDDjqkdPaesslHBOCQjslQmFAsEBtIgw7 TOfi4WRS6lzYsFAspmZohXcOWSQQjYtgijH/iGeJc2YBF7vCCxiyVGVFVC/Qepy510xJ JEh43ytDeYsZeHq7STXHaT2zNG9SHhS6CGETIaco2w5WgtkPeyAOfYFJz44HRnlXTTU9 sYLqphPQLGRv7MObiwFRVs7MAGkJ8WsuJMzpSgZLPiC4o3t4Iy62GyIJ58NkDubtbPCw peLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=U2KoAERSmntCVagM88zc1qtoLjC5V1jYSml6FkbWpKo=; b=1K6BjIkqQbsxffXevgiCKnHWQ4jW669z35SJODUBYvfAUqQv3w1PxB3lFHZ09/UKdJ SlvMfCczBpDI7oNFZlr51yCRBWQmPkieFQNJSCwWcCtuo0mihefNF/ISytf/iSyFcJi1 ZRpjqtBHh/4QfgmLH5NupZ4rRHOvpEHJST/gCsahv7ZlczZywhbOGetp7OjF+Jy8pWei GitgiGYMJAnkj4kA1QgPsbWSsyjogZVhPKOIIcvi6UTFZouwRFJzIJCT4enb+S8ajAgO raLs+If55FwSwAj/xUp/S/jKxT51wuxKtO60aKQhEhYt6EMUXaQzqHTD+HUTtpTssEwL LSHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=KJqYZqLp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si4137795plm.393.2019.01.31.00.18.32; Thu, 31 Jan 2019 00:18:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=KJqYZqLp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727988AbfAaIQ6 (ORCPT + 99 others); Thu, 31 Jan 2019 03:16:58 -0500 Received: from mail-eopbgr00071.outbound.protection.outlook.com ([40.107.0.71]:14513 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725963AbfAaIQ5 (ORCPT ); Thu, 31 Jan 2019 03:16:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U2KoAERSmntCVagM88zc1qtoLjC5V1jYSml6FkbWpKo=; b=KJqYZqLpV3g4yJnnq/fFkgb//oTBaTERww7cUJMzcHFIOApMRwCahJdQBa7xdYGd3EJUhKmJZOdZ8dNQKqibwa7w1mb1myDZeTnDjURWjDnfPPMQKNWIlA5h6lWyabUJ2QwmMNKNdEhrXxM0IwVbGT3yzYBHXiIgj4qpKX5XoKA= Received: from AM0PR04MB4211.eurprd04.prod.outlook.com (52.134.126.21) by AM0PR04MB4436.eurprd04.prod.outlook.com (52.135.148.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Thu, 31 Jan 2019 08:16:54 +0000 Received: from AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::bd44:e001:ab8d:1c51]) by AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::bd44:e001:ab8d:1c51%2]) with mapi id 15.20.1580.019; Thu, 31 Jan 2019 08:16:53 +0000 From: Aisheng Dong To: Daniel Baluta , "shawnguo@kernel.org" CC: "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , "daniel.baluta@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "S.j. Wang" Subject: RE: [PATCH v3] firmware: imx: Add support to start/stop a CPU Thread-Topic: [PATCH v3] firmware: imx: Add support to start/stop a CPU Thread-Index: AQHUuJ/zljwGGsgqVEqW1pCa+zHOeKXJCQ5g Date: Thu, 31 Jan 2019 08:16:53 +0000 Message-ID: References: <20190130133005.5732-1-daniel.baluta@nxp.com> In-Reply-To: <20190130133005.5732-1-daniel.baluta@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM0PR04MB4436;6:dYjwHs1VqigM4z4u+9NN1acmFTvx/HHclWv3AfSCf4IvsImIHuc4sgawoEg45060jV7RAKugn1V09UJf0UcHWBilQTmdE0ZSbZ1q3lYfBSm7SroeXmtG7p0TE5yV5XhwFJUMzvKdshKG/YMZ56Lh/yM9F+xBPMUycy3Bss7rkHaIvaOFKP3F9lK0yMp79K43EWum9KQvUiHcrTE3r9TjrLBeXP40/ZEnptLbCSRLqcuR6s3KOdOXEPXXxHycX14TYKlddWAiEZu4ImfzYdjJzAOkigJLColYKpRDXw9oT3woaQazvopx2VlH10y/M+PdOSSCFaqTfT0WXYBr8y9WYW0tZ84PLcZJamFd31M4VfVEW4xGrFqAnNtc/5X66CJBo6qaoww5mUABAlv9thJX4G6tJYAfJaT1RUJe7sBgIL1aFcEheSC0lScuaJrv1g5SgOMqx0ypRhMtIDn1rBirZA==;5:bWabK3DtiMT7kn+UrGCzDvS+3p/pGaIJeE53x/YBJ4fBywTcoVyzStWmVRXotnFocRFPIxgG6TmSUQrMk8s62DwK7oSedNsKiVFYME+2tz21K8iVrqRwj/1qzQl8CAB5xg9nIMe6hMU7jMl/Wyv62XqYXe3TF0OQoT21htsepMk74d2MiByLOgcOIIsTICbSWWgnnk8X9ztMlUOjWnCBww==;7:vWupaj0gSlEteHAZ07lxpfgBNA6cEDvd4Z9ifn4pxpl4MaaMJzPAuA4PAuvPuj0hm6+mHjaAtzXCzj0fUmkMQ/bZwGsKGX3k4PVYsDzMXA/DioGemRgv7q/HrP5Gy7Nvs9TveVz/2DB1vvXtpYmECw== x-ms-office365-filtering-correlation-id: 61595ce5-f9ee-4132-571b-08d68754759d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR04MB4436; x-ms-traffictypediagnostic: AM0PR04MB4436: x-microsoft-antispam-prvs: x-forefront-prvs: 09347618C4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(376002)(39860400002)(346002)(396003)(189003)(199004)(13464003)(71200400001)(6506007)(9686003)(7696005)(110136005)(25786009)(316002)(4326008)(6436002)(54906003)(53936002)(53546011)(99286004)(55016002)(76176011)(7736002)(74316002)(305945005)(186003)(256004)(86362001)(66066001)(26005)(478600001)(81166006)(81156014)(68736007)(446003)(14454004)(97736004)(8676002)(44832011)(105586002)(486006)(33656002)(106356001)(2501003)(8936002)(2906002)(6116002)(39060400002)(229853002)(6246003)(71190400001)(102836004)(3846002)(476003)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4436;H:AM0PR04MB4211.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: vu4EjFbQQ18A46HbhqA1tLHeJVOUM9xL9ZS+TmBNlNP0HZ32FGLHUoQofEoL+LXjY9coXmjESBKA2b1nlfZ3W1wOhgaMHJfhP+dRGpknizomHv6U8l+FtLcPwXP5A/5iUpUahtMGx5ZbSJ3BDvqPW1mJhrCRs8s3uxtbCLMVLp7AyPpMbKE2d3frK3gQLptpAhiAsAeeFnUyHvgmnRLFT/8v6CgXygBgTosnbgRQD5/M26oINMxm9wdwoiZk8LpC/uFVaMWNvE4oc2qBO/CS0PaTgXqIRyZQ+90ZKnez9mW2FcQvWdB+FV//UQZnreX7ulof0Po/4LmBnhEvfgkQYmHraIoN9ul2tpgYROvWj48qdxUkWAZZon1Uqv22e8QTDikY5MubYbz9Yd0RMsoZD7kKfHHa4iPPrBN3oSGoL8s= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61595ce5-f9ee-4132-571b-08d68754759d X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2019 08:16:53.8421 (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-Transport-CrossTenantHeadersStamped: AM0PR04MB4436 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Daniel Baluta > Sent: Wednesday, January 30, 2019 9:30 PM > To: shawnguo@kernel.org > Cc: s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com; > dl-linux-imx ; daniel.baluta@gmail.com; Aisheng Dong > ; linux-arm-kernel@lists.infradead.org; > linux-kernel@vger.kernel.org; S.j. Wang ; Daniel > Baluta > Subject: [PATCH v3] firmware: imx: Add support to start/stop a CPU >=20 > This is done via RPC call to SCU. >=20 > Signed-off-by: Daniel Baluta Reviewed-by: Dong Aisheng Regards Dong Aisheng > --- > Changes since v2: (as per Aisheng's review) > - rename address with phys_address > - remove unnecessary uint8_t cast > - use 'true' as last parameter of imx_scu_call_rpc to actually > wait for a response from SCU. >=20 > drivers/firmware/imx/misc.c | 38 > +++++++++++++++++++++++++++ > include/linux/firmware/imx/svc/misc.h | 3 +++ > 2 files changed, 41 insertions(+) >=20 > diff --git a/drivers/firmware/imx/misc.c b/drivers/firmware/imx/misc.c in= dex > 97f5424dbac9..4b56a587dacd 100644 > --- a/drivers/firmware/imx/misc.c > +++ b/drivers/firmware/imx/misc.c > @@ -18,6 +18,14 @@ struct imx_sc_msg_req_misc_set_ctrl { > u16 resource; > } __packed; >=20 > +struct imx_sc_msg_req_cpu_start { > + struct imx_sc_rpc_msg hdr; > + u32 address_hi; > + u32 address_lo; > + u16 resource; > + u8 enable; > +} __packed; > + > struct imx_sc_msg_req_misc_get_ctrl { > struct imx_sc_rpc_msg hdr; > u32 ctrl; > @@ -97,3 +105,33 @@ int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, > u32 resource, > return 0; > } > EXPORT_SYMBOL(imx_sc_misc_get_control); > + > +/* > + * This function starts/stops a CPU identified by @resource > + * > + * @param[in] ipc IPC handle > + * @param[in] resource resource the control is associated with > + * @param[in] enable true for start, false for stop > + * @param[in] phys_addr initial instruction address to be executed > + * > + * @return Returns 0 for success and < 0 for errors. > + */ > +int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource, > + bool enable, u64 phys_addr) > +{ > + struct imx_sc_msg_req_cpu_start msg; > + struct imx_sc_rpc_msg *hdr =3D &msg.hdr; > + > + hdr->ver =3D IMX_SC_RPC_VERSION; > + hdr->svc =3D IMX_SC_RPC_SVC_PM; > + hdr->func =3D IMX_SC_PM_FUNC_CPU_START; > + hdr->size =3D 4; > + > + msg.address_hi =3D phys_addr >> 32; > + msg.address_lo =3D phys_addr; > + msg.resource =3D resource; > + msg.enable =3D enable; > + > + return imx_scu_call_rpc(ipc, &msg, true); } > +EXPORT_SYMBOL(imx_sc_pm_cpu_start); > diff --git a/include/linux/firmware/imx/svc/misc.h > b/include/linux/firmware/imx/svc/misc.h > index e21c49aba92f..031dd4d3c766 100644 > --- a/include/linux/firmware/imx/svc/misc.h > +++ b/include/linux/firmware/imx/svc/misc.h > @@ -52,4 +52,7 @@ int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 > resource, int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resour= ce, > u8 ctrl, u32 *val); >=20 > +int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource, > + bool enable, u64 phys_addr); > + > #endif /* _SC_MISC_API_H */ > -- > 2.17.1