Message ID | 20240919-imx9-update-v2-18-0d798d9e08ad@nxp.com |
---|---|
State | Changes Requested |
Delegated to: | Fabio Estevam |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-NXP1-onmicrosoft-com header.b=Jh5N0Nok; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X8GLp5RpVz1y27 for <incoming@patchwork.ozlabs.org>; Thu, 19 Sep 2024 10:17:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E01BE890B5; Thu, 19 Sep 2024 02:15:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="Jh5N0Nok"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5318A8906C; Thu, 19 Sep 2024 02:15:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6254D8907F for <u-boot@lists.denx.de>; Thu, 19 Sep 2024 02:15:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aO+ba+q3MZnUBs9qJDHfjNI720Q05ymUBPHbxANnXPkEIyOj3Ue0tbXErOWIDsJn6RP4gbd7DYXBc8r+wMNPqjmT4Lihswy30PdVQOrz/fnV8+tDzBS7Jgs4RUDrlOSAciXZF7L96kDkydnAaqpo2tH873yxSC8Am7twiK8cUo78+Zk4ewJ00HYQc4gMKDIE1RLMk7n3v0L+3eAywkBbNtFjXryKsi/qYx3LltvYxizgqwfwx0mVPPAifrtMwVENN6f9S/MtlCo7ewVaa1xaC1h0pP6kbmndV6f7sBJnT7GsSFBLpSK3p0s5wGwE0MyVyPaeROvrWdzxLHvvQAHM1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=wYLgxBcCgvFVhLCk0CE1dak0hYn6A3h9u/Pjwah3V7U=; b=XJNkvrZ5OjxscadNe9W4NUM5NfztvGLNNvQwdK57dljy3W6/Ieyv3NIztGE9JxPLFNchHIOMqXYCglMDa4LdqvcNcjqTX8pRP6A+0rt7VsVPaB2gzYEKTvL8vGNsDyCrGNSgunX/T7UtyqcYjVDF1+FCWs0vyYJ7Nzc02+vN7w/6o2x/qZEQ8qFIBD9i3TahX+tyO9mC4gKWvZ7nnGevymwgT2ZdRiUx9ZTvIfGP8Zu/PrGZbt5KhzHAO1f3lolO3zClanW2hLPG9Iu1gfOGTtSPCFk5NG54bUArcBINpfMsBTILyjeYwy1484OgldzhdVL6aEBZzVtARB92aXRm7Q== 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=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wYLgxBcCgvFVhLCk0CE1dak0hYn6A3h9u/Pjwah3V7U=; b=Jh5N0Nok2Bd/1C5tVpWj+foJVCMfZ+iosXHltQg4Ei0JhEm0EjMOTQY+UCsE8Th4/kFhKQpD5NDe8B5nlc+8T6yeoztDf95BS19LeWb8X31dFYLlBzBpfwx1IY/nxkV5elavELdBLFV3vwyqrlrxTOqDbX8/6/6jknTZmNrLezOBVADVZJpRo7zN1fGjrQhxeVnQECTaR1P8QP/KlOPrcQHATiLf9h6oEhyhTAs4N0gTEUm1Zcv/Xrra7/QFgq0mCX8gYiEroJxwiaV2Zt4zIOdngCP9ORmDyppyrFJrFNrLKre8wTBywEvHbZMes6+1YtxtC24VSHWWbaCtIZc23w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7872.eurprd04.prod.outlook.com (2603:10a6:102:ce::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Thu, 19 Sep 2024 00:15:20 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.7982.018; Thu, 19 Sep 2024 00:15:20 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> Date: Thu, 19 Sep 2024 09:18:17 +0800 Subject: [PATCH v2 18/21] imx9: trdc: introduce trdc_mbc_blk_num Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240919-imx9-update-v2-18-0d798d9e08ad@nxp.com> References: <20240919-imx9-update-v2-0-0d798d9e08ad@nxp.com> In-Reply-To: <20240919-imx9-update-v2-0-0d798d9e08ad@nxp.com> To: Stefano Babic <sbabic@denx.de>, Fabio Estevam <festevam@gmail.com>, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com> Cc: u-boot@lists.denx.de, Peng Fan <peng.fan@nxp.com> X-Mailer: b4 0.14.1 X-ClientProxiedBy: SG2PR03CA0130.apcprd03.prod.outlook.com (2603:1096:4:91::34) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7872:EE_ X-MS-Office365-Filtering-Correlation-Id: d7d4c49f-e8b0-4a8b-190b-08dcd8402609 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|1800799024|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xOxNGAoQ1T8whTMgHxqhjcqpcfHEZDj?= =?utf-8?q?mwyogRrTtnbX0OvShYJ4ssS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eWLl0iMcjmB6TR1whTfk90VBr?= =?utf-8?q?Bki7RyN2lk0ozsoT0+oXE/DRkuQnne+eXxEqd/kYSRzcLbuyu10NgybKtOld2xwdS?= =?utf-8?q?nO/azewIqtb8qel/ZUKTbzXk2hDzHDWrCXiA5FZ0VWK9nzz8lGMKdmhhMDDaTDlfl?= =?utf-8?q?cYkZvxmp6FtUThQOGaxv3JNlorzdDmHv7GxVFak75Qlpq0d4qIAUBamUPmFThj363?= =?utf-8?q?1uNsAvGtJNYSgsJV4FjDBpbCLB7Rt4wpUBCNDMfGN8h+NHgWMfaMe8nkVhCH2iajM?= =?utf-8?q?ZnWlIbz0DS8zRHtdwUuY9A2If09K27Tiv3pDev+nVrsYjN0+68IwBpbzCC3wUjQT+?= =?utf-8?q?kKYMr/rSga4mxEHHOxHybqhR0OGvqlc5wY+iNj6E5pGOChGd+GvUeB1UqbkE18Ukm?= =?utf-8?q?RNRYzqUu3HFUGvJmL7liHH65FKf+dFTB4Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(1800799024)(376014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Lff5vOfN43YmDptNeYFMAIfV9fUQ?= =?utf-8?q?RxBayg2m11L9GBZ6ntJHK5Z/iQCoK+xw1+7E1eAfuOPbYW5fpqsm6h3K67IgbQY9c?= =?utf-8?q?l7aw2PemUe1FdMbQFZxl9Ajyycy5oTZogTygNBcIJ2wbwNhHjNpooyTbUNjAcCzPl?= =?utf-8?q?WFKB0qkJl2vzDgSFrmmk9ViognMZE2RrmuFJEZT8tr10+pA8jn4jc/nYyXTmKbqNQ?= =?utf-8?q?0PHzMmgpm9OzDabN34ovnShN8/5MNiLl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oUALNOK0kL?= =?utf-8?q?bq6FKXWAHqzkqIEQfhVUC8NNBPSqFI/De3EPWz+aQ0ANQI5UT6eqB5zT43kKvvdhd?= =?utf-8?q?CvDW0GdYS9oPBSdD9YXW/hkE4N7MzhVCRl4a7oSuak68CCXxdNYI3UlTLs4VR2kAU?= =?utf-8?q?h2VF+hrs3yCC8DrOWeh+XqzshdayCrS6lHH3jSzIb7jcQtkvnQ/+/BHPTMDvXEefM?= =?utf-8?q?524O9Ge2XqO4B8iDinyvdOpDqJSpv+K8k0LfkkU14dycp4cIy68eKqcKTGEzRyzoK?= =?utf-8?q?xpVWsXDbTLz4K6m5NJhKkfAyUfs7NcgJUD4FUkTCKv64yzsItiu85uXQYKqUpE07a?= =?utf-8?q?SZwjoasve1RVXTPZolq8nN1NkpKPANZyVDAe50obNsx3Sa/bHXPg8wqWuRuGTKzIa?= =?utf-8?q?uIgkpuWTULCS?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7d4c49f-e8b0-4a8b-190b-08dcd8402609 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:15:20.8324 (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: Zk5B72+3nF8YVSBRk2Pusme4CImSNag0oQwPhqNhkFMFfxyKRxgFm5p6VAX+Rw54Q3xocDNPDbjW9OnOVrVleQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7872 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
imx9: various update
|
expand
|
diff --git a/arch/arm/mach-imx/imx9/trdc.c b/arch/arm/mach-imx/imx9/trdc.c index ae1a46d1331..ef0f8b52a4d 100644 --- a/arch/arm/mach-imx/imx9/trdc.c +++ b/arch/arm/mach-imx/imx9/trdc.c @@ -19,6 +19,7 @@ #define MRC_MAX_NUM 2 #define MBC_NUM(HWCFG) (((HWCFG) >> 16) & 0xF) #define MRC_NUM(HWCFG) (((HWCFG) >> 24) & 0x1F) +#define MBC_BLK_NUM(GLBCFG) ((GLBCFG) & 0x3FF) enum { /* Order following ELE API Spec, not change */ @@ -154,6 +155,22 @@ static ulong trdc_get_mrc_base(ulong trdc_reg, u32 mrc_x) return trdc_reg + 0x10000 + 0x2000 * mbc_num + 0x1000 * mrc_x; } +static u32 trdc_mbc_blk_num(ulong trdc_reg, u32 mbc_x, u32 mem_x) +{ + struct trdc_mbc *mbc_base = (struct trdc_mbc *)trdc_get_mbc_base(trdc_reg, mbc_x); + struct mbc_mem_dom *mbc_dom; + u32 glbcfg; + + if (mbc_base == 0) + return 0; + + /* only first dom has the glbcfg */ + mbc_dom = &mbc_base->mem_dom[0]; + glbcfg = readl((uintptr_t)&mbc_dom->mem_glbcfg[mem_x]); + + return MBC_BLK_NUM(glbcfg); +} + int trdc_mbc_set_control(ulong trdc_reg, u32 mbc_x, u32 glbac_id, u32 glbac_val) { struct trdc_mbc *mbc_base = (struct trdc_mbc *)trdc_get_mbc_base(trdc_reg, mbc_x); @@ -383,6 +400,7 @@ int release_rdc(u8 xrdc) void trdc_early_init(void) { int ret = 0, i; + u32 blks; ret |= release_rdc(TRDC_A); ret |= release_rdc(TRDC_M); @@ -397,7 +415,8 @@ void trdc_early_init(void) /* Set OCRAM to RWX for secure, when OEM_CLOSE, the image is RX only */ trdc_mbc_set_control(TRDC_NIC_BASE, MBC(3), GLOBAL_ID(0), PERM(0x7700)); - for (i = 0; i < 40; i++) { + blks = trdc_mbc_blk_num(TRDC_NIC_BASE, MBC(3), MEM(0)); + for (i = 0; i < blks; i++) { trdc_mbc_blk_config(TRDC_NIC_BASE, MBC(3), DOM(3), MEM(0), i, true, GLOBAL_ID(0));