From patchwork Fri Jan 27 09:22:41 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: 13118284 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 1D67EC38142 for ; Fri, 27 Jan 2023 09:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232943AbjA0JVs (ORCPT ); Fri, 27 Jan 2023 04:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232740AbjA0JVi (ORCPT ); Fri, 27 Jan 2023 04:21:38 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2070.outbound.protection.outlook.com [40.107.21.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CB2A5BB0; Fri, 27 Jan 2023 01:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ub0UPzuf7pLAaCWtB+8kBvG5GBf20GYH+ll7x/vGcfW2bbCozwT59QX0yfo9Gp8df8q+N8TMWSd44mOiyrmnoH2m9cQYGEUmkNhpkwACUjLscLucWD3k+KURWbPdWehVLKTmBAM1kKxzNWrI/Ur+zeCxWndNxcVt/36m8yFBGnlkenRD9Qc93I2/CSRAqbUe+ixtMYguF3e5HUPq/Sb18PNvRVMVGCQnLpo+i9psISkHN6cCQ8Mwpd4jPm6FGRmGgwcdv2uP/z/W2VOj8ocZLxDWRWA3r+DL9MPnn4CQvXCNi13MYZf6govxZpNeqew8woXsNArbRQ443PzQAtDHLg== 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=drQgMQidUBpz7gkOL6w7PR9rbZwrvQPmviT03jTPMTsbMY72MKeT0iLGhlTKUOUbSZ7kyfGOAUWM8+LZhzAQc7YP2vjksgK2zp2umko8cIn9bcJ/qf/MN0teLH5TZeUgDYsMy0shLXszXFzhCrCVUx8+NApj5jWD2ftoDvLeTauMgo0NUxLItEruuWF9p52Q8/Ku2aDxhtYjikJFnRx257L3vU/zwBH02Ozftb6UNfo7+/ash4ofnMIBTvHW4sn+VIS7J7A10XsGqTeLnALUTl6M0xl8HBNniyKJvYN7dNvPSDMQrPTAXcodoHRyDt47RKL4pN3hswcMIN+HeAc50w== 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=j8UrOmKXEgqJ32m2QoHDra7T4790ViOE+flJuEn2iFxnzEtULFiFIDH6NF5r82azpn6qM8JWr/qiR55nLj7s4BQlVp570orZTp/V872WMX03b8w6lECcp7wygpvmBA0nsqwnpNAi+dgCyACB4VRN0M8UeZLn1gMKEXVe3Xz4Bx0= 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 DBBPR04MB7530.eurprd04.prod.outlook.com (2603:10a6:10:1f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 09:21:33 +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.6002.033; Fri, 27 Jan 2023 09:21:33 +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 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 V2 1/6] remoteproc: elf_loader: introduce rproc_elf_find_shdr Date: Fri, 27 Jan 2023 17:22:41 +0800 Message-Id: <20230127092246.1470865-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230127092246.1470865-1-peng.fan@oss.nxp.com> References: <20230127092246.1470865-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) 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_|DBBPR04MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: e47d44ee-53a7-49c7-5fa4-08db0047e1bf 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: a3gAd6HJMZW6rqMuBO7pHsX7Yt9cfcTNaFi3/dNlJXxY5Ga5/Jue7nIY+J8e8IHgtF7AmWNGefxnSGUSq3jufnhyz6Z0/x8V9u5F3RwLohJOI+amXkc8J23W1ZI2Tgd0Yn0YABozAA451YTvgMdhmsYLuQvEiaKHmnRlLThE9LUQEx26lUMiIJFVT5P3Ok/dRp3LoLVa1iQk/ndIG1GNzD3p5Lexy71ZtM0WYc4RAALFw5AGcDzfkhRLIIBtg48CQv5nUkaUKwKEsuQyr/UAZSrhwuXdq+05xS8pJv5aOCOq1DTzNvK13W+Bxi3Hvdgksg9HsXBF2MrE4yzdXXimX+5Goo7ZxiUVZiTdi7d5+ynEA8Kp2n0zo/VK2KDssVw13wRBf3tpwxdj+G9ZzyqqLfGo5QdEhzKdeaHpnJWFpzVfVPIxeeAtzGNu56hjsqJZwtRHdEmdaWgCleqY+OLBSjqUKiobp6ifMhZwQiQ78mhxgbH9XO6KmF56sHCWWfN5x3/hy9HWuPqsuEUnoJzNQDQHUqQlDMJvlG8QY54F78d+f1xTAzibG9+tlj6cAvRYb4jBJ2A7fF3dxFdSljoz+qFK8tibhzriNUbgZknf4OvgVviRm2Scx6pnzmtJ3+ZTC/PI3/B806WMm5G0nq8GZYacEeuHXykka8ELbme+bqIF88fi9LNJI1wTKzZjVWIjwVAsTxyNeFs1l+S9kcue+Q== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(38100700002)(1076003)(2616005)(8936002)(38350700002)(2906002)(316002)(52116002)(41300700001)(6486002)(478600001)(86362001)(83380400001)(6512007)(186003)(26005)(6666004)(6506007)(7416002)(8676002)(66946007)(5660300002)(66476007)(4326008)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cx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lqBYR3vGiM4f773LjKj1fY326uP1aEZs5TOJPt4r8hmph8iaTziJrZ1kMDBISc6nAYBPhBjShk4owmHFDk7dn38DtZr5Pl60U/hgSNpto300AwGeAClA2ZTKY1Fi18yOe3eAJjP2Cy4Pr3Qnh2RYUyy1lBoI53vv4HrrL3Tiq+lZSlFOiOtaWLvfrIsA14PHjvNExkTBpLR1CCYueW8y/5oxnwcckZOGSzWihnwLk8Jr4kYMITCX795jMIIzvArH85VHwzAjj6czDbK5YkcVPKstIbzXtiUFvXJx17MMmfRktyXjTgj03N8MSOtWWRDQyowgvCHKWUPqcE55RVv2EMJnFCgFOK5oBs1kXu+JGbNsD7LEmiNz5vPEoXL7WdHGP3zNZ8pNONTxgXca6PG1pWP90bVWovfsRYs6hYckHQOwK4gd7ftYJKOegI99XTho/gHsnd0jKs/oOy7Qt8g7mSucuWSpl1EbbXT6tFTTk00VjTx9fz5dImkrFRRUkp22bvA8dwPlPd X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e47d44ee-53a7-49c7-5fa4-08db0047e1bf X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 09:21:33.5790 (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: e67/u8c47Mb88fAzSPFPLU6huKZYklw70Ecuu0PaCiHJK8ftwA3mMeRbXhwm2XCdyt7YpbkasWwcQFhbkDxL7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7530 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 Fri Jan 27 09:22:42 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: 13118285 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 69545C54EAA for ; Fri, 27 Jan 2023 09:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232735AbjA0JVt (ORCPT ); Fri, 27 Jan 2023 04:21:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232937AbjA0JVr (ORCPT ); Fri, 27 Jan 2023 04:21:47 -0500 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2061.outbound.protection.outlook.com [40.107.104.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65F5026867; Fri, 27 Jan 2023 01:21:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KkJWSWj0HqLSGcLl2MyavJgFgvsXXJk2rcZG8W7bkiJbjjcMV0WpNPJRKYMxOoVzmRGk5egI+3MOlztHMmmN7P5lzRGGDQDgY467AN4v1E+Cu2GH5PZZJi0GNK4f8nl8RpotKxnWOcFwKuuosPk2WvOf8MzDjmV9YQOQiBRPXaxGZRow0O3y12q9kI+P9s4D7rBKQcXYQU6dwXQxeN4tUE29GFew6CMTZLk+eTWGW2J+27W0OL6DFXunXqKEh2yKyuO/AXsmzpzg4yPXmCF3i/Yk1Cd1FPwoXQ4NVN9GO274n94g36k6c3D/QxHLodDtvUGrxMFiY9aB8wqVKtQ+5A== 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=8lc5MM1T8vUGaBjaF/rjasRhwDWKTZxJI6RGsmSNl7M=; b=Mh2aKQp7dPRCrRs+zX69lnmEWkWCFpLeJadc09kCeKGzP5I431AXd7ZET7cMbpO6fadSdr3AiZI0aJjb+wu9D6kselDCXWuF+BU0mG+qIkyc4MyUEJWSe6QhQ2bTln0+i2W92TxRlWwdygHkwxvmVVGZ3kFrAIMYaKgSpv6K8J6I4DVOgzJw0qEeGooCAKRrVU9DmPu8L7J4DJfqWiuNLFqupHjRZbDUql/OtyVUQj3YNVShbdCQR8ICTpis/Hs0ZTkGwTbnv9pllqYRbOTGJrWMIrEsYQm3zXiy1umpRg4f+7syzo/7EAgqoFa9ptTCCDylpItIrIMh+myWAy+rBA== 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=8lc5MM1T8vUGaBjaF/rjasRhwDWKTZxJI6RGsmSNl7M=; b=WMwDfj6IiyF0OByfrQTjlvTkICednDkr4XA6geWoi2kb8W307d1ULIKg7uiXLv7X39VFqsfopbWpI0dnxlcEPsoMFoDJkmXGLHsoqQp0M2LsA3al7NZ14ISPQ/BG6BoX6TAUmvhc2WB7huEGcQcVrxPA4xBqYU8Fy0kneaEEa30= 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 DBBPR04MB7530.eurprd04.prod.outlook.com (2603:10a6:10:1f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 09:21:37 +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.6002.033; Fri, 27 Jan 2023 09:21:37 +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 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 V2 2/6] remoteproc: imx_rproc: add devtype Date: Fri, 27 Jan 2023 17:22:42 +0800 Message-Id: <20230127092246.1470865-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230127092246.1470865-1-peng.fan@oss.nxp.com> References: <20230127092246.1470865-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) 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_|DBBPR04MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: e2733a51-f8d9-4935-318f-08db0047e40a 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: 5zvo5XpdHvx5ms0GUoH8F+DSp2iwHgZMx6zDsbQBJk9gEzL0mJppWb1qQ4xBMCv7NHyiU9hLKJH3ZHA2wjPb+lAmy4QKB34Wx1Aku3hfDc9YF8GIh9ApI9F3yvzxux39nXbVbOSZrvJKYFpBPas2n18+vEyvAfIKz5ke2/fwhxh5NlbPdI1c2fCyET2S3iIOmpiA7Zn4lcIHB4xmUvqn32plNnhupDr8oqqCSDQTFYxsFj87lC1KW6p6OLMcm5aiJYbfaMHBZXcL1QpCrRrt+PJ7lX19tGsQKw3yUKgP5E7TllmLOSjbjDyQih/3H6I5g8IByPyiqRPCy29vLOGwOU/gjb6Yat+oPEmvvLB5p/FLOGgWaOPKSXeuJGmo2I25XslKS6TnX7AMcYHjutbJLUXFt2om7HCDvbonok8IWWf6l4nGcfyBai/AqDcTA5UExT+5bzUhQtJTkVWxOhqWqgAbpePGXZDd022oD2qlLBe2CDktOfExrNtAyIdoZotu2i4aMnIadw8FWXVUw2WHKtC3eKc79ZIRL0UOFq+Me3LqNKrs5YohXF6EWvGnERltj/FX2zqLRy1+cQKQqOo89V13CSFCcPaZ01vHAuvihnQBcKdM3I40wge5T5CLun1QPni4QOq877KAJm3KwTUvIOXwQThKelGfzmv/D7ZQAvH4+scrH6ANqyp34fDk8GGMwJWANV2/2T15WcsnvyjOCA== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(38100700002)(1076003)(2616005)(8936002)(38350700002)(2906002)(316002)(52116002)(41300700001)(6486002)(478600001)(86362001)(6512007)(186003)(26005)(6666004)(6506007)(7416002)(8676002)(66946007)(5660300002)(66476007)(4326008)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yxhScg6A+bIcYwC2Tw6YrLkQ/MGQo3fVYRYdrNZSDzO+4D7Y8J6cpwS8o7Fu+R9ym3AFd5nqx3GkufiIQgAOogkAzB8We/bacwU+rr1dNikkQAu8GbwqgamIvKSWRpV9xG5UD7K9ogqq80maggPUkg9N2lgakJjfaSWvOW6XOAe/k3i+KISSRsABYj9Z6QCjtbPGcTy3/0PLknE0rdxp8ZN4ZLa9KkElSQjJLBjAeufC8W55lARu5vOVOV64v4hUhYKgT22lOXROYPMTSGame8chtFiNYy0dWve2M2QqCNXoNwBvKRRoFjXl1medKLDvanGUeCLslRM7gJtvh7jw2vxSJwTlsU2V5ev9AXVuvpyTcww7egYyPllQBBqVfDVjEnaqBU371X4Khr3QwBRX5vZQ33rR0xOQmL6W/6d9NCLtvtgOYoN6e1QL6Rb5I2pNQTwcNtJGjlavroaBcYYV8r6s/ZVSIp0kW2AnXGp4EBV21/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5da10EhbxMOx6b2nsmrB7Yf+S/KgIQj2 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2733a51-f8d9-4935-318f-08db0047e40a X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 09:21:37.5826 (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: lUhANCTVEwrf4Tm9GN01N/IQuDjyWhTZSfbVFhYgkN27W7Y6Ic0b/cW1R6uLXO+KqHDqMb/y2rUCHBvEZmaSdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7530 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 | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 9fc978e0393c..8a282fb67a4d 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..43b105ff0175 100644 --- a/drivers/remoteproc/imx_rproc.h +++ b/drivers/remoteproc/imx_rproc.h @@ -26,6 +26,11 @@ enum imx_rproc_method { IMX_RPROC_SCU_API, }; +enum imx_rproc_devtype { + IMX_RPROC_IMX8M, + IMX_RPROC_IMX93, +}; + struct imx_rproc_dcfg { u32 src_reg; u32 src_mask; @@ -34,6 +39,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 Fri Jan 27 09:22:43 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: 13118286 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 9DED3C54EAA for ; Fri, 27 Jan 2023 09:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232123AbjA0JV6 (ORCPT ); Fri, 27 Jan 2023 04:21:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231686AbjA0JVu (ORCPT ); Fri, 27 Jan 2023 04:21:50 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 005FA783E3; Fri, 27 Jan 2023 01:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ICtUV7QDI0N+AFjVkirGs/Ovdp5edeYe7i2SLXBMYATCIMRimhpNkCvYvtGG86qxWEWDQSZVfg5Z0kO8FhtOiXQwSCIkJFfvycH9IdNUCCtpXMsKkCvxqplq3gg3PGgXp17N3mPdM8aoZmYEj7/cJu+e5tZ+SYvYvbJu4M58tbgNOYdsshYu59SMye4DRqjYF69aTC2CoCKaKWuNE8DH+FpyhgBApXu+7dub28P6HT8pFURxZXLjMtrZQjvWdQTzF91JXn5zphMdwHbqqxtJa+xraR3rRm4Ti2h50hmMq3LQum2gt8ExtDCS09xFZ5d73w9GMTzmsm46NdSrvwqT4w== 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=YSPoFCp1WU1ODs5miVRwkzxQHfokDiDO6FyQQnFZ4VI=; b=aRYbkXJIdhWQ+Wzcdb4XmufV1Q3zd95zo7Sbqxcd24o3nSgfG/PTIaC41mIsqKLH2pePBK60ip7o7W1YIlzgImQW94lEOZlE5YpGljheq82P4/SxnA/zIECTMgSNbRKcJYzCCVhjwManln4vuwacj6CJSsSBb/c0DuGFy0w4to6uYH9VnzyZDt+7nHTKc2Kyvw2JQkB16aCRkSD3SnUxNCoAC8sIiMGMvmIJRqTFUvoBzC7P8myePJB55HpGPeUzvx2vIo+TsyZpxoe2STxp7t+pQ2CzDXcAG5ZumbM3XSTj9Ww+8Kwk17V34gVVzYTSWw0N2kWBMJny/O6RaSeq9A== 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=YSPoFCp1WU1ODs5miVRwkzxQHfokDiDO6FyQQnFZ4VI=; b=ej+GT+26g990fJAdEPqm2iQ9GmSPSQ1nKojOaEZL+7L2q14nNry0/it0SuqCR7rjyqW0FxzJFWkq2Tz11rZ6+WfqR2VYTNmQDnZ8TkjBPEat+mXuWu/7tJGxf5b9ozvLRCtkJd+j4oTBUOogL0Sx4onq8air2LPmAwGQQasiNGw= 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 DBBPR04MB7530.eurprd04.prod.outlook.com (2603:10a6:10:1f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 09:21:42 +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.6002.033; Fri, 27 Jan 2023 09:21:41 +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 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 V2 3/6] remoteproc: imx_rproc: correct i.MX8MQ DDR Code alias mapping Date: Fri, 27 Jan 2023 17:22:43 +0800 Message-Id: <20230127092246.1470865-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230127092246.1470865-1-peng.fan@oss.nxp.com> References: <20230127092246.1470865-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) 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_|DBBPR04MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ecc2f5d-c375-4740-af0d-08db0047e6a3 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: 2Z8KMrfvXgQChqE08Q5K1JO3ZzVibMxlItJAeBF8tiOtS8apZDiSv8OyuFYCE3rCZMjtqdl5HPLSKt6NzbxQl9xY4/LWO4PCaYXn/xyIQvnWAeP5EfN6Q+rLnx/Vf3WF6FnftdB8rBz8A7vY63I0pJnRm0kZdZVTEC5dInYKWrjyN0XGySmEMhHlSJGCSN14GMdRV1mx0FgOSvlB1ktmK/Rc4dn0KJF3Ytw5SN0l2PyeHeSVsxHQQFzAvIsU7yA65FcIIlkd2pom+BA249De/pXwZO/BExdSC6v6yMn2jiuSaaCEaUgY78siCU+fzHURL3p25IrSBaYFGf0Q6BJ+x/9frBsz5HbievAnpraxJz9vjQSIChCHIRUq1Frjg9sFKklnKvZFVaqJM+/DC52OiEneapADxYUVpaD2vg5vSJam71a/T7Za1LIJFspBifNz1Q7X2ICKh6JWOwMLIU7ToA/C35PD7OxwsOC+jibLradDx0EjErA0ocoQWpgoxsDr8H/ygT60QTSpXiRMm76Z8n/WD8EDdMd7P3w2r1fLt/O+qx4YQ7w6DE3okOhrta6uCCzK+pskDcBXRqJS9iQ45DoeYwMsttqSLVYVDz2QMajNavTLSfQgMq+5cz68NGfB4JO265t8AelesXaHPvdPlgib2xfIeF6SinhPoc4idGXbN5CzE5vysnWI9LtznSRCJupTv2X5tAO2iox6IFMWHQ== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(4744005)(38100700002)(1076003)(2616005)(8936002)(38350700002)(2906002)(316002)(52116002)(41300700001)(6486002)(478600001)(86362001)(83380400001)(6512007)(186003)(26005)(6506007)(7416002)(8676002)(66946007)(5660300002)(66476007)(4326008)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mp/zFgVmm8zWmGCkf61p5Uqfbxi+R2bDojnl+gqeInGw2kWy64gs4HF/SApBuW1mH/8Ey1eAZVUpXx1norxRVU8B6W0fW8iQotGmiUuMGh6Iz7DQQnaY5BTZSMWAFRqFPM9UycP40lrgZuOzhpdc6PRH12u9N3Hd/C1fOsxuCo1l0/QmFTsBQTgPJvD4cQeyKqjJqzVeaBBiwaetLx2vAYg5fJ3cWHAx9PEhyQ/RH3q1Ke5/8kwgwKGa2SwjkG3MVpwjTb0yJx/a8Er2P1aHbzjB8AGhvjPB4Z8t26WjRNWMJATyk9c/Oj4odFfBr8uNqgxEAUKm8QZmAnSWxBAOpO3pYXBOUlQineG2HedZkYGmxqzyNAATkcmCAKOsCeT3A6zPj8K6vGYlxgep/9qps+yM9QHW6SaUoB8QNH1k+j6UjCtCMNB75T0ZYoUw2gWcdgCo9SbznpdoAesL3iCnFCu49OIbXv1wlb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IlAavv36CwlixBhAPqHhIron9olrfwflM6NxW8hFGV/uzf X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ecc2f5d-c375-4740-af0d-08db0047e6a3 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 09:21:41.8815 (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: 6T4Sb2+2qX2G8S3xml+94cU20VCrbP9hM5I/62P9/PFop0uwqlNO6SfSDUaaEIoVbD05zzQKMLg4eh4h27pr2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7530 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. 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 8a282fb67a4d..13199e593b47 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 Fri Jan 27 09:22:44 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: 13118287 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 21AF9C54EAA for ; Fri, 27 Jan 2023 09:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231276AbjA0JWM (ORCPT ); Fri, 27 Jan 2023 04:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231551AbjA0JWL (ORCPT ); Fri, 27 Jan 2023 04:22:11 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F84379630; Fri, 27 Jan 2023 01:21:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DqcV8dRGexji/nliGXlvqTOBCUL0WNHHFHtPJbx2+0mCJlljDUo09GX5RjLdpLHjcvsqB5k79zEqjqMOZGLYhFYwAxwnXrp0P+KRHxu6CwbMGxlovVJzfemy/JY13UgpPzVZvrZzb8Eoqy5GJvTgaXtH3N/1gx8poYzpbjxUqKi1s7FXG/CD+FU6uUIz83OlN6BlvAAFTwWMK5oUkyRUTqAZt04UxCkqkHYBGgYdHTmHlUMA7oJo3D9otvrZlyTFi650Gf7dZ+EmqmiSsv9SgSuo68yY9u796S56QoaacpmSBddltFLjRhqajz+WQJJqoPSiwoTLp4aHLv/0l2dcUg== 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=QuYiENaUEjsk8LAqWRWJR8G0DkT4om5+5jXpU8EqjKQqpHE1JFMZiUVNLJzmO98tY3yVLhHQ8LrrhE8/MLpasbqdZsp7wqOD8GWdLAygAEBOfX1RiOjiYvvEGU7oY9i77GlJ09YHp45UPpu8D/Fk7vZit6AHyD784YxSNRfkbmn+FBXaA/xN7A7V4tWML+GdLeSzEufjJvlM4gk1BSfQwi1r0EbQLT1NMps+gvq602aHpOiLD9i9u37XaCvoLfurC+2r+9XL1eeAEHRrGfqLdJNylNZYzNDIulEXdapEB5TQckpMU97fi5HW2CHj2S7XsOLFWDgOa0l6pRZZT1grRw== 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=MC0swOAYXscpDMwcZVzIoQ8IreZy08JtN0miSINHeoQhRPlSHBJNGMTihrRSHbNVHBivmfdxR52gjUFcRAm7xDPzeJ4SxJSxJAbUXaWwq7nm7pv1CTTw27SmYZTLChyd3+sMncTbvZqzMDiR1ArxaFyvFmdLOngc55LgpaSx9Ys= 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 DBBPR04MB7530.eurprd04.prod.outlook.com (2603:10a6:10:1f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 09:21:45 +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.6002.033; Fri, 27 Jan 2023 09:21:45 +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 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 V2 4/6] remoteproc: imx_rproc: force pointer type Date: Fri, 27 Jan 2023 17:22:44 +0800 Message-Id: <20230127092246.1470865-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230127092246.1470865-1-peng.fan@oss.nxp.com> References: <20230127092246.1470865-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) 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_|DBBPR04MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: 24d1fcdc-85e8-4e6a-73c7-08db0047e901 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: gN55yGiD6p8CcxpvV/6NKv76gGn/u5k3lRz1zct+ztZPDG1ZTzGQ6vHkWqvBwSxdAJPr1e9RukwHKoOH8Hks4TN8PKnk4uNE2n9D4vySTG3pi3s4cu3ILWTnBTUZkRWrh9JENbxtoF4ahZ1RtFPGoW/CJupigvW+RAHPWF7Cu+36Nz43zUHsZY1w/EyZVp7lvUN420ibvFTlkgpdpTVWDUch0kj5Ij85qqDxeXu+h/4KRAj+xgf89IbSY9Blom3w5PS1lZDA6bmF8bvXuv3WnaqFDDMsqo7HqR6m3Xjqng/Vjkn7RpLHwsGEjD1t1ImOFMDkJYD/JdNPHbpTiNEPVu5yuzMfEsJJEXR7b5wnHPcudS0tMEWFkwzCPUC42xTzNcT44R8lzpnHbbMijiPBOY+ICSy1sxIVvKTRljH4ozFiOiJ2S/AH0xryJ5jgeecffuNyiYhQKwRy/oNGBeO4YQXj2q2iV3sjkep0QQgMdQ7rcr+Sp9/G+rEpmWB54ZZn0vXRdszrIejkXCGBubjA6W6R3sagO6ITmRF7LC7TVktiFOKep7+vlcyFXMhimQ62icSA2evthX8vbITj72q/pVjWDPP2blB6JHK1VPtCEooxgLFwX8hHb1yx+shYpQtPIkyjyke3Mo9o/xWNu3VBR3w6GqFXzPGmoS2Tflj+MzKy0hhMeJ4GSB7Z9Yt2iGB+hQkVP1lbRCfOmBbrBi6AVw== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(38100700002)(1076003)(2616005)(8936002)(38350700002)(2906002)(316002)(52116002)(41300700001)(6486002)(478600001)(86362001)(83380400001)(6512007)(186003)(26005)(6506007)(7416002)(8676002)(66946007)(5660300002)(66476007)(4326008)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TzYVpiFVMIHWT2QLTI+MIMejGlLmYZYCdIdvLBGKuTJl138h6hnc4Nz74faLj2HoD7X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I5AipYEl1gTuRk0mSBDHApnLNAQq8BfrzpxRhuwHjmV0lkLt3yqzTHVxwYEWTKYFq6iv5YOJ1/UxhvNeinBoB/TT811D9biax/j34gcz0Po5x827fBzd67Tf+pDDMZatZKFfz40bdoxrgvAl+8rRxiZSZWOI5L9qD28Ug7h/S2Qyf37f2EQuqlGBAvZvymSNmEadjOyX2m1O8l3G/bxF1c4jwTv9EN0XDJAiHCVN35QjNwIryeR+TXkAMLkaxwXQukc1Pa3ed/TW6vxxJLjU0uIYQDnbtQeKKI9EIzj1jklr4/gBI5N/hWYHu/NUjVYgoycHshCw830AQwiPCljpitf1iW5RoGOFOniUwTCcjcgfqaRoG6UFJiXirMSAktjmwgcb9g3Q9jNZEHD8oYg5qQ3sjpS/1XWklZB+CfUfD3n3hHwf305ZFdKnHXIn5w1IhcTAOVXNPUMcbn3zfQsPR5I06bM X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24d1fcdc-85e8-4e6a-73c7-08db0047e901 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 09:21:45.7264 (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: hcXlyAHnb6QLPcyjgpXorZBIKOt5n0ZqTnXAysCBJijChgTMr647ztvWzUH/LfTQ+eVdLHT9a8mQ2/INge+e3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7530 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 Fri Jan 27 09:22:45 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: 13118288 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 268F8C54EAA for ; Fri, 27 Jan 2023 09:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbjA0JWl (ORCPT ); Fri, 27 Jan 2023 04:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjA0JWk (ORCPT ); Fri, 27 Jan 2023 04:22:40 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75CB677DDE; Fri, 27 Jan 2023 01:22:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MVMU7i2hQb0ckzV7kvsVtyPUeP8tIy3HUU/QeeBO/d1mcgrg8ooN+WYsd1Z+ZF0161GY0/Q2wpwcIEV4JDIWk0NohgWnXwtHri2sgCNbD0c0Of4fVTEteo/yTbLJzve1dDviGYJB+eAPhmGTxmWVvMTdllJEX9UyUE6MEnzRBTcJ8HjASUwpJORXfgKQww6XouSPU1AnG8Gz/VLP6tO6qtkTVL2ERxUtl9NoAUUh8t2BVmUhXg/cRyj40JMFj+TMqLk6Ve5rAMm8FUNAem8KcV05JH7ocS7Kqx8lYIyqaEoD6sQ+aUvmA7VZDC42XB/Qa2O9pnF8Bv3bTrqzpG5hjA== 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=jQ6L8GQqTrzRnzvB6FhAoAmcEsPzQfNPTTf/AGaPakM=; b=NF04qRg5QeHRRZ9P3z5fxTlc0+y5gsJmA3lSpexHxXfnbMa8OEIK4BWgXDVP9kSBR2xFgtbNfmf+3aUr114u4pup35T6bo3TwJ6+JW3awO7H5Du2eqZWNxRypcwyt1anjH44HMnB4NwzgejXzyxB0N2QK4r7bbU4DdzIdLpskg76J1EuwXRjrQ/B/Utto9+ekjIfx5Y3UIGzX44TpcST3xwwFrKy6wn1BeMTyg1gg3Jgmt5c4mdKM4Y1g6rq/xKBuk/MCms+tp/eIKryf8RzalosPQqlMHu3Wel/J7pdj6CTsU7p1H6i3BYH2cPTpvrh6wESwGXk42h9SqXpnMvv7g== 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=jQ6L8GQqTrzRnzvB6FhAoAmcEsPzQfNPTTf/AGaPakM=; b=P+OKp+weLI3b4f1uL4ybXIDTfDnQCSDyS411+xY/5Vsf0ir7HwYBKN8ivgZUXtw/M+sI7oCx/if49EKM//mcQdWMhsc9srOaffaIjrlxlsrhSOMSoI4lh6Oa/4s6PsR6YDWe7jMJ7DBFjdT52R8FtCMCdpdbYjkgwOnEXW/Mw7k= 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 DBBPR04MB7530.eurprd04.prod.outlook.com (2603:10a6:10:1f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 09:21:49 +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.6002.033; Fri, 27 Jan 2023 09:21:49 +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 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 V2 5/6] remoteproc: imx_rproc: set Cortex-M stack/pc to TCML Date: Fri, 27 Jan 2023 17:22:45 +0800 Message-Id: <20230127092246.1470865-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230127092246.1470865-1-peng.fan@oss.nxp.com> References: <20230127092246.1470865-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) 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_|DBBPR04MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: 3647e098-5aa6-4d4c-5892-08db0047eb47 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: q4LtB36+6O8Pwfm9VfGRNH5LQzB5bHrt3LTWclnrOB93BFi63pxbvbPH+DdE5y7f+Vs5ArdWGtlDOrk4+cPV7x5t9ESh2ZzDshwtc1aIvdZHiceGIScx14DuyLg1KZNmrQzheYz+zvV3xRujBjvheaeEiMLlfs3d1CC6jYUIUJ18lMR42SPcDc7ZLn7nPA/A26B39X2O8f0jojAqDPf16Sk0I364HokWVKk4mn+DkaWdDEDp4s4cbVnwOXJ1l3DBcgONMu2jkhmSPtSnL3ED+geNSky7TtQ9WWMCgDQgJguFMXjw74gd10Edy6HuL1N0YCheabFgaYoe1uRjbLB81JUsikJdzAxDSicAsAH6p5QkNtVkVvLtZ1TMZ3MxducIfW6m6npHez4nqzasjYVPxd0mk7X4F5dFclZj/m/HMRj1Mii0mEOTLqAldKlmJSWICVavRVIGtU6KbnL2t25V3ef9cD25nQAFrD07MMgNjNMqwDCL9tmqP47YUlgphg4Ybd2qXyR/9jiKWmnjJHSZBsHMxiWvcJGdSQBap6OLYv+OGbLZ0Eyly7NRRgGrtbTOVsWM/pQPucTokAKEOT2mwCU1/x6v5MX2c/2lnd62JdfSmIUZ3QW//go1tMOIIvn7WeEgNeAJWZ5t1+qrx5fwNYwSi3W1WVbZF05SaOVa9y1dZ1YdWPKgyIPia4KYVQhsTZAChkKZ3ymULS7f46kDNg== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(38100700002)(1076003)(2616005)(8936002)(38350700002)(2906002)(316002)(52116002)(41300700001)(6486002)(478600001)(86362001)(83380400001)(6512007)(186003)(26005)(6666004)(6506007)(7416002)(8676002)(66946007)(5660300002)(66476007)(4326008)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1ETzwjPonV3JU1z1eD6NKCa7HcAeb4lm64qlbFVq8qarQ23elhybyXK1I6NhRGbhRPzbY2igmwY5O8yUWu/48HggP43qFa6aKSuwURG7+I+6DuoUJFppsqC4fwV0Yr8AB3QpG50cTQtGCz3qxqF3AjipPQ2oKMO4BhnqhlToVmvLbENAPppFgtYJNUELmVqz6lpMo2z5Y5lfBEfDmowEFEZ+x6EZzOMKCkkcD44yZMOcglhEBVcK1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eIQ5vcskwv9uc5OuJoXxt9jsIiYLSviqRp4+rl7cqab/meFdQyFQZXatlRETIiSODPRle4KWbVdPsdMBPLo29tg1t354yD75jscyDZtAXByMB7hzyher8KJ2sF6ctlXLSVv356HhkUG2VDrQbf6ObdTuJMhVM3EFGdD/vVodwh0zl6HynoS3MgS1LUtCjb/JveN376LWuUaFuNqMIJK7zNN+Kl16FDV+LRLcfjJCL7mbNp8VAinNmGXpRYJPkTzmkdO8kEQO6a91d3mWtsecKny X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3647e098-5aa6-4d4c-5892-08db0047eb47 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 09:21:49.6805 (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: 2pSMr1rz46dsQMNH2G8WwyDHUZ0ntZBNFPcO5G01fVlxwqfnyYvEN8UVI4Z4g7HboPGr7blbzL3g+4LnCyjZrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7530 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. Signed-off-by: Peng Fan --- drivers/remoteproc/imx_rproc.c | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 295e0e0e869a..f5ee0c9bb09d 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,39 @@ 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 sh_addr, 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 words. + */ + 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; + sh_addr = elf_shdr_get_sh_addr(class, shdr); + 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 +682,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 Fri Jan 27 09:22:46 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: 13118289 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 AA566C38142 for ; Fri, 27 Jan 2023 09:23:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjA0JXT (ORCPT ); Fri, 27 Jan 2023 04:23:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbjA0JXS (ORCPT ); Fri, 27 Jan 2023 04:23:18 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B823F77DED; Fri, 27 Jan 2023 01:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jzM94cECm7JC+9F5LuPrkveDkf9aO/HQNvEtWZayTMNK/1iBUyV0Qf/bS5EAfoDV1AZCafHmvPnsqyQ6XYEhDNBz2iKx9AJET9eOTWw1q7g5ZmgRmHVjPdIQGAnLWFKNF3O+fptgYGENAYvGoeLO4z9hT8jGYRrhNELoGq5gkf3k221sN56sat4vq8KyunwhEC/94c25+NTchYLJvRHOJ5mTqOVYyfgNlBEXnUpwb0lLa5n0xtsTx3r34QbpWR/+hOBxd7+6YY/NxQhRYuohtuYtZJJwfERG0XDpBpX9m/iCXkz569v0aY8BZqvPye58NilwCZQWcehHVOZGPqLmhA== 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=4oqHj3aTUHkzEteDjyXDD4LqRrd5/36TOWD1fab0LS0=; b=j5NQfoJFL67/0bs3jAs61zCGUfaeTmoV3mYfB9T5INaGRYcfoR9R7IMn/9VhjGOzxPwPDBTmoqqFaUgB160kxXRsN0UTvANoMLUbMbwrkBBaA5rQLW+gQ7t0gpc7KeVrR+rzIoPEV64q5xt9x5tYfZTCAOcAOto49dhrOIO1AOHya0lXxCwh0hqixUFQgewO3YxlNLSwf4iJ1mtO4IH8SdVHI+oNfSiQyiaHxGqafEEQO9ay21i9LPbT/9o9QoHBCPVf7z4Bt2HaHci+6DTRAGSQj59ZzSn8TKv8+GYzqaNoaXCi4IvjQb1uYEf8ODNMaixvijRdVPHuLVLHiAQO6Q== 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=4oqHj3aTUHkzEteDjyXDD4LqRrd5/36TOWD1fab0LS0=; b=DFICwUaoNhEcW6vuxEMuWbpI9x6k169Yr5SB1q664peu9AlU2SHOmGQB6PZXi+37v8dMVwO2Dv1c27Mb7bwGLlPqb3rNivnxRAsqhPyukWfCxJcYu+Lp4yOXvRqL9rr5W3tisIzNYNk+pe1RLfpMHlCEofTxqjLFaTM/Eefn61Y= 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 DBBPR04MB7530.eurprd04.prod.outlook.com (2603:10a6:10:1f5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Fri, 27 Jan 2023 09:21:53 +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.6002.033; Fri, 27 Jan 2023 09:21:53 +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 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 V2 6/6] remoteproc: imx_rproc: set address of .interrupts section as bootaddr Date: Fri, 27 Jan 2023 17:22:46 +0800 Message-Id: <20230127092246.1470865-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230127092246.1470865-1-peng.fan@oss.nxp.com> References: <20230127092246.1470865-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) 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_|DBBPR04MB7530:EE_ X-MS-Office365-Filtering-Correlation-Id: de8f055a-4781-4589-3a75-08db0047eda5 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: ScCWPZNlS+wk8DaIyqO7oKFLmU4OYjSryTasyB8HpZVH3ug6HhewlVXLzzo+gKfhWoWjIgq08/2Zp5k1eJlXm4fyJ69v36wVQZ5bRBvxc4T+J+XzlmnCfp06Hb1hYXQ5V1ZmnCqv4ScXzZgViCZXYdJg+15MD2meBqyTXHnY8qA0uvcNTi80UaiA3MIBfUqk8hIkZBnYIhSTAXgH7mrlnS3W2PO6TuFjNISrfAcKV+m6OVz6CKT2vHRWcbaG0jWcfmV55Tz0DwB4vesx29uiQYuhi4Wc2HkW/fklkBdriWrM7jvpm6zffLSxVsQjkM2xfJBdlQ7NdVPlt1CHf3CyBdIk64IsS+9Mp3mpYuLLtkuqe359zb4L35gBFQBhRa1a1/JboBsuTZ03BFX8RLCn+0uev3BQOtE0LUoUmoYtE7JNQWXfw1TDZBEUtGWcsWX4BUbB32wDU0t0tgMtWqd/M8ugaXgTcJIN8bZmsI/10FV6OvtnVuKBH5XxkRqAPa6ymx7ia8CLLQ9Rc1prcIPEB1rX5l05iRlEY6tOrPInvfQ9yROfAhRs3BO9/sI5ZEEwJfC33v4r2/SIvJCvGvJVyDBIqClR5F07iN87UDl2yNDFVapG4iF/hSgvAIHXhRwS5oRB5cB5qAG4OIni71rvl67ykPvjaKMZkfVIAy8wdpxfuiIDIwu9UT9+DLARyE6X4zV5g5sqe5pA+EO4MifKRKt6KplNHHHA0mW50sP2XkA= 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(38100700002)(1076003)(2616005)(8936002)(38350700002)(2906002)(316002)(52116002)(41300700001)(6486002)(478600001)(86362001)(83380400001)(6512007)(186003)(26005)(6666004)(6506007)(7416002)(8676002)(66946007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oF851rdt63NosbMqS6GUNuNyd+srx4DBUZiT+ge0kicALifwzMyhr9SwbJXwUeu1xNuAuw5g9ySzjMs3rEj8JtdaGaUwh9jkbEC7neBpdGwhaNRyF7thiIbj4Bl9hxJh0uNrue0MCtYyATcyg5LHmL09rOkSEHSNz7bzTXqdxWtBb79UEuHf4O45ffEZrCKgIbfUFwdzDDU4AbgssD2BMn4VB0RiituB2ZQenR45xjDznzlp7XAf0pnYCM5MncpjPM5JVUWg8effGrnVRcRlJkT20gnPSTMePPWUWbl+mF7q7H2nKI3XW6ot5g2rzgQOpDM9LUnlymRyi6fynavZWNUNTZQ8JcivGgzPyr94pCGlj0wn/TRMp+l/UZaWi0b4lmCnxxA05d65Ons41tw4MyLB0JVrisSOABDkUugqSQpSgar0afES77nbqPMUaf2aoQFvTPfH6PgKY/lWSHCi3kKyarT4hvQv4oz1x62PHyNuLZp/81LuJX/BWSsZ2hAwFS/Qq8Qo9sHueVTRvs+ZRQaZ9aJplUiJHIzI0vwRyvRyrBgjvUEpgk5lSMKlC8LzrYKSoR2v4LEQGKFmy5z50zw9szkNO4VjnCxmlWHk5M9gpwSfLlZHHJPPK X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: de8f055a-4781-4589-3a75-08db0047eda5 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 09:21:53.6024 (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: xNA4XnjBXjNn+yLbsgwqzl0QhZKBDjw4v+zEuFhHzuSc0vi2ka8egTzSP/gBPcswd3Suz9bD6Vsvsive89j/Mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7530 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. 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. 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 f5ee0c9bb09d..59cca5ac3045 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: @@ -664,6 +665,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;