From patchwork Thu Feb 9 06:38:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13134051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88746C61DA4 for ; Thu, 9 Feb 2023 06:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjBIGhM (ORCPT ); Thu, 9 Feb 2023 01:37:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjBIGhL (ORCPT ); Thu, 9 Feb 2023 01:37:11 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2050.outbound.protection.outlook.com [40.107.241.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B911A25B94; Wed, 8 Feb 2023 22:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hCl2Y+rCIdJye1kjrlpoHTdUm7qgTaLH2qERBUBy99htnXZFP5IFi9tXWb89QYm4VOpVnxefkCRkstiBHcz7A/yEw9AFprxFRJzUJC2sEwFiAf+VNexK0pJNbhSD8vsLgU+iYsgdsYAvhC0ZNW82EWEdLarWUPE6VACO4BdosZPTWANZrITI1C2elzD+RpKYwd7LXSpT5aNMK2mekEW1A7kGWGEUS5yn/v4QDyMrm3O8hJk0J31m1cXXOKhftukKXImtPUQQdlzsHOvh20NjIXPgjJusb0k8txm2oDjEyyQXjB/0SAXhlucaSvJ3EArPi1EtkRgW9VsJnJAbUCMC/Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0tIRmbYwTAeBLe9c8790tpkL/yj/P7/Z9KeZrtxiHwQ=; b=VlCGJCTu+Y3iPSEQ9mcvm61ZI5BwK6MfV8JOX7TGFVs3U4ACCWmotmXd00NzsZxnaF4tiFq173C52PBUB3SW2r/J5BhlILNic0qEPohBoxT1Ci4Em53ea6gsblCKEjlmYPexr9ECcIh1c/IoZsrenQp8I8D8eV8XG4g5IKodasVMdoM87X0UsS6pTNFch3HYqykQ0rk+kqL+OIbwHESJGldme0WeTiKIAkTxSRVZ+J88o2OtXfpRDHX2PAHNdC+vKJnBS86T4612MI/pSct/Va7iXydUNekUHYQiNLDTAfANzMGeIqPtp4a9GdKryUtfZasfKzdCuOz4+vdtHNj8XQ== 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=0tIRmbYwTAeBLe9c8790tpkL/yj/P7/Z9KeZrtxiHwQ=; b=QniOdtZIYTjQzZ+7A6RBJN+oBS9zP/MG+WRyLo/R0ogC8yzgyF2a4tDAG6ibC8ncRCBKSLWOrm8pD2yEMdXxWOI23KkXE9wyFsB5orgWwT29ntgDcvng9aqe7Yn10igTu85FNy6EeFBbfyHhf+HOi69dllM3eCzyTt/z2p7bxkY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7979.eurprd04.prod.outlook.com (2603:10a6:10:1ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 06:37:07 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3%9]) with mapi id 15.20.6043.025; Thu, 9 Feb 2023 06:37:07 +0000 From: "Peng Fan (OSS)" To: andersson@kernel.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, arnaud.pouliquen@foss.st.com, daniel.baluta@nxp.com, iuliana.prodan@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 1/6] remoteproc: imx_rproc: correct i.MX8MQ DDR Code alias mapping Date: Thu, 9 Feb 2023 14:38:11 +0800 Message-Id: <20230209063816.2782206-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230209063816.2782206-1-peng.fan@oss.nxp.com> References: <20230209063816.2782206-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: ab15e328-3210-4a95-4f04-08db0a681056 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nNzMJPk7jXIWG2TbiKRbSINL3Lure/G2Js/QLr2Wa+nIWdGcN+MjDYxgSU2pRn5BQbhk+g3/FBPWXHE+G3dUlELttDwemHbAUH9K28DTazBy+6czFoL3KXULXztponY5rBZBRU49O0t9pki4GcUfCvBfNRNQVPb5/6jUy7bK0s9BAyW6BnYGXN6/YnLlPze3kZix5e8XPV7fide1JgmxFJmRBfCCDdSNGjpJL8H6d/bqsr7UBncjjJ+vDEUc+YDuqdcIiOP5TtLA5vvkD5KkDFuelgXleWaTRBbFpgcJIRYpsA79kOlXIl5Go149rSpBmVIXBok824WStTZqLKD1pqDbrEUSqI58TuhKVdMDL28p22jltDsDHSd8NUbp90URneEx4jrbNwEOnhrFf6zcqVdY5r4QWiXUgKh0nmmZz2/pNLtD0Ar70atI2YxLrEuCLWWhyMH5whfJ2Oes73YAODTCdaUeiWC5Vu5/6ehbwrUiYin48yqHwzL59aDWs4HEXmjN1IgSasYoEQwiLCxlJFCwekKvm7b/eNhUGy1Tgv1neDDG7LHInZQ8I33CHDfvWd5/3fUSZiv2tlnSCfBqgG1ASDCXsCEHuFfPcSHXeo1Fi40hYguPHen8B73RvbskhDrxRNqMkjqmBVkf+NCRkKQFjtNvaCd8kynnaQp+A9Wk5rx6kwH4hTIxvHh3Hu7qsEt43KHEykkpcV8Q0IJvCg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199018)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(38100700002)(38350700002)(2616005)(316002)(186003)(26005)(2906002)(8936002)(6506007)(6512007)(6666004)(1076003)(86362001)(478600001)(6486002)(5660300002)(52116002)(83380400001)(4744005)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8+WMKjS2Dgxid2ngbNQzn6ZNAz5s/MdDoUsy9QDCf8QMdtA/HNqhfqrXgdLzIubfTq9lTLvDn8I5F/XRnbImw1Par6pKtkKd8ocplXvb6Pc/A3vmLuEx5boytgvNkaZ+y0LlnIigCW4JGv2B51wj+1M2hItRr3ndtnXyLhioobAl64aPN6tfvc8WYMBci7kilWW5yt1Zrx/FSBlYhfXnYvR1P+teNGpkqXqYr+/2VcyfvK/VJfNDuK60XTbdvlinBgNI8HxsRBajm5UI3zgRItN7CVcGMmmzABVXELzHTaASYdZY3ETtwhWSdz2krTNFR3IVOfU+n2+47HydE4alt4D4dVV37Ttz8+yNzjlOKfcPAi3RgNx1kw6V/rtLV/5o0dZh5f7wHbwbIQd2rAl8gSHXpzM6myMpdN5nLn5WXnWZMnd54XbGfD9uhh7+BttybzchjWmAPLmL/NfXvPCdYtQ+XsClcuKAs6rVIOIMS5RbTXnDNmZ8XYuFw4iRXkLrKb4lE5WcWCihBittXqB0a7cG4el9wYjco7at1Ysey5tm9UbJBgyJELL4nhMVNdEJJCvhgmY1tUAVCNeZgDwa0eCl18YRnjJDYJMWIiNPT0FzQLcUt24gOcmukfBcXqvIlE6m0/5Uri/8uVqWUMzcrWBOlH3PMn029YhDlMWzSARta2s375jMJ2KGtIMJA691nkISNmQjoJ+YslZVpSCll2kgHxCJwvcWmcDE5YIF0def0C3Wc11dYFN/tevc3pcFdE0Gh2NUHI4SRXcIWJ/fD+Xi3K9+9IwGRU83sSDCfAazJYnlvDf/LJbAPSzWIPtcAjUWhqAgjWqOBYxgfbr4GqdknyIxlxWXWrHYbNYFt96cHArxm64CnU+sJBfEHLvCM9E3Nvl1THMXWTQrlT1lTVOmXBmiX9Jc1AI/4SIhSJTwmXkX7C+98/ivi8kp7heoXW3/4wadYWYLjphMjWG3NB8LdaNnnMK2tJwYHT3DQTkKDTBw9TB8ZLmHozU6vSclpErhbcjo7S7HSai4fnAR/611Kjrtgw8PDyZawFAUyhp6H4LQU/rYniG8y3CJa1iU9S2Qi1F7BaB+MnBvaDpJQAWqp9y5dGzK0mZb7iKerHTl8gKLR4IJ+OXVoQ35E8IjAPPsc+OxwVSL58R77vPfNnppUJQaMloMs5F24WOxZNdxasj2S35GU6+prUUrWaCwcsLk9k8IyOaUzTVT2yVlO3b6dF4SG/PXlq0bfy/GVnOGdYOPNGFq3MVCPn7mX+KGiha3uUvZJBEIcW2LEU0GsKyRWcj4l72wszKpChz00RHheyiI1eoUzTT2VvQbfelzZMO2oePF/wxKDxtxk6NFWkDza2lFZtbIwhFBpAQl3NLrZYIH1v6i8ueyWZOj2HZUwmQyfp7vm5p0RRbfvsQProxVHnl9nmgK0UPL5Z6hJorm6L3rzovr8bt1Z40xTc38/0KqRzhYcxvqLQyl7AfR+R0+6bh7gOOKebKsnG3MqfWqFwojR1tp+Zb8Rfl4etv7BQEggQYNwyVctweGeTdcrWH0O/Fp8PLLAhD0/0M33paPaVl2s1ctTnS5pmc7Jzdm X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab15e328-3210-4a95-4f04-08db0a681056 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 06:37:07.3632 (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: hnJZ5jtQEjhbe9luE418UyhzCXzkKvoh1Q6LdsthepeNmOUFzGjyiZnpw5SHQo5qSsiczH+bWLQSuhFd7SOSiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7979 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan The i.MX8MQ DDR starts at address 0x40000000, so correct it for the DDR code alias. Fixes: 4ab8f9607aad ("remoteproc: imx_rproc: support i.MX8MQ/M") Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 9fc978e0393c..6bc2f988fd4c 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -206,7 +206,7 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { /* QSPI Code - alias */ { 0x08000000, 0x08000000, 0x08000000, 0 }, /* DDR (Code) - alias */ - { 0x10000000, 0x80000000, 0x0FFE0000, 0 }, + { 0x10000000, 0x40000000, 0x0FFE0000, 0 }, /* TCML */ { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM}, /* TCMU */ From patchwork Thu Feb 9 06:38:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13134052 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51459C05027 for ; Thu, 9 Feb 2023 06:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbjBIGhW (ORCPT ); Thu, 9 Feb 2023 01:37:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjBIGhQ (ORCPT ); Thu, 9 Feb 2023 01:37:16 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2046.outbound.protection.outlook.com [40.107.241.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF6373F2B1; Wed, 8 Feb 2023 22:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NW4E8unEKvTT1y9UU2xaHuwlu8iIy+8axkGPdkRNS/ACj1jSg5fssTXnWJUFF8LwN3DyCPkonP1QdGefhUK8wZ3qZ+Bd4JnvnE8tZFyICUyqtLHZ0aHUcY3G8Eur2EQ9O6XJNmJ5Dx8WA6juDRdHegJlKlFpu1GP1nqFrTXW5le5uBX+y42FrRymzz4+yjUeo2rISHXTMCzpiuea852D9n2XBdb2UkhalfcnkCdF9GtnTE8Rb5o3cfujmy+BpMuMnVQ5s7uBT8U+qB5PJgee0rzHLGH22TXmljdZsOc1dDEJ1w73BW0HPyL0M8s8dXmhXbqnJvPFanHHo3jhs2AbMA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5JkRLjElN/hvoRUa9Qe1a4NLYuIcWhbRbz0xVhmDAl0=; b=f91mcl9XzWmbgTpVR7D+SWW246eFl5UIyeTthUvQ4hT1Tf1rBlCHZC9wiMuZ4NLxxx+jJXmVpOK65Owb5fEdoop2FmvjiNY/ExHmby1ixqX4oRjz54vmnrfGi7pvG42f0WiHeeDEvBRzutnlDHi4BOGHPP5Sceplep6ejgHrD2Rz7sh1K8//MuLPt3U86q/vmgbfXgcL7eg9KtUSWx0rLGBGmCfaaEdbyhUCCRh4n9Sno6cNLUW8GUTNEx+wXiIzpQsY2R3FfIG1bwFtXxNWgPvIIIREdaD/38mVsBdXCKCyv8pOWlzC38Vki3tkG7lxC95Yl7UBHjuCaIIrjQQiyw== 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=5JkRLjElN/hvoRUa9Qe1a4NLYuIcWhbRbz0xVhmDAl0=; b=kBnQ/UvNbdbPExUifCaj86YsBKtSkINOdLV0CqCWALOL/cc/6ja9bTTti+TMH7iZoHVkCOAjDQ5LLlhUc70WkTIJaTsH9Cw+dcizZUaeGKMfZ0qdUIrR7P9/DxdQ7xwtVNdc7n+xBEMko8gBcTVMn0YPLuzHQR6DTwm4DOQUzNU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7979.eurprd04.prod.outlook.com (2603:10a6:10:1ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 06:37:11 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3%9]) with mapi id 15.20.6043.025; Thu, 9 Feb 2023 06:37:11 +0000 From: "Peng Fan (OSS)" To: andersson@kernel.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, arnaud.pouliquen@foss.st.com, daniel.baluta@nxp.com, iuliana.prodan@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 2/6] remoteproc: elf_loader: introduce rproc_elf_find_shdr Date: Thu, 9 Feb 2023 14:38:12 +0800 Message-Id: <20230209063816.2782206-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230209063816.2782206-1-peng.fan@oss.nxp.com> References: <20230209063816.2782206-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ec5408a-6498-48da-0f38-08db0a6812f2 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ac4nLLNBPvqIB3tkY8oUDLNY0dNtR/05F9bVDYhVLqp4nv/Ud90A6+Q8ckQ78PeiD20F/seJhABFTCRDjWPCPPHhV1aUmZdSv2c4mqjRrgFnXp1d20TNtWBQo3Ot1gmI/KCq/5Zcz6q4qvJbksu7XN9QjtN8B+SabkrLbU5nDrwFBJ5tu6bbk7ESZWMvIdbvZN7zZ7gawUm+t+iltNTpc76JmbM/A8nJgrNwtBo7DLHh9DpcYLwRtDjNbslAriOTOByafFnDLvZVLWhiY0L9kbVynQzWNTMl14jZstcUcFbwyreLh0yyiWcmn4ou6nXFK8d40DdQB0VxHCXexs2twiYv/okvBaF9CJYVg+/kBszO8Nl598Qe4sqM+haaLaGZCSC0M8RsQ6MpFzn37wVUaJgNFB6pEeiXHqkmQqQH5Oij2wpFxheBalddHK5CeCBVuFMt461Lfe7JAD3LvB1psmiivomvx0brVdxIjefGwMQv/RG6nSA3e/UPL9c3qDnWefp8USiRERjP+yb57OASFgba+fY/MXWKy4h4f5HtyjZFim9qHk5SDaontHCDmRRVnmDNRbX55eqKbNqGYB6dTmzSDLRy/gpf8V8g3dcHqO2GpbgTFNHc7pDUi40uUgRpsgFouzRqDAFfLcoTSVcidz2ALySkYQxOVADOelmisr2cAMNUusdwG4DVMqp+lGv79F8PIfpqJICQm7zvOUsrTQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199018)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(38100700002)(38350700002)(2616005)(316002)(186003)(26005)(2906002)(8936002)(6506007)(6512007)(1076003)(86362001)(478600001)(6486002)(5660300002)(52116002)(83380400001)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0TybkDiGFBjJJ7ho3nTJCSnZOMsbWS/78aNkXjVL3WBuUgIxi043GLNKK9EsDw0Kh2Y6Ez5u8IjDRFZHFVHxQtRd8cyGenYJlaRQwawnuvmM/pAy6QLH1MaUEP6JEVLdugk2UbdaGU4fbb4lXwMNYs59NnIjsVnZRGOu7qgW9Fxe3TsTcoKVfUzCCR9I1ytYQ9KgoeSWPlMhCyC25ADgkqVHXiqxvOYAJlvqrMGj9utznfLKOnMXgOpTma8W9amvbYAGIITUthoTdfYDhRRh50iLl6zwo8kvw7XKgWxVd2nuuqHvf5nIA3jEqmyWZbcB5Q9e/57CgLgCIE+u6CuHjZd2rqFP+QZT1jlGzi4FvxL07VLCX4uuHPVbO2p6Dq7MTP1l26huV+I9TerfmBSwxSwjcvlHi7PXfxNCvbC6crConwWuSRtdCOCXY06f/g2HjAY+N7h6RVi4aAcfcdRkfHaC3K8wJ84aWpVw4v+StBun8Ynr/SriMPY7Hkcso6gMX9CtjNdcgAjX0uq5rl58abuh2CFWeOp7zY3vjkPDWTLRJxp3HMZo22Qtst2QMvGke7sJEPTEiVTvAN0HTN2xx/94UUxTRSWWO+vnlWxEcZz4r6GCc5uw5VrzEC5Bgf7xQMDhHssx3CPmu2a+dHDlBd6u+KWQ0i9f9At/ZPX/bIN2DZaUoRpSnb2hibY/5oMaK6fvcbKYloUbaeMUeIpADJFobOZDlAlEaPaacQB9kNAd9E98AAQhzJefMk2OiN/DbPvdK0XBgOuYhGvyQYGrB2WxiiRRchqk6lc/fqP8ndicHwWjoQ5dxpno1xXzA/AtscG6/JZW93nweAH+bqM0XDK7sEoxBHkFIBMvqkr2Tt++WNmAad17NORrA1ST2yIVAnP9VB5TpIAubqB/4R3hLStZWOX+ZWXvcPb6i3NjTQh9FmETLkUY5Pr6aWNtGPjSVptFmbod5xleW2AroTCRwhSDxlyZmbAbYYAJssxt2XlYDP6omJivnK2Mt4g6yNT2jSSJEaXw8YfbW2+LSZ/4fwjTbXhyQMmB/iSnMB88Fyjmon7YbooOqnhoomzYPIJk3QWkvrUGpnHNr5Bzs9g7AXiHdqpA4nHD/HgRLPufYu6mUmty13jJC3I4PGbcJh/RJIWVP9m8PwPx8h9jNFGZt5Wj90kHnIniIof7xNpqsYgUvsss88L+BDSu8FR7Bg1opYlGBQcngT7oLxTv/MutDtakkXv1kR1toadj17KgfG+eM8+T32kIjFxpcQCbyY9VLphjG5qJ3/Pinx8oDZ7em5DA/d5RsrFGRzOxKtvxcKKxcmnuFGlRrBYM0zIlM7tVaxuAGei/eCiFwo7Bm1zpNbeOX82c3KBg9i+lZj81ONdwUkgP/gc7OFFsUchyHmxSnoExJH7HCNaA9k8FrCn45ulonb9gzR72GhQNCcxWPBC61UuZtvcI3DdwT3HZkTsiVBRZ9sxmz1oQh0yLY88DAO4IUm60beFBBxly+1OCiu3lUv4tTZbT4IVPqQvCFSqsMLPAQ1K6hAD3A8Gh3PdguiOoE8TKBS7REz3zVvTRGF9kb3l5+bz4XJ6qBgRD9k8g X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ec5408a-6498-48da-0f38-08db0a6812f2 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 06:37:11.5661 (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: DY2zeUbfNjwN6d2dcoksiFX64iTpdhY/zu1UYZZYkIOVsxZoaLGYuM5Ko8IfO5Y//sXcoG0+IKhCsy36xnMhFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7979 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Introduce API rproc_elf_find_shdr to get the shdr pointer. This API could be used to find the ".resource_table" section, and could also be used by i.MX driver to find the ".interrupts" section. Signed-off-by: Peng Fan --- drivers/remoteproc/remoteproc_elf_loader.c | 93 +++++++++++++--------- drivers/remoteproc/remoteproc_internal.h | 2 + 2 files changed, 56 insertions(+), 39 deletions(-) diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index 5a412d7b6e0b..c09fd5733aee 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -244,22 +244,19 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) } EXPORT_SYMBOL(rproc_elf_load_segments); -static const void * -find_table(struct device *dev, const struct firmware *fw) +const void * +rproc_elf_find_shdr(struct rproc *rproc, const struct firmware *fw, const char *sh_name) { const void *shdr, *name_table_shdr; int i; const char *name_table; - struct resource_table *table = NULL; const u8 *elf_data = (void *)fw->data; u8 class = fw_elf_get_class(fw); - size_t fw_size = fw->size; const void *ehdr = elf_data; u16 shnum = elf_hdr_get_e_shnum(class, ehdr); u32 elf_shdr_get_size = elf_size_of_shdr(class); u16 shstrndx = elf_hdr_get_e_shstrndx(class, ehdr); - /* look for the resource table and handle it */ /* First, get the section header according to the elf class */ shdr = elf_data + elf_hdr_get_e_shoff(class, ehdr); /* Compute name table section header entry in shdr array */ @@ -268,49 +265,68 @@ find_table(struct device *dev, const struct firmware *fw) name_table = elf_data + elf_shdr_get_sh_offset(class, name_table_shdr); for (i = 0; i < shnum; i++, shdr += elf_shdr_get_size) { - u64 size = elf_shdr_get_sh_size(class, shdr); - u64 offset = elf_shdr_get_sh_offset(class, shdr); u32 name = elf_shdr_get_sh_name(class, shdr); - if (strcmp(name_table + name, ".resource_table")) + if (strcmp(name_table + name, sh_name)) continue; - table = (struct resource_table *)(elf_data + offset); + return shdr; + } - /* make sure we have the entire table */ - if (offset + size > fw_size || offset + size < size) { - dev_err(dev, "resource table truncated\n"); - return NULL; - } + return NULL; +} +EXPORT_SYMBOL(rproc_elf_find_shdr); - /* make sure table has at least the header */ - if (sizeof(struct resource_table) > size) { - dev_err(dev, "header-less resource table\n"); - return NULL; - } +static const void * +find_table(struct rproc *rproc, const struct firmware *fw) +{ + const u8 *elf_data = (void *)fw->data; + u8 class = fw_elf_get_class(fw); + size_t fw_size = fw->size; + struct resource_table *table = NULL; + struct device *dev = &rproc->dev; + const void *shdr; + u64 size, offset; - /* we don't support any version beyond the first */ - if (table->ver != 1) { - dev_err(dev, "unsupported fw ver: %d\n", table->ver); - return NULL; - } + shdr = rproc_elf_find_shdr(rproc, fw, ".resource_table"); + if (!shdr) + return NULL; - /* make sure reserved bytes are zeroes */ - if (table->reserved[0] || table->reserved[1]) { - dev_err(dev, "non zero reserved bytes\n"); - return NULL; - } + size = elf_shdr_get_sh_size(class, shdr); + offset = elf_shdr_get_sh_offset(class, shdr); + table = (struct resource_table *)(elf_data + offset); - /* make sure the offsets array isn't truncated */ - if (struct_size(table, offset, table->num) > size) { - dev_err(dev, "resource table incomplete\n"); - return NULL; - } + /* make sure we have the entire table */ + if (offset + size > fw_size || offset + size < size) { + dev_err(dev, "resource table truncated\n"); + return NULL; + } - return shdr; + /* make sure table has at least the header */ + if (sizeof(struct resource_table) > size) { + dev_err(dev, "header-less resource table\n"); + return NULL; } - return NULL; + /* we don't support any version beyond the first */ + if (table->ver != 1) { + dev_err(dev, "unsupported fw ver: %d\n", table->ver); + return NULL; + } + + /* make sure reserved bytes are zeroes */ + if (table->reserved[0] || table->reserved[1]) { + dev_err(dev, "non zero reserved bytes\n"); + return NULL; + } + + /* make sure the offsets array isn't truncated */ + if (struct_size(table, offset, table->num) > size) { + dev_err(dev, "resource table incomplete\n"); + return NULL; + } + + return shdr; } /** @@ -326,14 +342,13 @@ find_table(struct device *dev, const struct firmware *fw) int rproc_elf_load_rsc_table(struct rproc *rproc, const struct firmware *fw) { const void *shdr; - struct device *dev = &rproc->dev; struct resource_table *table = NULL; const u8 *elf_data = fw->data; size_t tablesz; u8 class = fw_elf_get_class(fw); u64 sh_offset; - shdr = find_table(dev, fw); + shdr = find_table(rproc, fw); if (!shdr) return -EINVAL; @@ -377,7 +392,7 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, u8 class = fw_elf_get_class(fw); struct device *dev = &rproc->dev; - shdr = find_table(&rproc->dev, fw); + shdr = find_table(rproc, fw); if (!shdr) return NULL; diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index d4dbb8d1d80c..2a4f75a401d3 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -117,6 +117,8 @@ int rproc_trigger_recovery(struct rproc *rproc); int rproc_elf_sanity_check(struct rproc *rproc, const struct firmware *fw); u64 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw); +const void *rproc_elf_find_shdr(struct rproc *rproc, const struct firmware *fw, + const char *sh_name); int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw); int rproc_elf_load_rsc_table(struct rproc *rproc, const struct firmware *fw); struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, From patchwork Thu Feb 9 06:38:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13134053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2304C636D4 for ; Thu, 9 Feb 2023 06:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbjBIGhY (ORCPT ); Thu, 9 Feb 2023 01:37:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjBIGhV (ORCPT ); Thu, 9 Feb 2023 01:37:21 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2046.outbound.protection.outlook.com [40.107.241.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0336740BF3; Wed, 8 Feb 2023 22:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MOMCFvI9qUGGU4Y8UR+B2q6iukw2ZSQSWIqmGgmKQAE/WiaRuLeouZQG8Izk/1yzPgh+9GIvu6d0s8IhE/YzM78COj+KSbxbMrQ2oYr33uP571pPVm+l8OcvbGZw0qgVcfe3XU6byrwcCMpGI+RvsBAT8Jw5t1FzslOfefPaR7YkXX1Xf1HgTSTG3W2x5iMweRbBl0l5tiNZYQdX0WsTgAd+Lq5r3eIt5U7zwMSAmO57FBnZFZLaneG9UpCTDT/v2GLUAQJLNxAZwyPrXIpIjQ3UTWYsntBA+EqeOo+LA602PcbaonM+tABgV19QNVOCKB78LMxkWNvtqq1K0Vv3qg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8jMqA5XJa5/YY3j6FEZkYZbyHMuRyhgPXNAMk8eUlhI=; b=U5mfU4e4HrzIvVa6qf2zxaDqmijwt4AlmMRqdsa3GjhKHIGHxOmOcw4J+SnlXQ15fhq+adupC2GR7P6HpLB2JDYEEmaB020rX5y47aw8fP6mkRpXdPb/MOw0XokkDRiQJ/5PmzcFnidPIdz2T+qjrvg+EZpsD4g+4kNRQzHvATycH+ed+vMQi1vDUYixfxnaUOi4/9bKNzEpsPjG3HGcnPSjCZA2fDOYGR/kZHWXdf+Vbp15omNhnTle57dufz4W9avn5akhFsukIsnWqh4aFZ9Rup/cS5L2cXArPAtJeXdS5/ypEotiM1Qw70In/HAbstr0rJJ9iiFEy66ZhYk8Fg== 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=8jMqA5XJa5/YY3j6FEZkYZbyHMuRyhgPXNAMk8eUlhI=; b=ZeHciiqHKKsN3eOR35BD4AWwk30wzgQyxaq8wiruyG785QWBi5+jkHvuzN3NN+q/iiBzAotBt/46hLfieVYPCS4C5hvByLFjNqxjyuWaBoPNREyfioVJXd//kSxfgTVtNDGo6xdFWOTgPLoZAXpuxFbCxNRPaMX3eyHCEQjcEUo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7979.eurprd04.prod.outlook.com (2603:10a6:10:1ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 06:37:15 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3%9]) with mapi id 15.20.6043.025; Thu, 9 Feb 2023 06:37:15 +0000 From: "Peng Fan (OSS)" To: andersson@kernel.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, arnaud.pouliquen@foss.st.com, daniel.baluta@nxp.com, iuliana.prodan@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 3/6] remoteproc: imx_rproc: add devtype Date: Thu, 9 Feb 2023 14:38:13 +0800 Message-Id: <20230209063816.2782206-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230209063816.2782206-1-peng.fan@oss.nxp.com> References: <20230209063816.2782206-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f9b1509-9a05-4bfa-05ff-08db0a681571 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AUhghTfdTNRz73TiK5AMCSmdlLIb0oAJ/6WU4zICLauQRhdu1GXIKWirJRrLvzo6MjQNKARkudFC1SAqq/M46ANZxgiV7S3fUGtbBPKMZ8L6mF1kZZ004cUpewUuGMr+Skw4vNUgnn7s/RTmtikLZ+bLjfouwIdQ460nyDr/WH0BB8i/pR3WehSwotOCqmO8a0wtRDSPA1K30v5tUjhwSrUR8Edq+A/gNSQGqg5RTPQSuDFNKRCQINW+x6kCrIAcXL23D+9kGaKZRXblIrtBj2wa7bix/2y9gD+fNiGOYSojo+KITpjwbhv3uShaPTN9mmXtfTe7CozIfQPtJQoM87v/jbl3JNKrsnaa1AfhXSw/J7zRW7Ju+bXa6IuC7jBEnfHqWidVNkEqjpHyUUdPjGr7AiGvjgE3mDKIr14Z3HlhSHY/iu6csuuI9VKaMq03AS8BF5oP3IiJhRXZ/jDT+hzD1sqvgx2UP3KI1/o+WUkNkZWUGg2UUejkh0yNIot+gQnQa+0+wNQc9YJXKf7dg13bNEx0pmpke8DrINQv4LT5uiGbZBaN7AZJccN8SpkKPpI72inJPhTQlfaGvTI9SF8LHXVqPVFVh9g8wPqhOEuLzlsZdn6sMt2Zoc9JHvvzyIJWlTaCRzFcyRiW+coePSg9/wwaMnZXU5KO9Da4VE9sA/w7PmtoDukstKZtp/I8NxNA0pM/o7A8OUW5HKvBdA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199018)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(38100700002)(38350700002)(2616005)(316002)(186003)(26005)(2906002)(8936002)(6506007)(6512007)(1076003)(86362001)(478600001)(6486002)(5660300002)(52116002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ri4l06YnxKv1/Dw6FXzMl+IO6lu8lGP/AyxRN48JWV+V+lAGnlC+PI3MdDjOhFnkti2Zkcytr4LFOwq6GK3nIJZg46T2h29WBxzHlW/iUcKqJmsM5eg+GYnslMaa0BNV1jTsYAC6TxDRJfzIvbkzv/M1OFgNuIOdqviC0D+yNWhydfXIPUaKpF85DbcSJYHbaYYKSkvjYla6QgiGpmXrQz4Y2v6fu4pu9vscAVdaFPZX6kJfGq1q35JQkq6WAUChJMtIoCxpPimaZ2bq5rC1AD4Xj5+oBt5BR2eIqfqLjmD+wLp1oReprPnvYqsVeA+lJf3PaTF7FD4veEimIdFNgyDAEe5gOROKK+lNTf2vfzNTQHlpD87qORonwk7oLHOXxVycE/hsAoHQs1dnzB3gqQ8SPimM8b0MaXXNYsWUKbFnoyZtmXnqXS46Ruaobl5O34FiLhf0LkJ4TidiIKFVp1RWoPgaHu39W4stwkzYQ+MghBakdH9873beuja5vf61z57E9E/LoITR+iSGpWcixJstV73fnMum10ExXtOryx5gObi1xbme8dOzJ7yPLsp642m64nlDJY/9Id12Yfn4LTW+aNhP7nV/wi+4fgmk3xenDuVrDYvy/QxVLSFdxIb3hwfdHIw4p1LR8mMAdpE/A/QP8EmJlF0/7QgWTARYFsxXVbTo8kp3Uy2iUWZ9YH3Egm1SebpoAE8mU42qmelC92zF0vWvd2QUBkY1d1M8BF7lwda1LaOSw8yerW0CcajZ4Vn1GR1TlH+9M4J6iQC4GiSok+UA5dQuT0zwEXyfdQrFPZQHbhq340HNdjXwE6OP4vCBQXg7sOPmQXicH3nxMleBa9JsEej9EhruXVH2Iv9xFY5Mvz+JAavzx0PLjqEfPwfb2QwLz4gf/YUtHpCs1rct+ifgV6lOacMD2qJdKvay3WOah9cBkGAoL5oZiUz7DbhHftyM158zgXKoyrAcJ8cxAnOl4Mzk603aVfXnJapOvyYcweSFdImcpfdBJAP0h+6miFKVA7ucWylBo+Zf8ovVAhijWadqeTrdV1euKoZ/uYcl9NM7JHG8nihlglui1DoHfxVJUQM4uUZ+k3CV48/99SokpMDpk8HdjAbEgvEHOEu0v8Mf1SpqYkgRwDNYJ/E+4WVmtpEpF2Us51raGGMTSADNsJWjjgN0OnvN+qe4YAkbenHFcQJra7FxwyJ4twXoLlQ9dOGCF2/hM9altc7yuhW9z0D9EfxkkQOHAwRkC0RJ/teqmPe8WgKSuElHBNH3EyMXkTqIVPD+qfhqbumsxTQfRrYCcpty8xz15klc2LmPmET9WB3cnIjtIDxGi91yOIBqI2/lMM7igOWfJNTGADFww7ml4CYluDVxvFQpmzqknPrixxMVOpH93nZUFvH2Cg4AzAZ5e9SoNugGF5GyUB9bnQDILrGA7oVDh6fp6zP59EQm92opXOiHOZMXY1AQ7eq5LdJ56J5DOno4W1YROiu07AR5ejw5mxIK+PT3bviJwepbl/RlzNaFjT30Crj23TGFU4AcXneXfHUXWVvWtiTrI8y26s9DT2ymKo5dfOPbStQ+KbXQ+Gkzi+BP X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f9b1509-9a05-4bfa-05ff-08db0a681571 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 06:37:15.8005 (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: PPN+ZacM+HFzh0yuW1E8frzTIF3Zx0OH2unh/oh2XgpGoyM14V6Q6eLG7wbANi0s0pWjS1lzwARsvvjyjcGuDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7979 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Add i.MX8M and i.MX93 devtype which will be used when parsing the firmware. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 3 +++ drivers/remoteproc/imx_rproc.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 6bc2f988fd4c..13199e593b47 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -289,6 +289,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mn = { .att = imx_rproc_att_imx8mn, .att_size = ARRAY_SIZE(imx_rproc_att_imx8mn), .method = IMX_RPROC_SMC, + .devtype = IMX_RPROC_IMX8M, }; static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { @@ -299,6 +300,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mq = { .att = imx_rproc_att_imx8mq, .att_size = ARRAY_SIZE(imx_rproc_att_imx8mq), .method = IMX_RPROC_MMIO, + .devtype = IMX_RPROC_IMX8M, }; static const struct imx_rproc_dcfg imx_rproc_cfg_imx8qm = { @@ -349,6 +351,7 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx93 = { .att = imx_rproc_att_imx93, .att_size = ARRAY_SIZE(imx_rproc_att_imx93), .method = IMX_RPROC_SMC, + .devtype = IMX_RPROC_IMX93, }; static int imx_rproc_start(struct rproc *rproc) diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h index 1c7e2127c758..572732f6e2c6 100644 --- a/drivers/remoteproc/imx_rproc.h +++ b/drivers/remoteproc/imx_rproc.h @@ -26,6 +26,12 @@ enum imx_rproc_method { IMX_RPROC_SCU_API, }; +enum imx_rproc_devtype { + IMX_RPROC_ANY, + IMX_RPROC_IMX8M, + IMX_RPROC_IMX93, +}; + struct imx_rproc_dcfg { u32 src_reg; u32 src_mask; @@ -34,6 +40,7 @@ struct imx_rproc_dcfg { const struct imx_rproc_att *att; size_t att_size; enum imx_rproc_method method; + enum imx_rproc_devtype devtype; }; #endif /* _IMX_RPROC_H */ From patchwork Thu Feb 9 06:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13134054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2F9CC05027 for ; Thu, 9 Feb 2023 06:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbjBIGhf (ORCPT ); Thu, 9 Feb 2023 01:37:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjBIGhd (ORCPT ); Thu, 9 Feb 2023 01:37:33 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2046.outbound.protection.outlook.com [40.107.241.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E839E3EFDF; Wed, 8 Feb 2023 22:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMB8vtzRHtd/SrY+C50VX9Erm4NyY/yGoZ7zruJvrPXzz2CtoSY6ZcKRs8mt312BsP52oZm3vZ205lmbbn8CAHdADG8ZS1zF+WvvF8sEESxXIyVdPIbXZWtEuiMRkp8GmIxRnhy2pmm4WmXX3Bw4rpCcqIp5KxqatKYUEyFQfy0/AVBVTrxGGObk6iY/Hw93ds4GifowJbVan1g/enH5rDVEx6cC2A/CLW15i8AJTEZ2CqEcda+ZL+Qo7dlFbFQMbY+FuWP6OST6D37bojZtqhOj0fzmovnp68cjQSklj3ZutKVs3c+Rfx2kPjeRWzC0us6vk47Lqd1J0RTOGvyQVQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UHjHnylbi4Bm/ezwRvCS3z8MRLYZ+drBLaIaTBOTV2Y=; b=NZwbWhwWUFWpMN5EiYArDhi/bHbIro9QuUVZ+TOzNeACO995IqAxTHXv4fPtwoxl9lMhcHle8TNbJ+hC8wX9b6ji34j+hz76Gm3wuifLWQmxhMA5Fo1S6wYsfNLjLz8zS18qihIf+XEefvSpMgL20jq4BICRjwdRVc9SDFGghPjlFdxWVAl6yohTkw5TAvN4947RNwektB7jBgLBMRFAwfF6FjSL5Ij3g5kKfVRQqPokE3QAD3BuUodswhkZz2czMIV7eNZgbs4Y3Qd8Y3eDUWym7olwHmu9wKlTavRy2LML0ldYD3NxAAxcm8YUzdScRMqxSdKOkl9WdlsH050sDA== 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=UHjHnylbi4Bm/ezwRvCS3z8MRLYZ+drBLaIaTBOTV2Y=; b=i8Gj2LTSNRs6BLcIgoFbIijjI4EMn9tvtbO0SyNGFixLOobnj6lxfT2nk8m6OsdGHKDi2hGb8vrt6wrDBXMqbDCWqzpqKNVZejZXxZiSTclQCFrUExZYrKuLo4vCUSpGeU633PwBPLRsThUhwjNmlPjdpE9cKlxYZtrkmaTzo0E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7979.eurprd04.prod.outlook.com (2603:10a6:10:1ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 06:37:20 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3%9]) with mapi id 15.20.6043.025; Thu, 9 Feb 2023 06:37:20 +0000 From: "Peng Fan (OSS)" To: andersson@kernel.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, arnaud.pouliquen@foss.st.com, daniel.baluta@nxp.com, iuliana.prodan@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 4/6] remoteproc: imx_rproc: force pointer type Date: Thu, 9 Feb 2023 14:38:14 +0800 Message-Id: <20230209063816.2782206-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230209063816.2782206-1-peng.fan@oss.nxp.com> References: <20230209063816.2782206-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: 17f127d6-ba41-4b39-1f9f-08db0a6817fc X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zbqkmLwBnDZu4tR7sE1sgW4chqq+B1+3j3gcgPM2x8ebIbFYlnrWgV7jT9hpP6DlR7PfvdqXGJhlisn8RUhXqqv0gqN3n8dAo8m7y7ifTdqP6dmITIZFtoW3iH2wN6To2CEx3hzpy6YPygresLBCBP9zsdrI4aHmQhS4d+ewjhajJh0OwZeuhmmCygS9iV9A++pBBHILGCeiggdx/D8jNziolCIj5JIwYKGsJm7Srvs3N6tCEaUZEllaQgZI/g8dlN0I2Rf2HtqcHxT/P+V4E0+FwUE8vLmrjWTJXkfGLoxDM8PcUw12AFKOCQ2dkWR2rZTRO1P7gAq2jlxTPElYSHVu4jtHTvRDLZVOvj4vB9glW8glrTgpvXpKhBJyhaQzmOXy8r/ST6hdALbSCmoQl0ajryP9tUEKZfqMUhKzX+SaPUzdd5dYEcbg2P578cq8WALur/M5u+GgMfVnA7oXOnZjAkwctyM+Qca1hK31ThOxTWh13qVDS/3jRcQVAkWLUdC7se1Z6bwCzkgiHvmr/vplNACFXIDwDZ/YBiS7jK7kbVrkejqCTxsyaYJPxozlSRb/bk7ODQqbAjlOtZHSaCPG/dU1q9n6/3eQgtTWt+jSdjnjfwXQH8jFGDmK8jOUKDmBVQ3E9qpOTUOF6oWNsUmhNuJiLzIdDVg0upuctyZdwljcVJWD5yhCWDkiROhC4cSFAshlO1Nt6I2HZJAFaA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199018)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(38100700002)(38350700002)(2616005)(316002)(186003)(26005)(2906002)(8936002)(6506007)(6512007)(6666004)(1076003)(86362001)(478600001)(6486002)(5660300002)(52116002)(83380400001)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +KYhBLHR8Sn+fg6Ub0FsuNtO6ahbon3cmJ0I3+vc9kOoIU0sFjw+5R5HgLSpJN7gV9nxEw0N6DNhrDujoAmV8D3B2k0MEO69c6lz75MZswywscME98LIrER/A393Y/LUsqbY93ltf/bGuvaWiPi9ce47klMrPNT2jHeKYcpa4tMtqys3OQNwXDuGGaHly3fOz0/boBDiHcNoJL43jTmS3Pyhz1aXnW47SSgZzLAlBM6poFDyy2yBpYo8mI8Id+uNluo00BJFkFzLG0PAjvEcRVpQNCV6Cpo+HXd2JTYRIL/Krl95X22JoVuh25lBZwYMG5TdCtFDcCGHHO1Wopl5mRZsQHg1HHZek3jTGCmucJ7E6+/Wqc53ZzTZwtb/H+nJk/tsevYsWo9mMmpqPLkRxwCuvGGJQekQnoQ3hnXxz4p/muBFZ3Oh9irJ1c4pdSP4QWU0HtSzhu3INRKJ9DFPiqjSZ9J5RKF/vTRbwGdFPfi/atRkWc+qqFdVt+SFoVGyCzjs9feyQIqP/2sDR3hSI2bftafAzpg5dxEbV718fbetl39HCSSox5iLaj5zUm/pOrHugKpRSHZ634CGRUtW9kdfFmYtm5AB5kchPots0QOMYVn1S+swQLK7Wf5mpQ3pVrLdAOrA2EpLLdsii1oLb18//skKeuHF9JaCkVX2C39tscF+ahQ3DpA2hyazd1gJTZM5TQ2zkT2UXlZtwWQr4rzOWxqyxlRqtXfEahLdplcERY7tzbkBwqq+rzMx+jMjkL3R7ERQCi5PHoaSf+yTLSWDQ4PXnp0uAHTVNG41LijgRc6+5N4CVBUYnZhNP5MljrjyeY4fokVrZc64lShw1fbrctP6jSKU7zw8VN1D6Sh6HeClJWlZZpKrtoMcgOvtgTCKCGwXb9TmrXoVQWwvQbOUWrWht/EXACf/SVtVVFSYxcc8ECqZS/48vj6LQYaw+vO+ZbStqhIReKdGd9Ifm0o194G4vUpzSGtH8yV4mfQQHzp+OIUsqqBVQB+PFYRoeViYXFdCldilkZ0zjQCxAhaBKMcLhi4u4C+3/2EU4RoGGSt4kKov9OoiC6OQGOjb4feJmrU4uwaAgWKVZrLX7OcfgD8+zpWnKJ56rQReDDoScUNLqmhqM2QW73JHS6F1pZTQjQkXDK+BMRnU2r+JDUVxQvwVYa2Vd1vFOYdPSoe/bLfeG7XM8pA9I33O7M0S/XY62+0KANXGZsMSwrWio6kYdOJg3BWu2fmU8j/zdwni/STBWjupddmELwwT/bdueFTVu76T8pF8kHzBcmAsSlFC+aaqLCLcOxOYDHqzEDYBnafFMVY4GFI+Z5yzFx/pSD+ss9UcM1eybwusZ+3xNN5taQcXrvRi12jPNEjOz44ilXWJcK0Xn6Juo/adNS/ITMMVbyXmsSq4Iu+vU+zRgLdID4NT19zjXB0u9ZIxwriHdvmq3lgaxgwVS/3YcQ817+vrNaRkV9KTiQzb5it4RIRk990ErKXbDns+I6UG1UF855sV7/kXYRTejDmlPZKXPLy/ybg0LSJgz3OrzIXegeLYOSKfbnohN67j8JtepDPZo0A84UH5m+WJLh1BWnR1 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17f127d6-ba41-4b39-1f9f-08db0a6817fc X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 06:37:20.1301 (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: J6BkVhA2Ir7D4uPYRSJfQBIlTRB/ISEHXHRtewBHSAqQDAElt7ckhfGOwqD+Kktd0Coh49tTxpj68LDsA80RbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7979 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan Address below sparse check warning: imx_rproc.c:498:12: sparse: warning: incorrect type in assignment (different address spaces) imx_rproc.c:498:12: sparse: expected void *va imx_rproc.c:498:12: sparse: got void [noderef] __iomem * imx_rproc.c:515:20: sparse: warning: incorrect type in argument 1 (different address spaces) imx_rproc.c:515:20: sparse: expected void volatile [noderef] __iomem *io_addr imx_rproc.c:515:20: sparse: got void *va imx_rproc.c:631:17: sparse: warning: cast removes address space '__iomem' of expression Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 13199e593b47..295e0e0e869a 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -498,7 +498,7 @@ static int imx_rproc_mem_alloc(struct rproc *rproc, void *va; dev_dbg(dev, "map memory: %p+%zx\n", &mem->dma, mem->len); - va = ioremap_wc(mem->dma, mem->len); + va = (void __force *)ioremap_wc(mem->dma, mem->len); if (IS_ERR_OR_NULL(va)) { dev_err(dev, "Unable to map memory region: %p+%zx\n", &mem->dma, mem->len); @@ -515,7 +515,7 @@ static int imx_rproc_mem_release(struct rproc *rproc, struct rproc_mem_entry *mem) { dev_dbg(rproc->dev.parent, "unmap memory: %pa\n", &mem->dma); - iounmap(mem->va); + iounmap((void __iomem *)mem->va); return 0; } @@ -631,7 +631,7 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc return NULL; *table_sz = SZ_1K; - return (struct resource_table *)priv->rsc_table; + return (struct resource_table __force *)priv->rsc_table; } static const struct rproc_ops imx_rproc_ops = { From patchwork Thu Feb 9 06:38:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13134055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69153C05027 for ; Thu, 9 Feb 2023 06:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbjBIGhz (ORCPT ); Thu, 9 Feb 2023 01:37:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjBIGhv (ORCPT ); Thu, 9 Feb 2023 01:37:51 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2046.outbound.protection.outlook.com [40.107.241.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80EFA42BE3; Wed, 8 Feb 2023 22:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vw4sIgbluTq/LuTtBgrPGp/hVx3r98+V25GlndDr0VOfUwzzNt9un6z0do9bunGkVdwuzoB//utAe7g5GjLCDt1RILibgHgGuLiW3J+2qD34s0JztD5+uORbrnqd3dCa6SBOAttBd4q27qMCnX/pCt6PuHlYB3m9Croie5JTbddZNmmGBAFX3V+KNUxy227l3QeXMgKErdSLWmWVRGjEQqnXAqiAobKqM6ZrPGAkR+ZGH/aWFkGoSdBgmelD6iMWUCAOxwW4zmyjt4xWiPcpjiI4T9JiCW3lgmeHnUfN5ZpWgG65/AcVTlNrHeMtFsDdUhmMBsDVJEJcxG8mOz1m0g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r63xdWghm3dhcPlNst2k8Ze7iDZxE/v+2VmG/ks9xYk=; b=i25U7Sfw9InV6Cig7YmuRsNvndV2bUOveJAXeAWvall7tss4F1o/nhc5rRgUgPjtXVrWG/6rZlN0KfBnFuVV50rd5MtNLBDko1TLGJyh7kc2bNMTP5UFIuKAsqH9MtGrXJ2gRJv4j/OcNQujHUJkQv8ZRLVeKte1c3D28w3u6DzxHL774w3SbtfExBUcLGjdEx+E9uxzWjUIPGdVPPMaXRWQWUv3KQOLo9Xhy2fr22sD1Zrt7Phm0U5cxn/o55dpaKdIwbLWiZCnU03/TILAywpiCOFGze0hYf1Og79y4UryWG6YTk8KK+TUS13dHXVPCCbaE8mNcwpsW/AAaqgfsQ== 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=r63xdWghm3dhcPlNst2k8Ze7iDZxE/v+2VmG/ks9xYk=; b=eDVxj5q5TIcArZNmkUi75/nYKsOpW7sMZtR9hLxnFMTknpYI0SDkxO5gAEMExTDkrYsXr0eJDqF3iBKhxLd/DuJmjoo4bhhQ9GYXaFGKblq5ZTGkwce7oZSET2UbxUYj0X+/bDIYKdTAqizCz+YGeag7JqIHxOpx3l45lrWPNxc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7979.eurprd04.prod.outlook.com (2603:10a6:10:1ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 06:37:24 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3%9]) with mapi id 15.20.6043.025; Thu, 9 Feb 2023 06:37:24 +0000 From: "Peng Fan (OSS)" To: andersson@kernel.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, arnaud.pouliquen@foss.st.com, daniel.baluta@nxp.com, iuliana.prodan@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 5/6] remoteproc: imx_rproc: set Cortex-M stack/pc to TCML Date: Thu, 9 Feb 2023 14:38:15 +0800 Message-Id: <20230209063816.2782206-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230209063816.2782206-1-peng.fan@oss.nxp.com> References: <20230209063816.2782206-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: 45037bc0-ccda-4143-b038-08db0a681a94 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A8b6CvbmK825UN2VcwanvkFG3aw68NZQyBEkTMxK1v4x3WkrN58r06lMndJoSt84DQiuQsRfb3cWluJttjZOjMu2m40ZualebA0CPedrgv1Cg0o8CRJ+84mG3tBxKCztgSExyL0+zhMGKBC1/4BmrZIa4qRQ58uImqqpKyyyRO05938NnsYsfRwcK5yw06RejFgWrk5NJ4AVkhYdE+ZkHfuLkORMU1+JIYXQgUcMiugWXSMWrTbDB7Kr6+C2VmGzuNHNkigIuxLPMpkUflfUsf5ajOlkFFE88jr4LDdeIs8DTAWjFBkmotR7tAugwLS5AWzv9KfvQC5sRtgZZlSHJuAHtQueAri/5rVR/uSYe+0T3lwaccDQqsM0zPaY5U6+Q0SkN97dNmwAr/7bQYnzCDp6Ds8NcwFcwJKA109shXryalcl+9vQCGfe3AESoM5oszWvbxSoowYqd/8lZtppSxT7//ygOogosNN8LJCVv/gHT5MYjpkLGJN8Xm1Ldf0bK/8Ul6ZCocuO7C6GveSSvJTIITMjuj+508SKK1nCEAaP/09yYTnji+yv2weR7hHjy+NQ31UOKoFMTzSd9Qr4c256YaBucK/mBteuXd/VWlzu1KXVwvcS2zlLw/BClHAJi36QkpmWvpui2UcdhlslmNTfubb+mGCKxv+Jldk7e2FRliD8RVhJJQNv6nHx3ndu4PAME/ISC0vbIwkijPodhg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199018)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(38100700002)(38350700002)(2616005)(316002)(186003)(26005)(2906002)(8936002)(6506007)(6512007)(6666004)(1076003)(86362001)(478600001)(6486002)(5660300002)(52116002)(83380400001)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6wlb+LYtkXFZ/fXa/S5mGfDBruF9UI2Zc3yRzBmoVMvKDlivnpKQ1J6zlCJ5Wnwv8aSpUngG6c8ZItQs1au7pb1wEI0LU5gfTp9Cw2fSNmgi/OZxSqqRGe3vKxOydsiJBlVcGX5lnutX0uE712BWuCYAewsmNgyueBgtjProG5OqbDMD3mnEVRxBOMFhAVbIaR4VBiNMYt0zUf/QVXQe/sMaim4fX3ly9jc9zLO1+87qTAERfFyC1Chq+OPEdQly4ypC0ZXnqNs8QOz7bWm2c5VSVM3iL5+MTtyNYj6qhHt14NSrNmCKAxusRfBCMe7QjvVIRpdOqa8jkSha/WxkVkc8usjpvSsY8bEd9bFasi+hMwKzBELQAuSTchlg7ubNHoe4Up4eE8ZuyKKuPs1+lqS9De0ywLQaMiAilRwYVWUj5bzUDyZHT4k/ShdWfrop0GghQq1IDXd81/AxUUUISxa8HFmUg/jGRAfInIptCnjzgf5kRje1O5tkB6qg6inB9KndC1KmAX44pcOJ5RWkeCRhvLleI7caSj7YDoX23wHkBospNkCZmmbKZV1ehQbXSQxTAEgOI2J6SqyoqnvRkTfaDWcDpnkWCNOK9CBZoPF65Pbue5lw37j4QQjFs7GYjRrga9QTamc2Laxv/uHbB2CZxeZGhWpKBwDkmWAFccx61bjS5K72MbDgvS1icZRgdhlHD3rcavNGfykqAGLCeccFKqLp519f4809M9l1qQDHuZRic3KEw3rI0iGI+N6MflBhvYyjsGYzl+aqHXpBvYvxPWCh14ou2nFPoP7pPBj+pIL+KrKlULkIi9oo+SWO7duMlA72BykJH3ih5SS7ipFYtj8W25Fggbjd1HT+tRua8XZgxId6YZzyNf5dDt9bFOkmYBfTooJU0ndvSfrio9xpH4NOEJaqiWNt4Vqq5N9Sq0ErFOyLOWIw1qCDqWwN/4ZbMGCPZfeakJQKEX/Hem2qoOcPYzy5wwsCjBCAG3ox2h8zieT9btCvRvtCBI3r+tOLtMzYkb4uwjn/4QeIfawlVEQItD/CXLONFCL80sAo6aAuP1EC+UWywatJlpfpl+ok+IGYDjqGF/cvHpYGXuHcHrXDvKN2EkJX3EMllulUWNBdLlypDn4rLj3D1QJc7ddMcokalwj0Kt2aTGNTSsdxe6fZlLvoyC8T59ryzlN1dHbe3GkTV1yaLAKGdZgh23t0OXSKK9APu7sC0krJ4QJF1aLtAmsc8659Tqvlo6x9Z5mqSNovLZGKBJSK+JlTpNiiXOcraWjILUWMjSp2SlsF1YY8SLB3eGHgYxnY+9K9URQ8SPXpKurHKb5F167Lx0SYGAQZnvJsLCJvvaiz5rqIHHmCUQiiQq7+tCX76HRW7GwImV5/g+zZ0hNpcuXOPgmbh007Rk+twr1cRlyhZmPNiNC+4JB8if+Ufl9DSAUEOVV5VzOy1Bw+aYwwcKHDMc02xE2ifcjv2Pj1CFOKbRBnJe/dRYKA/VDBK3D6pxhQxTovrYUbdQyZVoLs7RbkW6IuRDvi6GN1/B+8M3S/Og4k5J0JqNheOQHQAchF+3AWYHHCz3v28+3rUCqgbhNr X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45037bc0-ccda-4143-b038-08db0a681a94 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 06:37:24.4228 (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: 4qi3/AohGPPW+v4zAjywETBAUSrSPrQSg19b0pva6u8ZnjKm4XQecyqsx3GWcgzBzk4ec4MRrE4W7/O7HKIcgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7979 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan The i.MX8M Cortex-M core not has ROM. It has a requirement is the stack, pc value should be set in address 0 and 4 from the view of itself. From Cortex-A core view, the region is at TCML start address. The stack and pc value are the first two words stored in section ".interrupts" of the firmware, and the section is the first section in the firmware. When the firmware is built to run in TCML, there is no issue, because when copying elf segments, the first two words are copied to TCML also. However when the firmware is built ro run in DDR, the first two words are not copied to TCML start address. This patch is to find the ".interrupts" section, read out the first two words and write to TCML start address at offset 0 and 4. If there is no ".interrupts" section, it just return bootaddr. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 36 +++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 295e0e0e869a..2265eddef4e9 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,7 @@ #include #include "imx_rproc.h" +#include "remoteproc_elf_helpers.h" #include "remoteproc_internal.h" #define IMX7D_SRC_SCR 0x0C @@ -634,6 +636,38 @@ static struct resource_table *imx_rproc_get_loaded_rsc_table(struct rproc *rproc return (struct resource_table __force *)priv->rsc_table; } +static u64 imx_rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw) +{ + struct imx_rproc *priv = rproc->priv; + const u8 *elf_data = (void *)fw->data; + u8 class = fw_elf_get_class(fw); + u64 bootaddr = rproc_elf_get_boot_addr(rproc, fw); + const void *shdr; + void __iomem *va; + u64 offset; + + if (priv->dcfg->devtype == IMX_RPROC_IMX8M) { + /* + * i.MX8M Cortex-M requires [stack, pc] be put in address + * [0, 4], so the da address is 0, size is 8 bytes. + */ + va = (__force void __iomem *)rproc_da_to_va(rproc, 0, 8, NULL); + shdr = rproc_elf_find_shdr(rproc, fw, ".interrupts"); + if (!shdr || !va) + return bootaddr; + offset = elf_shdr_get_sh_offset(class, shdr); + + /* + * Write stack, pc to TCML start address. The TCML region + * is marked with ATT_IOMEM, so use writel. + */ + writel(*(u32 *)(elf_data + offset), va); + writel(*(u32 *)(elf_data + offset + 4), va + 4); + } + + return bootaddr; +} + static const struct rproc_ops imx_rproc_ops = { .prepare = imx_rproc_prepare, .attach = imx_rproc_attach, @@ -647,7 +681,7 @@ static const struct rproc_ops imx_rproc_ops = { .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table, .get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table, .sanity_check = rproc_elf_sanity_check, - .get_boot_addr = rproc_elf_get_boot_addr, + .get_boot_addr = imx_rproc_get_boot_addr, }; static int imx_rproc_addr_init(struct imx_rproc *priv, From patchwork Thu Feb 9 06:38:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13134056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73F88C61DA4 for ; Thu, 9 Feb 2023 06:38:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbjBIGi1 (ORCPT ); Thu, 9 Feb 2023 01:38:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbjBIGi1 (ORCPT ); Thu, 9 Feb 2023 01:38:27 -0500 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2046.outbound.protection.outlook.com [40.107.241.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FEC340BEF; Wed, 8 Feb 2023 22:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXWlbV1BNyo1qpP8eZvzpkfWTGWdO/+AX0vgM++3qaqZRT/AVxjXcIrFsppOcb+jtrzERfg2h3v47rHgp5sCI+SObohBHshCsY72dR1QCv8h9qk+wRsgmwXkW2qvCQvRpxYi2adeqbMyKup8SQ1Xg7nbHjTiSO1QYhIqTrw7qyN5/STWOeJGEZ7zR88ah2hqCjPKoyJc5cPeNs29HoAIXRPRS8UNDqq2x5LzDmGnyVy6ARDj8g/T3+lV7ECh0LCGX1d5f3BqnRyseBAZr9r7/gxtLUftWN1FCTCnVBIag1ibhxu21Y3oiXxkIqGVOPYTYqfpECUqKNlTgHYBqgx/Sg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tuwlH9ek5tMgVYl1OfWKuv6ppu+tqv22m/mAcECL2Xk=; b=XZy7VFlTQ1elb2o/nPk1EAYhyHVqTR+fufQEKZ9um7xz8kE3/QGyjviNQLUWGeT3Z7d7f3O9H804rF5aThco/xLNbemZ7fbboFuJr7fqkSNTbWkm13qDnZD5g7n/GKT+NMM4lnckiy/C3iaHeQW9mFysHiQb9kHEFGhqCa5A1MsmuK0NUSHUpDjFYrM06yvNOZAzYx5QfggeY1Y5F1LphXHGjBzOBkFyjZ0pzSfTuIiwOrasHl5OmGCnyVw9+GdZbmPDuTFNWuCcuRA/l6cIod0sQAxLuIqdHCiOZ1arYwI3NFe6MFIK0VfMvVb/a5HWtXSEdNGMnLgBrrOdra/qyw== 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=tuwlH9ek5tMgVYl1OfWKuv6ppu+tqv22m/mAcECL2Xk=; b=L+PCeqp+5/ghiVn1jQiw1tEX+i2iF41CpyozupqNWmMN3YHN8CshP156Xe2qFwI/tOzGw5MWzM222hDRW2K5BMGO/m6S17r/0PPfoMFZVPijrtbO5HbpVqkH75ivPNPDlPS9bEj1IOblVJOMvTwjzhF7eXoEjaU8BpYQs1TgVuw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBBPR04MB7979.eurprd04.prod.outlook.com (2603:10a6:10:1ec::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 06:37:28 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::e203:47be:36e4:c0c3%9]) with mapi id 15.20.6043.025; Thu, 9 Feb 2023 06:37:28 +0000 From: "Peng Fan (OSS)" To: andersson@kernel.org, mathieu.poirier@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, arnaud.pouliquen@foss.st.com, daniel.baluta@nxp.com, iuliana.prodan@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V3 6/6] remoteproc: imx_rproc: set address of .interrupts section as bootaddr Date: Thu, 9 Feb 2023 14:38:16 +0800 Message-Id: <20230209063816.2782206-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230209063816.2782206-1-peng.fan@oss.nxp.com> References: <20230209063816.2782206-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|DBBPR04MB7979:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c9280fa-824b-4dad-be74-08db0a681d1f X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qdWBIEWcqRzddwX1ww5dma46KBH8EsKLWns98dFkQPXTobKj+hIzcUVPbuh19MVJMqC3y09gBssouOpSccrfd7Rtu1Os31orHMvfB2nqZMGobhurVnFu79J8zzVa8eGKmM9t0vveKf23B2bWPMiqLkmClxwdpcTrR5IVbHLuVkH2Jq8QaJaf7bxLvCLYoUKlo4Vd5aCXabEWDTifi4ZCvWNS+zOeeWGWMebzO1u8y2htGi+jw8CmdabL+tdURp44MMHR44d6cHAO1BGLwyc86bSQwtMHYlCkC8CovDUzTmjzuFEWKYZZGMbGv8Hw0G/7uILLhj2E97RhPEvB7iCscCGu6wkvT470WAcjMTfzPSJb+aKqr51oUInfE0Lbr3u6C4+OQi8yC2SM1mIdWhUE8n0KQjTg+PSn83S3O9p9P75cpCRFoVeeSC0C6tGcSZwIF1Kdr7nFSNk6FVOvtbeVHLVlBmNPknK9AtGUaUFx8PzkZ1r6T2xFfQTpzt/zWREZaaZ2L2V4IMxENuIzCQEH60XW7ls3bdD98MsGjFz3uMQxcOkc6aOzBmuFaDZcaz0MR9GQKhXX3MCFUimzZSwKtINnVg/t2zuakUfkAPhWQQWaLW+GIXVP8T14KjM+koAOW4qhrbGMvoVYlsaDpLgMLiVQH8Irzt+yyFGv5BmsKsiK3cNiHzlEK3FGbbx3u45N7ThjMnFHlvb0mhM9BdpL4TSIXavQ6qw9LwVKEXzofBo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199018)(4326008)(8676002)(66946007)(66556008)(66476007)(41300700001)(38100700002)(38350700002)(2616005)(316002)(186003)(26005)(2906002)(8936002)(6506007)(6512007)(6666004)(1076003)(86362001)(478600001)(6486002)(5660300002)(52116002)(83380400001)(7416002)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rdByv/2T1MDFHZMMVsIob4v1h2u9ZNLovDiSFF5CpffEr53RrVxHuqXcekopMY9r5L2e3NDIX3kh2ZEX5r2CeGLJJ+8YlPUSH+3/8rqSEiijxNjGbHJlvtt4k33gsjMhB4cLJGjamZmfOrJ2+viGMAMrBpuZvzvsitY/kHBsANAD/TXeg7A4nuW6QpeaN7atZT/mBd0XTNp0ZD0FVAWPwFDuonNojmsBmykTHjOr1VcWshiTh7NCbPneeLlQGxyj7BBCyWa4omCwwc8iI8EONr4qLmnjsnNqSX+5PIiOD18KKhZQcXYMknsIQ2dKlXMKSqIf/opFQkAotxvlPL6d3TBi7W6mzCi6u/vtJ21iOkx1diiTcQxfSkse0n7TRWn+p58J6Gsdg0vNKjUSivMg85n05aklsXtejK5e0AtISY/oFzS81VCIsKKxCOFiCsZ2mIWrOofjVBr+ZfGEHU9fPDTlyuGfDvnGfXqWMT7LXzBUmcRtL2cxBgiLyg23eO6v69LzlGNt2GydpuFHRp6hjQ20EuSzKWMCv6GmP535amcc/R4unEOMnYcPRT2Vi/riJxix+BPDs9agkdGIG/4WPoz90TYG3GtieMwfpmDjCzOGDKWv/vj7aJBB4Q6BeYnoK03R1NOS336urMD4xMimApjDKVzNafqEEks8XSP4nd9FjRICVJYgXF+3eyipJZsDILYQd2eatCf8d9JZ/VEODf3vgDLIlNsQcjSboguCArtQ1UqY7xe+9dHsJ4yy8gmd6NKbgWRZOuxc0B7Q7SPTcF5zbrlxpoc/HIYd4tqFjyPXu1Qw/l2/IYuIZ8Hf4E/10GbXNN+Fx2mQGoWE6fh7sB6tXT+QamZnvH92/IOzYTzQ0Y3A469IU9APLH9CgKTnfLmL8gagwrlF1KLWYpBGv/bwDgkVMJR5ph2nqmVB18IQlsCqja0SRPxwXY6Qb9SELklvkC02BTs+/QXEopKlJ5MuWHePEfNmeuL5BWU4Nex0BKd8mDh2ev+Xo3vBegCWs9FJHJtv6SyAlCfwKkSfZuhu6lgpFPOKCURLFxP/6/Eww22VwZDsdZIsYfkRxbL9leyh9RdZCcEcLyjlP00t0qwLTrNs+W/c0LFbeHwT96VQGaNqvUSYjj3vcrNI4JZm7/MXMx6PyF9lgUaU8Es/p2/TYTs4TrCzOFnYxLFP/8OQa5g7bSo1e2FYVo76hWfiyUY2z4JvsEf3x7CHYqMKXhLkdVIjF3+8rQmddLhr/ODfHIJPBygPY5DIwLj2Kip/P3kDGB/cpuVMZs11Yc+SwmcKF8Weyz8An3sMK7AiqoFu14SnvQZHQ6Z373lMQNAhz/TmKYAaBqLZRXg4942/PKYRroRAfQizH7TJnobraqnGyk8/Rciv4a50FihfKtQidA/07VLcCRy+zoWasC4gmsU//S3spIN7i8RWhQwbcHXwpz4qgbgT0QvL7dsZjXP0OJd1ddeoASRA3cB1C0iMpRg1/BdfhBFBx1hA6t+SUmJwSfVXkV1XfvKnwcQYceOR4yBxfUKg4OWdSWls7dgvdB3BrH7xZLQFb02gTPdkfIigFLjXXN+0QUsSXtk5gx97 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c9280fa-824b-4dad-be74-08db0a681d1f X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 06:37:28.6740 (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: uefO2NGccf4XZXzcwwof2xpVpWCyj9YCiIsrpm+5dJmaTLsEXgDMpky1e9zPZPzFYKA+zpEb8Vc8PbSYyJ8vuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7979 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Peng Fan i.MX93 M33 has ROM, it needs the ".interrupts" section address to start M33 firmware, because the PC and Stack is stored in the first 8 bytes of section ".interrupts". In current design, the Arm Trusted Firmware(ATF) use TCML start address when the 2nd arg is 0 when SMC call. So When the M33 firmware is built with TCML address, it works well. However when M33 firmware is built to run in DDR, we need pass the ".interrupts" address as 2nd arg to ATF to start M33 firmwrae. If there is no ".interrupts", it just return bootaddr Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 2265eddef4e9..ec5b1d8ed8a0 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -374,7 +374,8 @@ static int imx_rproc_start(struct rproc *rproc) dcfg->src_start); break; case IMX_RPROC_SMC: - arm_smccc_smc(IMX_SIP_RPROC, IMX_SIP_RPROC_START, 0, 0, 0, 0, 0, 0, &res); + arm_smccc_smc(IMX_SIP_RPROC, IMX_SIP_RPROC_START, rproc->bootaddr, + 0, 0, 0, 0, 0, &res); ret = res.a0; break; case IMX_RPROC_SCU_API: @@ -663,6 +664,13 @@ static u64 imx_rproc_get_boot_addr(struct rproc *rproc, const struct firmware *f */ writel(*(u32 *)(elf_data + offset), va); writel(*(u32 *)(elf_data + offset + 4), va + 4); + } else if (priv->dcfg->devtype == IMX_RPROC_IMX93) { + /* i.MX93 Cortex-M33 has ROM, it only needs the section address */ + shdr = rproc_elf_find_shdr(rproc, fw, ".interrupts"); + if (!shdr) + return bootaddr; + + return elf_shdr_get_sh_addr(class, shdr); } return bootaddr;