From patchwork Fri Apr 12 07:54:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1084456 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="FYV9KPcX"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44gVYK0jGCz9s47 for ; Fri, 12 Apr 2019 17:55:01 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C55CFC21E0D; Fri, 12 Apr 2019 07:54:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 99ABDC21C2C; Fri, 12 Apr 2019 07:54:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5DAA3C21CB6; Fri, 12 Apr 2019 07:54:55 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70081.outbound.protection.outlook.com [40.107.7.81]) by lists.denx.de (Postfix) with ESMTPS id 11D31C21C2C for ; Fri, 12 Apr 2019 07:54:53 +0000 (UTC) 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=AKyLaClw5wkSDhv4NwZ3+PWYUP1ujoLk+RVTn+zTlNM=; b=FYV9KPcXL7hyL1Bk1Tehlifm1+/GMv6TzYlpv7YUBNgftDrELyZ7sC1ViJ++DYV0bzBA+H+1hNSPGpbRpS36MTrUpbrjt22hejqUDNX37uRZDoq+yiLqrUxOevZIW8Ar+432/dniDuoTR9cdJeBHaK5AJyq1LMPRqik54YJAGxk= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5843.eurprd04.prod.outlook.com (20.178.118.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.21; Fri, 12 Apr 2019 07:54:51 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::dc63:432c:eb4b:8d1b]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::dc63:432c:eb4b:8d1b%3]) with mapi id 15.20.1792.016; Fri, 12 Apr 2019 07:54:51 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 1/8] imx: sip: add call_imx_sip_ret2 Thread-Index: AQHU8QUBuAB/MsXkW0+fYAgdbvGPeg== Date: Fri, 12 Apr 2019 07:54:50 +0000 Message-ID: <20190412080741.32412-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK2PR03CA0045.apcprd03.prod.outlook.com (2603:1096:202:17::15) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 80bc0bcf-8acc-4cea-ff24-08d6bf1c242b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB5843; x-ms-traffictypediagnostic: AM0PR04MB5843: x-microsoft-antispam-prvs: x-forefront-prvs: 0005B05917 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(366004)(189003)(199004)(2616005)(476003)(7736002)(6116002)(97736004)(3846002)(99286004)(68736007)(66066001)(81166006)(305945005)(8936002)(105586002)(71200400001)(50226002)(5660300002)(71190400001)(6436002)(106356001)(81156014)(8676002)(186003)(316002)(53936002)(14454004)(478600001)(25786009)(54906003)(2501003)(110136005)(256004)(6486002)(1076003)(36756003)(44832011)(102836004)(4326008)(52116002)(26005)(486006)(6512007)(6506007)(386003)(86362001)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5843; H:AM0PR04MB4481.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: 9urL7h8At00sEs5FkNmA3+PqmxTyrsxhZitEGQdW59dcrv2vvUEYikYP+U2WeQFyyHni2jtgAu/CjwwIGf7hifaszQagfhDB4z+8RjR8U31zF5jvoRTRUChAN69+xKlbx71j6H13g+s3qSpdJ6UdvL0+MNo6BQyuJTjefffdtUMhgAhPXIiH43RGKQk83eUoBFQhZtncUk0TXwC7QTGcmuhWWCeV0t6ZAPXJeUvqXEPtvMIhS2yAwo9ZLpDUwuxY31RCsl4Ly1bpf9ceHMKQ9n5OT8bhoTOjMMmajfN6ThI5onwxtUnnOUQK3nVU7GhFxnx2oTpAGCSP3OovneBbMout4QNsI4NsMn5B8QOBtEV1J7RTOjGyh5nI+ts+2BA7kPiVx7/VOwwwlpjjoaS53YFlov6zdJATbTHMBOW27DE= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80bc0bcf-8acc-4cea-ff24-08d6bf1c242b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 07:54:51.0259 (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: AM0PR04MB5843 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH 1/8] imx: sip: add call_imx_sip_ret2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This function will be used by i.MX8 fuse driver. Signed-off-by: Peng Fan --- arch/arm/include/asm/mach-imx/sys_proto.h | 3 +++ arch/arm/mach-imx/sip.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index d0f866b630..4925dd7894 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -134,4 +134,7 @@ int mxs_wait_mask_clr(struct mxs_register_32 *reg, u32 mask, u32 timeout); unsigned long call_imx_sip(unsigned long id, unsigned long reg0, unsigned long reg1, unsigned long reg2); +unsigned long call_imx_sip_ret2(unsigned long id, unsigned long reg0, + unsigned long *reg1, unsigned long reg2, + unsigned long reg3); #endif diff --git a/arch/arm/mach-imx/sip.c b/arch/arm/mach-imx/sip.c index 813c2ae5e1..968e7cf309 100644 --- a/arch/arm/mach-imx/sip.c +++ b/arch/arm/mach-imx/sip.c @@ -20,3 +20,25 @@ unsigned long call_imx_sip(unsigned long id, unsigned long reg0, return regs.regs[0]; } + +/* + * Do an SMC call to return 2 registers by having reg1 passed in by reference + */ +unsigned long call_imx_sip_ret2(unsigned long id, unsigned long reg0, + unsigned long *reg1, unsigned long reg2, + unsigned long reg3) +{ + struct pt_regs regs; + + regs.regs[0] = id; + regs.regs[1] = reg0; + regs.regs[2] = *reg1; + regs.regs[3] = reg2; + regs.regs[4] = reg3; + + smc_call(®s); + + *reg1 = regs.regs[1]; + + return regs.regs[0]; +}