Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752261AbdHQKsb (ORCPT ); Thu, 17 Aug 2017 06:48:31 -0400 Received: from mail-co1nam03on0065.outbound.protection.outlook.com ([104.47.40.65]:61280 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751549AbdHQKs3 (ORCPT ); Thu, 17 Aug 2017 06:48:29 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=bestguesspass action=none header.from=xilinx.com; Subject: Re: [PATCH 3/3] soc: xilinx: zynqmp: Add firmware interface To: Arnd Bergmann , Michal Simek CC: Linux ARM , =?UTF-8?Q?S=c3=b6ren_Brinkmann?= , Lucas Stach , Michal Simek , yangbo lu , =?UTF-8?Q?Andreas_F=c3=a4rber?= , Linux Kernel Mailing List , Alexandre Belloni , Baoyou Xie , Shawn Guo , Geert Uytterhoeven , Nicolas Ferre , Simon Horman References: <98038734d73c604dee6ac0d34740d5bc2034e87d.1501854302.git.michal.simek@xilinx.com> <247a5660-6c53-ccc3-7b9f-bfd2a11f6f54@xilinx.com> <3809b6a0-1cb9-37af-a524-8bc1986268ec@xilinx.com> From: Michal Simek Message-ID: <5a53e449-b269-89da-9b69-e560132502fc@xilinx.com> Date: Thu, 17 Aug 2017 12:48:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23264.003 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(2980300002)(438002)(76104003)(377454003)(199003)(24454002)(189002)(54906002)(77096006)(86362001)(230700001)(64126003)(33646002)(356003)(626005)(478600001)(5660300001)(106466001)(6246003)(31696002)(6666003)(9786002)(4326008)(83506001)(47776003)(65956001)(2950100002)(7416002)(8656003)(50986999)(189998001)(36756003)(8676002)(65806001)(76176999)(54356999)(31686004)(50466002)(63266004)(23676002)(305945005)(229853002)(65826007)(53546010)(36386004)(8936002)(81166006)(81156014)(4001350100001)(93886005)(2906002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR02MB2250;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT031;1:RE0BQsMRqmtf63TOsxHBf5RWIboJ4lZZ4OupEjqz17WVS6O0ixESTWzILjCPF//ab5u+hjFklU/jTVQe/pyR3YTwrBFhVzdm1B5DtbGX/qk5dk1wxAJiro75NAHUjpCb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f6c33b3-2091-4748-579a-08d4e55d7d29 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR02MB2250; X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2250;3:YlxneOgRHbw8Ay4Ot+IEYnVnn5VUPOVeTq5hdB8osolm9xwbbpikj9l6HfbYPRBtWlKKmg9lRjLApPUoNMHFrTY5vly7UMTyTW+KtzC9fvEW/2sH3BRtnlrJ6YxcJR+sNyKiGqvpUKb3QvIopNBsn70Sq4N3PPfJzEE80aOFlbVcr2ngCrpIlu6G9hgvZgEV8KzO6k+UR+ZsF9vfJGVzItuAiRs1V8SV4X8p8aL9qgUezZcf/YN7xpc1nC977pPCOOxnd/qgNgfB2Ste2LzOHNJk5j/R4Gggshj3Li9cFJ6/rgutmxG4j+/9+0QHfxsG/ggC5XjoR5L+bql68t67fYQSTROPHW5xcDAma/DPaJc=;25:mlnPiU1118EzQyvai/L16rOmiaP54f8UstjC1Lh+Qo149HOVz9TcIcq43DFyUHnArFm5LslRyKUlwJ2zblRUv+ByTb0DXugNhoFzQl7SG3IGBiaBqP+hRzzalTS171rMXB3iDnwwxKUekKfep+wPNZKVvXawvfy5ZtOrKALSUv7g7R4XTIZP7jiHOoNSeTgvhO9wuI7EFSe4N7lGzDdd3vGv2jzFZ2DbXRUuqWiP7j2FtetM1fpjNUH4VZp37b3G4kWIu9O/L1L4zBevG/KoBQ6Iy0la8wFnFWdwG7YXWGtAwU8djSpzwpqiKDvHjD6p73Wok0se1iLCR8/8YXiGyg== X-MS-TrafficTypeDiagnostic: DM5PR02MB2250: X-LD-Processed: 657af505-d5df-48d0-8300-c31994686c5c,ExtAddr X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2250;31:kQGoN/tseE0uj+4GqMtT0HF4bJmQQUUEIfKgDkjOWJnCq5hKb9SjiGafgek7MHM0Awh+Oa+puDDget1QNlQBnBk5DiTNasX6Y/BV/bAxq/uuCne/FODnqKqltB36XXsxJVXQRkj+oYtO8lqoFCWTXAcxCV1OEbc3oFu+oXfJlv7DF6nksbMxhRgDpsOPygqFLc54BPUB4ZkPv60gbG/39uPobFRFSRsphLjF8Ilcrs8=;20:xrFjYPLHfoakEHd0iHBsBS7UrEWD4Kv/7QmxQRkJ2ny4z+mtS4xvDc+BeN5TWizzcaSjj2/xpH5sEJRKHfPZnSrpkMJPzXwqToqZdMdQAf9yTRcvjeDkQ8unijqGUXAbMjd0U8nhaL1hC5vYPfEf2sUxNpink+xge+IP4iiqNBRtAI1ODSnPy7PNKocCmbj2c7uihHx/w4Cyk+5pkDIt/LQt0VNMDhkn03cetem0tK6WZjrd8A7Ip3vIJvD83UICdWgnL2LQyj+2Sp7+3/6BD8m2mU0H5fgUILqQU5yGwDA8tsSGcxUd93d0+7D4fY7NxQvSPP0GlL7nFNK1ftZE6rFGJIeFTnPCQ1zf5sK7VZCeAiFxqP0RlDDRHp5KA3vlJQd0yEXiYheWzvtJWLFy/8lKfO+JCu7J9O/crguX6MG2yn/M4otAc+/6X/rfAmm25ooW+7vPkyD3hpbEDlOkIKUuK+vyQTnY741EsP+NvPR5eAEH2wpJllyi+nvuCVfF X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13016025)(5005006)(8121501046)(13018025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR02MB2250;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR02MB2250; X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2250;4:7btNl6yx+3oJZpPpXkoNuOUm1k6hsbEmRdgxkTNdL3yqlO1TeFkNzYCnJ61kTcY5AhfBEdkkMkRAuHmxksbqRDxF/KnKaxScVEUiH3mzy1+hgxpUzo/A8yWv3Ilm8S+xZB6aFOVfvs9ebAvOiyXAIY+QDkCdnDdrDmNbXcbxQLxKr8SY11qU+hhA31/iHZZ4Z0v5yvdqMea7l2XjmUka9hKWYbv15aieAeKdRqzV0QTCPsMpX/bnSFCyE+QQJqA+USyY027rdUQ/cRCduyoHza51ltE9O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dfNTe?= X-Microsoft-Exchange-Diagnostics: 1;DM5PR02MB2250;6:Rl4yr7F16Be6NmeQSe5wNM8YJuvLJFhzVWzuLYpiM1N1VkRpVxPoIUv+Ye1Qt9hWLBv5rw6vnyl7xb3j/KNYeHk2zrtWUdLlKT9HJ2+lHZn43Seg6krXAOShxfs6gX4gYdSyCsp5X0IUkcMI8SXbVIr2vP1capEMEHvt4R48m4upUo5PxjB5kyfliLYrgYECEHgJPu9PXOLY62fWFLgPoHHM13fKX6lBPs/1CDF/IouyRWKYSI0CgOOWxnWPvS6JP6gWhA8ffbD0zNRZSiHc9fJTuJq54uL6qPL4dbdAlKOStv3JZZ/jTkgt8y9yXbS5iH/TIjPlhbUDo0Xo+OImQw==;5:UCFySvw/rzR+71CQDgHlnxT0/u+hIBsKd5m5a3cRrnZbcPwNLQIebea2l7XK1OgSZBKnBqgJZqxzrCe/8BnZQ9tSBYwSTd53sLRnGBmfoqw0p+0z9grR6oQZWfGbOce5vSgyZJYjh7S2CE0jhJubcA==;24:o5nxhCKSXlGhTyGhFSvcDsnR00whkpf9wxRUKyiB11ijpNWiF9uH0L8RT0qAIOTUonNIfqae8LcAM5cbyc0YhR76/dpiGl5aBDB2EZR7OCc=;7:nXR6iJ4StQjxXPNpN7y6eXZrSPQspjh/uIZxRG1xsleCbH7jL/7h4rxgmbeWIdcSZ3Yip/PXEl+fdoeK1r7cxSR2aLJwCdmi/FOSCvuDoDm0Z/aic8IDBBFBYVSyb7ZVSyElS+eoL/y68Vm5dZM8TtdH9FIeG0JDkkS3nLT9OoeeuZU/1W08B9Y5Il6M4DktOgqGxO71Zq89n3fGnabZNjWi8niYBGgGr30972CH2Q8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2017 10:48:25.5975 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB2250 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2026 Lines: 60 On 16.8.2017 17:05, Arnd Bergmann wrote: > On Wed, Aug 16, 2017 at 4:34 PM, Michal Simek wrote: >> On 16.8.2017 16:00, Michal Simek wrote: >>> On 16.8.2017 14:41, Arnd Bergmann wrote: >>> >> >> What do you think? >> ret_payload[0] = lower_32_bits(le64_to_cpu(res.a0)); >> ret_payload[1] = upper_32_bits(le64_to_cpu(res.a0)); >> ret_payload[2] = lower_32_bits(le64_to_cpu(res.a1)); >> ret_payload[3] = upper_32_bits(le64_to_cpu(res.a1)); >> ret_payload[4] = lower_32_bits(le64_to_cpu(res.a2)); >> >> There should be probably also change in invoke_pm_fn to do conversion >> from cpu to le64. >> >> int invoke_pm_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, >> u32 *ret_payload) >> { >> /* >> * Added SIP service call Function Identifier >> * Make sure to stay in x0 register >> */ >> u64 smc_arg[4]; >> >> smc_arg[0] = cpu_to_le64(PM_SIP_SVC | pm_api_id); >> smc_arg[1] = cpu_to_le64(((u64)arg1 << 32) | arg0); >> smc_arg[2] = cpu_to_le64(((u64)arg3 << 32) | arg2); >> >> return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload); >> } >> >> This is not tested on BE just on LE. > > Looks good, just make sure you also check with sparse (make C=1) > to ensure you have the right __le64/__le32 types everywhere. Are you aware about any doc where it is written that data should be passed as little endian? I was playing with it a little bit and this means that these 2(3 with hvc) needs to be changed. asmlinkage void __arm_smccc_smc(__le64 a0, __le64 a1, __le64 a2, __le64 a3,__le64 a4, __le64 a5, __le64 a6, __le64 a7, struct arm_smccc_res *res, struct arm_smccc_quirk *quirk); struct arm_smccc_res { - unsigned long a0; - unsigned long a1; - unsigned long a2; - unsigned long a3; + __le64 a0; + __le64 a1; + __le64 a2; + __le64 a3; }; Thanks, Michal