From patchwork Wed Apr 22 13:52:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275028 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Uy2lKm2w; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hC230lQz9sSq for ; Wed, 22 Apr 2020 23:30:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 982B381352; Wed, 22 Apr 2020 15:30:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="Uy2lKm2w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A044A81A66; Wed, 22 Apr 2020 15:30:13 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::62a]) (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 F0B818006D for ; Wed, 22 Apr 2020 15:30:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Igeg2HFZxDY67b/IHwYZeM2aM0HcBvWcAAhnH1qoBKsARLabdl5tc48lfhtcBbf1JfkJwwoCXHGoMhZYiLZqwEKd3aIQLfwm+bL4X7gNhHdIwVZctmGyV89xsNJfRHszEahNyn21sE1rd7ODH70Zb5EameizNG6ql1EvONtPfnGq514EH4A6K6+EpP3t8w2TONJaF5Z9pa4d4EbmSeDNzeqEB0JjpOlGysePIuetrqNtn0v8j4ZPgiS4ZA/TF3SyA758Q/7KY4xE3NRu9DMY+f88Xc/beM4u86b7ZPcQptzt8WZFmlhih+XFwFb69pvqdK2F1BzKz+iKwHY+5etMTA== 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-SenderADCheck; bh=m207HUyIyrcig1WGuL31tWy+l2yI+LkKjgnrKxFaWYs=; b=JjkcIkF0MxLY501VB7aTgvi9OseZ+SeyTxe/HZ1SF4dT1eo5ylI9VxXeJhDbJNLhi3esPsUPY/2kj22HbfTtx5y2A7kQ4sOweCVIOzGCdClW5aryorAde1bo2j5L6HNtzuHM+hzfhYL8lGAi2xn0n501TwZmvZeNABBqrdny/Qt20snVO4dqjTSj309BO4oJulYjUySsRV3N8Dr8TlbbW6Pp9FIPSN+aPn6Pp6ChXcwxhWNflZZkJeD3XV32Cr5Ev/55bVmNxjNL1xFTaW0GLp9VrFViYmzXDPktn5jLeZfhyZVOpSe+itte15wdbjHtQhf4leTTVo+v437pA5bHpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m207HUyIyrcig1WGuL31tWy+l2yI+LkKjgnrKxFaWYs=; b=Uy2lKm2wC0VOad/PyD7174G3uRCn5PGK5bG1V60pVA1gnsqg2NyxsYBy/el6YBBc2jzA55vXDDyftLW6tj9UxJ+nxbL3YQEIUprKSWJucLKGaGVWTY/OFfZ+YG10uQWgG3xvWIY01xRedSoOlBqyjj7lScn9OHZGy3P4QhJZpns= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:29:58 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:29:58 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 01/24] imx: fix cpu_type helper Date: Wed, 22 Apr 2020 21:52:12 +0800 Message-Id: <20200422135235.14756-1-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:29:56 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fea79e51-93b6-4c97-629d-08d7e6c14082 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:962; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(6666004)(956004)(86362001)(1076003)(4744005)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mp+D24yMuMb3rkrigpiQnFKwMf9K78LNeOsmoi9WBwj8H1jPckcLd+DRBBsjmAHMcZ7rxSSHHjC3i9sc68OZwRINY1ifDX9tumn+wAgcnF0vMgyMG2fAnaIlIm9x1J/a30lIvCHcbY5UfKyZBpbUxFLP6+HbOG2MrF3bTUTgk3sjzZbcrU8xLWUi/OYMWbs1EGXK0E1IGYIXX/nzsBj3niqOifaU2aiIRqvPAGJq7CUKxjlgkHOsiTPZ/mVkMGkY4AcxzMlmBiWjTQZ1kp54YSEv8L5XrbHGr3kejPiW8IKXGv3Y5Cm5D595e+WJb5XU9mh8+/WinFZyieTz0isQQTn06gQLdIdBPDq2M0H/6KHXgSR2ZwMft1Ij2urPwxdYbrdaVbr8wvt7Z3Pz3ufGfJQ0nfFWipdrA0g5EFSEXd4c5otOFJKRHMlpeBJY5icI X-MS-Exchange-AntiSpam-MessageData: o1qeDjAshEAJKXj7/C4+t4WcpOuLOaIPLS58l07hnXlPr/1st0PV3eQsosDwcuJFBmlRv1XwMm/lZnIhb9N9BEy60H+/PzV4wl7fpvxJD6p5H3+zxxDpFQEQV7t69J4d6leAO4OYuopXre89qUxCOg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fea79e51-93b6-4c97-629d-08d7e6c14082 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:29:58.5406 (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: Vn4s16iVIOWqT7BBKEsAU3lX9OZg6u48Rij61kQ29buRmZPgbmRT9hTMf9aSj/yWya1QVRFh2Sl3mWaYr1kkmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean i.MX8MP use 0x182 as its ID, so 0xff is not valid to get the cpu type, extend it to 0x1ff. Signed-off-by: Peng Fan --- arch/arm/include/asm/mach-imx/sys_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 35b39b1f86..103dde4d36 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -16,7 +16,7 @@ #define is_soc_rev(rev) (soc_rev() == rev) /* returns MXC_CPU_ value */ -#define cpu_type(rev) (((rev) >> 12) & 0xff) +#define cpu_type(rev) (((rev) >> 12) & 0x1ff) #define soc_type(rev) (((rev) >> 12) & 0xf0) /* both macros return/take MXC_CPU_ constants */ #define get_cpu_type() (cpu_type(get_cpu_rev())) From patchwork Wed Apr 22 13:52:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275029 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=WkUT+Jgw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hCV1Hqwz9sSq for ; Wed, 22 Apr 2020 23:31:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 101E881C67; Wed, 22 Apr 2020 15:30:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="WkUT+Jgw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B95481A42; Wed, 22 Apr 2020 15:30:21 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0630.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::630]) (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 7CF9B81352 for ; Wed, 22 Apr 2020 15:30:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fSQsgHiNO0cw1lEY+bi/wrxI+Mh9rXdPWtm2MdG+t9QqkXlGT5IrodKPAtvqgx+XBM4Otf6l1ytFhocvnQoQ72UVTH7BJpGjhEv3zmR4JowNEamzVgAeyHqfKsvNKvyWYxmSn+5O9aq9t5ycyK2dYVvcNLmZgA78tBO0KplYB+nNEh4VISZ6FJI8ZuBMe3EAXPYiyAHmqXVpi0rH8j1ns5NjjpFIMIsLs9sS7ZI7wnak8a+4fvR8PtOrmMniIxF25OTN6irXbTxVmhdPZ/DHfuWESdr84ytOJZBJIRxyBL5GSZJqzSe7J3nhDsI1H9Tj9ARJH/W5RFydQNOOHM4e1g== 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-SenderADCheck; bh=yLYdDxgG574sJYiIuo02/HOjB3oxjzb4iJzPgAk0DiI=; b=h/a149/3ZUK5UeketNh8iOIf9Ouyz65GbbXPKasxn6SAjifFUsDD7XTCX4VFfAjCjgo5qFx/Y3z7+2XcG1RoSD99DROK16kUMYqZMX9HNRJ5L9cr/r6prRVt8xq2wZEWLgGHss3pgMR5JhsleWf4Qw3fSs9nrtq1eVhNb+jaYS+A2lLeWiyguFoVMtaEFuHQvEFYzWTir+FmbHRFhingsFNqLKM+/ipPK+cGtZ9V23Ogi7KxA09x4HSlWY2rIaLt/riU6PZ+XCjVIxtrq9OJ/GRv2vQSh4OcIzQq3cyO92l1KhbFsACctYOes2o4MQdQuxh6cim9NVkpIzVd01Z1qQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yLYdDxgG574sJYiIuo02/HOjB3oxjzb4iJzPgAk0DiI=; b=WkUT+JgwtxjbWSEg/FtRLoJO6TsUta6m8IKB6Ih3f/IjNAcQ7MYhNEKnZ3tc2R3Oey9dAkrCrIwpkEIdYnOtQ2tm0N6HfghMIfpIZLlONmSoikyFmIgRwEULUBXWY6UtxQBHG3W5hL5jn9lSSW4jC42gRhNF4liyv6jZi7TZLvk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:00 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:00 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 02/24] imx8mm: Update CPU speed grading Date: Wed, 22 Apr 2020 21:52:13 +0800 Message-Id: <20200422135235.14756-2-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:29:58 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8966233f-706c-4f5b-a5a2-08d7e6c141ab X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(15650500001)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yXdyPv1iRWRRFt0IhcsRFt7jkToghCZY+rXSOCPJNGaHbvCwHeKhbmnljU0SlN1CYo5BEPS7iu/9TQ1rhz5UPbF6iMAK7cmPP9oAczGz6Ay0SxcCWC01E/mLhqGSjSYLuFn6+SU4TIqS9llnCbREgqy7DdHxv6a1fmHg1uQH7u1xZQGJeOL10h+VhkmpAkz/39A9Fg7l5WmkY+TlImns4P7K952MxbS8rnJNV9FGkZvbLpK6uzvLiD533+FWFilG6esVrxgj9JPPrhZUL3CoFjRFx74uw6RsUJfD89bgnS8WFyQ7G5d7uWrVQlsyEMwNF1cBjMKBZ2vL/qYrp0lNo5i1BIndHFeuW9ti5PFe1GVPRbxv5in76gW6+jLYf72IN2qG5GRLURiw2hn6lTsb/NuHseYbZ27gM/QwJiSvjJreqvi3rNseENOfKxRSh+SQw0F9gTQ/6N5hYpQngy5H4XvvIHxZ7SsDRIt0IxwVwZ5bsaCWH9qnCLCM6kzCm6Wm X-MS-Exchange-AntiSpam-MessageData: 4eHPbKNHtoyqH/3zATpl+0M6cmXXOLZsK52K31DWzMa5n3EMFWqj0tC6uk+hJ3ey9Sw+SCc+CkIhVjdBS8ec2p50+jxXKjscgFEWEB1NIptRGyIpPcP1uRV1bQDfUei1LqtjhNLCfz75GSwp+N/pWw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8966233f-706c-4f5b-a5a2-08d7e6c141ab X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:00.4717 (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: p31arStrnRCchQ2OIrtqdNoG3FyAaUU61BKFfarAvTGKTkG1XaYLtqqisMA6ljnXfX2a/jKi/ZsNHnIT8MluKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li According to iMX8MM datasheet (IMX8MMIEC_Rev_D and IMX8MMCEC_Rev_D), the speed grading for imx8mm is 800Mhz, 1.2Ghz, 1.6Ghz and 1.8Ghz. Update them to get_cpu_speed_grade_hz function. Signed-off-by: Ye Li Reviewed-by: Peng Fan --- arch/arm/mach-imx/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index bfa85c64c6..55e3539cff 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -332,11 +332,11 @@ u32 get_cpu_speed_grade_hz(void) case OCOTP_TESTER3_SPEED_GRADE0: return 800000000; case OCOTP_TESTER3_SPEED_GRADE1: - return is_mx7() ? 500000000 : 1000000000; + return (is_mx7() ? 500000000 : (is_imx8mq() ? 1000000000 : 1200000000)); case OCOTP_TESTER3_SPEED_GRADE2: - return is_mx7() ? 1000000000 : 1300000000; + return (is_mx7() ? 1000000000 : (is_imx8mq() ? 1300000000 : 1600000000)); case OCOTP_TESTER3_SPEED_GRADE3: - return is_mx7() ? 1200000000 : 1500000000; + return (is_mx7() ? 1200000000 : (is_imx8mq() ? 1500000000 : 1800000000)); } return 0; From patchwork Wed Apr 22 13:52:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275031 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=BIKLwTXP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hD60fXGz9sSs for ; Wed, 22 Apr 2020 23:31:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0D0A381C54; Wed, 22 Apr 2020 15:30:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="BIKLwTXP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1309F81A18; Wed, 22 Apr 2020 15:30:21 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0630.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::630]) (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 1963C81737 for ; Wed, 22 Apr 2020 15:30:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f74x5Mt2m60jq2Zeoc/2KGx+u8+euFYAhMf3tBCpwWq8lNwbHpG3aHEuA1MIvX+pF/NNg0Jr48pqWm4/moFICw/X4oRBpcTRIHXFBB060IbzMHpCoHJKOrrFYGEapbKOzbH+w2DE79waKxHOHLMdfngKOJg34YqFhP4IEcVvpS7R2fLGZgutUIaec9H1uwC4iAcv92usY/gP50WwqgiNwebqEOySkJg9xN3STPMNwJbjQ5y+34yLPzqKMZeiIpB1Vp0k0988Oh8/N81PRFkcweUb1sThoF6klajCzyNER2f/b3eu0cUDsBrDltYUhY3UbspkTdbcuHExACb+92Dqog== 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-SenderADCheck; bh=3bwSQB5CevFvWUShZV89Z0h2IElH3DVgBG8c2np8hS4=; b=AYCObtmOUegN9FuqR0uEY3HwAbJl8wg1iT1pcmQAKGyP74JAf1nTYg7r6ER68xFqqo6/25OLjXvYzTvha6Yux7K9d4GLBDzjouJ8LX7osfmtNBTrwcnA4VbR8+3HG5IafKi9pyRG474INvi0CaSrfj8eZfO46Bv9j0yibjnNCnobK4jTsQQmcyfdl65lChis/4D18vkkP48C12MW1o7N7XGRqd5YLLMqIUP3rDs1bHVPIB7lLZ2sCzUvXqfIkFoUEF/knUotaL8UD1zT9Q4lOVQk+27W2mQIGzAa+U891svDEl81kefcysmBddb1mBGV8ml88jV+SWfwE39qoAfBZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3bwSQB5CevFvWUShZV89Z0h2IElH3DVgBG8c2np8hS4=; b=BIKLwTXPOrhoAADXxymRVrsLgRE/B3LlkOHkEtcUJYsujUvlDdLK5Ny/PWjWtGlzcxR8naz6btiQSGc4gRTiE5UBpRCrPR1Qq9umCKSqkiSvrglOczJ2ivYqkhZeti19QLw58oPXb4M5duyYiy9cgx4dBPixiOKtJvtqZISP6Lg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:02 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:02 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 03/24] imx8mn: Update speed grade Date: Wed, 22 Apr 2020 21:52:14 +0800 Message-Id: <20200422135235.14756-3-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:00 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b8b0eaa1-da04-419d-8942-08d7e6c142d3 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1002; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(15650500001)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bY03miV9CJn61tgntY2H85GEfGbrgQksquzMCCiy2IJRb2jHfW5gQfEpc2nUVeMYh1c7Zz33OAGXxUs5r6kcPwt7dOdVno4BH7Xom2xSLs5PxJS0xaVQ38/skn5b/i2BP0JraGNwa7ZriMGrjOdOl5EKPk1/XIYMadwfGhV9pMlmhdeCdePzBhQyg3TfgTBRQgDn5AGgHmbD0wjvcGaP3i+TI8r1C1g14xt6AM2g7jI6W+S3d0pkUyw0NQU87clIg2rVqxVcATlGKMZ398WJ8pGTJOWH3ASS3v7CEDVqWEOUN1EOGH+2guVwNdP3BRjz73ZPAskMVcBpuRz8k5rGe9VMGlBoTC8diHAhtlcAR7w+DYK20NH6lgF/GMtsX1CmD5PGCKVgoAnHPUhxvbqTcvPWpyJZovXj4Q7vA0lODErlTVPRnQmn9bSDaSxgh3qreOtB8Dc7ot6327/XXZOFdDqKZIQWpXpbbmrEBmIr3nXu14wnUgkCmnBW5QWI56Jd X-MS-Exchange-AntiSpam-MessageData: D2tbnMh/oxO6hJsvYXfciB9xYCvLQDjtHTy3BB0TqhZV4Bt91y7NBJSd6B9lnaBQgrWatKZ82E677KCC2UmgVP2/p9uddAeydi2vsJJZqB0oRJNFWLesLN5F/XzGprC8wY/8NQgoU0ICYXcWVs3YQg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8b0eaa1-da04-419d-8942-08d7e6c142d3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:02.2719 (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: iJIgvoDwvXw9ymP7C5qB7NpXghCNvygwCuKhrWyLfwg+fIWxudiYxgE4kBQ6y+wluKDgT3S0cF2KrP/4tZK08g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean imx8mn speed grade fuse uses new definitions as below. So have to update get_cpu_speed_grade_hz function to match it. SPEED_GRADE[5:4] SPEED_GRADE[3:0] MHz xx 0000 2300 xx 0001 2200 xx 0010 2100 xx 0011 2000 xx 0100 1900 xx 0101 1800 xx 0110 1700 xx 0111 1600 xx 1000 1500 xx 1001 1400 xx 1010 1300 xx 1011 1200 xx 1100 1100 xx 1101 1000 xx 1110 900 xx 1111 800 Signed-off-by: Peng Fan --- arch/arm/mach-imx/cpu.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 55e3539cff..5b979cc1f5 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -314,6 +314,7 @@ enum cpu_speed { OCOTP_TESTER3_SPEED_GRADE1, OCOTP_TESTER3_SPEED_GRADE2, OCOTP_TESTER3_SPEED_GRADE3, + OCOTP_TESTER3_SPEED_GRADE4, }; u32 get_cpu_speed_grade_hz(void) @@ -326,7 +327,16 @@ u32 get_cpu_speed_grade_hz(void) val = readl(&fuse->tester3); val >>= OCOTP_TESTER3_SPEED_SHIFT; - val &= 0x3; + + if (is_imx8mn()) { + val &= 0xf; + return 2300000000 - val * 100000000; + } + + if (is_imx8mm()) + val &= 0x7; + else + val &= 0x3; switch(val) { case OCOTP_TESTER3_SPEED_GRADE0: @@ -337,6 +347,8 @@ u32 get_cpu_speed_grade_hz(void) return (is_mx7() ? 1000000000 : (is_imx8mq() ? 1300000000 : 1600000000)); case OCOTP_TESTER3_SPEED_GRADE3: return (is_mx7() ? 1200000000 : (is_imx8mq() ? 1500000000 : 1800000000)); + case OCOTP_TESTER3_SPEED_GRADE4: + return 2000000000; } return 0; From patchwork Wed Apr 22 13:52:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275030 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=ohI2eh3b; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hCl6kL8z9sSq for ; Wed, 22 Apr 2020 23:31:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3162981C80; Wed, 22 Apr 2020 15:30:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="ohI2eh3b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C064181C4C; Wed, 22 Apr 2020 15:30:20 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0630.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::630]) (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 44AA781A18 for ; Wed, 22 Apr 2020 15:30:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=krHhamn9QhowfqizS9Hl+JNVay4PzvOnMC1Ovpb9BR9Qcxm4nHyZnpSFQBRYEKLOAXTMnDZhxTf5mrbcmSi6pvPW0aL6RUHRg9MFeGx4WVKRrDdyoTsmar1/oE+eGsDX7osfLkRljr8WIfoYAaH0G3j/fTvcLwZMmahPYvLEOrisioF+h4YNRZ663czzDANYW6tHE5ff3PmKn/Dhn97Ebji64/ePR+BtYwJseGSr7e4kexOi/js6jeYel6HLuKsKzTPVKObOoq59CxoDBkyyLSSSNA9DmaCpK90qBbfyfYv+TjyAYsfYmbH6gesvUw0SNQ6Dk0HAnA+DbQsqHFxuvA== 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-SenderADCheck; bh=1DvcJrWUwhcXjkFEhCwt4IO7FW+FhfyCdqLt7MVMFG8=; b=Fs1YgW08hUY6Dw3Uvbk2hPsFHPzpO25EIvtZrYogBcmXuheRitjCPDUwGxzx013XYgauqlgWOQ3fdKax9R4MSIE+CFQRehqv4f9BQsYQJc69hzRk2KwbHP8TQws4Vjlxy4sb8qOVgAycSUKXxGbBA3xNWVh9FmonGs/vs4GVfm7HsD4XF7BfL+2rO5YPBD6oqjVDG88RE6KxslKYgBk5FmZxWkiqlKr0OQjU+NyCuTh66KFjyciJzmdOSxRcj4Gc1ljduzqben3Gb0HQje032QCJgSCVhFRbntuV2WeqasdgxF+xJlPDXZaWCqigz+56ZVroJed/W4bpYlM2uZpnAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1DvcJrWUwhcXjkFEhCwt4IO7FW+FhfyCdqLt7MVMFG8=; b=ohI2eh3bUnmyXGyKdE4A3dmDiOUyhx2vRmS+RRsRWVIi6LbvpkFDbQVQEdG2WO+YMb0GMo8hRhsRpSyi2czWaBxvPJ3TtxdanpbxIKmbJmExqehY5BHQXP4ofopuhhGPRy3xKvcnn0TSerQsBpFjP4P7vN8kLMh9cDEj2LEDEAA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:04 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:04 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 04/24] imx: cpu: support speed grade for i.MX8MP Date: Wed, 22 Apr 2020 21:52:15 +0800 Message-Id: <20200422135235.14756-4-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:02 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f7470574-ab32-41cc-5c38-08d7e6c143e8 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(4744005)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wL2o0Ux522YuSaHUdsH3HmsEKZgAS9TdyJczW7sZK5kcNsAbt470XDGm1XdE4b+SwW24BtNhJWWt1OsUpWc6qG57l6tKX2vGtQCx3sk31D0B5Z9jUmqhE225+pqUn9zGsVxOdbfVwBivZNHiieMwddkGtjodPUXED/er4ZHsqhfnq49dcE9O/yMmAzaKxEpc1x0y79rn5bQW8C765pULLydOCEiilIuXcca4EJ7wfTqYrB/FQmtFWauXOsH0ylhQTpTBGasgzL/zWmYC07uadPNum8LseA19wUpKAxRD8E59U/QIjOFcmzpo17NHob8Ms4owXWJHg6eL+Dcqd75e+rd1yNnjabnvy61mIyf8M4aXl6ZfDDDGSvnuk8RgInrKL/bfmy25NpmdTIrVAYLc3K/DQtbs11s4fdQeb/JE+QZRNNbATaILOanLLjsxvZso X-MS-Exchange-AntiSpam-MessageData: qHWX91PBXSZFBHU3NIEMWPXe092L4qZH70VvNUICkwPtRLEzUmE+D6Qb75bS5jps2AyUkKYvZUebhr3mA6oQN8XDtn+dK1tBQPGsofXoXerC9tSztOA9d0xH/DglCzuhQJOz3vdnz7sz4oPIXej4ng== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7470574-ab32-41cc-5c38-08d7e6c143e8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:04.2960 (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: 01lUi3YWim6GmStcCnEcQdIJwsK+jU7cTCw6dlVvXdCg9v+woE+fhIs7hqzSI0sc7ANOMFXLmXnTi9sqdsmdbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean i.MX8MP speed grade use same layout as i.MX8MN, so reuse it for i.MX8MP Reviewed-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/mach-imx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 5b979cc1f5..8217913b4a 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -328,7 +328,7 @@ u32 get_cpu_speed_grade_hz(void) val = readl(&fuse->tester3); val >>= OCOTP_TESTER3_SPEED_SHIFT; - if (is_imx8mn()) { + if (is_imx8mn() || is_imx8mp()) { val &= 0xf; return 2300000000 - val * 100000000; } From patchwork Wed Apr 22 13:52:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275032 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=UuP+NE90; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hDS68C2z9sSq for ; Wed, 22 Apr 2020 23:31:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 87EC381C81; Wed, 22 Apr 2020 15:31:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="UuP+NE90"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1151781A18; Wed, 22 Apr 2020 15:30: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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0630.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::630]) (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 9523A81A26 for ; Wed, 22 Apr 2020 15:30:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cNMJhgp/loBbZzDFZ1cCOsqz0JrBQLMTIZ1igJotDULEto2gwyNLqW8ePj7SKf4SxmhpeeSOB0fos90SoL2/qaGJTQThYecWQd3JF1Uvj8v6OrqF6ltKkVU2damh1LXmjh9gSg0kSwGmLktVRtYhTtl7X6EAXEBFo3D+WoKbeAVQXsylH4361rJsYMF40tGdlblthnJCBtPWCBIazTxVS6DmWzmYPty04RvZgNN+Kpi80P0CMbQxcocbGFBADS94b8/A+q2ZONiUEw4cTeghnKIPbuhMig+7paMenN70hPlPOQcdyS+envADWC6kll6K3Iw1U1+JmevxmwMGL3+x6A== 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-SenderADCheck; bh=tEooIxQsVuUANwgIkIYmeplQ2lRzL7cieaVs2vQI7qU=; b=CsChSC2SGJc5hj2Xt08LfiI6+mLnGa4VAJXWdmERhBnvG5RvrlVlJZb8if36RRNsgTrVCInsW4z3Ett3zMNQnZsTBhnfndwGejceAWwBAt2bWfnKeIGw33aEv2cFIvixIZzxm1gN4RuFllX4ebL1csXXMV5clzk70Mj9MC8ngWOKZhs3NM/8305NUKrmWLtF/ufV1wqyRDK6BfrGl50OUXATVOqX2iyRT4U4ISYoSsZiK3natYVGYUSkBMUbAZwL4maNhxlUcllc8L2bFA3JMkpyJlhYq9LZ3Is02j71kFpu8o/xF6RktXlP5802NYbSEfgSjIwPaQbXvr703kOSng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tEooIxQsVuUANwgIkIYmeplQ2lRzL7cieaVs2vQI7qU=; b=UuP+NE90HbbZjGFkcklx31RF6i9PMRnNMygppxc+JK+knm6y+oEaz5PjLOZz/jj12i8xPPlPiN40JaFYO5pcESDW2Dt5+YZsTg3rQ7Xjy8xOjdDg3IR+3Mwd8IjZFIPqj4RABy/PUZyM/V+XTkEAjjoM3RUHigct7s0p5TLYBWo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:06 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:06 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 05/24] imx: imx8m: add i.MX8MQ Dual and QuadLite support Date: Wed, 22 Apr 2020 21:52:16 +0800 Message-Id: <20200422135235.14756-5-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:04 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: adf3020a-9c81-41bb-1872-08d7e6c14519 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6aVF5bTjToM+NFCq0zvLpbEGohbLC4ZDjgqS9M4ZTgul9B6FWA17v/eCSTIhhqgctjRnzhO1+jta/eXCoxRgnA24yqE4rS06dFoR35kM+yyiwVRSGRmhAUApkMy6S960C7tXMwnl+3dEwLf609+Q5bx4uii5K86creJuw3lCUExL1TNrT8Gegg9c+2iim27NU9FRdDtnOANrUTAOHJLTb3StPTsqbtcCKqltgMtCijcAuULo6DzrBLg1c18+3HH4P4bmROTXyQ23VZDodf0EOWdEbUq6bY+xROQZaSp7o035+5IYMQqHyElK48nTry+q+vbwsG7ZGY0UUEpsbj1FXenRKhOz8pisw/bMPgvspzhk/OSQSi4Fng3C9kEOSydz02Qs/fMaabqHEzY6glQ8ob0xmNT4zCgWYrW4lKlIbZjLOU/mBIStszPfM2HAHJEPmxvdv93mwEB6UU4TDm6Fk84DLRKsIdmVU+dFkqi8Z1u7SInANex4X6U+DEaeijrB X-MS-Exchange-AntiSpam-MessageData: g5b7/LsaqJETCbDKS3e5qAfwv736WEDA/NxSDLPJUt6gQV60NjamW0+qzVAuqbeAZRmVPQcKJ5tVQ/hHLiO64Gg1r0RvW4TqsjkRQ0VWB2vB/9GLgLD4qlLKBjoQBZyLH/fL6fUMi0bRqWwsU1I/YQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: adf3020a-9c81-41bb-1872-08d7e6c14519 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:06.0952 (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: u798cTfAmC5eCdCVg9Y71cq/ur3hRVdULzWWC2A6EyuhRoEeJtIfQmBpDqeRSRpC2mqRQkogRXe6FhMJ70pxZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Add i.MX8MQ Dual and QuadLite variants. Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx/cpu.h | 2 ++ arch/arm/include/asm/mach-imx/sys_proto.h | 4 +++- arch/arm/mach-imx/cpu.c | 6 +++++- arch/arm/mach-imx/imx8m/soc.c | 10 +++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h index 5ade63665a..71f0715dd1 100644 --- a/arch/arm/include/asm/arch-imx/cpu.h +++ b/arch/arm/include/asm/arch-imx/cpu.h @@ -26,6 +26,8 @@ #define MXC_CPU_MX7S 0x71 /* dummy ID */ #define MXC_CPU_MX7D 0x72 #define MXC_CPU_IMX8MQ 0x82 +#define MXC_CPU_IMX8MD 0x83 /* dummy ID */ +#define MXC_CPU_IMX8MQL 0x84 /* dummy ID */ #define MXC_CPU_IMX8MM 0x85 /* dummy ID */ #define MXC_CPU_IMX8MML 0x86 /* dummy ID */ #define MXC_CPU_IMX8MMD 0x87 /* dummy ID */ diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 103dde4d36..59b145bab1 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -43,7 +43,9 @@ #define is_mx7ulp() (is_cpu_type(MXC_CPU_MX7ULP)) -#define is_imx8mq() (is_cpu_type(MXC_CPU_IMX8MQ)) +#define is_imx8mq() (is_cpu_type(MXC_CPU_IMX8MQ) || is_cpu_type(MXC_CPU_IMX8MD) || is_cpu_type(MXC_CPU_IMX8MQL)) +#define is_imx8md() (is_cpu_type(MXC_CPU_IMX8MD)) +#define is_imx8mql() (is_cpu_type(MXC_CPU_IMX8MQL)) #define is_imx8qm() (is_cpu_type(MXC_CPU_IMX8QM)) #define is_imx8mm() (is_cpu_type(MXC_CPU_IMX8MM) || is_cpu_type(MXC_CPU_IMX8MML) ||\ is_cpu_type(MXC_CPU_IMX8MMD) || is_cpu_type(MXC_CPU_IMX8MMDL) || \ diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 8217913b4a..e07ca5821a 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -109,7 +109,11 @@ const char *get_imx_type(u32 imxtype) case MXC_CPU_IMX8MMSL: return "8MMSL"; /* Single-core Lite version of the imx8mm */ case MXC_CPU_IMX8MQ: - return "8MQ"; /* Quad-core version of the imx8m */ + return "8MQ"; /* Quad-core version of the imx8mq */ + case MXC_CPU_IMX8MQL: + return "8MQLite"; /* Quad-core Lite version of the imx8mq */ + case MXC_CPU_IMX8MD: + return "8MD"; /* Dual-core version of the imx8mq */ case MXC_CPU_MX7S: return "7S"; /* Single-core version of the mx7 */ case MXC_CPU_MX7D: diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 7fcbd53f30..c449b8b1ec 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -165,7 +165,13 @@ static u32 get_cpu_variant_type(u32 type) u32 value = readl(&fuse->tester4); - if (type == MXC_CPU_IMX8MM) { + if (type == MXC_CPU_IMX8MQ) { + if ((value & 0x3) == 0x2) + return MXC_CPU_IMX8MD; + else if (value & 0x200000) + return MXC_CPU_IMX8MQL; + + } else if (type == MXC_CPU_IMX8MM) { switch (value & 0x3) { case 2: if (value & 0x1c0000) @@ -226,6 +232,8 @@ u32 get_cpu_rev(void) } } } + + type = get_cpu_variant_type(type); } return (type << 12) | reg; From patchwork Wed Apr 22 13:52:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275034 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=iWP1YjjU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hFL1zLjz9sSq for ; Wed, 22 Apr 2020 23:32:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7A8681C4A; Wed, 22 Apr 2020 15:31:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="iWP1YjjU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE49C81C78; Wed, 22 Apr 2020 15:30:35 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 4E9C881BED for ; Wed, 22 Apr 2020 15:30:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XNEInFiL8Q1PdGE1jH68GHI578iEk03dtSPsf/mn91bZu+TNICH1+/oovDe2gsU0AFgJYQ5fk+GuFau/WnOGI107m3gDXuKyH2Xk1Zkpit2ArtS+J1llKz9oQKL+kTsaNqr59EG6sK4+0Pyq0zjb7d/lOQwrKyTOqOX5R0UGTEa3YAXC1ut6CjjVuCO0rYFIrO/cX19yvJRDD5ECatT0km6AOuaYFbqFn/I1wBff9GCLkIRSmISb0b5VAkvYM4tgB4SWkC1cAMziGZpSzf8WRrZLRQRXgYEBvzK2ESznjyujhs55YOs1RMkKYBW5npgfnBzybZA3/hNesLHziV06Pw== 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-SenderADCheck; bh=7gcWxKXyJwS53YAOQmn1nnL8rphma3IFZcHZWI+R2R8=; b=h/rlGjbjb37kWn29cbTKMTVIiGHnuxto9ZCZRYrKN7g/n9Ke517shtRTJFcexEzsHZaA+4mKbI412jdF+UPfXOpSk1ewN9azajRwcn2nyCoSUvrlxELjhd4OGvfDOF/azQWnZXVAxG/BBEkgEJeBE5mtS28cLqaiOJDvAemzglGgSPL+WwR9U8meFl6fNBA+KVcajDjctjLgiIXG+/RGttLFJCR258Mi9mYikETTWOjX0Ocvks3/UctBwCB+uue8yfi9yKDm+5B70YQNhNjKCTEXLHmod2dQ9koMxAtA5t5u3EmaLi3TUah90oZf8Z8ylPw8x8oKKXsYVBQCMfZKfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7gcWxKXyJwS53YAOQmn1nnL8rphma3IFZcHZWI+R2R8=; b=iWP1YjjUx1Z0FW2i/1VVL2J/fps7j2GhlIGIaShEOOPHnib83jACJTSB2Ep+vmc+upz9oATg+/UJa6XJScAOO40QMCEi72fDi0Fq6u0GD3eevGh8iPpC5z0+gi1lgfkmfu0woMs1ij5flwIuVVVy/O2+IQ88T5XoQyeMnJGEbtc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:08 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:08 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 06/24] imx: imx8m: add i.MX8MN variants support Date: Wed, 22 Apr 2020 21:52:17 +0800 Message-Id: <20200422135235.14756-6-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:06 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7f17192a-696c-4c50-de84-08d7e6c1462a X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xBa7O9r/8v1s1bJnT4/nTCdIeEyBl0xnW5SgS8OcErl8ivRJr2IuJyC55pt0VvH8oZU0IrrcmPHCYP0XHsUnX0dBo+N94y6ne+wt0SKEAIDo+k3AGMS5IT7EnkwL9PUjNhPFBLHu+ksT1n6otMwjVPA0/ZSh4NdjZoqCzH9bwMACv/MhiWBpmncHT07J+5Y72mXAh7r0qxgCA0UxPsz3EKOK4ygePqeuqoZPyvmz7lwfPasv42Qtv1Zpir9FQ1LiMbsi4RfUzo+Y0ElAN0ygts8E5u/YpPClp/5UG6xKFEPPrTrweQrx1s7L1ysLTVW2/e3fKUt/eLbiAefqHvhQGrb+u80fdEnzGmLaCx0z8GD4McOLEBSCPLHnUFVuMOUHMYwzWfn6XjrJj0GNIGumTsdD4G5wbFkPE6KI7m3XQSQ0sV9/lGOcwY7hfSl8thVHYdEO9gw5ey2Sg1Eh1C6ZiluJMAB1GoP6ExUW4nP+ZbFuBgQsuX0v/QUsXFe6nDqN X-MS-Exchange-AntiSpam-MessageData: t+dvbrkDYztgQcwS3AakwISS+aYeyiFVbK5rfWUKRyidJ2fzEjGWQu2hG1kNvmBY6P3nuaanpn8crgWFxmHqMx9xYJQWERcyjKyhkkD2pHs1uwcr5QsJPyQLmdwQlT0/Uwu3Gypzt9p/tLIy0Z8EjA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f17192a-696c-4c50-de84-08d7e6c1462a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:07.9024 (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: 6MpeuT0F226YACOU5kQVHfvk+IiPjKL0UZ0/eK9vrLSBx5mwHjGf+PnNx0GQ+ESz+zm9nsmyPccYtM8svFXBOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Add i.MX8MN variants support Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx/cpu.h | 5 +++++ arch/arm/include/asm/mach-imx/sys_proto.h | 9 ++++++++- arch/arm/mach-imx/cpu.c | 12 +++++++++++- arch/arm/mach-imx/imx8m/soc.c | 19 ++++++++++++++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h index 71f0715dd1..b52565473d 100644 --- a/arch/arm/include/asm/arch-imx/cpu.h +++ b/arch/arm/include/asm/arch-imx/cpu.h @@ -35,6 +35,11 @@ #define MXC_CPU_IMX8MMS 0x89 /* dummy ID */ #define MXC_CPU_IMX8MMSL 0x8a /* dummy ID */ #define MXC_CPU_IMX8MN 0x8b /* dummy ID */ +#define MXC_CPU_IMX8MND 0x8c /* dummy ID */ +#define MXC_CPU_IMX8MNS 0x8d /* dummy ID */ +#define MXC_CPU_IMX8MNL 0x8e /* dummy ID */ +#define MXC_CPU_IMX8MNDL 0x8f /* dummy ID */ +#define MXC_CPU_IMX8MNSL 0x181 /* dummy ID */ #define MXC_CPU_IMX8MP 0x182/* dummy ID */ #define MXC_CPU_IMX8QXP_A0 0x90 /* dummy ID */ #define MXC_CPU_IMX8QM 0x91 /* dummy ID */ diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 59b145bab1..a02cd40c7d 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -55,7 +55,14 @@ #define is_imx8mmdl() (is_cpu_type(MXC_CPU_IMX8MMDL)) #define is_imx8mms() (is_cpu_type(MXC_CPU_IMX8MMS)) #define is_imx8mmsl() (is_cpu_type(MXC_CPU_IMX8MMSL)) -#define is_imx8mn() (is_cpu_type(MXC_CPU_IMX8MN)) +#define is_imx8mn() (is_cpu_type(MXC_CPU_IMX8MN) || is_cpu_type(MXC_CPU_IMX8MND) || \ + is_cpu_type(MXC_CPU_IMX8MNS) || is_cpu_type(MXC_CPU_IMX8MNL) || \ + is_cpu_type(MXC_CPU_IMX8MNDL) || is_cpu_type(MXC_CPU_IMX8MNSL)) +#define is_imx8mnd() (is_cpu_type(MXC_CPU_IMX8MND)) +#define is_imx8mns() (is_cpu_type(MXC_CPU_IMX8MNS)) +#define is_imx8mnl() (is_cpu_type(MXC_CPU_IMX8MNL)) +#define is_imx8mndl() (is_cpu_type(MXC_CPU_IMX8MNDL)) +#define is_imx8mnsl() (is_cpu_type(MXC_CPU_IMX8MNSL)) #define is_imx8mp() (is_cpu_type(MXC_CPU_IMX8MP)) #define is_imx8qxp() (is_cpu_type(MXC_CPU_IMX8QXP)) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index e07ca5821a..e83f6934cd 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -95,7 +95,17 @@ const char *get_imx_type(u32 imxtype) case MXC_CPU_IMX8MP: return "8MP"; /* Quad-core version of the imx8mp */ case MXC_CPU_IMX8MN: - return "8MNano";/* Quad-core version of the imx8mn */ + return "8MNano Quad"; /* Quad-core version */ + case MXC_CPU_IMX8MND: + return "8MNano Dual"; /* Dual-core version */ + case MXC_CPU_IMX8MNS: + return "8MNano Solo"; /* Single-core version */ + case MXC_CPU_IMX8MNL: + return "8MNano QuadLite"; /* Quad-core Lite version */ + case MXC_CPU_IMX8MNDL: + return "8MNano DualLite"; /* Dual-core Lite version */ + case MXC_CPU_IMX8MNSL: + return "8MNano SoloLite"; /* Single-core Lite version */ case MXC_CPU_IMX8MM: return "8MMQ"; /* Quad-core version of the imx8mm */ case MXC_CPU_IMX8MML: diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index c449b8b1ec..871179509c 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -188,6 +188,23 @@ static u32 get_cpu_variant_type(u32 type) return MXC_CPU_IMX8MML; break; } + } else if (type == MXC_CPU_IMX8MN) { + switch (value & 0x3) { + case 2: + if (value & 0x1000000) + return MXC_CPU_IMX8MNDL; + else + return MXC_CPU_IMX8MND; + case 3: + if (value & 0x1000000) + return MXC_CPU_IMX8MNSL; + else + return MXC_CPU_IMX8MNS; + default: + if (value & 0x1000000) + return MXC_CPU_IMX8MNL; + break; + } } return type; @@ -208,7 +225,7 @@ u32 get_cpu_rev(void) return (MXC_CPU_IMX8MP << 12) | reg; } else if (major_low == 0x42) { /* iMX8MN */ - return (MXC_CPU_IMX8MN << 12) | reg; + type = get_cpu_variant_type(MXC_CPU_IMX8MN); } else if (major_low == 0x41) { type = get_cpu_variant_type(MXC_CPU_IMX8MM); } else { From patchwork Wed Apr 22 13:52:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275035 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Li56LyJj; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hFr0plFz9sSd for ; Wed, 22 Apr 2020 23:32:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9541581C73; Wed, 22 Apr 2020 15:31:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="Li56LyJj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 518ED81C61; Wed, 22 Apr 2020 15:30:32 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 7946781737 for ; Wed, 22 Apr 2020 15:30:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KHA0Ot4WSYl/E7EImyiegxxjEUYLpwNFHn5Zwaw8hudgNyv8b9KQDA5JbnLqhAk/Z80x15+uQlZadAQUEEcMRq7ovT91rck+Atv2G/d4PfNJp9WhNlRlzdWQ8T4/pkVJgYmbV/c1mkJBPNB7pjzRXkmpnyYEc3Fx6AXw84RJvusU198dzej1NygaXkrjcwBqp0kqjXqGMv3DTYihuhT2oHpK5QfVAKqluUrnMRVWCxF1yl7VC70tumyjnwgfJA2aulRCHbT94JYnpJ8AXgUr8DsOv/Wok4ms5eeH1BIewLbJ5QVJCGh+IEWOqEtcuUZeQgtrcdAbpWAYtbHNYIfyfw== 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-SenderADCheck; bh=bEmvI6GiydUb6ZJLigAYnRhgLE0GoySb9T4FwoccEzE=; b=SYDKUu1HKbUj0L6PaKbF91kI9+IoGZkHQwLmAurnYkq15iz7XS97cVY3RJ+PektOlVI6JFQSddmgcMTl0Ln7WLJ7HGyc1+ZZ+Ur4LGaCpeefaHyxWA124wgWA11lVu/KC5pYG2HswWh7YPLFiIhLc15vuSjqrDT8mF8tdN1dB2Nzs2GGdu/eCmZXzOICVynh3dFfe3Qv9yz6Bs2cTduAoRxo3rrt66NVIL8Y1N43xKs7jXyB62B2LX3nydbA/Q2B1velGZpaXYnUDxxCuHj6EsiK1gN6mgDjmk8NLOaFoXnpHspjvZfrXezOXtHelfRdo9HukGTOUK8Hlx+kM+59lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bEmvI6GiydUb6ZJLigAYnRhgLE0GoySb9T4FwoccEzE=; b=Li56LyJjCn5jO+oQYS1/kmQm/XbPprIJTRgr1Ik3KVBVcAMuwhyGl7zmBTSJkTeLRTYbDErnIYrztGqsj+67peAEfNMB65s50tX3XAtF7lZycR1YFc+sh1kxPb+Y10E9RmWYdOQVCVmb6byTRWGNuArgNaK1ls/CO3Ssvuqq2A8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:09 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:09 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 07/24] imx: update is_imx6ull to include i.MX6ULZ Date: Wed, 22 Apr 2020 21:52:18 +0800 Message-Id: <20200422135235.14756-7-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:08 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 722578fb-8e5d-497f-48ec-08d7e6c1474b X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(15650500001)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(4744005)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Aj0iILdaB3E5tG8DlJRQ49uaMV9gvAO6QSnfjR+Ki9bkRlE2W1xa7J2UO+PNQaD425puiBbDNpBwnLlS/L1X5ysxnSiiO6jAR/oyv/g51pbmD1Bxo++WTODdU7di9VzXGOkS0Wz9bDGbuHcH5kAsC6ztn62wrB1wTPX2VIBw/j8tn+B6GJAidLhWBiwy1t5mgL04Xdt46Yw2gwlxA5WBf1e5cW6VAXNo0cp5hrpTPFytma6qiXFKjYIy2GyWhuqtHUSR3EWQzoTTxgzgb1XJBsWlRf7eeFHTV1siXAtiGT72Hq4Njf2H3BV4mgIQb/5BcO40/TPrfntJNpRS+r8BEzcdGRibbpmVa4GXQ6feDPVGzugpdsD9uYoTf3vnzhy/iSrWDESrdIVTegJUypI3XAicCwuGficW544uUotG7/9qq0wX50qcJomYYVHvsTW X-MS-Exchange-AntiSpam-MessageData: cGiiu0G1SAvVxqbhJDrIiljO+maK9kxniZXr4yOo+4+J5k+EdyDz6gRp5PKnKFF+FMqHQB3GKC7SJCB+CpDhBO/LjRE5Mz7/JCJJL1RfTAQK49QUyiIXBCVG8yrDuS47AxXswrHE0PtKadq5KjDsVA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 722578fb-8e5d-497f-48ec-08d7e6c1474b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:09.8875 (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: GTZA90Rsiedo0Gpy9E1A/x+nhbQtsCl1ba8YVd7/t5vy7ESrh0iLyp6iagejvoeZ+PwINjk/myUdpUPkoNi8Yg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update is_imx6ull helper to include i.MX6ULZ SoC. i.MX6ULZ could share same macro, then we no need to add is_imx6ulz in various drivers. Signed-off-by: Peng Fan --- arch/arm/include/asm/mach-imx/sys_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index a02cd40c7d..2a997f280d 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -37,7 +37,7 @@ #define is_mx6sl() (is_cpu_type(MXC_CPU_MX6SL)) #define is_mx6solo() (is_cpu_type(MXC_CPU_MX6SOLO)) #define is_mx6ul() (is_cpu_type(MXC_CPU_MX6UL)) -#define is_mx6ull() (is_cpu_type(MXC_CPU_MX6ULL)) +#define is_mx6ull() (is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6ULZ)) #define is_mx6ulz() (is_cpu_type(MXC_CPU_MX6ULZ)) #define is_mx6sll() (is_cpu_type(MXC_CPU_MX6SLL)) From patchwork Wed Apr 22 13:52:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275051 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=QaJAVpKB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hKT0xY9z9sT3 for ; Wed, 22 Apr 2020 23:36:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5962E81A66; Wed, 22 Apr 2020 15:33:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="QaJAVpKB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 334EA81C84; Wed, 22 Apr 2020 15:31:02 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0606.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::606]) (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 288F681C4C for ; Wed, 22 Apr 2020 15:30:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BOnBvf8+hWg41wupmDjCex9e+nHFfrnCugrWWdLBZcgpYYxQxf8QfH0+E+EEyZTzj+hQUO+bDKpPFNpws3NEH7ZeGvfBcWSnfjwGeAu6d7725wH7VSaLFUZb+MeiE+3E1IYZMrToJ09gSCPtzeD/fnuZ7AoS0WfxJLyWRLx2pGuZK9dRyoXvP4owG6eyw+oZNdTBubv0Dch9K7TGFzws9YQgzXPofGWJgyWAd61l10gk8d6AyvWnzGdY3IGAK5KNXTwWkJ347gTDARhM08JIwwD1hlAmsrFulSVloP9hAXQ1sOWIIUd82ASl/mSLmmJxYs+5nEI+YiQTIq1WwhhFJg== 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-SenderADCheck; bh=FU8EL6+ECx70Bk5R3E+BZEtorz0T1Dz+/+bRGptggu4=; b=dKRr1tYNpyIp9f3dadpcr0EEaWT4Myoot4WVkipeKp9flTwNhvtBTHL8myCI2UEpb/qI5w4hWoKHYWFNCFAQyllFe7HCSG42ZE9dvCtr8JiG3dg5xIbiBrQs1z0odXXkrD4PkAaqU6vVsOeL6HroC4uPcTRNmcSk5NMAhJFfQlhrJ885pZG19c77ogdwqqvb3ei6O5U0azR+i/a2Ovx85lmgSgLDbmC9X3cKgTKFqOz9ig7XyczZov08MUKaQNjT8Fc0bSMKopqyHf+Rf1fHxmAY4KVZsLxlcYMX1AGBUnUHn6aDkpVH1PH55kV7ZyHoy2M/YzxU29Zoo9iP71U29w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FU8EL6+ECx70Bk5R3E+BZEtorz0T1Dz+/+bRGptggu4=; b=QaJAVpKBtDCe+a7BAYwVL5RZjRgZfSR3M6xpFMzmx5RMEkTQGtZQysa2jxdqQBIrXOv8svmlER8i3SUpBB04yKJ4foUQiDR06TC7zgaClLYCsBKqXPNtNS+QOl8Qu7NSg5ZpYRDnL4pLLHGOWHnsLwd6RIY0A0qIQCm/1s21+tc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:11 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:11 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 08/24] imx8: move SIP macro to common header Date: Wed, 22 Apr 2020 21:52:19 +0800 Message-Id: <20200422135235.14756-8-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:10 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 670905bc-897b-482f-2408-08d7e6c1486e X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:51; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(44832011)(26005)(2906002)(8936002)(86362001)(6506007); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DpNQmZ44p0FDhJY5mQa0rN7EMHS1chZuJZmpu9DapkpWRqePdxV0oI/qnHMLdpsRJYytcQVsmwBCH7oEzwoJIWvpFHLfGhcjjSZqgP1WJ5O4tPICQfcTlkp85nxbhxq+A+arKpCkSnMz42oMg3z9FHksP88WZoUGVRFg/vwkEFJkr4X22m6SRHSZsmtDwfCCMaO3uyQxc5QziIIskWP8ncfLip3VxI+tahVX7Wk+kl99xZGiOkdHqYtlLXaiOns1l1Qz8RNl/roTaGfLpM9eIT7UQY1pzFUIHczlXpHdq5A7QQo9AMd9SZ3R/hZxaCj2qooH+BK/Vi1wvpQ6pwO9gOgUl8wOUlK16K4Fx75/wLAKep/Tx0aF7xIZMKF73jhP9Wl/xP5Pzatx6c8PZX8fw9Mk6F5roNe/ikU9MHbjQMCuqL9LJ6bdmGVzBX6k/ass X-MS-Exchange-AntiSpam-MessageData: McGobAyducMKOmH+xSkObNJIAzEZyDn4OXb+1qrVMk6flRIEXmGYAL4tEZfItqdQtji9wBycGprUv9BThtOoWP8z3e0wC6+sjw4APb9m8O+qKIniB3sFs5dQjFZi6qXxoyesbdnTcg7aAW4Ut875ng== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 670905bc-897b-482f-2408-08d7e6c1486e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:11.7047 (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: wRA8F+IZAl0zuuyidWOQlKAOtoVtyAXQsyEOOSkGpdXxnd/jsM5nz+Z50FvstP2vhg/G12jkw3WO/vVqN3cUmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Move the SIP macro to common header and unify the name to make others could reuse them. Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8/misc.c | 8 +++----- include/imx_sip.h | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-imx/imx8/misc.c b/arch/arm/mach-imx/imx8/misc.c index 00fe4670bb..76d6571d8b 100644 --- a/arch/arm/mach-imx/imx8/misc.c +++ b/arch/arm/mach-imx/imx8/misc.c @@ -2,6 +2,7 @@ #include #include #include +#include int sc_pm_setup_uart(sc_rsrc_t uart_rsrc, sc_pm_clock_rate_t clk_rate) { @@ -26,9 +27,6 @@ int sc_pm_setup_uart(sc_rsrc_t uart_rsrc, sc_pm_clock_rate_t clk_rate) return 0; } -#define FSL_SIP_BUILDINFO 0xC2000003 -#define FSL_SIP_BUILDINFO_GET_COMMITHASH 0x00 - void build_info(void) { u32 seco_build = 0, seco_commit = 0; @@ -51,8 +49,8 @@ void build_info(void) } /* Get ARM Trusted Firmware commit id */ - atf_commit = call_imx_sip(FSL_SIP_BUILDINFO, - FSL_SIP_BUILDINFO_GET_COMMITHASH, 0, 0, 0); + atf_commit = call_imx_sip(IMX_SIP_BUILDINFO, + IMX_SIP_BUILDINFO_GET_COMMITHASH, 0, 0, 0); if (atf_commit == 0xffffffff) { debug("ATF does not support build info\n"); atf_commit = 0x30; /* Display 0 */ diff --git a/include/imx_sip.h b/include/imx_sip.h index 139ff61b8a..26dbe0421a 100644 --- a/include/imx_sip.h +++ b/include/imx_sip.h @@ -7,7 +7,10 @@ #define _IMX_SIP_H_ #define IMX_SIP_GPC 0xC2000000 -#define IMX_SIP_GPC_PM_DOMAIN 0x03 +#define IMX_SIP_GPC_PM_DOMAIN 0x03 + +#define IMX_SIP_BUILDINFO 0xC2000003 +#define IMX_SIP_BUILDINFO_GET_COMMITHASH 0x00 #define IMX_SIP_SRC 0xC2000005 #define IMX_SIP_SRC_M4_START 0x00 From patchwork Wed Apr 22 13:52:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275033 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=q8IEeOmm; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hF04JwKz9sSd for ; Wed, 22 Apr 2020 23:32:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EFA18006D; Wed, 22 Apr 2020 15:31:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="q8IEeOmm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AAA4981C62; Wed, 22 Apr 2020 15:30:32 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 CBE5481A26 for ; Wed, 22 Apr 2020 15:30:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbtBsi1w0u9aLJcthdF9/Kd621M6OuW3FrsiS2ge+iIJMuVavTpTlYK1ogEj2tgqT7Aw2Tb/UJLhJXv+36xG4TURQJWxPEmfJ6THFCMyggra/b7zoYmOeHCsCbhSluY4eCVBlVzSIuuku6qLbXcFPJ6a6X3gKiTBLYqQcxLgDlHKZtpyDMPHPB8QgtoYVV8+btiQmhxj/uDL3HplhMuRsU/MzL6Fs7XywjVHP4Bbs+HCCDpBPhvtLBqlrECTd9V5aZhMHy9GjoQ+PdAQQrbfXAYYGPvNVMZHPWgfLFQ7sTg1SQ26hUSO9coeSGphaIA9eSG2c4g1mucB0JGNOFtyCw== 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-SenderADCheck; bh=cGwi/S6gZLraeWvk9tjyUsdVdSqh0uD4slK0600Y5Ww=; b=Y+2NvTlZEa1h1AWwF90rbCA+wh30zTbCfm0UfxYF+gqBt89uXoDYxA8mDI4+xQtmnkyZiMXh7taUzEZgRWrRgurH6vXfxQnEnaRp8zlno6dn+VRDApfeH16lTSeoh2tuzmp6Bwa9uwI6g/olFSUHfFX1ds2zn+8PJTQo/7MBpyqMP/AIncDn2D898APo7OokQIouTkE60mnGvyMxEMNuhCylyrzDAIAwpd50cfBNDkymRnnGZEThj2juN64V/4ZmmgwWxbC1iP4R74LNt3MGblE+OSYOSCKpe3f6q1PdhvK3/V7+19fJ9dlB5MAKCVfqdINTUXrn03+B1qWxFEE66w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cGwi/S6gZLraeWvk9tjyUsdVdSqh0uD4slK0600Y5Ww=; b=q8IEeOmmQSwoaPFJ2WQHKKSyK6Olg4hMXlF301fL7JHlb7XDpXZ+j0QbIpQElI/I817JsDqolDKqCMC0WoQmS475GiSSnXFK+v2lCcnkeweZXEvu2TDB9GwkZ9jhxCWhLrfudRoXwi2TGbIlMHotE3rFj6UeNH+02n1KtGb8Qe0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:13 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:13 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 09/24] imx8m: acquire ATF commit hash Date: Wed, 22 Apr 2020 21:52:20 +0800 Message-Id: <20200422135235.14756-9-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:12 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 68c516d6-7793-4439-f6f6-08d7e6c14982 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(4744005)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9W0kI3+yyHAf3LIKaRx0r9yjmI09qg5DlCnPhg/Bli2qkCOGX05RR1HrPgzBN2ndbpi3sjRNy9e4Q0wKhb5oD+6uEDUsnT4aqmSFdYxiJqkqjdNuCBYlVtvoVYK107A1bMqIsGc5+KdzHwyIbaO9sDFutmXlHwufWQLh4JDOQPlThF8MCUEajho8tT+SZpVLtb9JeNEBZPPM5X7D7hrhyqOdzwnSKaKeF2GRQOSITFP6v6EiUAppbraLMzExDe84jrTucLCGpRrxLZ4heEnnib/pznb0teWtyR6JMHbb+fhZ0IDlzFpfA+zfNj8G43gWRF29otKhXsptfhcQt2ITmvTBGigd9SgyzoJPSyynfgW8Fi1bWBBRrZXMERdiYlVL7mwqauEQHpKrIEFdP/aibHXKUAkkxfg73hhlGCpph2L7fdvJ7lX5fn5SHYijUXZaKHtFrE//t2QCxDzFI5NIli1PYy4fJSm9AB6Mmno8JF0xDI4RNH7j75nNkyUgOBF7 X-MS-Exchange-AntiSpam-MessageData: Ib9oeyaAQg2Hx2N4UPqYRPDMZkz8/Cz2DZ9auGXqPtBHvdGJqcG7C8hu2Y8MaZTmeGJBRZvodCJ+2F+DgPSPxP8qEBKfhhn/tMTpa75I9oDj9/LbQfGOyZUtknd5rn1tnTeG2NEXmb9RkYQT+RDmpA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68c516d6-7793-4439-f6f6-08d7e6c14982 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:13.5939 (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: /24K1O92LW3J8KntVkJvrDKcllUpMyn14zu+nduOE4kgYxDE2k7GQkbaiwQzoTQ1QZM/STD0YbpEIWSoAR+NJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Acquire ATF commit hash when booting U-Boot to make user easy to know the ATF version. Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8m/soc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 871179509c..8b6be7bc19 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -425,3 +425,27 @@ void reset_cpu(ulong addr) } } #endif + +#if defined(CONFIG_ARCH_MISC_INIT) +static void acquire_buildinfo(void) +{ + u64 atf_commit = 0; + + /* Get ARM Trusted Firmware commit id */ + atf_commit = call_imx_sip(IMX_SIP_BUILDINFO, + IMX_SIP_BUILDINFO_GET_COMMITHASH, 0, 0, 0); + if (atf_commit == 0xffffffff) { + debug("ATF does not support build info\n"); + atf_commit = 0x30; /* Display 0, 0 ascii is 0x30 */ + } + + printf("\n BuildInfo:\n - ATF %s\n\n", (char *)&atf_commit); +} + +int arch_misc_init(void) +{ + acquire_buildinfo(); + + return 0; +} +#endif From patchwork Wed Apr 22 13:52:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275044 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=j/zeFLCU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hHg584Rz9sSm for ; Wed, 22 Apr 2020 23:34:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8412581CA0; Wed, 22 Apr 2020 15:32:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="j/zeFLCU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C7B781C5A; Wed, 22 Apr 2020 15:30:53 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,UPPERCASE_75_100,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 39ED181A42 for ; Wed, 22 Apr 2020 15:30:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzpVces0FxpFHjTVh/T+aoOX5AvR9hrfhZ0JT2yJIMcURPwMJJ6xBhGVlhimnmJSTjZIbTHrV9mp9S8UFeKl4lo+xOQBhBkwQXUqExF6Mx2VdKm0uuebcBdHjNzdHYucpQRnd8rNJzjmS6sYmn0TotMQInm3RRisC4hvYOztVJJQhH6dhuzP4cdLzeW4sorbeJdlMq99f1Pe7WulI2jg6Ci84aH++YZLyhpjbv823sCXivDOsS3qe+z4IBQjLL8pLH/9Eq7kyaLyQ4g4YLCXSHE8qQnWmB+cD28PTw0S68fP1hD7Gq2y+qLZ7TCB7+UQ/qxorz+x9qj9SwZ9jP+OkA== 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-SenderADCheck; bh=BAjL2RmFDtyiS06VQMh4ZttzXRNGsfF+Tq6RaUN2G2s=; b=L0nzX0KR3ccxT1SJGbUoP4leAyJtXmsjt5iwKYFXdnpc/nxSIPCX2abb6jXd1VYOWtJ61qHDnTmQ9yYkx5vM/SiJTelQueP2JWcu++jm/QztHllwzTN9MMh4lGT/CaYtHQBrxjbDSrzqWcnY1Qvsd2msUSQ60IBbQJt6DxKlcGDl8xQl4VP+vMdDIcazcjWXflhPnDSKOq4qRchHP5eIG50HqMK3i0Ig+SXLAWCG3v/ZPPDsVqPiY/3XKlkaHmEEGytUIaPZWT2TAw3REUOoyiXq8tDij3MqoPYMpCjRqTS+5o0xXznjN5PALJwHPCDil3AkdxReE0wET6gNZ0N8FQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BAjL2RmFDtyiS06VQMh4ZttzXRNGsfF+Tq6RaUN2G2s=; b=j/zeFLCUvMEtRwWv1pP56EepwpwhUyHSR03kmk/7IdzBFhWEARBeUYyS1eu+HuJ6bP83+RgTyxCms4f0xRm24iYoZvYjaLAI7nUgD+GwRnUmCtrr6Dvy98ahssqCeB3M3CwJ0okkbcGVwZrQ1jZJkUkKrsT4RUGR83MGgA6mjAA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:15 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:15 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 10/24] imx8m: update clock root and fix core_sel Date: Wed, 22 Apr 2020 21:52:21 +0800 Message-Id: <20200422135235.14756-10-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:13 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 52da44e8-a565-4e28-4ba4-08d7e6c14aa4 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(15650500001)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(30864003)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /DSLjb3Gv9CEPuIiz2ejIS/kHkTsJGX0wGaBTrNVDqSyB90HmWdLEptJ7w6tlk1b+UcfOkU0YCglLCQcgNHtGiY41kPD7HVP3x63IO8P0/AjWDSNnhVTgnS5PFbrXjR0J6ePO2J07VMAgrvolJ/A0KC4WnKpv1lqkgMmgU4u3LzCUekRHx6QiE5jWNU9CFipJBlhpas1i+fFpl78QAro95th5dR1Oz0Z8kO37acm4DKrLrTWzbVXvUh8p+84kLC2TCQ6X9D9W8fAcVnu9CRFp5oUV5F5E+f9lH8wS4xyi36uVi0GEy+BJGZHtmHmVhWvo9hu2ch+SII4UFCOft1sLev8f92IgRRx2jwQOxPEfQfDsLP3W0D59G3K29e7lXeGGNnI7ywcYDVINI5GREtX38N5yfFs14PqoBOyCpjbs2Y5NK9faNsSWtppmQ/w9AyLiylducDOs1glbmOWiI7D70AZJ9Mzon/Zn4LP1z8ZRI+XpvTdo0Eep29VHSOQsR8j X-MS-Exchange-AntiSpam-MessageData: xGCYHCecx5x5ikEJ+tk0dd8Zni2S3qfzPYsfvUNnsKKBvGpe0FGVb5UAe8E+2/KuJNOtlmUHp/SjuQ3nE5wZJMw1KjYUh+WUiy06+smrjC7i45kx9XqwZ5pHC649VauChnXBZ4IKISr+2PKfn9WFGg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52da44e8-a565-4e28-4ba4-08d7e6c14aa4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:15.5890 (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: rfUOD+AhVM0E9ra64k1aAodLUE3Oh1TQBSdIMoaCqJbv0ijqKm79glBQWUiyRlkWvd/NCZPyOWHBxKnryANgig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update clock root table to let it be easy to configure clock at very early stage. Also the core_sel mux parent should be A53 CLK root and ARM PLL. Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8m/clock_imx8mm.h | 3 +- arch/arm/mach-imx/imx8m/clock_slice.c | 824 ++++++++++++++++++++++++- 2 files changed, 809 insertions(+), 18 deletions(-) diff --git a/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h b/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h index debed6bac7..84ed61d21e 100644 --- a/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h +++ b/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h @@ -363,7 +363,8 @@ enum clk_root_src { EXT_CLK_2, EXT_CLK_3, EXT_CLK_4, - OSC_HDMI_CLK + OSC_HDMI_CLK, + ARM_A53_ALT_CLK, }; enum clk_ccgr_index { diff --git a/arch/arm/mach-imx/imx8m/clock_slice.c b/arch/arm/mach-imx/imx8m/clock_slice.c index 8b7a4dad65..b5ed27a923 100644 --- a/arch/arm/mach-imx/imx8m/clock_slice.c +++ b/arch/arm/mach-imx/imx8m/clock_slice.c @@ -472,33 +472,545 @@ static struct clk_root_map root_array[] = { {DRAM_PLL1_CLK} }, {CORE_SEL_CFG, CORE_SEL_CLOCK_SLICE, 0, + {ARM_A53_ALT_CLK, ARM_PLL_CLK} + }, +}; +#elif defined(CONFIG_IMX8MM) +static struct clk_root_map root_array[] = { + {ARM_A53_CLK_ROOT, CORE_CLOCK_SLICE, 0, + {OSC_24M_CLK, ARM_PLL_CLK, SYSTEM_PLL2_500M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL1_400M_CLK, AUDIO_PLL1_CLK, SYSTEM_PLL3_CLK} + }, + {ARM_M4_CLK_ROOT, CORE_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_250M_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, SYSTEM_PLL3_CLK} + }, + {VPU_A53_CLK_ROOT, CORE_CLOCK_SLICE, 2, + {OSC_24M_CLK, ARM_PLL_CLK, SYSTEM_PLL2_500M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL1_400M_CLK, AUDIO_PLL1_CLK, VPU_PLL_CLK} + }, + {GPU3D_CLK_ROOT, CORE_CLOCK_SLICE, 3, + {OSC_24M_CLK, GPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {GPU2D_CLK_ROOT, CORE_CLOCK_SLICE, 4, + {OSC_24M_CLK, GPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {MAIN_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 0, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_250M_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, SYSTEM_PLL1_100M_CLK} + }, + {ENET_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_250M_CLK, SYSTEM_PLL2_200M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, SYSTEM_PLL3_CLK} + }, + {NAND_USDHC_BUS_CLK_ROOT, BUS_CLOCK_SLICE, 2, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_133M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL1_CLK} + }, + {VPU_BUS_CLK_ROOT, BUS_CLOCK_SLICE, 3, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, VPU_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_100M_CLK} + }, + {DISPLAY_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 4, + {OSC_24M_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, AUDIO_PLL2_CLK, + EXT_CLK_1, EXT_CLK_4} + }, + {DISPLAY_APB_CLK_ROOT, BUS_CLOCK_SLICE, 5, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, AUDIO_PLL2_CLK, + EXT_CLK_1, EXT_CLK_3} + }, + {DISPLAY_RTRM_CLK_ROOT, BUS_CLOCK_SLICE, 6, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL2_1000M_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + EXT_CLK_2, EXT_CLK_3} + }, + {USB_BUS_CLK_ROOT, BUS_CLOCK_SLICE, 7, + {OSC_24M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_200M_CLK, + EXT_CLK_2, EXT_CLK_4, AUDIO_PLL2_CLK} + }, + {GPU_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 8, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, GPU_PLL_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {GPU_AHB_CLK_ROOT, BUS_CLOCK_SLICE, 9, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, GPU_PLL_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {NOC_CLK_ROOT, BUS_CLOCK_SLICE, 10, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL2_500M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {NOC_APB_CLK_ROOT, BUS_CLOCK_SLICE, 11, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL1_800M_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} + }, + {AHB_CLK_ROOT, AHB_CLOCK_SLICE, 0, + {OSC_24M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL1_400M_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} + }, + {AUDIO_AHB_CLK_ROOT, AHB_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL2_166M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} + }, + {MIPI_DSI_ESC_RX_CLK_ROOT, AHB_CLOCK_SLICE, 2, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_80M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {DRAM_ALT_CLK_ROOT, IP_CLOCK_SLICE, 0, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL1_100M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, SYSTEM_PLL1_266M_CLK} + }, + {DRAM_APB_CLK_ROOT, IP_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {VPU_G1_CLK_ROOT, IP_CLOCK_SLICE, 2, + {OSC_24M_CLK, VPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_100M_CLK, + SYSTEM_PLL2_125M_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK} + }, + {VPU_G2_CLK_ROOT, IP_CLOCK_SLICE, 3, + {OSC_24M_CLK, VPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_100M_CLK, + SYSTEM_PLL2_125M_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK} + }, + {DISPLAY_DTRC_CLK_ROOT, IP_CLOCK_SLICE, 4, + {OSC_24M_CLK, VIDEO_PLL2_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_160M_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK} + }, + {DISPLAY_DC8000_CLK_ROOT, IP_CLOCK_SLICE, 5, + {OSC_24M_CLK, VIDEO_PLL2_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_160M_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK} + }, + {PCIE_CTRL_CLK_ROOT, IP_CLOCK_SLICE, 6, + {OSC_24M_CLK, SYSTEM_PLL2_250M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL3_CLK} + }, + {PCIE_PHY_CLK_ROOT, IP_CLOCK_SLICE, 7, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_500M_CLK, + EXT_CLK_1, EXT_CLK_2, EXT_CLK_3, EXT_CLK_4, + SYSTEM_PLL1_400M_CLK} + }, + {PCIE_AUX_CLK_ROOT, IP_CLOCK_SLICE, 8, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_80M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_200M_CLK} + }, + {DC_PIXEL_CLK_ROOT, IP_CLOCK_SLICE, 9, + {OSC_24M_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, + AUDIO_PLL1_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_4} + }, + {LCDIF_PIXEL_CLK_ROOT, IP_CLOCK_SLICE, 10, + {OSC_24M_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, + AUDIO_PLL1_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_4} + }, + {SAI1_CLK_ROOT, IP_CLOCK_SLICE, 11, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_1, EXT_CLK_2} + }, + {SAI2_CLK_ROOT, IP_CLOCK_SLICE, 12, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_2, EXT_CLK_3} + }, + {SAI3_CLK_ROOT, IP_CLOCK_SLICE, 13, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_3, EXT_CLK_4} + }, + {SAI4_CLK_ROOT, IP_CLOCK_SLICE, 14, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_1, EXT_CLK_2} + }, + {SAI5_CLK_ROOT, IP_CLOCK_SLICE, 15, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_2, EXT_CLK_3} + }, + {SAI6_CLK_ROOT, IP_CLOCK_SLICE, 16, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_3, EXT_CLK_4} + }, + {SPDIF1_CLK_ROOT, IP_CLOCK_SLICE, 17, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_2, EXT_CLK_3} + }, + {SPDIF2_CLK_ROOT, IP_CLOCK_SLICE, 18, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_3, EXT_CLK_4} + }, + {ENET_REF_CLK_ROOT, IP_CLOCK_SLICE, 19, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, EXT_CLK_4} + }, + {ENET_TIMER_CLK_ROOT, IP_CLOCK_SLICE, 20, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, AUDIO_PLL1_CLK, + EXT_CLK_1, EXT_CLK_2, EXT_CLK_3, EXT_CLK_4, + VIDEO_PLL_CLK} + }, + {ENET_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 21, + {OSC_24M_CLK, SYSTEM_PLL2_50M_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_500M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {NAND_CLK_ROOT, IP_CLOCK_SLICE, 22, + {OSC_24M_CLK, SYSTEM_PLL2_500M_CLK, AUDIO_PLL1_CLK, + SYSTEM_PLL1_400M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL2_250M_CLK, VIDEO_PLL_CLK} + }, + {QSPI_CLK_ROOT, IP_CLOCK_SLICE, 23, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL2_333M_CLK, + SYSTEM_PLL2_500M_CLK, AUDIO_PLL2_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL1_100M_CLK} + }, + {USDHC1_CLK_ROOT, IP_CLOCK_SLICE, 24, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} + }, + {USDHC2_CLK_ROOT, IP_CLOCK_SLICE, 25, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} + }, + {I2C1_CLK_ROOT, IP_CLOCK_SLICE, 26, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {I2C2_CLK_ROOT, IP_CLOCK_SLICE, 27, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {I2C3_CLK_ROOT, IP_CLOCK_SLICE, 28, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {I2C4_CLK_ROOT, IP_CLOCK_SLICE, 29, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {UART1_CLK_ROOT, IP_CLOCK_SLICE, 30, + {OSC_24M_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL3_CLK, + EXT_CLK_2, EXT_CLK_4, AUDIO_PLL2_CLK} + }, + {UART2_CLK_ROOT, IP_CLOCK_SLICE, 31, + {OSC_24M_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL3_CLK, + EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {UART3_CLK_ROOT, IP_CLOCK_SLICE, 32, + {OSC_24M_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL3_CLK, + EXT_CLK_2, EXT_CLK_4, AUDIO_PLL2_CLK} + }, + {UART4_CLK_ROOT, IP_CLOCK_SLICE, 33, + {OSC_24M_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL3_CLK, + EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {USB_CORE_REF_CLK_ROOT, IP_CLOCK_SLICE, 34, + {OSC_24M_CLK, SYSTEM_PLL1_100M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_200M_CLK, + EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {USB_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 35, + {OSC_24M_CLK, SYSTEM_PLL1_100M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_200M_CLK, + EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {GIC_CLK_ROOT, IP_CLOCK_SLICE, 36, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_800M_CLK, + EXT_CLK_2, EXT_CLK_4, AUDIO_PLL2_CLK} + }, + {ECSPI1_CLK_ROOT, IP_CLOCK_SLICE, 37, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {ECSPI2_CLK_ROOT, IP_CLOCK_SLICE, 38, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {PWM1_CLK_ROOT, IP_CLOCK_SLICE, 39, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_1, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {PWM2_CLK_ROOT, IP_CLOCK_SLICE, 40, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_1, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {PWM3_CLK_ROOT, IP_CLOCK_SLICE, 41, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_2, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {PWM4_CLK_ROOT, IP_CLOCK_SLICE, 42, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_2, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {GPT1_CLK_ROOT, IP_CLOCK_SLICE, 43, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_1} + }, + {GPT2_CLK_ROOT, IP_CLOCK_SLICE, 44, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_2} + }, + {GPT3_CLK_ROOT, IP_CLOCK_SLICE, 45, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_3} + }, + {GPT4_CLK_ROOT, IP_CLOCK_SLICE, 46, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_1} + }, + {GPT5_CLK_ROOT, IP_CLOCK_SLICE, 47, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_2} + }, + {GPT6_CLK_ROOT, IP_CLOCK_SLICE, 48, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_3} + }, + {TRACE_CLK_ROOT, IP_CLOCK_SLICE, 49, + {OSC_24M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL1_160M_CLK, + VPU_PLL_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_1, EXT_CLK_3} + }, + {WDOG_CLK_ROOT, IP_CLOCK_SLICE, 50, + {OSC_24M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL1_160M_CLK, + VPU_PLL_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_166M_CLK} + }, + {WRCLK_CLK_ROOT, IP_CLOCK_SLICE, 51, + {OSC_24M_CLK, SYSTEM_PLL1_40M_CLK, VPU_PLL_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_100M_CLK} + }, + {IPP_DO_CLKO1, IP_CLOCK_SLICE, 52, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, OSC_HDMI_CLK, + SYSTEM_PLL1_200M_CLK, AUDIO_PLL2_CLK, + SYSTEM_PLL2_500M_CLK, VPU_PLL_CLK, SYSTEM_PLL1_80M_CLK} + }, + {IPP_DO_CLKO2, IP_CLOCK_SLICE, 53, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL2_166M_CLK, SYSTEM_PLL3_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, OSC_32K_CLK} + }, + {MIPI_DSI_CORE_CLK_ROOT, IP_CLOCK_SLICE, 54, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_250M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_DSI_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 55, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_DSI_DBI_CLK_ROOT, IP_CLOCK_SLICE, 56, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {USDHC3_CLK_ROOT, IP_CLOCK_SLICE, 57, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} + }, + {MIPI_CSI1_CORE_CLK_ROOT, IP_CLOCK_SLICE, 58, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_250M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI1_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 59, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI1_ESC_CLK_ROOT, IP_CLOCK_SLICE, 60, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_80M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {MIPI_CSI2_CORE_CLK_ROOT, IP_CLOCK_SLICE, 61, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_250M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI2_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 62, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI2_ESC_CLK_ROOT, IP_CLOCK_SLICE, 63, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_80M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {PCIE2_CTRL_CLK_ROOT, IP_CLOCK_SLICE, 64, + {OSC_24M_CLK, SYSTEM_PLL2_250M_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL3_CLK} + }, + {PCIE2_PHY_CLK_ROOT, IP_CLOCK_SLICE, 65, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_500M_CLK, + EXT_CLK_1, EXT_CLK_2, EXT_CLK_3, + EXT_CLK_4, SYSTEM_PLL1_400M_CLK} + }, + {PCIE2_AUX_CLK_ROOT, IP_CLOCK_SLICE, 66, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_80M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_200M_CLK} + }, + {ECSPI3_CLK_ROOT, IP_CLOCK_SLICE, 67, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {PDM_CLK_ROOT, IP_CLOCK_SLICE, 68, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, AUDIO_PLL1_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK}, + }, + {VPU_H1_CLK_ROOT, IP_CLOCK_SLICE, 69, + {OSC_24M_CLK, VPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, AUDIO_PLL2_CLK, + SYSTEM_PLL2_125M_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK} + }, + {DRAM_SEL_CFG, DRAM_SEL_CLOCK_SLICE, 0, {DRAM_PLL1_CLK} }, + {CORE_SEL_CFG, CORE_SEL_CLOCK_SLICE, 0, + {ARM_A53_ALT_CLK, ARM_PLL_CLK} + }, }; -#elif defined(CONFIG_IMX8MM) || defined(CONFIG_IMX8MN) +#elif defined(CONFIG_IMX8MN) static struct clk_root_map root_array[] = { {ARM_A53_CLK_ROOT, CORE_CLOCK_SLICE, 0, {OSC_24M_CLK, ARM_PLL_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL1_400M_CLK, AUDIO_PLL1_CLK, SYSTEM_PLL3_CLK} }, - {NAND_USDHC_BUS_CLK_ROOT, BUS_CLOCK_SLICE, 2, - {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, - SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_133M_CLK, - SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL1_CLK} + {ARM_M7_CLK_ROOT, CORE_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_250M_CLK, + VPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, SYSTEM_PLL3_CLK} + }, + {GPU_CORE_CLK_ROOT, CORE_CLOCK_SLICE, 3, + {OSC_24M_CLK, GPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {GPU_SHADER_CLK_ROOT, CORE_CLOCK_SLICE, 4, + {OSC_24M_CLK, GPU_PLL_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {MAIN_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 0, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_250M_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, SYSTEM_PLL1_100M_CLK} + }, + {ENET_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_250M_CLK, SYSTEM_PLL2_200M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, SYSTEM_PLL3_CLK} + }, + {NAND_USDHC_BUS_CLK_ROOT, BUS_CLOCK_SLICE, 2, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_133M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL1_CLK} + }, + {DISPLAY_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 4, + {OSC_24M_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, AUDIO_PLL2_CLK, + EXT_CLK_1, EXT_CLK_4} + }, + {DISPLAY_APB_CLK_ROOT, BUS_CLOCK_SLICE, 5, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, AUDIO_PLL2_CLK, + EXT_CLK_1, EXT_CLK_3} + }, + {USB_BUS_CLK_ROOT, BUS_CLOCK_SLICE, 7, + {OSC_24M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_200M_CLK, + EXT_CLK_2, EXT_CLK_4, AUDIO_PLL2_CLK} + }, + {GPU_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 8, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, GPU_PLL_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {GPU_AHB_CLK_ROOT, BUS_CLOCK_SLICE, 9, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, GPU_PLL_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} }, {NOC_CLK_ROOT, BUS_CLOCK_SLICE, 10, {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL2_500M_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} }, -#ifdef CONFIG_IMX8MM - {NOC_APB_CLK_ROOT, BUS_CLOCK_SLICE, 11, - {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL3_CLK, - SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_200M_CLK, - SYSTEM_PLL1_800M_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} + {AHB_CLK_ROOT, AHB_CLOCK_SLICE, 0, + {OSC_24M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL1_400M_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} + }, + {AUDIO_AHB_CLK_ROOT, AHB_CLOCK_SLICE, 1, + {OSC_24M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL2_166M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} }, -#endif {DRAM_ALT_CLK_ROOT, IP_CLOCK_SLICE, 0, {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL1_100M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL2_1000M_CLK, @@ -509,6 +1021,91 @@ static struct clk_root_map root_array[] = { SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} }, + {DISPLAY_PIXEL_CLK_ROOT, IP_CLOCK_SLICE, 10, + {OSC_24M_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, + AUDIO_PLL1_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_4} + }, + {SAI2_CLK_ROOT, IP_CLOCK_SLICE, 12, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_2, EXT_CLK_3} + }, + {SAI3_CLK_ROOT, IP_CLOCK_SLICE, 13, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_3, EXT_CLK_4} + }, + {SAI5_CLK_ROOT, IP_CLOCK_SLICE, 15, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_2, EXT_CLK_3} + }, + {SAI6_CLK_ROOT, IP_CLOCK_SLICE, 16, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_3, EXT_CLK_4} + }, + {SPDIF1_CLK_ROOT, IP_CLOCK_SLICE, 17, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_2, EXT_CLK_3} + }, + {ENET_REF_CLK_ROOT, IP_CLOCK_SLICE, 19, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, EXT_CLK_4} + }, + {ENET_TIMER_CLK_ROOT, IP_CLOCK_SLICE, 20, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, AUDIO_PLL1_CLK, + EXT_CLK_1, EXT_CLK_2, EXT_CLK_3, EXT_CLK_4, + VIDEO_PLL_CLK} + }, + {ENET_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 21, + {OSC_24M_CLK, SYSTEM_PLL2_50M_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_500M_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK} + }, + {NAND_CLK_ROOT, IP_CLOCK_SLICE, 22, + {OSC_24M_CLK, SYSTEM_PLL2_500M_CLK, AUDIO_PLL1_CLK, + SYSTEM_PLL1_400M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL2_250M_CLK, VIDEO_PLL_CLK} + }, + {QSPI_CLK_ROOT, IP_CLOCK_SLICE, 23, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL2_333M_CLK, + SYSTEM_PLL2_500M_CLK, AUDIO_PLL2_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL1_100M_CLK} + }, + {USDHC1_CLK_ROOT, IP_CLOCK_SLICE, 24, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} + }, + {USDHC2_CLK_ROOT, IP_CLOCK_SLICE, 25, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} + }, + {I2C1_CLK_ROOT, IP_CLOCK_SLICE, 26, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {I2C2_CLK_ROOT, IP_CLOCK_SLICE, 27, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {I2C3_CLK_ROOT, IP_CLOCK_SLICE, 28, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, + {I2C4_CLK_ROOT, IP_CLOCK_SLICE, 29, + {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, + AUDIO_PLL2_CLK, SYSTEM_PLL1_133M_CLK} + }, {UART1_CLK_ROOT, IP_CLOCK_SLICE, 30, {OSC_24M_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL3_CLK, @@ -529,19 +1126,167 @@ static struct clk_root_map root_array[] = { SYSTEM_PLL2_100M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} }, + {USB_CORE_REF_CLK_ROOT, IP_CLOCK_SLICE, 34, + {OSC_24M_CLK, SYSTEM_PLL1_100M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_200M_CLK, + EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {USB_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 35, + {OSC_24M_CLK, SYSTEM_PLL1_100M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL2_100M_CLK, SYSTEM_PLL2_200M_CLK, + EXT_CLK_2, EXT_CLK_3, AUDIO_PLL2_CLK} + }, {GIC_CLK_ROOT, IP_CLOCK_SLICE, 36, {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_800M_CLK, EXT_CLK_2, EXT_CLK_4, AUDIO_PLL2_CLK} }, + {ECSPI1_CLK_ROOT, IP_CLOCK_SLICE, 37, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {ECSPI2_CLK_ROOT, IP_CLOCK_SLICE, 38, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {PWM1_CLK_ROOT, IP_CLOCK_SLICE, 39, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_1, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {PWM2_CLK_ROOT, IP_CLOCK_SLICE, 40, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_1, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {PWM3_CLK_ROOT, IP_CLOCK_SLICE, 41, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_2, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {PWM4_CLK_ROOT, IP_CLOCK_SLICE, 42, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_160M_CLK, + SYSTEM_PLL1_40M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_2, + SYSTEM_PLL1_80M_CLK, VIDEO_PLL_CLK} + }, + {GPT1_CLK_ROOT, IP_CLOCK_SLICE, 43, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_1} + }, + {GPT2_CLK_ROOT, IP_CLOCK_SLICE, 44, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_2} + }, + {GPT3_CLK_ROOT, IP_CLOCK_SLICE, 45, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_3} + }, + {GPT4_CLK_ROOT, IP_CLOCK_SLICE, 46, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_1} + }, + {GPT5_CLK_ROOT, IP_CLOCK_SLICE, 47, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_2} + }, + {GPT6_CLK_ROOT, IP_CLOCK_SLICE, 48, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL1_40M_CLK, VIDEO_PLL_CLK, + SYSTEM_PLL1_80M_CLK, AUDIO_PLL1_CLK, EXT_CLK_3} + }, + {TRACE_CLK_ROOT, IP_CLOCK_SLICE, 49, + {OSC_24M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL1_160M_CLK, + VPU_PLL_CLK, SYSTEM_PLL2_125M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_1, EXT_CLK_3} + }, {WDOG_CLK_ROOT, IP_CLOCK_SLICE, 50, {OSC_24M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL1_160M_CLK, VPU_PLL_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL1_80M_CLK, SYSTEM_PLL2_166M_CLK} }, + {WRCLK_CLK_ROOT, IP_CLOCK_SLICE, 51, + {OSC_24M_CLK, SYSTEM_PLL1_40M_CLK, VPU_PLL_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_200M_CLK, + SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_100M_CLK} + }, + {IPP_DO_CLKO1, IP_CLOCK_SLICE, 52, + {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, OSC_HDMI_CLK, + SYSTEM_PLL1_200M_CLK, AUDIO_PLL2_CLK, + SYSTEM_PLL2_500M_CLK, VPU_PLL_CLK, SYSTEM_PLL1_80M_CLK} + }, + {IPP_DO_CLKO2, IP_CLOCK_SLICE, 53, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_400M_CLK, + SYSTEM_PLL2_166M_CLK, SYSTEM_PLL3_CLK, + AUDIO_PLL1_CLK, VIDEO_PLL_CLK, OSC_32K_CLK} + }, + {MIPI_DSI_CORE_CLK_ROOT, IP_CLOCK_SLICE, 54, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_250M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {DISPLAY_DSI_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 55, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_DSI_DBI_CLK_ROOT, IP_CLOCK_SLICE, 56, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {USDHC3_CLK_ROOT, IP_CLOCK_SLICE, 57, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} + }, + {DISPLAY_CAMERA_PIXEL_CLK_ROOT, IP_CLOCK_SLICE, 58, + {OSC_24M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_250M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI1_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 59, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI2_PHY_REF_CLK_ROOT, IP_CLOCK_SLICE, 62, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MIPI_CSI2_ESC_CLK_ROOT, IP_CLOCK_SLICE, 63, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_80M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK} + }, + {ECSPI3_CLK_ROOT, IP_CLOCK_SLICE, 67, + {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, + SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} + }, + {PDM_CLK_ROOT, IP_CLOCK_SLICE, 68, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, AUDIO_PLL1_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK}, + }, + {SAI7_CLK_ROOT, IP_CLOCK_SLICE, 70, + {OSC_24M_CLK, AUDIO_PLL1_CLK, AUDIO_PLL2_CLK, + VIDEO_PLL_CLK, SYSTEM_PLL1_133M_CLK, + OSC_HDMI_CLK, EXT_CLK_3, EXT_CLK_4} + }, {DRAM_SEL_CFG, DRAM_SEL_CLOCK_SLICE, 0, {DRAM_PLL1_CLK} }, + {CORE_SEL_CFG, CORE_SEL_CLOCK_SLICE, 0, + {ARM_A53_ALT_CLK, ARM_PLL_CLK} + }, }; #elif defined(CONFIG_IMX8MP) static struct clk_root_map root_array[] = { @@ -580,6 +1325,26 @@ static struct clk_root_map root_array[] = { SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_133M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL1_CLK} }, + {MEDIA_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 4, + {OSC_24M_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, + AUDIO_PLL2_CLK, EXT_CLK_1, SYSTEM_PLL2_500M_CLK} + }, + {MEDIA_APB_CLK_ROOT, BUS_CLOCK_SLICE, 5, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, + AUDIO_PLL2_CLK, EXT_CLK_1, SYSTEM_PLL1_133M_CLK} + }, + {HDMI_APB_CLK_ROOT, BUS_CLOCK_SLICE, 6, + {OSC_24M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, + AUDIO_PLL2_CLK, EXT_CLK_1, SYSTEM_PLL1_133M_CLK} + }, + {HDMI_AXI_CLK_ROOT, BUS_CLOCK_SLICE, 7, + {OSC_24M_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL3_CLK, SYSTEM_PLL1_40M_CLK, + AUDIO_PLL2_CLK, EXT_CLK_1, SYSTEM_PLL2_500M_CLK} + }, {NOC_CLK_ROOT, BUS_CLOCK_SLICE, 10, {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL2_500M_CLK, @@ -605,6 +1370,11 @@ static struct clk_root_map root_array[] = { SYSTEM_PLL1_400M_CLK, SYSTEM_PLL2_125M_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} }, + {MEDIA_DISP2_CLK_ROOT, AHB_CLOCK_SLICE, 3, + {OSC_24M_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, + AUDIO_PLL1_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_4} + }, {DRAM_ALT_CLK_ROOT, IP_CLOCK_SLICE, 0, {OSC_24M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL1_100M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL2_1000M_CLK, @@ -615,11 +1385,6 @@ static struct clk_root_map root_array[] = { SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL2_250M_CLK, AUDIO_PLL2_CLK} }, - {MEMREPAIR_CLK_ROOT, IP_CLOCK_SLICE, 6, - {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, - SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, - SYSTEM_PLL1_133M_CLK} - }, {I2C5_CLK_ROOT, IP_CLOCK_SLICE, 9, {OSC_24M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL2_50M_CLK, SYSTEM_PLL3_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, @@ -798,11 +1563,36 @@ static struct clk_root_map root_array[] = { SYSTEM_PLL3_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_266M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL1_100M_CLK} }, + {HDMI_REF_266M_CLK_ROOT, IP_CLOCK_SLICE, 56, + {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL3_CLK, + SYSTEM_PLL2_333M_CLK, SYSTEM_PLL1_266M_CLK, + SYSTEM_PLL2_200M_CLK, AUDIO_PLL1_CLK, VIDEO_PLL_CLK} + }, {USDHC3_CLK_ROOT, IP_CLOCK_SLICE, 57, {OSC_24M_CLK, SYSTEM_PLL1_400M_CLK, SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_500M_CLK, SYSTEM_PLL3_CLK, SYSTEM_PLL1_266M_CLK, AUDIO_PLL2_CLK, SYSTEM_PLL1_100M_CLK} }, + {MEDIA_MIPI_PHY1_REF_CLK_ROOT, IP_CLOCK_SLICE, 59, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MEDIA_DISP1_PIX_CLK_ROOT, IP_CLOCK_SLICE, 60, + {OSC_24M_CLK, VIDEO_PLL_CLK, AUDIO_PLL2_CLK, + AUDIO_PLL1_CLK, SYSTEM_PLL1_800M_CLK, + SYSTEM_PLL2_1000M_CLK, SYSTEM_PLL3_CLK, EXT_CLK_4} + }, + {MEDIA_LDB_CLK_ROOT, IP_CLOCK_SLICE, 62, + {OSC_24M_CLK, SYSTEM_PLL2_333M_CLK, SYSTEM_PLL2_100M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + EXT_CLK_2, AUDIO_PLL2_CLK, VIDEO_PLL_CLK} + }, + {MEMREPAIR_CLK_ROOT, IP_CLOCK_SLICE, 63, + {OSC_24M_CLK, SYSTEM_PLL2_100M_CLK, SYSTEM_PLL1_80M_CLK, + SYSTEM_PLL1_800M_CLK, SYSTEM_PLL2_1000M_CLK, + SYSTEM_PLL3_CLK, EXT_CLK_3, AUDIO_PLL2_CLK} + }, {ECSPI3_CLK_ROOT, IP_CLOCK_SLICE, 67, {OSC_24M_CLK, SYSTEM_PLL2_200M_CLK, SYSTEM_PLL1_40M_CLK, SYSTEM_PLL1_160M_CLK, SYSTEM_PLL1_800M_CLK, @@ -812,7 +1602,7 @@ static struct clk_root_map root_array[] = { {DRAM_PLL1_CLK} }, {CORE_SEL_CFG, CORE_SEL_CLOCK_SLICE, 0, - {DRAM_PLL1_CLK} + {ARM_A53_ALT_CLK, ARM_PLL_CLK} }, }; #endif From patchwork Wed Apr 22 13:52:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275036 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=O1lZsXi0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hG759nQz9sSd for ; Wed, 22 Apr 2020 23:33:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B41BC81A66; Wed, 22 Apr 2020 15:31:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="O1lZsXi0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C49281C7B; Wed, 22 Apr 2020 15:30:44 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 99F6E81A66 for ; Wed, 22 Apr 2020 15:30:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CtEc/HejXDhbgYgk+jEJls1LNcBeHIfHI4RnPD7j22K4KO/VjxTQNkclQv1QD0tC4ahgONVyX0o4Ro0IvP8R1oCBk1qaEFbm9Wzn9QQupllywdjVjzmJfn9gJ0SmN0AYXOoMKQ5+ZpXdbq5jci8m9+VYG2MAikrb3bRS3YRPwTzczhcBwQQ9Q3gBprx2bHOOcHASpktmAZ5q3G75l3OeJFWiuhK+MyJHbO7goq0wnH/PDRBh4L4igWkLEuQijYmT1dEebidfIJk9YzDy0AhOERmOMcb/GEX1Qgjo2e3rskRvkwbMZmOTYslKBA8m8g6w518UzNbMg23RV/rXATi7zA== 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-SenderADCheck; bh=iUdbyhyrPkg3E7kVG/IidGPl0s2zFdExGGCdr0VNE70=; b=HinDRo72aQN7QJo1r/gezwjp8zOo3xuVyvydNNYsEAqA/S760HcBAjOQjjXi9v6lCrhUiaW7iupmexehRZ/Ga+cOEEhChXh9+kF/lBNpwaXPO3p/tY+1tCdfOUHY/9gpFJHTQ1Zlv304/ZZIhHnhda4U74XGsRHJ71JSmlFmaSjcvC13z/fXyM78Irb4Itk3pvowaxrB86hvZTJXIJdvn9aFTlM/C2A2KcmWJamNl/yHgo/Va47ocTj6eLmcp/6US5ptqlRH1Q3DAvjQZdNzOVWLF/vx6C+J6Y5JcfnfvQnwtXljl4pDOt8EgUR5mPrAMyC4BS6mnCxsg33YKSfdXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iUdbyhyrPkg3E7kVG/IidGPl0s2zFdExGGCdr0VNE70=; b=O1lZsXi0EZIr7IJ/bnxf0fnff3D7myUTlnblkZndTrQjwR6XhGIj64L1LrHBVUw7tgXd+rxiTbRYGfPnrNkZ/anSeiAdPf5Vi8z4UJk4XpSTLeGI9LheZEXFBpLqz1BKdd4gksMs1K4jaKUHoMQkI8wsryLfcLg85p45KSHqlBY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:17 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:17 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 11/24] imx8mq: Enable eMMC HS400 and SD UHS mode on EVK Date: Wed, 22 Apr 2020 21:52:22 +0800 Message-Id: <20200422135235.14756-11-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:15 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dc4f5c80-2345-4d8b-105c-08d7e6c14bda X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NwIYVcepusSHDOnhpFiHUJhRqNiPQ+2IQCuMfZ3kUS/XjmD8zJ3EBf+UMJiBsenPQtZXs/9Cz0v+KZCgnZ5uYSFoJa1KzvQ4nT5XOnvrJsLeCECsBx1bbeDYLFVHi3/v0LDqBmjTKvR4BTsm2upI2Oxf/ZAK6yG9QNB7QKm2YljIVcldi3uSaJntCAkVcH0GRJ2ZLumjft2MTRC9mzRUv7Z597HdV0hom84WdYtHzk9+aXKOvJQ5zDDegJ5cIjQp9K61XTaneejHqPh50mzO+Wn+8+ZQauM1xhbTBD3e9/EFpPRjhmtpabXRjyveblW6qa8HPF/9yyRmdkm4vQdudiAyv4JWUVYwogdQiajMUhTzLuU3zrYA53W8oKhCzFMCJywjxRTPDRCZN9VfTgPzqlNY2pmj3LyK9uAFVF7LZGC28ZekVnR5GdpKuFqE8qUcBKvzpwF7rtOTuWYTNocZBr/J7KhMfsj58pfmVBjXbnZ1y1B51ApZh2lieRvcQzMI X-MS-Exchange-AntiSpam-MessageData: opher6AMjy1N6pn8YFvXHiGYesxdsz39QKImFrvBaVvSBSzPbHjBtzPB+HeSriLLkKN4VenN+/6GFW4UcabRFAGOrtP+7sormnW2V3C19j2aHwPIQG558ApwLpcN8SYsCIhUOaahXUrirGYAoNNE9A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc4f5c80-2345-4d8b-105c-08d7e6c14bda X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:17.5441 (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: DmBc6uM9BTzV75y9Ao/syFvWgpRrsGlcuKu7m4JpDrzj3zz7gJF1v4mJhdCCniJ0b9Xm+zyQWr3s2Y60dboh7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li iMX8MQ EVK board has a eMMC5.0 chip and supports SD3.0, so enable the UHS and HS400 configs to enhance the eMMC/SD access. The change also needs to set usdhc clock to 400Mhz, and add the off-on-delay-us to SD reset pin, otherwise some SD cards will fail to select UHS mode in re-initialization. Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8m/clock_imx8mq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c b/arch/arm/mach-imx/imx8m/clock_imx8mq.c index aad9cf13ef..76104e4f92 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c @@ -428,15 +428,13 @@ void init_clk_usdhc(u32 index) case 0: clock_enable(CCGR_USDHC1, 0); clock_set_target_val(USDHC1_CLK_ROOT, CLK_ROOT_ON | - CLK_ROOT_SOURCE_SEL(1) | - CLK_ROOT_POST_DIV(CLK_ROOT_POST_DIV2)); + CLK_ROOT_SOURCE_SEL(1)); clock_enable(CCGR_USDHC1, 1); return; case 1: clock_enable(CCGR_USDHC2, 0); clock_set_target_val(USDHC2_CLK_ROOT, CLK_ROOT_ON | - CLK_ROOT_SOURCE_SEL(1) | - CLK_ROOT_POST_DIV(CLK_ROOT_POST_DIV2)); + CLK_ROOT_SOURCE_SEL(1)); clock_enable(CCGR_USDHC2, 1); return; default: From patchwork Wed Apr 22 13:52:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275041 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=PfpT2+bd; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hGv66Btz9sSd for ; Wed, 22 Apr 2020 23:33:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 28AA481C97; Wed, 22 Apr 2020 15:32:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="PfpT2+bd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEFC381A66; Wed, 22 Apr 2020 15:30:47 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 F214681A18 for ; Wed, 22 Apr 2020 15:30:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AoeZBt4QtTKTvpIFV7ZHR+UKNdUO9q0a+t8oPn+Zw0LOyRtuNh4jLKCR9LItKe/g5Y5aKMVxo+uKxWugwBIObgJphU8mT4SRHktkR77kiCcezAT2Zv1rdeeYdfPVeevRns1+R1N2kTZ24OZbbE5dcIjdv6iJpNN0hwFvfsMiWDrVsikpB8yzwDMq6xk3sgQ5IHpBvSyR82Xf/J1cZ9PDCj9Bduxr7A4ul5A2ifGkGEny5oFBro0ZDgkGp+ZCkNxu699JvtuNNVWA9fGa0olAj/CzYJn1X2zupB9Gz1st4SY5D0aw+g/t4ime8KpybUFyrGWu7ST6YiduxALP0JeHcA== 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-SenderADCheck; bh=HCtYMO4tQA251FqRFoaHdMxSmFe6Qd+PoAZgkfEQX2U=; b=ki6WrD5sOPv8oE5mz/Knj350MTcXwsA+8nv1+wzEKZdE/dgi9b2wYcf2LZIAsyTEIvwQkFNnY28I11BYIRzK+Vn53EVosdG84bAmFzY2z4bYVeBd4aYDgNpfAzwl/iL+O5rS5aFR/+wFj9XZ6AqisvjCpBtRkKXIYPb12zyg8PDAXuzlqoPjWjTBovZGEE7DTasVIXjh18DURd23rbOlre91oeZ/cdKADcMnupPfvpCBMOgnJ0RF0LPgkQ7fXM34lMlY/PHXTw/lK6cXe+itwqwx11VnocT6Qk8P78stbVfsLjlasQ5oy24c/00yNjreRJFl5AWXZ7NWUkrwpuBMQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HCtYMO4tQA251FqRFoaHdMxSmFe6Qd+PoAZgkfEQX2U=; b=PfpT2+bdwsneJ6Zu6rQ/XkII280pS3gqq77oV2rAwWxkycdUFv+acO6AH1ZqTn/b/Vlcn0S/alq1SZpfZ0g7vyDCjgLe+WtuRIcLN1zvB+cLa84gpUlJqg9Xznrkn1qF++tKG99QWiztHaRrmcHSnV0sA4TkCF4IPBOIe4ZwaTM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:19 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:19 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 12/24] imx8mq: Set ARM core clock directly from ARM PLL Date: Wed, 22 Apr 2020 21:52:23 +0800 Message-Id: <20200422135235.14756-12-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:17 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 41617c68-9123-4861-f3ee-08d7e6c14d01 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HrrapSvsPIWObDqlei8gM7aqPw9Bt9aqgIAB9qhfhKx5kO3KrR5JjVkB8EhSifp55a8vWSfnHjWuWpSmBoioUcnBDgoi08gI12AL2oDwbuYbSiYmP1yu4GOs/o+ddJ5upPs6KHz5msMzvZBpQjiQbQOVQxGUL18d5Nk0Tq2LhavVLxqc3MllC7cm9xGv6BmHX+f/6LbmGyxk44o2InbrNnAHG+AetuRPHnRJk0J0dB8CjPLIvZjaUyjRmXdgRwUuty7bS37x03gNWgmHcBxljwEQFcphKKIY550FIdwdLn9xPXAj6Ccnho4NiR79JLGjpGmYQe/JnotuqfsBjG7D/WIF2qnLxMWB2yaGJ1FCHQnswCbj4OshSjbm0SLiW06njXx92HXpJ8n3Of9JDHxcjihgsvU3bb/ua9XBTGpog7+zvfpNixhPxyOX20+HGhobd7UY9f5EEbasWIJRmshLKO/xEl7qmKtzxEA8ZkaCayejcpHE4pNaDW/0C0kBHAHS X-MS-Exchange-AntiSpam-MessageData: /hHQ2pA6xKNhk0509rv7/IuBFTWF6Fo+RFPgwWsachn8hm0gi6GGo6IWFl1R+MPnTHVlbgwLocs9bJDXpZjeMM2U7KsYFnNJ+MQbuanA7238+885ZZE3ukxYvtWbtud0rjtkE68zJKMInJmMpiNgcw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41617c68-9123-4861-f3ee-08d7e6c14d01 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:19.3933 (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: ODnqdbfs/GxTMz2GycQ92b1P7bZaRp91YBM83BhGitCo02pC091zDxbT7TlleGlnL1WQF+N6SbUbjC82gu8oVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean For ARM core clock, there are two input branches, and can select via mux: one from ARM PLL directly, second from CCM A53 clock root. Currently we are using second branch. But IC confirmed the CCM A53 root signoff timing is 1Ghz, so we should switch to input from ARM PLL directly. This patch fixes the CORE SEL slice configuration and switch ARM clock to ARM PLL. Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8m/clock_imx8mq.h | 3 +- arch/arm/mach-imx/imx8m/clock_imx8mq.c | 49 +++++++++++++++++--------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/arch/arm/include/asm/arch-imx8m/clock_imx8mq.h b/arch/arm/include/asm/arch-imx8m/clock_imx8mq.h index 38a6f5966b..9dda6ddc8c 100644 --- a/arch/arm/include/asm/arch-imx8m/clock_imx8mq.h +++ b/arch/arm/include/asm/arch-imx8m/clock_imx8mq.h @@ -153,6 +153,7 @@ enum clk_root_src { EXT_CLK_3, EXT_CLK_4, OSC_27M_CLK, + ARM_A53_ALT_CLK, }; /* CCGR index */ @@ -419,7 +420,7 @@ enum clk_src_index { enum frac_pll_out_val { FRAC_PLL_OUT_1000M, - FRAC_PLL_OUT_1600M, + FRAC_PLL_OUT_800M, }; void init_nand_clk(void); diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c b/arch/arm/mach-imx/imx8m/clock_imx8mq.c index 76104e4f92..fb85a8d06e 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c @@ -15,6 +15,8 @@ static struct anamix_pll *ana_pll = (struct anamix_pll *)ANATOP_BASE_ADDR; +static u32 get_root_clk(enum clk_root_index clock_id); + static u32 decode_frac_pll(enum clk_root_src frac_pll) { u32 pll_cfg0, pll_cfg1, pllout; @@ -275,6 +277,8 @@ static u32 get_root_src_clk(enum clk_root_src root_src) case SYSTEM_PLL2_50M_CLK: case SYSTEM_PLL3_CLK: return decode_sscg_pll(root_src); + case ARM_A53_ALT_CLK: + return get_root_clk(ARM_A53_CLK_ROOT); default: return 0; } @@ -322,13 +326,26 @@ int enable_i2c_clk(unsigned char enable, unsigned int i2c_num) return 0; } +u32 get_arm_core_clk(void) +{ + enum clk_root_src root_src; + u32 root_src_clk; + + if (clock_get_src(CORE_SEL_CFG, &root_src) < 0) + return 0; + + root_src_clk = get_root_src_clk(root_src); + + return root_src_clk; +} + unsigned int mxc_get_clock(enum mxc_clock clk) { u32 val; - switch(clk) { + switch (clk) { case MXC_ARM_CLK: - return get_root_clk(ARM_A53_CLK_ROOT); + return get_arm_core_clk(); case MXC_IPG_CLK: clock_get_target_val(IPG_CLK_ROOT, &val); val = val & 0x3; @@ -637,7 +654,7 @@ void dram_pll_init(ulong pll_val) static int frac_pll_init(u32 pll, enum frac_pll_out_val val) { void __iomem *pll_cfg0, __iomem *pll_cfg1; - u32 val_cfg0, val_cfg1; + u32 val_cfg0, val_cfg1, divq; int ret; switch (pll) { @@ -645,14 +662,17 @@ static int frac_pll_init(u32 pll, enum frac_pll_out_val val) pll_cfg0 = &ana_pll->arm_pll_cfg0; pll_cfg1 = &ana_pll->arm_pll_cfg1; - if (val == FRAC_PLL_OUT_1000M) + if (val == FRAC_PLL_OUT_1000M) { val_cfg1 = FRAC_PLL_INT_DIV_CTL_VAL(49); - else + divq = 0; + } else { val_cfg1 = FRAC_PLL_INT_DIV_CTL_VAL(79); + divq = 1; + } val_cfg0 = FRAC_PLL_CLKE_MASK | FRAC_PLL_REFCLK_SEL_OSC_25M | FRAC_PLL_LOCK_SEL_MASK | FRAC_PLL_NEWDIV_VAL_MASK | FRAC_PLL_REFCLK_DIV_VAL(4) | - FRAC_PLL_OUTPUT_DIV_VAL(0); + FRAC_PLL_OUTPUT_DIV_VAL(divq); break; default: return -EINVAL; @@ -688,17 +708,14 @@ int clock_init(void) * We set ARM clock to 1Ghz for consumer, 800Mhz for industrial */ grade = get_cpu_temp_grade(NULL, NULL); - if (!grade) { + if (!grade) frac_pll_init(ANATOP_ARM_PLL, FRAC_PLL_OUT_1000M); - clock_set_target_val(ARM_A53_CLK_ROOT, CLK_ROOT_ON | - CLK_ROOT_SOURCE_SEL(1) | - CLK_ROOT_POST_DIV(CLK_ROOT_POST_DIV1)); - } else { - frac_pll_init(ANATOP_ARM_PLL, FRAC_PLL_OUT_1600M); - clock_set_target_val(ARM_A53_CLK_ROOT, CLK_ROOT_ON | - CLK_ROOT_SOURCE_SEL(1) | - CLK_ROOT_POST_DIV(CLK_ROOT_POST_DIV2)); - } + else + frac_pll_init(ANATOP_ARM_PLL, FRAC_PLL_OUT_800M); + + /* Bypass CCM A53 ROOT, Switch to ARM PLL -> MUX-> CPU */ + clock_set_target_val(CORE_SEL_CFG, CLK_ROOT_SOURCE_SEL(1)); + /* * According to ANAMIX SPEC * sys pll1 fixed at 800MHz From patchwork Wed Apr 22 13:52:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275039 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=kDzSyYrT; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hGb0lc1z9sSm for ; Wed, 22 Apr 2020 23:33:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98C4281C90; Wed, 22 Apr 2020 15:31:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="kDzSyYrT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 005B181C80; Wed, 22 Apr 2020 15:30:43 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 4946081B8F for ; Wed, 22 Apr 2020 15:30:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OLPtUkwtgOjn7XzmBplKXRCGoGG0s8XUaeYdPFLuQqKiGvdMKnsCRqh0VsBqel8d+0NwkfaGCqwFZBwOCgCvnqFmnbWtMnXKUbtJTMESiOWHYF5jysWmyDfVsrVs+LT7km1B7wfrBY2AB+CYOndkUyZoMOvO8RvujA/+dAZDyisJj5HEn7/I6/UItHlANUWAjY+zQ+dZtXcfIzH7afFogXeUOpt/ZVr+pQtyKE+uNwMigNCMLOw1Xk3zPvInED8Gpelvu6arMLaSKab6biB7XDGXf2EOodd/AycYJi6DalTL1SdWP+nkrenH/qyrH6JuL07wzX/ltJ4ag15/puXdYg== 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-SenderADCheck; bh=3SaAWtyhNrwlxkn2aj4TYhjpBJ6KGsUSPqhQX5Gej4U=; b=IgBzqrvk3FRWUK/K45i9b4h6bsZX04PdfmRsCK90Awf+S+SL8f2fyjDhM2WNXghvcO8e3AZBdDYgU1imrsjZS5l4jG1FxGMDIGELiKffBqKVwWuNX06g3Nw+mIqqQ3LSBf1BpmgmXuQ7+cuq5B56FBi5E1mQSNl6BZlnTWVO/yyQB6Dx0Q9B5VOid8kBZVQCV5vrC+agYR+o8lw1b97f95mNAx1aOcrfjP10zdx+Qpr762pNUDvKin0OhL52KzYgsCb2BaqtBK9NzzdAZwtisuuU16SUGCiAqNVnR+lV5Le0h0RTUCMhZMASro0RGngYQ18MTCE1ySIuL9MbJsxxvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3SaAWtyhNrwlxkn2aj4TYhjpBJ6KGsUSPqhQX5Gej4U=; b=kDzSyYrTvc7sHqrAgIF/sMvWfSiv2Ch9enXEnz3zaZJjJgRnAj1eEhjPegWPslXINUsPMzm9mdShk+g2FwuO/pIXXbHNzL3yldQh2BOiC+VbG1ivBMw/3U+4sDp/sg7HEVUqXsJTVFZvf7wkbr4nsgCLzsd5aeO1DjBKynCG04s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:21 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:21 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 13/24] imx8m: Dump DRAM PLL rate by clocks command Date: Wed, 22 Apr 2020 21:52:24 +0800 Message-Id: <20200422135235.14756-13-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:19 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5cde2ff6-29de-4f3f-4483-08d7e6c14e1c X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:669; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(4744005)(316002)(6666004)(44832011)(26005)(2906002)(8936002)(86362001)(6506007)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Od7XQygXGJ/32c/s0xl8ZZfbX9aMlwJ5M2biGq9woylXbl9jV/bg3xcDZRdRifbMU6PsZZskuPRI27UU8eRY3oQRJLiYMkya+QDcAAIncFi++BmXWnGEAq/MHrz1JNrU4iNfciYBHQXKE6v8iowFjPSBtyQfjiRGCfdSddRkIOpT2YlO0J7U1CDU3vvd/vkpKKeMhvpvyyJBQCdy2GPMyausQRyV7ijaSWZ2SGVMmpLNvBcUDbF4ZfppaOgjh9xsA88UEqxs4eqUwlQ6CaikKjNJ+Y2656Tl7Xq+pEZ2rBWDggivrmbubU4UIXy7iwQdm1OinJCnnYs3fISM+bBnCS0L5mkWnpfXoP2RuTu+a2yy5GyrsjoSgitRwnJb3qANqKgkB3snplIJOGAzmKEzKgH00NEFxs3iMpF+7MMicJysMY9S5W+dkQyKK4T7orNJ/DGA67nyBxVR+EKdwBqYvTXRs55aWGj628RFUYLowNZNyWik84A40PQs5K3vfEys X-MS-Exchange-AntiSpam-MessageData: iMpZ5EKq74kdjfjq2b4zGSps1WWq4C1i/uSEGdBi7wMLR3aW8wYjFL9DXCC0agfDN5YvgVPqpqrhV+IosP2EGgUoAl//rPIusaHxL/T8R2uDlsHLpCZH9Tmh094DUGqZhhZKIWHKp8riRt2mNFUn7g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cde2ff6-29de-4f3f-4483-08d7e6c14e1c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:21.3964 (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: akIDECD+eu4E97FaxUZMIX8clqifHNf5lzN6lHBiJOruQrz5BLHyznzoD95QPr4ZkLz8dxQehdhsCZqYe/J6TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li Add the dump of DRAM PLL into "clocks" command Reviewed-by: Peng Fan Signed-off-by: Ye Li --- arch/arm/mach-imx/imx8m/clock_imx8mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c b/arch/arm/mach-imx/imx8m/clock_imx8mq.c index fb85a8d06e..ee18cdee50 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c @@ -762,6 +762,8 @@ static int do_imx8m_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, freq = decode_frac_pll(ARM_PLL_CLK); printf("ARM_PLL %8d MHz\n", freq / 1000000); + freq = decode_sscg_pll(DRAM_PLL1_CLK); + printf("DRAM_PLL %8d MHz\n", freq / 1000000); freq = decode_sscg_pll(SYSTEM_PLL1_800M_CLK); printf("SYS_PLL1_800 %8d MHz\n", freq / 1000000); freq = decode_sscg_pll(SYSTEM_PLL1_400M_CLK); From patchwork Wed Apr 22 13:52:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275045 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=EiWJwDbW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hJ03j8yz9sSq for ; Wed, 22 Apr 2020 23:34:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E1D5881C65; Wed, 22 Apr 2020 15:32:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="EiWJwDbW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 858CB81C54; Wed, 22 Apr 2020 15:30:53 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on062c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::62c]) (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 8123981C4A for ; Wed, 22 Apr 2020 15:30:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GUglyukRz1AgizU6qL41gobN9aSaPeJm8mc96XJ3Mrnb+AVpk9vkITxzzZW9lcdAjYqj7qhi+Ma77C4ZCyTHePhi+DxKHedY3OQvJuvPKyyUXgLC6AAllnJip0+jtNZWxdKhnkB74nLTPvx2hY68voeogQp5FMez4uLaRx/aKY9vI56M3f0TMvgWHg1lWXfKmA+t6KqQNOmveTBLri7eTUKU0Hdo5yVJjKBJchdBBIZltneffaSkSZGWuMty5UoHTdPdlLV+0924s+9rxiEwoI2LSknu0OesT6D5DGQcSL3LDGG0KMyz48PClAaMq/tDLFBZfRy0DWqjQDMDShNa/w== 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-SenderADCheck; bh=mlSrQizl4Q+13Prg2NcYC8ahHePyGC1X4ZL8DTRSQdc=; b=lLjLY+FXpJLKApd0KFnyXINTA0wTT4gxusHu7MFg+pKUKMaZJHprf3ou315KFtx/eIKpnf8uR6PLnL2Px7UGSO0OAHlgLi5FHcqmdhCajolwXxiM7FxgrdGt7zGctPvr1zdzY1D8pOfOrS4gmi7IrrEBNWuQNVv9+W7Vy59NHDLnSei/RYjSJn3a8tO3TVvS7IAF7PZ9OqvUztyga1dmwDKWkYLpkCpDHI+feF12mWpOhz+0dLuVlUA7JvUwiG0Xo9FA4fV23l1ToKl8xJxlO82yF5xokwXhrOmZsEXkrKd6v116G9UJSOfZywmTl+P3e41V/0cKMlwiBw2DcBi1mA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mlSrQizl4Q+13Prg2NcYC8ahHePyGC1X4ZL8DTRSQdc=; b=EiWJwDbW5Av2zUkcBeb1lXtfW0Q/656+irLeadZLeLWZCdCseELfRz1A6ruQXW1HpBQHnli1ulekoutlomYPnQqNiFkE5vjgvBHv44+xfmS8YYkBoSSkIbkhJkieDPUa6HUHTsfOrDJJ+aM5hy9pPIFnKq7ykByOWTC6sSGZOPQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2806.eurprd04.prod.outlook.com (2603:10a6:4:97::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:23 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:23 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 14/24] imx8: parser: fix 'end address' parameter of rm_find_memreg Date: Wed, 22 Apr 2020 21:52:25 +0800 Message-Id: <20200422135235.14756-14-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:21 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ba2eeb33-c1cf-440e-c7a8-08d7e6c14f5d X-MS-TrafficTypeDiagnostic: DB6PR0402MB2806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(366004)(346002)(39860400002)(136003)(376002)(8676002)(956004)(16526019)(6512007)(186003)(36756003)(52116002)(81156014)(6486002)(1076003)(4326008)(66476007)(66556008)(5660300002)(66946007)(2616005)(478600001)(4744005)(316002)(44832011)(26005)(2906002)(8936002)(86362001)(6506007); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /gLH6NEXB+NsGZJzidQDQgwzg4nn47QEJPPbtPGfnQIoiFHG6F0iI5FzAol+lLzUTBf6mLX3B0u1rzgkQSRir3TpMZu22CZ1b4T/1fWIeZhMiPXgEoHSKSLx4O+8s7Id66ZZuJYa8JstrrUfxfnx9vmrwsGtRh+cmnhkhEo7MJ8ZgrCKes9MzHLKWUpc6cl0h5vQmqx1f4j6mHHexAADbdxSw/Y1OowRUDKezlIkTIuL6BV/vK4og10XHGqTuUmELdLMZdA7SW22PjoxygNqniNclp+LMvTr5uA/NptMCEzKYyiuUa19qh2694SPAN2ENgfss12bBq9Pda52uKzxHEhrd8cRw8IvkyMkqweSLolgk/ttIKKdsIqIVy/p1d/m4zLvRcxZxwYOZMuH0hLk0VK6FVzQm1q6Ux3kIDo/RjikCFiMyxRjbqycG4qAR3lJ X-MS-Exchange-AntiSpam-MessageData: pCH2NN8FtSjW1HCkbg95TC9ygh02x0HSVzg/KJeyFbwfaDNz+qjl95zK8kYOE9d96UpPF82aSV6kwZbdawWYvA3Vl8dR80FTADVPtv4X9LhbCShofIXdPChHqjO6uQzw/hMe6RhRC046NQzf8xdadg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba2eeb33-c1cf-440e-c7a8-08d7e6c14f5d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:23.5764 (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: +XghXmvO1IfJgJIDcAD67bDakJ6ZdqwYHj0TL+e7r5t/U2VPgEv2FPf7eb6siYJP2fJ0N2J+5D7JtSoxNp9EVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2806 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean parameter 'end address' must be inclusive of address range. Modified from Seb's downstream patch. Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8/parse-container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8/parse-container.c b/arch/arm/mach-imx/imx8/parse-container.c index b57e68e412..e192b0c6d2 100644 --- a/arch/arm/mach-imx/imx8/parse-container.c +++ b/arch/arm/mach-imx/imx8/parse-container.c @@ -29,7 +29,7 @@ static int authenticate_image(struct boot_img_t *img, int image_index) /* Find the memreg and set permission for seco pt */ err = sc_rm_find_memreg(-1, &mr, img->dst & ~(CONFIG_SYS_CACHELINE_SIZE - 1), - ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE)); + ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE) - 1); if (err) { printf("can't find memreg for image: %d, err %d\n", From patchwork Wed Apr 22 13:52:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275042 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=sgBoJWa+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hHF5Jfyz9sSd for ; Wed, 22 Apr 2020 23:34:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9159D81C6A; Wed, 22 Apr 2020 15:32:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="sgBoJWa+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF14281C73; Wed, 22 Apr 2020 15:30:52 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 9D36781C5A for ; Wed, 22 Apr 2020 15:30:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IFXcxrUQ8agrQVN1fHczkHdMRcsw4fx8J9O7fh43HkWgFrNN2w8a4Y1sh8V/qQ0MXTexNo3QhMFxQz+hET94yHR4Y3OvNiQgf9eDo/dt9Eg8v2BemRcnlORSwh1Mwnu5vwCtJMb9SDwHkUylzt5eDuRxlc7xrhoS/niqaxyG+OVSb71xsFjlT6zw+j9sYNu312vr6AW43CprHlr1xFQ/6mbXdInyZQa7vo42ZcqN6GhNbYGB9UJcwx/3LttQBNK/Hdtzz6AoZj+O7aUVAXvuJ+uRs7YtHgC8tU3w2PQMwcs2Xg/AZjno/6RI6JqQBC4WV9oUXefExoOmgB7LOVZycw== 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-SenderADCheck; bh=ZkH8JdTLO59VQlAazrKpwezRERbKdDp1UYmSCQY7C9I=; b=d86IYxltnGZMLAv84/H9SAIe+O48AkiKMCydztG+lzghyeWg0WgKNUdqqpayBlx4ZcF40AhguUl3Y30dFHQwxhKO4H25LhPk6ngBaX/4pmPD9MLcDQm69hpgJrhmvDLi7tAs/sTfGCaYB+2Bb7wSak9/G/1WsrQe9SBTSUFngbE1BYBw3nC5EslDVPKJK10eLsx0RycntZhcnrhxIsmbJZ8fYyy4iVhS7pl4vr5F8y+OuYFBcC7u5sLwP0IkZWPCqdx4rAKSxKWKEboRhBBZD8klUW19Onhl+bQwEb9y3iz6Xpy9KkCCCZTbckOQCC99q40hUbTXWdnHXMV+dsxKlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZkH8JdTLO59VQlAazrKpwezRERbKdDp1UYmSCQY7C9I=; b=sgBoJWa+OGfMayXzjHgJdKxWbVbcYmab4ENz/dlf3FzOGko1ezOgjAvxLmfzi7ffZhwgmnC0KaPj7e7ld3Y5n6ZgnkqWTO59bojHrYjTC9StNpkdYJm5h0dtIuxZs/EHb0Lyr5c6aLus/xalIxDrY2IjHZraTwTRY91Lzd4gPn4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:25 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:25 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 15/24] imx8: Change to use new SECO API commands Date: Wed, 22 Apr 2020 21:52:26 +0800 Message-Id: <20200422135235.14756-15-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:23 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1b5751a5-6125-403c-3ded-08d7e6c1509c X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:651; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IJmjIgdYfFk2p0Boqmo7Z8aLB9fyUpRhf9rzAu4Y+IyuoBZ8jxDrEC6Fw0MRxwvuNpmXV4OAOWURTwlWZ2MyzbKqwxqbZV8HUXmFGZDH6ZrGG8cBJZI0O2128cGRM5QeLSeG7YFGLTo+i6hDLozT4h3Ie2hF/nKE/cf4WbSEyqsNvBJWAHyRmO7xYvt9uAZrrN2LhaUXdnUFEv8hhXLRloBABkNLk6yhVsLaYJARDWCNuGBBvFPMWMFWRvwHdZ7ae8NgNsW2i8svmFvOBfki+cR9j7D5h1Nd3CIi2BZoGIStRIZ+9XnZZXCCpRl4F+2P/ePov1mTsH1GwrOZKwiRsnuv58MbL9V1R6Nz8ZEuTSzkbSNp5lJ9woyqtDNiV/Wskg3l5ccjNrC6+1jvyowLD3W4K3PN7IxHZxAyolAK11ZTXdDlG/urPaPjrfMMFHud X-MS-Exchange-AntiSpam-MessageData: z9NIQUTpwdqMvLkZtdLfgj/rlzcCgY7C2bPJmsRUCcrxOrYRVfVSfS+XJMDuT6I227ZosKv+JaG28QOe5C2Ti28s6gq2TsaQDEyzxOTAnedQ93dxHCOm1osyViArG0rhX/zCo7N3fNJgYpjHRohw5w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b5751a5-6125-403c-3ded-08d7e6c1509c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:25.3946 (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: FZqs3/fvFNsCXmqTTb4kLvLHf8QrIlrtToUiuf1NajChjwqL6Dy/jZAzypm71SJ8zjiT3UBdl5m3eFmC+vbnbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li Latest SCFW has removed old MISC SECO commands. So update the codes to use new SECO commands. Signed-off-by: Ye Li Reviewed-by: Peng Fan --- arch/arm/mach-imx/imx8/ahab.c | 6 +++--- arch/arm/mach-imx/imx8/parse-container.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c index cf3c7d762a..361c578efc 100644 --- a/arch/arm/mach-imx/imx8/ahab.c +++ b/arch/arm/mach-imx/imx8/ahab.c @@ -75,7 +75,7 @@ int authenticate_os_container(ulong addr) memcpy((void *)SEC_SECURE_RAM_BASE, (const void *)addr, ALIGN(length, CONFIG_SYS_CACHELINE_SIZE)); - err = sc_seco_authenticate(-1, SC_MISC_AUTH_CONTAINER, + err = sc_seco_authenticate(-1, SC_SECO_AUTH_CONTAINER, SECO_LOCAL_SEC_SEC_SECURE_RAM_BASE); if (err) { printf("Authenticate container hdr failed, return %d\n", @@ -123,7 +123,7 @@ int authenticate_os_container(ulong addr) goto exit; } - err = sc_seco_authenticate(-1, SC_MISC_VERIFY_IMAGE, + err = sc_seco_authenticate(-1, SC_SECO_VERIFY_IMAGE, (1 << i)); if (err) { printf("Authenticate img %d failed, return %d\n", @@ -144,7 +144,7 @@ int authenticate_os_container(ulong addr) } exit: - if (sc_seco_authenticate(-1, SC_MISC_REL_CONTAINER, 0) != SC_ERR_NONE) + if (sc_seco_authenticate(-1, SC_SECO_REL_CONTAINER, 0) != SC_ERR_NONE) printf("Error: release container failed!\n"); return ret; diff --git a/arch/arm/mach-imx/imx8/parse-container.c b/arch/arm/mach-imx/imx8/parse-container.c index e192b0c6d2..62e5b45610 100644 --- a/arch/arm/mach-imx/imx8/parse-container.c +++ b/arch/arm/mach-imx/imx8/parse-container.c @@ -49,7 +49,7 @@ static int authenticate_image(struct boot_img_t *img, int image_index) return -EPERM; } - err = sc_seco_authenticate(-1, SC_MISC_VERIFY_IMAGE, + err = sc_seco_authenticate(-1, SC_SECO_VERIFY_IMAGE, 1 << image_index); if (err) { printf("authenticate img %d failed, return %d\n", @@ -168,7 +168,7 @@ static int read_auth_container(struct spl_image_info *spl_image, memcpy((void *)SEC_SECURE_RAM_BASE, (const void *)container, ALIGN(length, CONFIG_SYS_CACHELINE_SIZE)); - ret = sc_seco_authenticate(-1, SC_MISC_AUTH_CONTAINER, + ret = sc_seco_authenticate(-1, SC_SECO_AUTH_CONTAINER, SECO_LOCAL_SEC_SEC_SECURE_RAM_BASE); if (ret) { printf("authenticate container hdr failed, return %d\n", ret); @@ -194,7 +194,7 @@ static int read_auth_container(struct spl_image_info *spl_image, end_auth: #ifdef CONFIG_AHAB_BOOT - if (sc_seco_authenticate(-1, SC_MISC_REL_CONTAINER, 0)) + if (sc_seco_authenticate(-1, SC_SECO_REL_CONTAINER, 0)) printf("Error: release container failed!\n"); #endif return ret; From patchwork Wed Apr 22 13:52:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275046 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=qGNByh5U; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hJJ5srcz9sSd for ; Wed, 22 Apr 2020 23:35:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 14C3981C81; Wed, 22 Apr 2020 15:32:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="qGNByh5U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6533F81C7B; Wed, 22 Apr 2020 15:30:54 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 2357081A26 for ; Wed, 22 Apr 2020 15:30:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pb03m+Y80EPKkA5xVralhKyF6HOjA5kkSmFnAnK1F4iV/QzybdaAK8PHDrvq0yT7bBYIsOSKPuRdB8AZiyTF1AGLuxBRYEAmElIUXX+NAzoujIVEabQYZWElk8aE2S7qCegwd4qUFJ2Pl8LbTKh8ZjMZd5/6OTynI6DHft7Itb+VrAEg0B2QRalnPzlUv1/6xh+0sCUroVeVSML6DVuel1TQGeTooEC0e02LgqlHcDgdOXwUvzryWq85KzULmbuamYk0VPen5xrwjrz6dJP0UNxwGHqZMvx0CPOzk++0rvxcQhBKR+1HEvGRTbONw/G7laXCAxpaA1QzrhW427wMCw== 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-SenderADCheck; bh=hhfyFRNOT920It7LddsgJ7ZEAJ6/tuTtP8+wOBX9zJ8=; b=LxZmiseqAntnLaYSDlv4xskxazOBuuQBjEbFYBU/42R2hmf0R8Dc3SK0asgRtqyCv0k6LtNlALf63Qrx3emf/Mf0dHRIRwO8yjTNdlNodCTDIk7ObABcFpDfiVleNf6do9cvTgjtUOTWZNTjCJazMdpYM0jWgNdZGT4m9f0oPZ6a3rS2MCt3lPbNB9+D/O/xQRvg4ZROXR0Biz8q/HtfGmLimKN89nsYHcl4kNUUo/t0/TyYqre6tHIeTXkufRVOZH+HGXZ5AHz8texQRHC1AWcHk2ADJHKEYkxB6I1Wet29xiy/yEigiLkJDytZ4176pr9rHtWN8Lu9cb2JH7sEPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hhfyFRNOT920It7LddsgJ7ZEAJ6/tuTtP8+wOBX9zJ8=; b=qGNByh5UWDKZK0hXkX3MgprNMFqjsTD54L6sLpbYMmectfvGwvs4W48JXPYtsc1ePT0Dn91mEMOqiSpSkPASGuH1CThM7bdW8k4CFofogq0aC7FvLahZ1dmHj+LMpp6CPrps9zybZiAHYvsDi7LLslI93A1AconjFqDzaN6dpJQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:27 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:27 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 16/24] imx8: ahab: fix 'end address' parameter of rm_find_memreg Date: Wed, 22 Apr 2020 21:52:27 +0800 Message-Id: <20200422135235.14756-16-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:25 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8d32a0e8-becd-4285-2f6a-08d7e6c151ac X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:82; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(956004)(86362001)(1076003)(4744005)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +cPvcMMEaMh4abOYeFBu1xdRb6zmfA+qNF4qbAVuZYKvWxVqo86ON8+5oJeLDSwtc48EOX1WRbaDh+O0NNmIkK/ayUpkhLqsEeoijcPTjIP/aci3x1INcjq+C4wxRpB8JxzFP6dOaXXnmMlriru6886lh4aFcEaU7d/Uy8ZJb8sEqeSJ8h7hD/EQIuL40Xa39YJDm8XAN3Zb5S6aEKl5FdoROjsvEty538TkWn5LY+ePv+W6fsMH+PPY6yxte7j8lp9EbgYEyC+xM4+uxje96Y0yYHgJnT7C0teGjtvvvN4KqnC8lBTZpoSuY6eBqLh5VRDL4RH/DnHaphyej3TExSA6hGFadVeivigGE+3KBVfJ+U3U+NcGSnJVcC5mBAQdj5BoCtPzY8pBlF/Tm04W5gCKsT9zHuREFTJbBFMn+CLlRAuY0EZFhE3Fv2lflBae X-MS-Exchange-AntiSpam-MessageData: BOmYi4S95SN8BNfzTfcEa8MSgUaNF068BGUdriqYvuLvsP1K3o/WldN21NywN8C7whQlTjrSO6NVTyFfi1tDm+WUmwzsVbR8YPO7z3B42S/NvLdjZGdJ4xtTbsw+QmqWpzDjWFOEfor49zcdkJgaUw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d32a0e8-becd-4285-2f6a-08d7e6c151ac X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:27.3818 (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: eqzPIum/llPUGmstrukwiBZomLaLtRkMFBwu7zYlwdCagqZx3xAEX7Af/SavrQ1dFm5sUngGTD3B9mIVTqYx4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean parameter 'end address' must be inclusive of address range. Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8/ahab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c index 361c578efc..89544b3dc6 100644 --- a/arch/arm/mach-imx/imx8/ahab.c +++ b/arch/arm/mach-imx/imx8/ahab.c @@ -97,7 +97,7 @@ int authenticate_os_container(ulong addr) img->size); s = img->dst & ~(CONFIG_SYS_CACHELINE_SIZE - 1); - e = ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE); + e = ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE) - 1; flush_dcache_range(s, e); From patchwork Wed Apr 22 13:52:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275047 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=hYrGXssf; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hJh1bQnz9sSd for ; Wed, 22 Apr 2020 23:35:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CDD8E81CA4; Wed, 22 Apr 2020 15:32:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="hYrGXssf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0AC5881C8A; Wed, 22 Apr 2020 15:31:04 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 848A881C5F for ; Wed, 22 Apr 2020 15:30:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YkODImNGkjlmeOrHQQNbRHws6Ya6pmEWZgs72OIsH8UI4Ry4vCwAFk9grUHjHdeHdHRC69Oggf7e7qevkjHVh5Rg9le6BSgAggJQ/Yll2R/MSYbR9Q5QTWPB28dkm3u5MxVgHWIaO7C21cRq9vaoPcFmKGXIDzqm8p+Nan2NWUkWXDKJ63929Sn996o9PNheK7LCsKr1bzOoa7wEeChJADEa8L2yQo3L0W7RGc5a73+XBV0twaGfC5YnKSk4FrEAvu1I0vtVqmFX+q/IZDHAVw94C3pwE2iCf6QM56iw5i7vH5yFdKuTwDupfirVGbSo8p/gqJJ22vPV6dK69K8+rA== 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-SenderADCheck; bh=Sl77kX86c68JzhqqHkZyRglgCyhrXyYZ+jYVajY+4Rg=; b=m6hkJ1p3nF0UANnu5E+cILaePF39mWLO6GXjyBBFXmosKLswCV9sibvn6QsvFMUPD5bQIDy6FjsLL6laZ6y47VWQk3VxqcVPkZVVNgHc3x7IQFQRfiX2K9VoAmpFNFSNrM3JDaKqHYHhjGax9fFyccYSyHnwceF3ANB6i+ESOqZX4NEcE6F53p+rBUm9EkNIALHJOgZuIFwBsqkW2Riat2sdZw/yn9RBLVDpVmXslLbjTv6HdUmO9D3CA/SMsu5s2fTCjzyaCgTLj6lP8Xv2vif5B9GymJcV93pWyPG0SKxW76WcLcFnB6PsnFbGB3b0cZ3Gfv2UzGoY+oNC0V1GoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Sl77kX86c68JzhqqHkZyRglgCyhrXyYZ+jYVajY+4Rg=; b=hYrGXssfojbvXqMzo3+9rcLz46A/Zn9wFMv/DpT+OhFAauN1LUdIh5O7VPC82prSR3lZPApko8x0wFnL51BvHUu5k4c+C5JvAfBF9c6gmDhw4pmJP1vJhoJJn0PJAUNLndhWWuILiG3T+07Hq03xsrjuBgn5K4xYrIVJFxSi+Vw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:29 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:29 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 17/24] imx8: ahab: fix some bad debug message formating Date: Wed, 22 Apr 2020 21:52:28 +0800 Message-Id: <20200422135235.14756-17-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:27 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 96975e06-4a8a-4b96-991e-08d7e6c152de X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XRR4V0r61OiS7UScEMoCxZRQG26mwepz/zvGFyqYLHrr2ZGn0tr6O1uVM2rz8bBmEanWBNniWZ+tGUPAV40lOPopfc0mFrC9AcSw3QOaGLFrFh8gTawyIw/4KjtvORSFAuMyx6UXkIAUqZw5biENVN2zBsFPtYVI25E3P4juOWHtEQ7eLTK1DRBSIX5YFn/JW1hRpKZpxZmHe3utobeKG4CfFFQ0uImdpTf1kBpaveGm4SwPgJ/VuuHl/XYNXx1hsb4XrXgYwpb3/ox4837VtFz9jcw+xJgO1pC6D6T95A1whVsYHlq+mY6InG4IozSTuxnoCIj3Ql2JSUztPawLoocgp+sXOhDFHtg6w30vXRv7ehwDH5fQzPtOCeMfb5qOcftbXLJh4Efz43Fnf5WOgl2GzrexGmVNysePmcCnHMqtCNsWCpbKpFWGntiMx6Ir X-MS-Exchange-AntiSpam-MessageData: pSwj20R82s0Im2W3tdIMHuItCZ4uce59RiZxojKxNzsSFI8EA9lDvC7opyTNlxLERtL/f6rKFGboiIjXvwonMHYL8dZuMxzJ19WvqZ2i2sZFQmpDgBHlvxWbev7wX3JIwczgYak/OUEH/4f7mCf6og== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96975e06-4a8a-4b96-991e-08d7e6c152de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:29.1950 (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: L1fYHovTAlW8UuYE8TuHsWfhPqqyIZxoTKnkq/aWUHEAHEMNSIJJYsqwaCiw1xoIXofhGHKnmxzjUPgddW/E8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Seb Fagard In SPL build, the formatting '%llx' in debug() is not supported. Also, fix some misplaced parameters in printf. Reviewed-by: Ye Li Signed-off-by: Seb Fagard Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8/ahab.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c index 89544b3dc6..6d25abe5ce 100644 --- a/arch/arm/mach-imx/imx8/ahab.c +++ b/arch/arm/mach-imx/imx8/ahab.c @@ -90,8 +90,8 @@ int authenticate_os_container(ulong addr) sizeof(struct container_hdr) + i * sizeof(struct boot_img_t)); - debug("img %d, dst 0x%llx, src 0x%lx, size 0x%x\n", - i, img->dst, img->offset + addr, img->size); + debug("img %d, dst 0x%x, src 0x%x, size 0x%x\n", + i, (uint32_t) img->dst, img->offset + addr, img->size); memcpy((void *)img->dst, (const void *)(img->offset + addr), img->size); @@ -104,8 +104,7 @@ int authenticate_os_container(ulong addr) /* Find the memreg and set permission for seco pt */ err = sc_rm_find_memreg(-1, &mr, s, e); if (err) { - printf("Not found memreg for image: %d, error %d\n", - i, err); + printf("Error: can't find memreg for image load address 0x%x, error %d\n", img->dst, err); ret = -ENOMEM; goto exit; } From patchwork Wed Apr 22 13:52:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275052 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=g1kagrqb; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hKg48Nfz9sSm for ; Wed, 22 Apr 2020 23:36:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3EEC281C98; Wed, 22 Apr 2020 15:33:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="g1kagrqb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F5B181C5A; Wed, 22 Apr 2020 15:31:04 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 E0D4581C65 for ; Wed, 22 Apr 2020 15:30:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gOq6ep6DPglEAEnHr7DCuUOEyzX8SThC1g+ZuupuRS2SJ9DgqSZ+HvvnaQkl7gdXyj42YAzci/F49RQB3KCApqpiCSVNBWHI4VW12KFXovwFVB0OLFWB3ohnytjsyg6N5hm5n7jR42rl064n6rAB1Dq5sH+JKIL7aV7SvyZkOLS7aPirxMh1wwbmBLym1hFQ3YQvpSRZKoPl4jiqVAOCTQvxeVJ79cKPCHEggtLGWRmT67g5PEJycsK+OL/skkLDhiPytbR5n903Yur0/AaSyzJsxv0M+kCjOkCfuWNrloZziNFhOPhVaigc9E27n9iB1yexcwMhJNFWPzqlqE0P2w== 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-SenderADCheck; bh=NmxCD1k/8TVuAB3iAWqpKkI3iLe9HuospgFnGCjxP30=; b=FmbCCjbw0CjU9OplBg1TOxv0rVWqWGCJ5Ei3JIt6nPaTb6RQGawXQmwwpfPPtbgxkpqlnLLPuS36yX+w5Uu0kBAJCAWI5+o5aDrx3LLRjI4vvZaz1cIJ1F1pg91nKeH0c3dyxRuDkssPCsF6Q+GPN/uTa1xkof0tkXVKNduqlTSAFvN65DKFe5tfocCoL5BuvF6dHHsRqkBWSSCuOf7TkTs5AkrpekwmMkp1cUbBPElGhXyaTpMwvKE2mjZqHLjczJ2W5bzHFxhS8WR4qEj92vaDbvc0gy5vlK62p8IxoMimsuuC3H5hRzSyGbzRpSKr4ybbJv0ZFvMonaIYhKstWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NmxCD1k/8TVuAB3iAWqpKkI3iLe9HuospgFnGCjxP30=; b=g1kagrqbp7Rko0iXXipHZ11uUExT0gHX/QQKblA8c164H+qvGz59Wz09LINjtBWJ8YHrn05QG0EMjf383vWeLZig2bJt/azcCk5DEi0Iwh/RNeKxIynn0SvXRl7Szs4k3BzVthzvzqUTovcUIXLCupfUKRzdVa+gPHXplOOs418= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:31 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:31 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 18/24] imx8: parser: fix some bad debug message formating Date: Wed, 22 Apr 2020 21:52:29 +0800 Message-Id: <20200422135235.14756-18-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:29 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d7623cc1-98a4-4899-e54a-08d7e6c153fa X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5TpUrMuRaWQ1baQTfUPDDrOyCbU1WgKI1meU+zhDOhr8qBZO5HhNuF+/RhpuGP/ct7R5noEza6x0WFClGsQiJClnTemUvFYAE+LmgMDQipFJrmlM4t2JoGPitc0oNhUlED8OUhc4nzlUQ4J4Lue5tpVbFZ11IAA1GYu+dNrqW2Y/3RpXaDYFgjK/pxk84NbLElnjubh7Gxk14LNj7+sdxRtBXe+/1vnwMfTVkiL0KT/EMfpodQ9YXAtK+o1IF9kSIAZRGPbn6xqtSyPaUJ0oWiCJ+sGpEPpD56RuMFuCIvU4MOOhcixInYjT6zAHGteVHc93XilREGD+BW3tb8WAdtgVLrHipVL3EeRudAFNJmIqa9VLrKOlkVsMx/n3FTwsDVMBbymUIGkFvjJurLko4KXiTCbwSoC8aJW3BAnUax7YSkJr/6rjG1fIs6lckcue X-MS-Exchange-AntiSpam-MessageData: iA8zfIs0hcKrhyy2FV9XuEDZqP+MICXScsRFJ5On/c8xyLw6KLuY1modu4fXvfXaAZWTJI74ciLbqARFNvAL+AuMKJkFxWpY65Hnk9JKLnuZMVuljr1Cq+80D41T18WsDBeUfg3ULRGv/FcONLRNHw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7623cc1-98a4-4899-e54a-08d7e6c153fa X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:31.0751 (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: bAEPrwucB9qediUOgNP2yRb2EW/GGnBt88WwKtfy7iWwlnmBeertDil9ked0cCs6l5MlQab1TtHheRHV6bSBWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean In SPL build, the formatting '%llx' in debug() is not supported. Also, fix some misplaced parameters in printf. Modified from Seb Fagard's downstream patch Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8/parse-container.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-imx/imx8/parse-container.c b/arch/arm/mach-imx/imx8/parse-container.c index 62e5b45610..cc8a51ad55 100644 --- a/arch/arm/mach-imx/imx8/parse-container.c +++ b/arch/arm/mach-imx/imx8/parse-container.c @@ -23,8 +23,8 @@ static int authenticate_image(struct boot_img_t *img, int image_index) int err; int ret = 0; - debug("img %d, dst 0x%llx, src 0x%x, size 0x%x\n", - image_index, img->dst, img->offset, img->size); + debug("img %d, dst 0x%x, src 0x%x, size 0x%x\n", + image_index, (uint32_t)img->dst, img->offset, img->size); /* Find the memreg and set permission for seco pt */ err = sc_rm_find_memreg(-1, &mr, @@ -32,14 +32,14 @@ static int authenticate_image(struct boot_img_t *img, int image_index) ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE) - 1); if (err) { - printf("can't find memreg for image: %d, err %d\n", - image_index, err); + printf("can't find memreg for image %d load address 0x%x, error %d\n", + image_index, img->dst & ~(CONFIG_SYS_CACHELINE_SIZE - 1), err); return -ENOMEM; } err = sc_rm_get_memreg_info(-1, mr, &start, &end); if (!err) - debug("memreg %u 0x%llx -- 0x%llx\n", mr, start, end); + debug("memreg %u 0x%x -- 0x%x\n", mr, start, end); err = sc_rm_set_memreg_permissions(-1, mr, SECO_PT, SC_RM_PERM_FULL); From patchwork Wed Apr 22 13:52:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275054 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=hrL95U3y; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hL12T4jz9sSd for ; Wed, 22 Apr 2020 23:36:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FEFA81C90; Wed, 22 Apr 2020 15:33:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="hrL95U3y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4159381C7F; Wed, 22 Apr 2020 15:31:10 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 B065381C70 for ; Wed, 22 Apr 2020 15:30:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aTRdP6zVOnHz3SDFo2a5w5lHbX9A7Xfjpj7TuDXp4IJz4er7QMHQdu7RKwvESqDWbdAxOypBEqDRfg9iCqCT9TjSUAZ4vMWsJKgMllFPSZeEiz34zltXUKqWj/1aikCs43F9TnzVfZfKDw1OJGcqwbg1oXcMegcM9onhZzlLAjBioPCxsC40H54FcpBQPgSxLYT72Zzv0oLJKj864D/mI0KkRJTKSAIo6fU4KJZzK3hlBOGZTssHqTsdyTG/ok2YgPMvs+A6JZq7/udMjnE+WYPwT4ZeUsyYYcJLYrjPbTLUAhqmjtbiUxdr6JwcMCX5RpNt16UHLxXFovQhVIXvpg== 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-SenderADCheck; bh=E5vSuTudha0QJwRRpflcAv9yCsPyHyBSafHzJ/abaRM=; b=bwEyqdsYMaJ6MH6bOYSYVAOE07/vXFPsPaTVS2FYHSY7rXkS709zM70NuMYQgrY18pb5f/sWzmpPkCdGSq3IWZcrnkbdb3eMMbVCeqyWZAaD/HYptCwLfcySX16No/FTV+fY73dlEaRcGg45MWtEA5OW5EX+/r5wdM6FjovELPj7WqpAIVwwiYcA4shZXNyDFW7AtIkKqSpg/buhjwjbr1QDKMPMYcK5T6K2p+jEcpe/kB7Mvir7hYa8K1Eu7jjpHm4+Md6+VT6SJzVhQpEPEgUaseReYYcovPJuvdGTzeBRtOboKIhOvkMQr3zESXPP847rUIEpaiPCI7ASvzzaMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E5vSuTudha0QJwRRpflcAv9yCsPyHyBSafHzJ/abaRM=; b=hrL95U3yro4REJg3cYqydKmefYWJhhAG/nDKgT0goUX32SECvaYYK9E1hvwk1apygJWh91b5LlExvtrFP6auR0skzoG5KYFIsHR04iHCevwiWiNevEUzz2gWI0A77CeQZFLfwjyHrQarZWRAY0MCEkL1KDSYiVJ2SjwT6eCwGpo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:33 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:33 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 19/24] imx8mm: clock: fix fracpll decode issue Date: Wed, 22 Apr 2020 21:52:30 +0800 Message-Id: <20200422135235.14756-19-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:31 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 874e4198-af2d-4fef-0ece-08d7e6c15515 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qHgVpQ0uZSqio0OX8l8JkVCRanKmQ21AAtYhi5knptsxQG2X9Sau+FCcPVnf5jr861n7kfc17W7WB2KkA7gjW4wBhLQvcq/Hk0C7pJwnliCxOueAZnVTg8e0pzjzYlOHc6AFcZ1T+Dk4f+Pfd8zYu/kiZdQVAdeFF52lyTz/pnvZKXHdC4jFatUJBOxKLHfxVi12p0psHfBQJvHN1nQhKPT4Y/osE3wuVyddBtgVlwzcYWwOqUFQXrCANbhi3AQ5nEcvpoUcdfAJUy+4pEGnX1Zu5ZFjr5S20aYbt5nL1GvaWNEuP3T2UOkpy4ByLiNRfEZb6qtjFBAjYoiFIZBSdiZ27gtUWM/vVM/uZQr7Iu77Ie1expJ5Pm+MsUsF5VC44s6QvoebuEXr1UqDzwCS4qjQ4DDKGQ7deQguiTK83qltVS6pthG2fHciLUR1iXFqMRpYIJGT/byyq4xwQJyA/hnZwXTsCI9XzrovZnWXBLktDo81tE7FKN6ww2nYoadn X-MS-Exchange-AntiSpam-MessageData: KMISywpw2uHo/WOJrGaNZJd/dKm3unLEzj2ToeBr8Gm5DmvNvWsxIukyxB/u2/ioZxYY/BSpx1VF0aNjFrSMvidXePnDLHRAIiTzg11J8+qIszheoL1uDQTw3vayupk68qDRd4k/EcKs9EDmOg8XLg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 874e4198-af2d-4fef-0ece-08d7e6c15515 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:32.9473 (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: xzhRACzTGqPEU07goZRGPKL8G4dbfuzZDAgZlEgKOQNaDqZqiNZB52Rc+3huZ4LmbU1pkslK1QnB96w3Z3NlKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li The fracpll decoding is using the bit definitions for int pll. Most of them are same, but the CLKE bit is different. Fix the wrong CLKE_MASK for fracpll and correct all bit definitions in fracpll decoding. Reviewed-by: Peng Fan Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8m/clock_imx8mm.h | 2 +- arch/arm/mach-imx/imx8m/clock_imx8mm.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h b/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h index 84ed61d21e..140e8bbabd 100644 --- a/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h +++ b/arch/arm/include/asm/arch-imx8m/clock_imx8mm.h @@ -19,7 +19,7 @@ #define LOCK_STATUS BIT(31) #define LOCK_SEL_MASK BIT(29) -#define CLKE_MASK BIT(11) +#define CLKE_MASK BIT(13) #define RST_MASK BIT(9) #define BYPASS_MASK BIT(4) #define MDIV_SHIFT 12 diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c index c423ac0058..8c9a6b8b12 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c @@ -447,34 +447,34 @@ static u32 decode_fracpll(enum clk_root_src frac_pll) } /* Only support SYS_XTAL 24M, PAD_CLK not take into consideration */ - if ((pll_gnrl_ctl & INTPLL_REF_CLK_SEL_MASK) != 0) + if ((pll_gnrl_ctl & GENMASK(1, 0)) != 0) return 0; - if ((pll_gnrl_ctl & INTPLL_RST_MASK) == 0) + if ((pll_gnrl_ctl & RST_MASK) == 0) return 0; /* * When BYPASS is equal to 1, PLL enters the bypass mode * regardless of the values of RESETB */ - if (pll_gnrl_ctl & INTPLL_BYPASS_MASK) + if (pll_gnrl_ctl & BYPASS_MASK) return 24000000u; - if (!(pll_gnrl_ctl & INTPLL_LOCK_MASK)) { + if (!(pll_gnrl_ctl & LOCK_STATUS)) { puts("pll not locked\n"); return 0; } - if (!(pll_gnrl_ctl & INTPLL_CLKE_MASK)) + if (!(pll_gnrl_ctl & CLKE_MASK)) return 0; - main_div = (pll_fdiv_ctl0 & INTPLL_MAIN_DIV_MASK) >> - INTPLL_MAIN_DIV_SHIFT; - pre_div = (pll_fdiv_ctl0 & INTPLL_PRE_DIV_MASK) >> - INTPLL_PRE_DIV_SHIFT; - post_div = (pll_fdiv_ctl0 & INTPLL_POST_DIV_MASK) >> - INTPLL_POST_DIV_SHIFT; + main_div = (pll_fdiv_ctl0 & MDIV_MASK) >> + MDIV_SHIFT; + pre_div = (pll_fdiv_ctl0 & PDIV_MASK) >> + PDIV_SHIFT; + post_div = (pll_fdiv_ctl0 & SDIV_MASK) >> + SDIV_SHIFT; - k = pll_fdiv_ctl1 & GENMASK(15, 0); + k = pll_fdiv_ctl1 & KDIV_MASK; return lldiv((main_div * 65536 + k) * 24000000ULL, 65536 * pre_div * (1 << post_div)); From patchwork Wed Apr 22 13:52:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275048 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Th+Sdkrw; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hK11tnvz9sSd for ; Wed, 22 Apr 2020 23:35:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C9E381C84; Wed, 22 Apr 2020 15:33:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="Th+Sdkrw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BE8981C65; Wed, 22 Apr 2020 15:31:10 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 08BAC81BED for ; Wed, 22 Apr 2020 15:30:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QfCwek79XFhO6CWZQJ+uAPeUzj6xCOMDKb7wAz+juMEj00TvuGMBzTMPfvD1In6/Y0+T+mstPVM1U2i2/Jf7eX1BQf8JLhLJ9hBFQNDfre30jjwX0ddoYW0JUz+U58dE+LM9Pt3hk1BtIgj+0TsJM4hT01p9GPQwP6NMiitPzXRjNSczcTuElb3xqW6J4GAwLbtnuDJa8LSFIMwXhiZc1SLJLximx82Uw/ppp+A9pNBQvoLKHoRc+MRkQ7RYuHyx5G9iRI26wTz3Did+lD0J+Igtp0zCw+vn6dMFrUwfti+Dj1s2NOK+FX8sjOaINi+y2FsL3x7IJkfLgywOCcE8sQ== 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-SenderADCheck; bh=woeR3+PFcrjQJPI9HBVcZRIIqrp1obRujxomrEAGXfI=; b=hakGh/tsIICbINtqaSjfd1uvkRquwS55zz20G/n9rl97E7x8eIo2dz+ZOGDCjsuE7m1uAZ98zkFLNwQMx5eMkdqLrukZR3LkjkiSRlFeI43NMjnD3ViTGuxMpDTDVNA5QC4f1UVNiG/JXTj9QbEc0LRJWhh02+KBKgfLp1IAd+0hN+iC7JACvAwBlfzUGuO1AGTgTAfvsVyNS45hqJvBVluTxTH97tswmhyMefpNYge+xWmFrXsn25YRHhRYtrLoHpWeV+PCTuTUKc1UztK9q5obQF4mLgS5MDUBaCdLlySKnV6LcL9DREQTH/N9+lxwIT2VRuHf4BUsZOTnKzeyvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=woeR3+PFcrjQJPI9HBVcZRIIqrp1obRujxomrEAGXfI=; b=Th+SdkrwnskoyTZFK2BYVJVRfg5ppGVO57Bxrop7+6WOZIkB+5SX1DOpOMDfkxduxF0ueUX2t4Dc9FwqIIC4oDLUJNJumAVQlgSSSB0UlFP2Rh506u6gvs/Twb+O3bJIqwo9U7FuJtF7jNVixVi9yeaVy6XkkkYf5FOgy686bw4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:34 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:34 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 20/24] imx8m: Enable WDOG_B for timeout Date: Wed, 22 Apr 2020 21:52:31 +0800 Message-Id: <20200422135235.14756-20-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:33 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2eec3363-a0f4-4811-7de2-08d7e6c1562a X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008)(32563001); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lf3sqQ+LekAxK6ZlQHKH5rdH0nNOaWNaItXu4VV+7ldJnKlCf3j6dRgeqwJdJCIhLAwe+Nnnh60yv301dBAYyOvICu+Jr80Ro9EHvu/4aC7vM9c8XT9bkWaeifrrESf7Opt4LOGV769e6jjmsjhCOw9MrjTZuVcj4mdrHSHrW39kNLjVpQi83EDrXzqmfSvDymrjeWxS86EwsPt3nI1NOi+W1Nem2DURm3dFPvmV0Er98GdCsgG0E2QTwpmCzNuFtnkDzayMMP6wZTFAVRO0n6afYIDVQkcFrSBSQ1FPe2L7lh9gFvAEkGfz1Mx1F8yoP7lpvn5NagX7ozDUxQ4XC10tHWNT9VIztg+yXIHjPw0PD9DjRZGkDYX0Px/u4PR1Pvw+c1a3lw/2uJelLeIJ/cEiSfDGjXlCXPgY9Y1xmJdNHxcakujKMVsp8rpStEHWD6lahhIk4e90khMZh95vvJhfNbjsNqT7xc4LJu0NGiVPPzD9sPmh1ymaF2+ZGZed X-MS-Exchange-AntiSpam-MessageData: uAZnmzG1j9aVut1323BU+o+qtjbmvcXnWRAg7hqmc0mdDhcbHvd3ZsjZx7a1SYGR/pWXauN6IIz2bF/wJz260QrPGrt0R5FkvE4mfGZNmZmHXqg68EpK5TMAQAEcXK57dxSEjd6yHzO4NZ5EIDIZoA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2eec3363-a0f4-4811-7de2-08d7e6c1562a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:34.7235 (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: tiWDuJatrNVXYs0JLl8UzZuLpLclWq+GEkOkoOsacQzzfdhu2rKyKHcUASjE1YYiOIo7jF0LhWDyMekwI9A/NQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li When doing reset_cpu, in normal case the WDOG_B outputs immediately after we clean WDA bit. But on mscale, the WDOG_B may be later than internal reset, and cause PMIC not reset. As we enabled the SD3.0 support, the PMIC must be reset to reset SD card. Change the reset_cpu to enable the WDOG_B for timeout as well, and set WDOG timeout to 1s. Acked-by: Peng Fan Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/mach-imx/imx8m/soc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 8b6be7bc19..f10b71c345 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -410,19 +410,19 @@ int ft_system_setup(void *blob, bd_t *bd) #if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYSRESET) void reset_cpu(ulong addr) { - struct watchdog_regs *wdog = (struct watchdog_regs *)addr; + struct watchdog_regs *wdog = (struct watchdog_regs *)addr; - if (!addr) - wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; + if (!addr) + wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; - /* Clear WDA to trigger WDOG_B immediately */ - writew((WCR_WDE | WCR_SRS), &wdog->wcr); + /* Clear WDA to trigger WDOG_B immediately */ + writew((SET_WCR_WT(1) | WCR_WDT | WCR_WDE | WCR_SRS), &wdog->wcr); - while (1) { - /* - * spin for .5 seconds before reset - */ - } + while (1) { + /* + * spin for 1 second before timeout reset + */ + } } #endif From patchwork Wed Apr 22 13:52:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275049 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=pU96S7Y/; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hKG1ql6z9sSd for ; Wed, 22 Apr 2020 23:36:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D964781CA5; Wed, 22 Apr 2020 15:33:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="pU96S7Y/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D2D6A81C7F; Wed, 22 Apr 2020 15:31:17 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 1175481C61 for ; Wed, 22 Apr 2020 15:30:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=emcOLduI7Do+sNo1S5H0ftPrP3cj2Y8g698h4jo50lc9K4usZ0AMsgAJYDoqrR9F5zapcggyIFaTE8LBdXEEgfwtGjcfaf9Hy5D0A5Na1/MffqI8XVqFaDzL5Q2Bk2jEM+IJKEouCvifGVCApzzuh5RaGdxWpSLPoyJEkzNxXW8zYreb9pzBu98MFHGnocb6wnk9in2lf7rg/S9eZ6gVclgLwWY3WzdjzWRGhN14Upv1/PW1pxmMSB6auDBdWSlynH/be0fpOYXWI3O9YHvW8Y8IPmIWaNgprm7vluu6DsC3KpKxYcKZh1jWExqgCG1cqaMagriQrcqOg+GcFWO9Lw== 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-SenderADCheck; bh=p+TWwK/dSMEFUsb4C52NE22Vz+CKTXvdOg0i+GlQBsw=; b=oc6osjZAdFAc2D5OJNmonYEB0qSar+uFWY57fRKm0ucGsS541oCMyU38K9EH0fi6rWpEFv7jHweFcop7rmw0MKcZjr3LUVMlb88yRUV3ODrpwd0VKG+37ZigPajB0Xe+XKulbVyya58dfNYBD2PoCHA/fU5cRLj7LZlsX9IVjGLwu6R/R6kYt2WqT7kWTHectJbSDhvWEDWlNma53JWNwi6ukW+z+QyqBpZ/UUmhs2+9jxTsU04WRO1oFHjbuVhRgtGrUCpwRVSm7enJjc247MoqSd1UH6+lYE0Rhb4mncmSQaDJnkmP9D5MJPa+Uq5Oyf4onUg8tknSeOPlE+J87Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p+TWwK/dSMEFUsb4C52NE22Vz+CKTXvdOg0i+GlQBsw=; b=pU96S7Y/zuMNs0bqXEzpX64gg9XeXs4RqfH59Uzy+iuPEszrP2C9EkvSJYM9NsUaJMDlWCW4FTlJZMDEWmQ3ulSzqsfXDV/IvI/HpDBm7YxQr7Zel8UshB16gMqWYqql2KSjRKilbEJ2D1OlZ8cxhVtLxGuEXZPz8scDsZn8jm4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:36 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:36 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 21/24] doc: ahab: Add encrypted boot documentation for i.MX8/8x devices Date: Wed, 22 Apr 2020 21:52:32 +0800 Message-Id: <20200422135235.14756-21-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:35 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f0326eda-0372-4c39-84cd-08d7e6c15742 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(6666004)(30864003)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 37IU4Yx2CVHeqenDVBV1l8j0LcPVQyisb3gvAogHPhnikteJnEzEK7SZQyt9tmHHUC0PiSRtu4wnkqCsfdTBMfhgdflskqD1j1JKEWpK8aRa1KORVPVeOGzHc1Q8o1Fms+UkC+7E+EZLmUe1Ib4Mf6pJX7/AfSQeBN7mhDfdmOBQfxZ+k2KzbM1Enj9mPMRs2xXFP788iXjKwYiVGaerjhbn3/wBeOL/fOCv3ygdqmzk755r4lgxUCHzt44YXuexhPFhMEyDutXtChH8SfYA3TBb+pvxXyiiWFjRwKQbJGQz5vII9TFDM9HhR7Seob1eM+98FrTaE3EZHeCau0T6lXxVhKhz95xMsYfy+xS6zB3eFzK2WJeGokyIXxQ20iZjtAhEIfBThgtdafPoEvtdhWqkD+/+CUngtgkiF9rT1PTYqKODe9ywD1CIlsynHTeG X-MS-Exchange-AntiSpam-MessageData: jI//jgolkcQqmE3c9SNAciALaVDEPxSc2EjmWHgXBiz9AEJKqVfPn0hICc+ymBE++P33TYZ4W7JCKDuya2OnVwp9YZxblUXPKHe06hsLqyE0XpT7tlbH6KLydJkYSjJaXiKl6nuI53LDjyTVkmCFCg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0326eda-0372-4c39-84cd-08d7e6c15742 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:36.6826 (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: kPkp1rizULQgaGsyYW0l26r8+z+SlYKY+Rpec1iIteA1RokYFGvMEh935JeuP8HhGW342wn7zZ1xlGxzSVpzEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Breno Lima Add AHAB encrypted boot documentation for i.MX8/8x family devices covering the following topics: - How to encrypt and sign the 2nd container in flash.bin image. - How to encrypt and sign a standalone container image. Include a CSF example to encrypt 2nd container in flash.bin image. Signed-off-by: Catia Han Signed-off-by: Breno Lima Signed-off-by: Peng Fan --- doc/imx/ahab/csf_examples/csf_enc_boot_image.txt | 27 +++ doc/imx/ahab/guides/mx8_mx8x_encrypted_boot.txt | 293 +++++++++++++++++++++++ 2 files changed, 320 insertions(+) create mode 100644 doc/imx/ahab/csf_examples/csf_enc_boot_image.txt create mode 100644 doc/imx/ahab/guides/mx8_mx8x_encrypted_boot.txt diff --git a/doc/imx/ahab/csf_examples/csf_enc_boot_image.txt b/doc/imx/ahab/csf_examples/csf_enc_boot_image.txt new file mode 100644 index 0000000000..6c70db657b --- /dev/null +++ b/doc/imx/ahab/csf_examples/csf_enc_boot_image.txt @@ -0,0 +1,27 @@ +[Header] +Target = AHAB +Version = 1.0 + +[Install SRK] +# SRK table generated by srktool +File = "./release/crts/SRK_1_2_3_4_table.bin" +# Public key certificate in PEM format +Source = "./release/crts/SRK1_sha384_secp384r1_v3_usr_crt.pem" +# Index of the public key certificate within the SRK table (0 .. 3) +Source index = 0 +# Type of SRK set (NXP or OEM) +Source set = OEM +# bitmask of the revoked SRKs +Revocations = 0x0 + +[Authenticate Data] +# Binary to be signed generated by mkimage +File = "flash.bin" +# Offsets = Container header Signature block (printed out by mkimage) +Offsets = 0x400 0x590 + +[Install Secret Key] +Key = "dek.bin" +Key Length = 128 +#Key Identifier = 0x1234CAFE +Image Indexes = 0xFFFFFFFE diff --git a/doc/imx/ahab/guides/mx8_mx8x_encrypted_boot.txt b/doc/imx/ahab/guides/mx8_mx8x_encrypted_boot.txt new file mode 100644 index 0000000000..dfea4c8277 --- /dev/null +++ b/doc/imx/ahab/guides/mx8_mx8x_encrypted_boot.txt @@ -0,0 +1,293 @@ + +=========================================================+ + + i.MX 8, i.MX 8X Encrypted Boot guide using AHAB + + +=========================================================+ + +1. AHAB Encrypted Boot process +------------------------------- + +This document describes a step-by-step procedure on how to encrypt and sign a +bootloader image for i.MX8/8x family devices. It is assumed that the reader +is familiar with basic AHAB concepts and has already closed the device, +step-by-step procedure can be found in mx8_mx8x_secure_boot.txt and +mx8_mx8x_spl_secure_boot.txt guides. + +The steps described in this document were based in i.MX8QM device, the same +concept can be applied to others processors in i.MX8/8X family devices. + +1.1 Understanding the encrypted image signature block +------------------------------------------------------ + +As described in mx8_mx8x_secure_boot.txt guide a single binary is used to boot +the device. The imx-mkimage tool combines all the input images in a container +structure, generating a flash.bin binary. + +AHAB is able to decrypt image containers by calling SECO authentication +functions, the image must be encrypted by CST and the resulting DEK (Data +Encryption Key) must be encapsulated and included into the container signature +block: + + +----------------------------+ + | | ^ + | | | + | Container header | | + | | | + | | | + +---+------------------------+ | + | S | Signature block header | | Signed + | i +------------------------+ | + | g | | | + | n | | | + | a | SRK table | | + | t | | | + | u | | v + | r +------------------------+ + | e | Signature | + | +------------------------+ + | B | | + | l | SGK Key | + | o | Certificate (optional) | + | c | | + | k +------------------------+ + | | DEK Blob | + +---+------------------------+ + +1.1.1 Understanding and generating the DEK blob +------------------------------------------------ + +The encrypted boot image requires a DEK blob on each time AHAB is used to +decrypt an image. The DEK blob is used as a security layer to wrap and store +the DEK off-chip using the OTPMK which is unique per device. + +On i.MX8/8x devices the DEK blob is generated using the SECO API, the following +funtion is available in U-Boot and can be executed through dek_blob command: + +- sc_seco_gen_key_blob(sc_ipc_t ipc, uint32_t id, sc_faddr_t load_addr, + sc_faddr_t export_addr, uint16_t max_size) + +Details in API usage can be found in SCFW API guide [1]. + +1.2 Enabling the encrypted boot support in U-Boot +-------------------------------------------------- + +For deploying an encrypted boot image additional U-Boot tools are needed, +please be sure to have the following features enabled, this can be achieved +by following one of the methods below: + +- Defconfig: + + CONFIG_AHAB_BOOT=y + CONFIG_CMD_DEKBLOB=y + CONFIG_IMX_SECO_DEK_ENCAP=y + CONFIG_FAT_WRITE=y + +- Kconfig: + + ARM architecture -> Support i.MX8 AHAB features + ARM architecture -> Support the 'dek_blob' command + File systems -> Enable FAT filesystem support-> Enable FAT filesystem + write support + +1.3 Enabling the encrypted boot support in CST +----------------------------------------------- + +The encryption feature is not enabled by default in Code Signing tools (CST). +The CST backend must be recompiled, execute the following commands to enable +encryption support in CST: + + $ sudo apt-get install libssl-dev openssl + $ cd /code/back_end/src + $ gcc -o cst_encrypted -I ../hdr -L ../../../linux64/lib *.c + -lfrontend -lcrypto + $ cp cst_encrypted ../../../linux64/bin/ + +1.4 Preparing the image container +---------------------------------- + +The container generation is explained in and mx8_mx8x_secure_boot.txt and +mx8_mx8x_spl_secure_boot.txt guides. This document is based in imx-mkimage +flash target (2 containers in flash.bin). + +- Assembly flash.bin binary: + + $ make SOC= flash + +The mkimage log is used during the encrypted boot procedure to create the +Command Sequence File (CSF): + + CST: CONTAINER 0 offset: 0x400 + CST: CONTAINER 0: Signature Block: offset is at 0x590 + DONE. + Note: Please copy image to offset: IVT_OFFSET + IMAGE_OFFSET + +1.6 Creating the CSF description to encrypt the 2nd container +-------------------------------------------------------------- + +The csf_enc_boot_image.txt available under ahab/csf_examples/ can be used as +example for encrypting the flash.bin binary, the main change is the Install +Secret Key command that must be added after Authenticate Data command. + + [Install Secret Key] + Key = "dek.bin" + Key Length = 128 + #Key Identifier = 0x1234CAFE + Image Indexes = 0xFFFFFFFE + +By default all images are encrypted and image indexes parameter can be used +to mask the images indexes that must be encrypted, on this example only the +2nd container will be encrypted. + +Optionally users can provide a key identifier that must match the value +provided during the blob generation, by default its value is zero. + +1.7 Encrypting the 2nd container +--------------------------------- + +The image is encrypted using the Code Signing Tool. The tool generates the +encrypted image and a random dek.bin file. + +- Encrypt flash.bin binary: + + $ ./cst_encrypted -i csf_enc_boot_image.txt -o enc_flash.bin + The DEK BLOB must be inserted at offset 0x7c0 (its expected size is 72 bytes) + CSF Processed successfully and signed image available in enc_boot_image.bin + +The output log will be used in a later step to insert the DEK blob into the +signature block. + +1.8 Generating the DEK Blob +---------------------------- + +The DEK must be encapsulated into a CAAM blob so it can be included into the +final encrypted binary. The U-Boot provides a tool called dek_blob which is +calling the SECO blob encapsulation API. + +Copy the dek.bin in SDCard FAT partition and run the following commands from +U-Boot prompt: + + => mmc list + FSL_SDHC: 1 (SD) + FSL_SDHC: 2 + => fatload mmc 1:1 0x80280000 dek.bin + => dek_blob 0x80280000 0x80280100 128 + => fatwrite mmc 1:1 0x80280100 dek_blob.bin 0x48 + +In host PC copy the generated dek_blob.bin to the CST directory. + +1.9 Assembling the encrypted image +----------------------------------- + +The DEK blob generated in the step above have to be inserted into the container +signature block. + +The CSF log is used to determine the DEK Blob offset: + + The DEK BLOB must be inserted at offset 0x7c0 (its expected size is 72 bytes) + CSF Processed successfully and signed image available in enc_boot_image.bin + +- Insert DEK Blob into container signature block: + + $ dd if=dek_blob.bin of=enc_flash.bin bs=1 seek=$((0x7c0)) conv=notrunc + +1.10 Flashing the encrypted boot image +--------------------------------------- + +The same offset is used for encrypted boot images, in case booting from +eMMC/SDCard the offset is 32K. + +- Flash encrypted image in SDCard: + + $ sudo dd if=enc_flash.bin of=/dev/sd bs=1K seek=32 && sync + +2.0 Encrypting a standalone container +-------------------------------------- + +CST is also able to encrypt additional images containers, the steps documented +in this section are based in OS container but can be also applied to SPL +targets and 3rd containers. + +2.1 Creating the OS container +------------------------------ + +As explained in mx8_mx8x_secure_boot.txt guide the imx-mkimage tool is used to +generate an image container for OS images, the mkimage log is used during the +encrypted boot procedure to create the Command Sequence File (CSF). + +- Creating OS container: + + $ make SOC= flash_kernel + ... + CST: CONTAINER 0 offset: 0x0 + CST: CONTAINER 0: Signature Block: offset is at 0x110 + +2.2 Creating the CSF description file for standalone container +--------------------------------------------------------------- + +The Image Indexes parameter is used to mask the images that are encrypted by +CST, as a single container is used for OS images the Image Indexes command can +be commented or set to 0xFFFFFFFF. + + [Install Secret Key] + Key = "dek_os.bin" + Key Length = 128 + #Key Identifier = 0x1234CAFE + Image Indexes = 0xFFFFFFFF + +2.3 Encrypting the standalone container +---------------------------------------- + +As explained in section 1.7 the CST generates the encrypted image and a random +dek.bin file. + +- Encrypt the standalone container: + + $ ./cst_encrypted -i csf_linux_img.txt -o enc_flash_os.bin + The DEK BLOB must be inserted at offset 0x340 (its expected size is 72 bytes) + CSF Processed successfully and signed image available in enc_flash_os.bin + +The output log will be used in a later step to insert the DEK blob into the +signature block. + +2.4 Generating the DEK Blob for standalone container +---------------------------------------------------- + +Similar to section 1.8 the DEK must be encapsulated into a CAAM blob so it can +be included into the final encrypted binary. + +Copy the dek_os.bin in SDCard FAT partition and run the following commands from +U-Boot prompt: + + => mmc list + FSL_SDHC: 1 (SD) + FSL_SDHC: 2 + => fatload mmc 1:1 0x80280000 dek_os.bin + => dek_blob 0x80280000 0x80280100 128 + => fatwrite mmc 1:1 0x80280100 dek_blob_os.bin 0x48 + +In host PC copy the generated dek_blob_os.bin to the CST directory. + +2.5 Assembling the encrypted image +----------------------------------- + +The DEK blob generated in the step above have to be inserted into the container +signature block. + +The CSF log is used to determine the DEK Blob offset: + + The DEK BLOB must be inserted at offset 0x340 (its expected size is 72 bytes) + CSF Processed successfully and signed image available in enc_flash_os.bin + +- Insert DEK Blob into container signature block: + + $ dd if=dek_blob_os.bin of=enc_flash_os.bin bs=1 seek=$((0x340)) conv=notrunc + +2.6 Copy encrypted image to SDCard +----------------------------------- + +The encrypted container can be copied to SDCard FAT partition, please note +that U-Boot requires signed and encrypted containers to be named as +os_cntr_signed.bin. + + $ sudo cp enc_flash_os.bin /media/UserID/Boot\ imx8/os_cntr_signed.bin + +References: +[1] SCFW API guide: "System Controller Firmware API Reference Guide - Rev 1.5" From patchwork Wed Apr 22 13:52:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275056 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=rJyMOr0m; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hLF3QJVz9sSm for ; Wed, 22 Apr 2020 23:36:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E1DC81CA9; Wed, 22 Apr 2020 15:33:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="rJyMOr0m"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7C94E81C8D; Wed, 22 Apr 2020 15:31:20 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::613]) (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 6628681C62 for ; Wed, 22 Apr 2020 15:30:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dJBfAsUKPNhLnUKKczWte8TC1AuO5s64yHzXV4/04gGuHx3fKJAx+4bsX+1YQKwP2c4J4G43iqbYHt02sq7KqXQJxoIi4GW1p/MZgn5fo3JAxB4quWrD5Lg3LUwQSuTfBDWL4cmHA2WU8RUSEWlXEa7s33rjeIFitUixMUQuPoEvIUOZeG9x9gyqDevVBAyKNFuG+WloOZHzbf3FjxSWm7ynOMkijKvWI9zd1sijVPCRQ9H9v8H/6YFORUy0hwcNa2Mnh9fzkahaUHxEmvffMT42wOpEula0nzxa15bJZGL5oG9uTZAZTQOkew+ymlemOsky0ingxozy2TK6QJV+bQ== 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-SenderADCheck; bh=rq8jKdddWsl7rX297wJvMwZShqX0z1pgEWsr+5/B7z0=; b=PbeXxM2AdrMB5K/lxyT17M0FK0lstYCoHLObVFBpvgHgSg4kObJE9eCvPHlusnHxZq6YhXQV9CPMe5nyaSkxLNzowkMNZjWIi23fkhCyM3H5e9FEsiMoE2eRYkZwltdFGVi0S1PvAlIujxbPMhVOS3Oy2Du2z13zHCsm1PMK2O9tnc0+VM2n3CG99x3jBnyNsIcMstuqTT1SuBllTj6FOCiHUHPNC5HwIivwMEbzsx00yoC5yvIPHq6vhbbPd0wnqsfmC5F/shuNEjts/DNMoNQ2VxY8F0M3Xv1O0H7hQPG9bmsvJO3dKSG0jPTQAWIedI3N5wWlZr639ZT7O2757w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rq8jKdddWsl7rX297wJvMwZShqX0z1pgEWsr+5/B7z0=; b=rJyMOr0mv1fe8XgkwxWEAUwxwdZBjMpssyHr3afsf+Kn5AG/WQaUajduPlMg+b0iCC71jp82kWTGx1gHWFPJBycDicgvLk8kKuWsg4ea75O8BFCixn4rl8PyIssxdmLBCPaxpqDSOfKk3AxStzoh520Z8IYc7WgTPdpQ+FFMAqQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:38 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:38 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 22/24] imx8: scu api: Add support for SECO manufacturing protection APIs Date: Wed, 22 Apr 2020 21:52:33 +0800 Message-Id: <20200422135235.14756-22-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:37 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4d392ec2-4270-4294-a522-08d7e6c15869 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(6666004)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u7UqrFbb6V2TMDpzegdTBuYxlWVzQw+ryJixPCKtUoLhcdchp7ydK3gRrFp4Va1Au7Ua1Tl6ddijjqYcpnV6zHV9w0XIhW7yiF4vubxkLsPZnMp3SwTY62ah16eX58qpdmEPp0SNKa36ZzFE+AS/Um/eDLIZNHiuKUhJZQaXOkxIhZg1GNgvetJwNz0Oj0SRpj+DkwQsbsDO74cCysG+YqFllmBVCzLfLpAiT1XPJCAGWNmQQQP1Ju6Qiu+EZ57J+kiDsFHdljqTINN2rzglEsqzw5rJOHoIbYitzsEZVzrpt+/+Cl5X4iTqb4GvTc78V+HVwsNU15QwAWY9IJzZDqe3WZW/5rgtr3LkJ/fbyaYd9Qp8p3kvmVSPvuHSoca2WdjFiz/EAa/lf+nyfnZkhU1z798SEtmnrdTQypTgvk8fdibGNOfp0Qk0z5psiKsS X-MS-Exchange-AntiSpam-MessageData: GZnaaINxRue8VFvopTBLr98HCmskQuLENfC5L3TYhOsHPxjEcNPHpKjLj7Cdu1NNBkzBEx9uBh4T4WPXALmD2bDK6HtfqR3uOT1at6W1kMLCCQTf9Iasmj5cZ91UyCXtweBfelaM+ZRZuwRTCJmzUw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d392ec2-4270-4294-a522-08d7e6c15869 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:38.5248 (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: 7Sd56Px7hvPzqESf7mI5v71GLmc/cH2zRLxwJE7u3aycR//PXNWq1VazBAupfYP9yQ/TABQ9fE4lGTD3/+w96g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Breno Lima SECO provides APIs to support CAAM manufacturing protection: - sc_seco_get_mp_key() - sc_seco_get_mp_sign() - sc_seco_update_mpmr() Add SCFW APIs support. Signed-off-by: Breno Lima Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8/sci/sci.h | 4 ++ drivers/misc/imx8/scu_api.c | 80 ++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/arch/arm/include/asm/arch-imx8/sci/sci.h b/arch/arm/include/asm/arch-imx8/sci/sci.h index 14ee6f999b..ac65f199b8 100644 --- a/arch/arm/include/asm/arch-imx8/sci/sci.h +++ b/arch/arm/include/asm/arch-imx8/sci/sci.h @@ -122,5 +122,9 @@ void sc_seco_build_info(sc_ipc_t ipc, u32 *version, u32 *commit); int sc_seco_get_event(sc_ipc_t ipc, u8 idx, u32 *event); int sc_seco_gen_key_blob(sc_ipc_t ipc, u32 id, sc_faddr_t load_addr, sc_faddr_t export_addr, u16 max_size); +int sc_seco_get_mp_key(sc_ipc_t ipc, sc_faddr_t dst_addr, u16 dst_size); +int sc_seco_update_mpmr(sc_ipc_t ipc, sc_faddr_t addr, u8 size, u8 lock); +int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr, + u16 msg_size, sc_faddr_t dst_addr, u16 dst_size); #endif diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index 3ad21c1ea0..c1e54fc4bc 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -948,3 +948,83 @@ int sc_seco_gen_key_blob(sc_ipc_t ipc, u32 id, sc_faddr_t load_addr, return ret; } + +int sc_seco_get_mp_key(sc_ipc_t ipc, sc_faddr_t dst_addr, + u16 dst_size) +{ + struct udevice *dev = gd->arch.scu_dev; + struct sc_rpc_msg_s msg; + int size = sizeof(struct sc_rpc_msg_s); + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 4U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_SECO); + RPC_FUNC(&msg) = (u8)(SECO_FUNC_GET_MP_KEY); + + RPC_U32(&msg, 0U) = (u32)(dst_addr >> 32ULL); + RPC_U32(&msg, 4U) = (u32)(dst_addr); + RPC_U16(&msg, 8U) = (u16)(dst_size); + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret) + printf("%s, dst_addr:0x%llx, res:%d\n", + __func__, dst_addr, RPC_R8(&msg)); + + return ret; +} + +int sc_seco_update_mpmr(sc_ipc_t ipc, sc_faddr_t addr, uint8_t size_m, + uint8_t lock) +{ + struct udevice *dev = gd->arch.scu_dev; + struct sc_rpc_msg_s msg; + int size = sizeof(struct sc_rpc_msg_s); + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 4U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_SECO); + RPC_FUNC(&msg) = (u8)(SECO_FUNC_UPDATE_MPMR); + + RPC_U32(&msg, 0U) = (u32)(addr >> 32ULL); + RPC_U32(&msg, 4U) = (u32)(addr); + RPC_U8(&msg, 8U) = (u8)(size_m); + RPC_U8(&msg, 9U) = (u8)(lock); + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret) + printf("%s, addr:0x%llx, size_m:%x, lock:0x%x, res:%d\n", + __func__, addr, size_m, lock, RPC_R8(&msg)); + return ret; +} + +int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr, + u16 msg_size, sc_faddr_t dst_addr, + u16 dst_size) +{ + struct udevice *dev = gd->arch.scu_dev; + struct sc_rpc_msg_s msg; + int size = sizeof(struct sc_rpc_msg_s); + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 6U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_SECO); + RPC_FUNC(&msg) = (u8)(SECO_FUNC_GET_MP_SIGN); + + RPC_U32(&msg, 0U) = (u32)(msg_addr >> 32ULL); + RPC_U32(&msg, 4U) = (u32)(msg_addr); + RPC_U32(&msg, 8U) = (u32)(dst_addr >> 32ULL); + RPC_U32(&msg, 12U) = (u32)(dst_addr); + RPC_U16(&msg, 16U) = (u16)(msg_size); + RPC_U16(&msg, 18U) = (u16)(dst_size); + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret) + printf("%s, msg_addr:0x%llx, msg_size:%x, dst_addr:0x%llx," + "dst_size:%x, res:%d\n", __func__, msg_addr, msg_size, + dst_addr, dst_size, RPC_R8(&msg)); + + return ret; +} From patchwork Wed Apr 22 13:52:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275058 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=BK4BDDhh; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hLW3vdtz9sSm for ; Wed, 22 Apr 2020 23:37:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C346B81CAD; Wed, 22 Apr 2020 15:34:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="BK4BDDhh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 57A4581A66; Wed, 22 Apr 2020 15:31:25 +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.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FORGED_SPF_HELO,KHOP_HELO_FCRDNS,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0622.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1e::622]) (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 4427981C78 for ; Wed, 22 Apr 2020 15:30:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KzEMskQW+5zEEBtIy1y12V9ZY0oE/V7FJH+lIVEHPCfifa7YVYyGKDmoYhA+rRvwJ4gUZRWwboM5jHQ6Nhzqv6aQEqFDN8+bnUmleQwgfbR9dYZ0uWJFA9sTtgis/fwOxqGIxIK4No5k1u54n9d8H4PCdqVHqxjaXQmVnGCMnI5bYmWwiNWWm7NBbfhtuEIjR1jxYj6kDFsdBrU4ztLdFp9u6S+5nexQbGzraBylHVjuxPWMyzhW8SPOqKcnuySD6K9VdBfPw7N+J2/LTkCJYrybcB7ZT/CE4NKVW5fFnUPnT0SflFEzeOqWvXDH5iP1SUZoOd0pQwvLhxQ1QZvwRg== 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-SenderADCheck; bh=dl6Wm/pue+sl9iEa/rW1US9Xk8OE09SDMdZJlwgYmjw=; b=AKGF2A2hEu1t+fenI+5Xtn+NbPSvsUrcTLSfDho8PG/3mPZUIhLClWoVegoYaxq5YR6+loyD1Hb9yHQCn97AEF3hTZXzeABudxOH8tchzU8EAJquHfipXM9tYJD8iyFJMu/yvp+rZVzuKUoee+ANyElAjJobsh7yMg1IpBIWsytFuHt5bm/4UcPPB+/dOigIDn7CkOtTW6cmJRD5ruT4ztXgbGQWW7SAq4pwiDJHnJA4rML46eVw8xbZCdUFBOXZoCJaV4syC/K+mR8TQ0IDtWmk5r+AxpGFJxE2AYOutm1kgcOAZRoFy0/EIT78x2SpUit/vHO3By/UTR6SkcVWww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dl6Wm/pue+sl9iEa/rW1US9Xk8OE09SDMdZJlwgYmjw=; b=BK4BDDhh0rI7ekdb7hTrQBjpjkbdbfw464raUklQ25xRUJvNJxdzSs/vAPgm9ereznwtKbFNlLFgSsRFUyaORfZEN1KbbL0pAtaT7fsOygs9//mMqG/s06Lbrj0vdN04MMb82OXtIGBMpm1yBSl5wuoG7vW+RWyVQxOGGjN8zq4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:41 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:40 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 23/24] imx8: Update SCFW API to version 1.5 Date: Wed, 22 Apr 2020 21:52:34 +0800 Message-Id: <20200422135235.14756-23-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:38 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 62e8b48c-b77c-4058-2e0e-08d7e6c15985 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:40; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(6666004)(30864003)(15650500001)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008)(309714004); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a8qfI1U5r6vMP86Xnhgd6B8RgQkKfpQZaUujRUvTM1dResE3W7SeR28iulhLrJ1MqyxdhniQRakXbHjNXDp55cOteMHSO83ESCk5nmhj9gC/Ai3Uav/rLkL5EoW9Wb9kZX5iSqCOeXrYuX5cNnpOhIOAGPYkuT17rFPEj8xs5+YjWPpwZi7ohZuHnk8UDw3U6/qIwhZwLGU0+sQCeqnA7rIxw/1Ja5MEiCVxBivXkVPCOQCzT/Fiba4CFzfaf4s56HX3BS4WJvt6iyTueCFUP0Q+vZ0vqayzMInaIkuQTnjXN30DQXxYaKbp8xJZaTaSJYn7yMTpdx6Eb0Rw/RN0Rbxbnqa5PDqUhqmICx9HWkJNwBaBlftiWaHO+vE4EvqaLT2jj9jkK/ou9mBKdnesZBH0hJ/V3ratPWM4PCNp60LzvNJeJcVZpXUwg9P0pavlwyV6uQV1uYMHafLH4cjBiCfkEaBb+Rn2utW6msM9yf1qdSWsBc/Pl8HyivMKgeYj X-MS-Exchange-AntiSpam-MessageData: ftZ2hKH6eaigs/l7Z20ckTTQOwmHZFgBb6A/UiH8gq8xpepVPLZCi6/XgDbQ+9kj0LZsR3Xhgf9RWys6LoQyAOx9jMZcvY5y98O0tVInypfH907KoTXBcM2GaxHC8hRh6hVrdJ5D5I3ZXvEUd8KArQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62e8b48c-b77c-4058-2e0e-08d7e6c15985 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:40.4729 (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: F1XirE+3sD4vJ5klxdHuVvxwAhws6fCgmwdHHuySWisdVD0HnBlvkrwkNJWxhNZq2zsOr8dMZuJ4k0Q+lUgDbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Ye Li Sync the latest SCFW API with below commit 6dcd0242ae7a53ac ("SCF-105: Revert accidental change") to add interfaces for PM resource reset and read/write SNVS security violation and tamper DGO registers. Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8/sci/rpc.h | 86 ++++++++++++++++++------ arch/arm/include/asm/arch-imx8/sci/sci.h | 2 + arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h | 3 + arch/arm/include/asm/arch-imx8/sci/types.h | 6 ++ drivers/misc/imx8/scu_api.c | 50 ++++++++++++++ 5 files changed, 126 insertions(+), 21 deletions(-) diff --git a/arch/arm/include/asm/arch-imx8/sci/rpc.h b/arch/arm/include/asm/arch-imx8/sci/rpc.h index 8e1e9bbf43..c1a9c353ba 100644 --- a/arch/arm/include/asm/arch-imx8/sci/rpc.h +++ b/arch/arm/include/asm/arch-imx8/sci/rpc.h @@ -8,6 +8,11 @@ #define SC_RPC_H /* Note: Check SCFW API Released DOC before you want to modify something */ +/* Defines */ + +#define SCFW_API_VERSION_MAJOR 1U +#define SCFW_API_VERSION_MINOR 15U + #define SC_RPC_VERSION 1U #define SC_RPC_MAX_MSG 8U @@ -17,9 +22,13 @@ #define RPC_SVC(MSG) ((MSG)->svc) #define RPC_FUNC(MSG) ((MSG)->func) #define RPC_R8(MSG) ((MSG)->func) +#define RPC_I64(MSG, IDX) ((s64)(RPC_U32((MSG), (IDX))) << 32ULL) | \ + (s64)(RPC_U32((MSG), (IDX) + 4U)) #define RPC_I32(MSG, IDX) ((MSG)->DATA.i32[(IDX) / 4U]) #define RPC_I16(MSG, IDX) ((MSG)->DATA.i16[(IDX) / 2U]) #define RPC_I8(MSG, IDX) ((MSG)->DATA.i8[(IDX)]) +#define RPC_U64(MSG, IDX) ((u64)(RPC_U32((MSG), (IDX))) << 32ULL) | \ + (u64)(RPC_U32((MSG), (IDX) + 4U)) #define RPC_U32(MSG, IDX) ((MSG)->DATA.u32[(IDX) / 4U]) #define RPC_U16(MSG, IDX) ((MSG)->DATA.u16[(IDX) / 2U]) #define RPC_U8(MSG, IDX) ((MSG)->DATA.u8[(IDX)]) @@ -76,6 +85,8 @@ struct sc_rpc_msg_s { #define PM_FUNC_REBOOT 9U #define PM_FUNC_REBOOT_PARTITION 12U #define PM_FUNC_CPU_START 11U +#define PM_FUNC_CPU_RESET 23U +#define PM_FUNC_RESOURCE_RESET 29U #define PM_FUNC_IS_PARTITION_STARTED 24U /* MISC RPC */ @@ -160,26 +171,59 @@ struct sc_rpc_msg_s { #define RM_FUNC_DUMP 27U /* SECO RPC */ -#define SECO_FUNC_UNKNOWN 0 -#define SECO_FUNC_IMAGE_LOAD 1U -#define SECO_FUNC_AUTHENTICATE 2U -#define SECO_FUNC_FORWARD_LIFECYCLE 3U -#define SECO_FUNC_RETURN_LIFECYCLE 4U -#define SECO_FUNC_COMMIT 5U -#define SECO_FUNC_ATTEST_MODE 6U -#define SECO_FUNC_ATTEST 7U -#define SECO_FUNC_GET_ATTEST_PKEY 8U -#define SECO_FUNC_GET_ATTEST_SIGN 9U -#define SECO_FUNC_ATTEST_VERIFY 10U -#define SECO_FUNC_GEN_KEY_BLOB 11U -#define SECO_FUNC_LOAD_KEY 12U -#define SECO_FUNC_GET_MP_KEY 13U -#define SECO_FUNC_UPDATE_MPMR 14U -#define SECO_FUNC_GET_MP_SIGN 15U -#define SECO_FUNC_BUILD_INFO 16U -#define SECO_FUNC_CHIP_INFO 17U -#define SECO_FUNC_ENABLE_DEBUG 18U -#define SECO_FUNC_GET_EVENT 19U -#define SECO_FUNC_FUSE_WRITE 20U +#define SECO_FUNC_UNKNOWN 0 /* Unknown function */ +#define SECO_FUNC_IMAGE_LOAD 1U /* Index for seco_image_load() RPC call */ +#define SECO_FUNC_AUTHENTICATE 2U /* Index for seco_authenticate() RPC call */ +#define SECO_FUNC_ENH_AUTHENTICATE 24U /* Index for sc_seco_enh_authenticate() RPC call */ +#define SECO_FUNC_FORWARD_LIFECYCLE 3U /* Index for seco_forward_lifecycle() RPC call */ +#define SECO_FUNC_RETURN_LIFECYCLE 4U /* Index for seco_return_lifecycle() RPC call */ +#define SECO_FUNC_COMMIT 5U /* Index for seco_commit() RPC call */ +#define SECO_FUNC_ATTEST_MODE 6U /* Index for seco_attest_mode() RPC call */ +#define SECO_FUNC_ATTEST 7U /* Index for seco_attest() RPC call */ +#define SECO_FUNC_GET_ATTEST_PKEY 8U /* Index for seco_get_attest_pkey() RPC call */ +#define SECO_FUNC_GET_ATTEST_SIGN 9U /* Index for seco_get_attest_sign() RPC call */ +#define SECO_FUNC_ATTEST_VERIFY 10U /* Index for seco_attest_verify() RPC call */ +#define SECO_FUNC_GEN_KEY_BLOB 11U /* Index for seco_gen_key_blob() RPC call */ +#define SECO_FUNC_LOAD_KEY 12U /* Index for seco_load_key() RPC call */ +#define SECO_FUNC_GET_MP_KEY 13U /* Index for seco_get_mp_key() RPC call */ +#define SECO_FUNC_UPDATE_MPMR 14U /* Index for seco_update_mpmr() RPC call */ +#define SECO_FUNC_GET_MP_SIGN 15U /* Index for seco_get_mp_sign() RPC call */ +#define SECO_FUNC_BUILD_INFO 16U /* Index for seco_build_info() RPC call */ +#define SECO_FUNC_CHIP_INFO 17U /* Index for seco_chip_info() RPC call */ +#define SECO_FUNC_ENABLE_DEBUG 18U /* Index for seco_enable_debug() RPC call */ +#define SECO_FUNC_GET_EVENT 19U /* Index for seco_get_event() RPC call */ +#define SECO_FUNC_FUSE_WRITE 20U /* Index for seco_fuse_write() RPC call */ +#define SECO_FUNC_PATCH 21U /* Index for sc_seco_patch() RPC call */ +#define SECO_FUNC_START_RNG 22U /* Index for sc_seco_start_rng() RPC call */ +#define SECO_FUNC_SAB_MSG 23U /* Index for sc_seco_sab_msg() RPC call */ +#define SECO_FUNC_SECVIO_ENABLE 25U /* Index for sc_seco_secvio_enable() RPC call */ +#define SECO_FUNC_SECVIO_CONFIG 26U /* Index for sc_seco_secvio_config() RPC call */ +#define SECO_FUNC_SECVIO_DGO_CONFIG 27U /* Index for sc_seco_secvio_dgo_config() RPC call */ + +/* IRQ RPC */ +#define IRQ_FUNC_UNKNOWN 0 /* Unknown function */ +#define IRQ_FUNC_ENABLE 1U /* Index for sc_irq_enable() RPC call */ +#define IRQ_FUNC_STATUS 2U /* Index for sc_irq_status() RPC call */ + +/* TIMER RPC */ +#define TIMER_FUNC_UNKNOWN 0 /* Unknown function */ +#define TIMER_FUNC_SET_WDOG_TIMEOUT 1U /* Index for sc_timer_set_wdog_timeout() RPC call */ +#define TIMER_FUNC_SET_WDOG_PRE_TIMEOUT 12U /* Index for sc_timer_set_wdog_pre_timeout() RPC call */ +#define TIMER_FUNC_START_WDOG 2U /* Index for sc_timer_start_wdog() RPC call */ +#define TIMER_FUNC_STOP_WDOG 3U /* Index for sc_timer_stop_wdog() RPC call */ +#define TIMER_FUNC_PING_WDOG 4U /* Index for sc_timer_ping_wdog() RPC call */ +#define TIMER_FUNC_GET_WDOG_STATUS 5U /* Index for sc_timer_get_wdog_status() RPC call */ +#define TIMER_FUNC_PT_GET_WDOG_STATUS 13U /* Index for sc_timer_pt_get_wdog_status() RPC call */ +#define TIMER_FUNC_SET_WDOG_ACTION 10U /* Index for sc_timer_set_wdog_action() RPC call */ +#define TIMER_FUNC_SET_RTC_TIME 6U /* Index for sc_timer_set_rtc_time() RPC call */ +#define TIMER_FUNC_GET_RTC_TIME 7U /* Index for sc_timer_get_rtc_time() RPC call */ +#define TIMER_FUNC_GET_RTC_SEC1970 9U /* Index for sc_timer_get_rtc_sec1970() RPC call */ +#define TIMER_FUNC_SET_RTC_ALARM 8U /* Index for sc_timer_set_rtc_alarm() RPC call */ +#define TIMER_FUNC_SET_RTC_PERIODIC_ALARM 14U /* Index for sc_timer_set_rtc_periodic_alarm() RPC call */ +#define TIMER_FUNC_CANCEL_RTC_ALARM 15U /* Index for sc_timer_cancel_rtc_alarm() RPC call */ +#define TIMER_FUNC_SET_RTC_CALB 11U /* Index for sc_timer_set_rtc_calb() RPC call */ +#define TIMER_FUNC_SET_SYSCTR_ALARM 16U /* Index for sc_timer_set_sysctr_alarm() RPC call */ +#define TIMER_FUNC_SET_SYSCTR_PERIODIC_ALARM 17U /* Index for sc_timer_set_sysctr_periodic_alarm() RPC call */ +#define TIMER_FUNC_CANCEL_SYSCTR_ALARM 18U /* Index for sc_timer_cancel_sysctr_alarm() RPC call */ #endif /* SC_RPC_H */ diff --git a/arch/arm/include/asm/arch-imx8/sci/sci.h b/arch/arm/include/asm/arch-imx8/sci/sci.h index ac65f199b8..179037ae17 100644 --- a/arch/arm/include/asm/arch-imx8/sci/sci.h +++ b/arch/arm/include/asm/arch-imx8/sci/sci.h @@ -72,6 +72,7 @@ int sc_pm_set_clock_parent(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk, int sc_pm_cpu_start(sc_ipc_t ipc, sc_rsrc_t resource, sc_bool_t enable, sc_faddr_t address); sc_bool_t sc_pm_is_partition_started(sc_ipc_t ipc, sc_rm_pt_t pt); +int sc_pm_resource_reset(sc_ipc_t ipc, sc_rsrc_t resource); /* MISC API */ int sc_misc_set_control(sc_ipc_t ipc, sc_rsrc_t resource, @@ -126,5 +127,6 @@ int sc_seco_get_mp_key(sc_ipc_t ipc, sc_faddr_t dst_addr, u16 dst_size); int sc_seco_update_mpmr(sc_ipc_t ipc, sc_faddr_t addr, u8 size, u8 lock); int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr, u16 msg_size, sc_faddr_t dst_addr, u16 dst_size); +int sc_seco_secvio_dgo_config(sc_ipc_t ipc, u8 id, u8 access, u32 *data); #endif diff --git a/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h b/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h index 905c56834e..df368e8c8b 100644 --- a/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h +++ b/arch/arm/include/asm/arch-imx8/sci/svc/pad/api.h @@ -6,6 +6,9 @@ #ifndef SC_PAD_API_H #define SC_PAD_API_H +/* Defines for type widths */ +#define SC_PAD_MUX_W 3U /* Width of mux parameter */ + /* Defines for sc_pad_config_t */ #define SC_PAD_CONFIG_NORMAL 0U /* Normal */ #define SC_PAD_CONFIG_OD 1U /* Open Drain */ diff --git a/arch/arm/include/asm/arch-imx8/sci/types.h b/arch/arm/include/asm/arch-imx8/sci/types.h index 9eadc88592..adfed13e33 100644 --- a/arch/arm/include/asm/arch-imx8/sci/types.h +++ b/arch/arm/include/asm/arch-imx8/sci/types.h @@ -32,6 +32,7 @@ typedef u64 sc_ipc_t; #define SC_83MHZ 83333333U /* 83MHz */ #define SC_84MHZ 84375000U /* 84.37MHz */ #define SC_100MHZ 100000000U /* 100MHz */ +#define SC_114MHZ 114000000U /* 114MHz */ #define SC_125MHZ 125000000U /* 125MHz */ #define SC_133MHZ 133333333U /* 133MHz */ #define SC_135MHZ 135000000U /* 135MHz */ @@ -52,6 +53,7 @@ typedef u64 sc_ipc_t; #define SC_372MHZ 372000000U /* 372MHz */ #define SC_375MHZ 375000000U /* 375MHz */ #define SC_400MHZ 400000000U /* 400MHz */ +#define SC_465MHZ 465000000U /* 465MHz */ #define SC_500MHZ 500000000U /* 500MHz */ #define SC_594MHZ 594000000U /* 594MHz */ #define SC_625MHZ 625000000U /* 625MHz */ @@ -75,6 +77,7 @@ typedef u64 sc_ipc_t; #define SC_1500MHZ 1500000000U /* 1.5GHz */ #define SC_1600MHZ 1600000000U /* 1.6GHz */ #define SC_1800MHZ 1800000000U /* 1.8GHz */ +#define SC_1860MHZ 1860000000U /* 1.86GHz */ #define SC_2000MHZ 2000000000U /* 2.0GHz */ #define SC_2112MHZ 2112000000U /* 2.12GHz */ @@ -89,6 +92,7 @@ typedef u64 sc_ipc_t; #define SC_144MHZ 144000000U /* 144MHz */ #define SC_192MHZ 192000000U /* 192MHz */ #define SC_211MHZ 211200000U /* 211.2MHz */ +#define SC_228MHZ 228000000U /* 233MHz */ #define SC_240MHZ 240000000U /* 240MHz */ #define SC_264MHZ 264000000U /* 264MHz */ #define SC_352MHZ 352000000U /* 352MHz */ @@ -96,11 +100,13 @@ typedef u64 sc_ipc_t; #define SC_384MHZ 384000000U /* 384MHz */ #define SC_396MHZ 396000000U /* 396MHz */ #define SC_432MHZ 432000000U /* 432MHz */ +#define SC_456MHZ 456000000U /* 466MHz */ #define SC_480MHZ 480000000U /* 480MHz */ #define SC_600MHZ 600000000U /* 600MHz */ #define SC_744MHZ 744000000U /* 744MHz */ #define SC_792MHZ 792000000U /* 792MHz */ #define SC_864MHZ 864000000U /* 864MHz */ +#define SC_912MHZ 912000000U /* 912MHz */ #define SC_960MHZ 960000000U /* 960MHz */ #define SC_1056MHZ 1056000000U /* 1056MHz */ #define SC_1104MHZ 1104000000U /* 1104MHz */ diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index c1e54fc4bc..227bc52873 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -174,6 +174,28 @@ sc_bool_t sc_pm_is_partition_started(sc_ipc_t ipc, sc_rm_pt_t pt) return !!result; } +int sc_pm_resource_reset(sc_ipc_t ipc, sc_rsrc_t resource) +{ + struct udevice *dev = gd->arch.scu_dev; + int size = sizeof(struct sc_rpc_msg_s); + struct sc_rpc_msg_s msg; + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 2U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_PM); + RPC_FUNC(&msg) = (u8)(PM_FUNC_RESOURCE_RESET); + + RPC_U16(&msg, 0U) = (u16)(resource); + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret) + printf("%s: resource:%d res:%d\n", + __func__, resource, RPC_R8(&msg)); + + return ret; +} + /* PAD */ int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val) { @@ -1028,3 +1050,31 @@ int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr, return ret; } + +int sc_seco_secvio_dgo_config(sc_ipc_t ipc, uint8_t id, uint8_t access, + u32 *data) +{ + struct udevice *dev = gd->arch.scu_dev; + struct sc_rpc_msg_s msg; + int size = sizeof(struct sc_rpc_msg_s); + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 3U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_SECO); + RPC_FUNC(&msg) = (u8)(SECO_FUNC_SECVIO_DGO_CONFIG); + + RPC_U32(&msg, 0U) = (u32)(*data); + RPC_U8(&msg, 4U) = (u8)(id); + RPC_U8(&msg, 5U) = (u8)(access); + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret) + printf("%s, id:0x%x, access:%x, res:%d\n", + __func__, id, access, RPC_R8(&msg)); + + if (data) + *data = RPC_U32(&msg, 0U); + + return ret; +} From patchwork Wed Apr 22 13:52:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1275059 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=FCMB54JF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496hLn1G2Gz9sSm for ; Wed, 22 Apr 2020 23:37:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 469B381CAE; Wed, 22 Apr 2020 15:34:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="FCMB54JF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2EA2B81C91; Wed, 22 Apr 2020 15:31:37 +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=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20611.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::611]) (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 1520781C76 for ; Wed, 22 Apr 2020 15:30:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dURXelji5jHZiKybJpu+r34p+qwKeaeiieR76ySK60TEjOHxEoR+FWeHfvlkxI3u6bfrSZp6EqJhL4KmKNK83jmTBe9N8Qynk+rFd6V9TAkiOyDJIZR1V0XtnfnX87r49iCRqmFwTxe2jICmq4mBsKAYuDq6EcxMrZX1S8WVOoPqAkXRI+wELZusATKCXTkmK9/px8TvlGytBl1Pv5aDrSLGP37tP73Wy8ZqbrwftIZKba5GpUFgmT1UyN1GhCeLuIfD42NqdeDC4ZOxGqWl97RXrcrKefovWqkqB4sL0nN4E/dSnbmaqo2diM6y74YoUEGe12SI1WeLx/VpGy3Wxw== 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-SenderADCheck; bh=UoPzEIfd01Zfypf4bRdcKHJ5+x4PQ/cNswof3IkqXPk=; b=htjpNNvcz4MN05cExPRBF+V7f1+Z7P/ZrssQshxqqhI8npg7FAdoPxWGaMy7b2d0hDIejDu9ifjKnON/L08aeBfTWO+VmBr3ehdEQR60cPZ61EN0M8zDn+CwGJMYKQ7J1NdhBfKP8oqxgpLtRLwl042epEM4kBZwddrclIjDun1a1+DJB9lGXd4wnISSPWIZAd6a1CGRL8Lsf3LMCK7PlYaTMXsMzfZ19/cyekY3JjvAjWSQu1AbkBzavTznlrDTDLkzV51TWcZHLpE83PKnTxyWa4Rc9ZkEAdQOSzbEjFvjQooK2qSmIsOZPQQ5GLrVEUSPC/3NxCTL8O0JNk/HuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UoPzEIfd01Zfypf4bRdcKHJ5+x4PQ/cNswof3IkqXPk=; b=FCMB54JFTojPztTYDXo3ymZ6OwZIjqE2Tt1uhumgyg7vS/JGJAYiBTe9ZpMPgBskw9obj2e2062B6B2nhcWXlnxeQdVy4lobKCi7S8Cs96cdvpVu8f3shDIkxMHhPiNAMDNtWeMJhMjVXgjS7pxBDjNLo1G6hkhlrZcgQxJ49TQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 13:30:42 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 13:30:42 +0000 From: Peng Fan To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de Subject: [PATCH 24/24] imx8: Configure SNVS Date: Wed, 22 Apr 2020 21:52:35 +0800 Message-Id: <20200422135235.14756-24-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200422135235.14756-1-peng.fan@nxp.com> References: <20200422135235.14756-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-ljuv.ap.freescale.net (119.31.174.71) by SG2PR06CA0190.apcprd06.prod.outlook.com (2603:1096:4:1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 13:30:40 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9d4c7e2b-3448-48cb-ad1c-08d7e6c15abf X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-Forefront-PRVS: 03818C953D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39860400002)(346002)(366004)(376002)(136003)(16526019)(2616005)(44832011)(52116002)(66946007)(186003)(8676002)(6666004)(30864003)(956004)(86362001)(1076003)(5660300002)(2906002)(8936002)(36756003)(6486002)(81156014)(478600001)(316002)(6506007)(26005)(6512007)(66476007)(66556008)(4326008); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZoYvBnjuzy7BHa1hzTjr/HjbfIVsVE8V5ByYXV0COzV2IOkk/py4lC9ziRFM0+HiTQJ1a2GkYU8cmB5y85/gvzaTFJ2Ji8Ze4rvXMGUPapV1XbX0VWQzBXr7OBPevqOUuqnjuwRtHVcSyt8HqLxjIgxUp4JWFdM0Epxnhcqe1WmT2xjjzyPAsD+hFBonKLPzfd7CopESzadPs9bbdnRcy2YTwX0ubIP0jGy+W0gLLFaU9k2+dNsNHoZJZPnSNsa6V1tnqTXfSzmtWxK7ooz7sVlLUOc3XLUEubj357SrOUzZElRt7eDrL9Mx5iOFurXt85hLc/rifjM7JYDA4Z//kEwBXRYvngg7lvE6m7EvRWtXiZwF1JKHb1JGQQbVVlVGASLCd82WhxYsLHYAx4Q+0oq5LNftbBXwGuOwqVkRZRi3J24Vj5/Qd3g8UWSqECa6 X-MS-Exchange-AntiSpam-MessageData: oG2ZrTBh5jXkjH9/88pefktNrxQ5TBrtZq/u98WBeJjx9cVyUeAIJo267XQN3Exsgw4ifU/Y6TLw1VAc96t0JG4LFbInHJDCS4knIdTFeeZvDO2EQBcucIksFpOeQ99cptbKinXmstf2vKSak33VJg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d4c7e2b-3448-48cb-ad1c-08d7e6c15abf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 13:30:42.6640 (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: w74/SIq9iwLTN+O3t/5FEOW6JVVZ3Xi9uTPOF/BRBEixhe4aQe9v2ONdBkVBjResIzY9PbSqKW57Dyiu7gYZAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Franck LENORMAND Add a module to configure the tamper and secure violation of the SNVS using the SCU API. The module also adds some commands: - snvs_cfg: Configure the SNVS HP and LP registers - snvs_dgo_cfg: Configure the SNVS DGO bloc if present (8QXP) - tamper_pin_cfg: Change the configuration of the tamper pins - snvs_clear_status: Allow to write to LPSR and LPTDSR to clear status bits Signed-off-by: Franck LENORMAND Signed-off-by: Ye Li Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx8/sci/sci.h | 4 + arch/arm/include/asm/arch-imx8/snvs_security_sc.h | 11 + arch/arm/mach-imx/imx8/Kconfig | 13 + arch/arm/mach-imx/imx8/Makefile | 1 + arch/arm/mach-imx/imx8/snvs_security_sc.c | 923 ++++++++++++++++++++++ board/freescale/imx8qxp_mek/imx8qxp_mek.c | 10 + drivers/misc/imx8/scu_api.c | 72 +- 7 files changed, 1030 insertions(+), 4 deletions(-) create mode 100644 arch/arm/include/asm/arch-imx8/snvs_security_sc.h create mode 100644 arch/arm/mach-imx/imx8/snvs_security_sc.c diff --git a/arch/arm/include/asm/arch-imx8/sci/sci.h b/arch/arm/include/asm/arch-imx8/sci/sci.h index 179037ae17..05f736f14f 100644 --- a/arch/arm/include/asm/arch-imx8/sci/sci.h +++ b/arch/arm/include/asm/arch-imx8/sci/sci.h @@ -109,6 +109,7 @@ int sc_rm_get_resource_owner(sc_ipc_t ipc, sc_rsrc_t resource, /* PAD API */ int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val); +int sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, uint32_t *val); /* SMMU API */ int sc_rm_set_master_sid(sc_ipc_t ipc, sc_rsrc_t resource, sc_rm_sid_t sid); @@ -128,5 +129,8 @@ int sc_seco_update_mpmr(sc_ipc_t ipc, sc_faddr_t addr, u8 size, u8 lock); int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr, u16 msg_size, sc_faddr_t dst_addr, u16 dst_size); int sc_seco_secvio_dgo_config(sc_ipc_t ipc, u8 id, u8 access, u32 *data); +int sc_seco_secvio_config(sc_ipc_t ipc, u8 id, u8 access, + u32 *data0, u32 *data1, u32 *data2, u32 *data3, + u32 *data4, u8 size); #endif diff --git a/arch/arm/include/asm/arch-imx8/snvs_security_sc.h b/arch/arm/include/asm/arch-imx8/snvs_security_sc.h new file mode 100644 index 0000000000..0b7ded7ba6 --- /dev/null +++ b/arch/arm/include/asm/arch-imx8/snvs_security_sc.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2018 NXP + */ + +#ifndef _SNVS_SECURITY_SC_H +#define _SNVS_SECURITY_SC_H + +int snvs_security_sc_init(void); + +#endif /* _SNVS_SECURITY_SC_H */ diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig index 5827ab334f..1f8add015f 100644 --- a/arch/arm/mach-imx/imx8/Kconfig +++ b/arch/arm/mach-imx/imx8/Kconfig @@ -90,4 +90,17 @@ source "board/toradex/apalis-imx8/Kconfig" source "board/toradex/colibri-imx8x/Kconfig" source "board/siemens/capricorn/Kconfig" +config IMX_SNVS_SEC_SC + bool "Support SNVS configuration" + help + Allow to configure the SNVS via SCU API to configure tampers and secure + violation. + +config IMX_SNVS_SEC_SC_AUTO + bool "Support SNVS configuration command" + depends on IMX_SNVS_SEC_SC + help + This configuration will apply the selected configurations automatically + at boot. + endif diff --git a/arch/arm/mach-imx/imx8/Makefile b/arch/arm/mach-imx/imx8/Makefile index 7ffb7e95b2..bbb41adbe4 100644 --- a/arch/arm/mach-imx/imx8/Makefile +++ b/arch/arm/mach-imx/imx8/Makefile @@ -11,3 +11,4 @@ obj-$(CONFIG_AHAB_BOOT) += ahab.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_LOAD_IMX_CONTAINER) += image.o parse-container.o endif +obj-$(CONFIG_IMX_SNVS_SEC_SC) += snvs_security_sc.o diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c new file mode 100644 index 0000000000..73f5651161 --- /dev/null +++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c @@ -0,0 +1,923 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019-2020 NXP. + */ + +/* + * Configuration of the Tamper pins in different mode: + * - default (no tamper pins): _default_ + * - passive mode expecting VCC on the line: "_passive_vcc_" + * - passive mode expecting VCC on the line: "_passive_gnd_" + * - active mode: "_active_" + */ + +#include +#include +#include +#include +#include +#include +#include + +/* Access to gd */ +DECLARE_GLOBAL_DATA_PTR; + +#define SC_WRITE_CONF 1 + +#define PGD_HEX_VALUE 0x41736166 +#define SRTC_EN 0x1 +#define DP_EN BIT(5) + +struct snvs_security_sc_conf { + struct snvs_hp_conf { + u32 lock; /* HPLR - HP Lock */ + u32 __cmd; /* HPCOMR - HP Command */ + u32 __ctl; /* HPCR - HP Control */ + u32 secvio_intcfg; /* HPSICR - Security Violation Int + * Config + */ + u32 secvio_ctl; /* HPSVCR - Security Violation Control*/ + u32 status; /* HPSR - HP Status */ + u32 secvio_status; /* HPSVSR - Security Violation Status */ + u32 __ha_counteriv; /* High Assurance Counter IV */ + u32 __ha_counter; /* High Assurance Counter */ + u32 __rtc_msb; /* Real Time Clock/Counter MSB */ + u32 __rtc_lsb; /* Real Time Counter LSB */ + u32 __time_alarm_msb; /* Time Alarm MSB */ + u32 __time_alarm_lsb; /* Time Alarm LSB */ + } hp; + struct snvs_lp_conf { + u32 lock; + u32 __ctl; + u32 __mstr_key_ctl; /* Master Key Control */ + u32 secvio_ctl; /* Security Violation Control */ + u32 tamper_filt_cfg; /* Tamper Glitch Filters Configuration*/ + u32 tamper_det_cfg; /* Tamper Detectors Configuration */ + u32 status; + u32 __srtc_msb; /* Secure Real Time Clock/Counter MSB */ + u32 __srtc_lsb; /* Secure Real Time Clock/Counter LSB */ + u32 __time_alarm; /* Time Alarm */ + u32 __smc_msb; /* Secure Monotonic Counter MSB */ + u32 __smc_lsb; /* Secure Monotonic Counter LSB */ + u32 __pwr_glitch_det; /* Power Glitch Detector */ + u32 __gen_purpose; + u8 __zmk[32]; /* Zeroizable Master Key */ + u32 __rsvd0; + u32 __gen_purposes[4]; /* gp0_30 to gp0_33 */ + u32 tamper_det_cfg2; /* Tamper Detectors Configuration2 */ + u32 tamper_det_status; /* Tamper Detectors status */ + u32 tamper_filt1_cfg; /* Tamper Glitch Filter1 Configuration*/ + u32 tamper_filt2_cfg; /* Tamper Glitch Filter2 Configuration*/ + u32 __rsvd1[4]; + u32 act_tamper1_cfg; /* Active Tamper1 Configuration */ + u32 act_tamper2_cfg; /* Active Tamper2 Configuration */ + u32 act_tamper3_cfg; /* Active Tamper3 Configuration */ + u32 act_tamper4_cfg; /* Active Tamper4 Configuration */ + u32 act_tamper5_cfg; /* Active Tamper5 Configuration */ + u32 __rsvd2[3]; + u32 act_tamper_ctl; /* Active Tamper Control */ + u32 act_tamper_clk_ctl; /* Active Tamper Clock Control */ + u32 act_tamper_routing_ctl1;/* Active Tamper Routing Control1 */ + u32 act_tamper_routing_ctl2;/* Active Tamper Routing Control2 */ + } lp; +}; + +static struct snvs_security_sc_conf snvs_default_config = { + .hp = { + .lock = 0x1f0703ff, + .secvio_ctl = 0x3000007f, + }, + .lp = { + .lock = 0x1f0003ff, + .secvio_ctl = 0x36, + .tamper_filt_cfg = 0, + .tamper_det_cfg = 0x76, /* analogic tampers + * + rollover tampers + */ + .tamper_det_cfg2 = 0, + .tamper_filt1_cfg = 0, + .tamper_filt2_cfg = 0, + .act_tamper1_cfg = 0, + .act_tamper2_cfg = 0, + .act_tamper3_cfg = 0, + .act_tamper4_cfg = 0, + .act_tamper5_cfg = 0, + .act_tamper_ctl = 0, + .act_tamper_clk_ctl = 0, + .act_tamper_routing_ctl1 = 0, + .act_tamper_routing_ctl2 = 0, + } +}; + +static struct snvs_security_sc_conf snvs_passive_vcc_config = { + .hp = { + .lock = 0x1f0703ff, + .secvio_ctl = 0x3000007f, + }, + .lp = { + .lock = 0x1f0003ff, + .secvio_ctl = 0x36, + .tamper_filt_cfg = 0, + .tamper_det_cfg = 0x276, /* ET1 will trig on line at GND + * + analogic tampers + * + rollover tampers + */ + .tamper_det_cfg2 = 0, + .tamper_filt1_cfg = 0, + .tamper_filt2_cfg = 0, + .act_tamper1_cfg = 0, + .act_tamper2_cfg = 0, + .act_tamper3_cfg = 0, + .act_tamper4_cfg = 0, + .act_tamper5_cfg = 0, + .act_tamper_ctl = 0, + .act_tamper_clk_ctl = 0, + .act_tamper_routing_ctl1 = 0, + .act_tamper_routing_ctl2 = 0, + } +}; + +static struct snvs_security_sc_conf snvs_passive_gnd_config = { + .hp = { + .lock = 0x1f0703ff, + .secvio_ctl = 0x3000007f, + }, + .lp = { + .lock = 0x1f0003ff, + .secvio_ctl = 0x36, + .tamper_filt_cfg = 0, + .tamper_det_cfg = 0xa76, /* ET1 will trig on line at VCC + * + analogic tampers + * + rollover tampers + */ + .tamper_det_cfg2 = 0, + .tamper_filt1_cfg = 0, + .tamper_filt2_cfg = 0, + .act_tamper1_cfg = 0, + .act_tamper2_cfg = 0, + .act_tamper3_cfg = 0, + .act_tamper4_cfg = 0, + .act_tamper5_cfg = 0, + .act_tamper_ctl = 0, + .act_tamper_clk_ctl = 0, + .act_tamper_routing_ctl1 = 0, + .act_tamper_routing_ctl2 = 0, + } +}; + +static struct snvs_security_sc_conf snvs_active_config = { + .hp = { + .lock = 0x1f0703ff, + .secvio_ctl = 0x3000007f, + }, + .lp = { + .lock = 0x1f0003ff, + .secvio_ctl = 0x36, + .tamper_filt_cfg = 0x00800000, /* Enable filtering */ + .tamper_det_cfg = 0x276, /* ET1 enabled + analogic tampers + * + rollover tampers + */ + .tamper_det_cfg2 = 0, + .tamper_filt1_cfg = 0, + .tamper_filt2_cfg = 0, + .act_tamper1_cfg = 0x84001111, + .act_tamper2_cfg = 0, + .act_tamper3_cfg = 0, + .act_tamper4_cfg = 0, + .act_tamper5_cfg = 0, + .act_tamper_ctl = 0x00010001, + .act_tamper_clk_ctl = 0, + .act_tamper_routing_ctl1 = 0x1, + .act_tamper_routing_ctl2 = 0, + } +}; + +static struct snvs_security_sc_conf *get_snvs_config(void) +{ + return &snvs_default_config; +} + +struct snvs_dgo_conf { + u32 tamper_offset_ctl; + u32 tamper_pull_ctl; + u32 tamper_ana_test_ctl; + u32 tamper_sensor_trim_ctl; + u32 tamper_misc_ctl; + u32 tamper_core_volt_mon_ctl; +}; + +static struct snvs_dgo_conf snvs_dgo_default_config = { + .tamper_misc_ctl = 0x80000000, /* Lock the DGO */ +}; + +static struct snvs_dgo_conf snvs_dgo_passive_vcc_config = { + .tamper_misc_ctl = 0x80000000, /* Lock the DGO */ + .tamper_pull_ctl = 0x00000001, /* Pull down ET1 */ + .tamper_ana_test_ctl = 0x20000000, /* Enable tamper */ +}; + +static struct snvs_dgo_conf snvs_dgo_passive_gnd_config = { + .tamper_misc_ctl = 0x80000000, /* Lock the DGO */ + .tamper_pull_ctl = 0x00000401, /* Pull up ET1 */ + .tamper_ana_test_ctl = 0x20000000, /* Enable tamper */ +}; + +static struct snvs_dgo_conf snvs_dgo_active_config = { + .tamper_misc_ctl = 0x80000000, /* Lock the DGO */ + .tamper_ana_test_ctl = 0x20000000, /* Enable tamper */ +}; + +static struct snvs_dgo_conf *get_snvs_dgo_config(void) +{ + return &snvs_dgo_default_config; +} + +struct tamper_pin_cfg { + u32 pad; + u32 mux_conf; +}; + +static struct tamper_pin_cfg tamper_pin_list_default_config[] = { + {SC_P_CSI_D00, 0}, /* Tamp_Out0 */ + {SC_P_CSI_D01, 0}, /* Tamp_Out1 */ + {SC_P_CSI_D02, 0}, /* Tamp_Out2 */ + {SC_P_CSI_D03, 0}, /* Tamp_Out3 */ + {SC_P_CSI_D04, 0}, /* Tamp_Out4 */ + {SC_P_CSI_D05, 0}, /* Tamp_In0 */ + {SC_P_CSI_D06, 0}, /* Tamp_In1 */ + {SC_P_CSI_D07, 0}, /* Tamp_In2 */ + {SC_P_CSI_HSYNC, 0}, /* Tamp_In3 */ + {SC_P_CSI_VSYNC, 0}, /* Tamp_In4 */ +}; + +static struct tamper_pin_cfg tamper_pin_list_passive_vcc_config[] = { + {SC_P_CSI_D05, 0x1c000060}, /* Tamp_In0 */ /* Sel tamper + OD input */ +}; + +static struct tamper_pin_cfg tamper_pin_list_passive_gnd_config[] = { + {SC_P_CSI_D05, 0x1c000060}, /* Tamp_In0 */ /* Sel tamper + OD input */ +}; + +static struct tamper_pin_cfg tamper_pin_list_active_config[] = { + {SC_P_CSI_D00, 0x1a000060}, /* Tamp_Out0 */ /* Sel tamper + OD */ + {SC_P_CSI_D05, 0x1c000060}, /* Tamp_In0 */ /* Sel tamper + OD input */ +}; + +#define TAMPER_PIN_LIST_CHOSEN tamper_pin_list_default_config + +static struct tamper_pin_cfg *get_tamper_pin_cfg_list(u32 *size) +{ + *size = sizeof(TAMPER_PIN_LIST_CHOSEN) / + sizeof(TAMPER_PIN_LIST_CHOSEN[0]); + + return TAMPER_PIN_LIST_CHOSEN; +} + +#define SC_CONF_OFFSET_OF(_field) \ + (offsetof(struct snvs_security_sc_conf, _field)) + +static u32 ptr_value(u32 *_p) +{ + return (_p) ? *_p : 0xdeadbeef; +} + +static int check_write_secvio_config(u32 id, u32 *_p1, u32 *_p2, + u32 *_p3, u32 *_p4, u32 *_p5, + u32 _cnt) +{ + int scierr = 0; + u32 d1 = ptr_value(_p1); + u32 d2 = ptr_value(_p2); + u32 d3 = ptr_value(_p3); + u32 d4 = ptr_value(_p4); + u32 d5 = ptr_value(_p5); + + scierr = sc_seco_secvio_config(-1, id, SC_WRITE_CONF, &d1, &d2, &d3, + &d4, &d4, _cnt); + if (scierr != SC_ERR_NONE) { + printf("Failed to set secvio configuration\n"); + debug("Failed to set conf id 0x%x with values ", id); + debug("0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x (cnt: %d)\n", + d1, d2, d3, d4, d5, _cnt); + goto exit; + } + + if (_p1) + *(u32 *)_p1 = d1; + if (_p2) + *(u32 *)_p2 = d2; + if (_p3) + *(u32 *)_p3 = d3; + if (_p4) + *(u32 *)_p4 = d4; + if (_p5) + *(u32 *)_p5 = d5; + +exit: + return scierr; +} + +#define SC_CHECK_WRITE1(id, _p1) \ + check_write_secvio_config(id, _p1, NULL, NULL, NULL, NULL, 1) + +static int apply_snvs_config(struct snvs_security_sc_conf *cnf) +{ + int scierr = 0; + + debug("%s\n", __func__); + + debug("Applying config:\n" + "\thp.lock = 0x%.8x\n" + "\thp.secvio_ctl = 0x%.8x\n" + "\tlp.lock = 0x%.8x\n" + "\tlp.secvio_ctl = 0x%.8x\n" + "\tlp.tamper_filt_cfg = 0x%.8x\n" + "\tlp.tamper_det_cfg = 0x%.8x\n" + "\tlp.tamper_det_cfg2 = 0x%.8x\n" + "\tlp.tamper_filt1_cfg = 0x%.8x\n" + "\tlp.tamper_filt2_cfg = 0x%.8x\n" + "\tlp.act_tamper1_cfg = 0x%.8x\n" + "\tlp.act_tamper2_cfg = 0x%.8x\n" + "\tlp.act_tamper3_cfg = 0x%.8x\n" + "\tlp.act_tamper4_cfg = 0x%.8x\n" + "\tlp.act_tamper5_cfg = 0x%.8x\n" + "\tlp.act_tamper_ctl = 0x%.8x\n" + "\tlp.act_tamper_clk_ctl = 0x%.8x\n" + "\tlp.act_tamper_routing_ctl1 = 0x%.8x\n" + "\tlp.act_tamper_routing_ctl2 = 0x%.8x\n", + cnf->hp.lock, + cnf->hp.secvio_ctl, + cnf->lp.lock, + cnf->lp.secvio_ctl, + cnf->lp.tamper_filt_cfg, + cnf->lp.tamper_det_cfg, + cnf->lp.tamper_det_cfg2, + cnf->lp.tamper_filt1_cfg, + cnf->lp.tamper_filt2_cfg, + cnf->lp.act_tamper1_cfg, + cnf->lp.act_tamper2_cfg, + cnf->lp.act_tamper3_cfg, + cnf->lp.act_tamper4_cfg, + cnf->lp.act_tamper5_cfg, + cnf->lp.act_tamper_ctl, + cnf->lp.act_tamper_clk_ctl, + cnf->lp.act_tamper_routing_ctl1, + cnf->lp.act_tamper_routing_ctl2); + + scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.tamper_filt_cfg), + &cnf->lp.tamper_filt_cfg, + &cnf->lp.tamper_filt1_cfg, + &cnf->lp.tamper_filt2_cfg, NULL, + NULL, 3); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Configure AT */ + scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.act_tamper1_cfg), + &cnf->lp.act_tamper1_cfg, + &cnf->lp.act_tamper2_cfg, + &cnf->lp.act_tamper2_cfg, + &cnf->lp.act_tamper2_cfg, + &cnf->lp.act_tamper2_cfg, 5); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Configure AT routing */ + scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.act_tamper_routing_ctl1), + &cnf->lp.act_tamper_routing_ctl1, + &cnf->lp.act_tamper_routing_ctl2, + NULL, NULL, NULL, 2); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Configure AT frequency */ + scierr = SC_CHECK_WRITE1(SC_CONF_OFFSET_OF(lp.act_tamper_clk_ctl), + &cnf->lp.act_tamper_clk_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Activate the ATs */ + scierr = SC_CHECK_WRITE1(SC_CONF_OFFSET_OF(lp.act_tamper_ctl), + &cnf->lp.act_tamper_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Activate the detectors */ + scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.tamper_det_cfg), + &cnf->lp.tamper_det_cfg, + &cnf->lp.tamper_det_cfg2, NULL, NULL, + NULL, 2); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Configure LP secvio */ + scierr = SC_CHECK_WRITE1(SC_CONF_OFFSET_OF(lp.secvio_ctl), + &cnf->lp.secvio_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Configure HP secvio */ + scierr = SC_CHECK_WRITE1(SC_CONF_OFFSET_OF(hp.secvio_ctl), + &cnf->hp.secvio_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Lock access */ + scierr = SC_CHECK_WRITE1(SC_CONF_OFFSET_OF(hp.lock), &cnf->hp.lock); + if (scierr != SC_ERR_NONE) + goto exit; + + scierr = SC_CHECK_WRITE1(SC_CONF_OFFSET_OF(lp.lock), &cnf->lp.lock); + if (scierr != SC_ERR_NONE) + goto exit; + +exit: + return (scierr == SC_ERR_NONE) ? 0 : -EIO; +} + +static int dgo_write(u32 _id, u8 _access, u32 *_pdata) +{ + int scierr = sc_seco_secvio_dgo_config(-1, _id, _access, _pdata); + + if (scierr != SC_ERR_NONE) { + printf("Failed to set dgo configuration\n"); + debug("Failed to set conf id 0x%x : 0x%.8x", _id, *_pdata); + } + + return scierr; +} + +static int apply_snvs_dgo_config(struct snvs_dgo_conf *cnf) +{ + int scierr = 0; + + debug("%s\n", __func__); + + debug("Applying config:\n" + "\ttamper_offset_ctl = 0x%.8x\n" + "\ttamper_pull_ctl = 0x%.8x\n" + "\ttamper_ana_test_ctl = 0x%.8x\n" + "\ttamper_sensor_trim_ctl = 0x%.8x\n" + "\ttamper_misc_ctl = 0x%.8x\n" + "\ttamper_core_volt_mon_ctl = 0x%.8x\n", + cnf->tamper_offset_ctl, + cnf->tamper_pull_ctl, + cnf->tamper_ana_test_ctl, + cnf->tamper_sensor_trim_ctl, + cnf->tamper_misc_ctl, + cnf->tamper_core_volt_mon_ctl); + + dgo_write(0x04, 1, &cnf->tamper_offset_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + dgo_write(0x14, 1, &cnf->tamper_pull_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + dgo_write(0x24, 1, &cnf->tamper_ana_test_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + dgo_write(0x34, 1, &cnf->tamper_sensor_trim_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + dgo_write(0x54, 1, &cnf->tamper_core_volt_mon_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + + /* Last as it could lock the writes */ + dgo_write(0x44, 1, &cnf->tamper_misc_ctl); + if (scierr != SC_ERR_NONE) + goto exit; + +exit: + return (scierr == SC_ERR_NONE) ? 0 : -EIO; +} + +static int pad_write(u32 _pad, u32 _value) +{ + int scierr = sc_pad_set(-1, _pad, _value); + + if (scierr != SC_ERR_NONE) { + printf("Failed to set pad configuration\n"); + debug("Failed to set conf pad 0x%x : 0x%.8x", _pad, _value); + } + + return scierr; +} + +static int apply_tamper_pin_list_config(struct tamper_pin_cfg *confs, u32 size) +{ + int scierr = 0; + u32 idx; + + debug("%s\n", __func__); + + for (idx = 0; idx < size; idx++) { + debug("\t idx %d: pad %d: 0x%.8x\n", idx, confs[idx].pad, + confs[idx].mux_conf); + pad_write(confs[idx].pad, 3 << 30 | confs[idx].mux_conf); + if (scierr != SC_ERR_NONE) + goto exit; + } + +exit: + return (scierr == SC_ERR_NONE) ? 0 : -EIO; +} + +int examples(void) +{ + u32 size; + struct snvs_security_sc_conf *snvs_conf; + struct snvs_dgo_conf *snvs_dgo_conf; + struct tamper_pin_cfg *tamper_pin_conf; + + /* Caller */ + snvs_conf = get_snvs_config(); + snvs_dgo_conf = get_snvs_dgo_config(); + tamper_pin_conf = get_tamper_pin_cfg_list(&size); + + /* Default */ + snvs_conf = &snvs_default_config; + snvs_dgo_conf = &snvs_dgo_default_config; + tamper_pin_conf = tamper_pin_list_default_config; + + /* Passive tamper expecting VCC on the line */ + snvs_conf = &snvs_passive_vcc_config; + snvs_dgo_conf = &snvs_dgo_passive_vcc_config; + tamper_pin_conf = tamper_pin_list_passive_vcc_config; + + /* Passive tamper expecting GND on the line */ + snvs_conf = &snvs_passive_gnd_config; + snvs_dgo_conf = &snvs_dgo_passive_gnd_config; + tamper_pin_conf = tamper_pin_list_passive_gnd_config; + + /* Active tamper */ + snvs_conf = &snvs_active_config; + snvs_dgo_conf = &snvs_dgo_active_config; + tamper_pin_conf = tamper_pin_list_active_config; + + return !snvs_conf + !snvs_dgo_conf + !tamper_pin_conf; +} + +#ifdef CONFIG_IMX_SNVS_SEC_SC_AUTO +int snvs_security_sc_init(void) +{ + int err = 0; + + struct snvs_security_sc_conf *snvs_conf; + struct snvs_dgo_conf *snvs_dgo_conf; + struct tamper_pin_cfg *tamper_pin_conf; + u32 size; + + debug("%s\n", __func__); + + snvs_conf = get_snvs_config(); + snvs_dgo_conf = get_snvs_dgo_config(); + + tamper_pin_conf = get_tamper_pin_cfg_list(&size); + + err = apply_tamper_pin_list_config(tamper_pin_conf, size); + if (err) { + debug("Failed to set pins\n"); + goto exit; + } + + err = apply_snvs_dgo_config(snvs_dgo_conf); + if (err) { + debug("Failed to set dgo\n"); + goto exit; + } + + err = apply_snvs_config(snvs_conf); + if (err) { + debug("Failed to set snvs\n"); + goto exit; + } + +exit: + return err; +} +#endif /* CONFIG_IMX_SNVS_SEC_SC_AUTO */ + +static char snvs_cfg_help_text[] = + "snvs_cfg\n" + "\thp.lock\n" + "\thp.secvio_ctl\n" + "\tlp.lock\n" + "\tlp.secvio_ctl\n" + "\tlp.tamper_filt_cfg\n" + "\tlp.tamper_det_cfg\n" + "\tlp.tamper_det_cfg2\n" + "\tlp.tamper_filt1_cfg\n" + "\tlp.tamper_filt2_cfg\n" + "\tlp.act_tamper1_cfg\n" + "\tlp.act_tamper2_cfg\n" + "\tlp.act_tamper3_cfg\n" + "\tlp.act_tamper4_cfg\n" + "\tlp.act_tamper5_cfg\n" + "\tlp.act_tamper_ctl\n" + "\tlp.act_tamper_clk_ctl\n" + "\tlp.act_tamper_routing_ctl1\n" + "\tlp.act_tamper_routing_ctl2\n" + "\n" + "ALL values should be in hexadecimal format"; + +#define NB_REGISTERS 18 +static int do_snvs_cfg(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +{ + int err = 0; + u32 idx = 0; + + struct snvs_security_sc_conf conf = {0}; + + if (argc != (NB_REGISTERS + 1)) + return CMD_RET_USAGE; + + conf.hp.lock = simple_strtoul(argv[++idx], NULL, 16); + conf.hp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.lock = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.tamper_filt_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.tamper_det_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.tamper_det_cfg2 = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.tamper_filt1_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.tamper_filt2_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper1_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper2_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper3_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper4_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper5_cfg = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper_clk_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper_routing_ctl1 = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.act_tamper_routing_ctl2 = simple_strtoul(argv[++idx], NULL, 16); + + err = apply_snvs_config(&conf); + + return err; +} + +U_BOOT_CMD(snvs_cfg, + NB_REGISTERS + 1, 1, do_snvs_cfg, + "Security violation configuration", + snvs_cfg_help_text +); + +static char snvs_dgo_cfg_help_text[] = + "snvs_dgo_cfg\n" + "\ttamper_offset_ctl\n" + "\ttamper_pull_ctl\n" + "\ttamper_ana_test_ctl\n" + "\ttamper_sensor_trim_ctl\n" + "\ttamper_misc_ctl\n" + "\ttamper_core_volt_mon_ctl\n" + "\n" + "ALL values should be in hexadecimal format"; + +static int do_snvs_dgo_cfg(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + int err = 0; + u32 idx = 0; + + struct snvs_dgo_conf conf = {0}; + + if (argc != (6 + 1)) + return CMD_RET_USAGE; + + conf.tamper_offset_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.tamper_pull_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.tamper_ana_test_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.tamper_sensor_trim_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.tamper_misc_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.tamper_core_volt_mon_ctl = simple_strtoul(argv[++idx], NULL, 16); + + err = apply_snvs_dgo_config(&conf); + + return err; +} + +U_BOOT_CMD(snvs_dgo_cfg, + 7, 1, do_snvs_dgo_cfg, + "SNVS DGO configuration", + snvs_dgo_cfg_help_text +); + +static char tamper_pin_cfg_help_text[] = + "snvs_dgo_cfg\n" + "\tpad\n" + "\tvalue\n" + "\n" + "ALL values should be in hexadecimal format"; + +static int do_tamper_pin_cfg(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + int err = 0; + u32 idx = 0; + + struct tamper_pin_cfg conf = {0}; + + if (argc != (2 + 1)) + return CMD_RET_USAGE; + + conf.pad = simple_strtoul(argv[++idx], NULL, 10); + conf.mux_conf = simple_strtoul(argv[++idx], NULL, 16); + + err = apply_tamper_pin_list_config(&conf, 1); + + return err; +} + +U_BOOT_CMD(tamper_pin_cfg, + 3, 1, do_tamper_pin_cfg, + "tamper pin configuration", + tamper_pin_cfg_help_text +); + +static char snvs_clear_status_help_text[] = + "snvs_clear_status\n" + "\tHPSR\n" + "\tHPSVSR\n" + "\tLPSR\n" + "\tLPTDSR\n" + "\n" + "Write the status registers with the value provided," + " clearing the status"; + +static int do_snvs_clear_status(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + int scierr = 0; + u32 idx = 0; + + struct snvs_security_sc_conf conf = {0}; + + if (argc != (2 + 1)) + return CMD_RET_USAGE; + + conf.lp.status = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.tamper_det_status = simple_strtoul(argv[++idx], NULL, 16); + + scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.status), + &conf.lp.status, NULL, NULL, NULL, + NULL, 1); + if (scierr != SC_ERR_NONE) + goto exit; + + scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.tamper_det_status), + &conf.lp.tamper_det_status, NULL, + NULL, NULL, NULL, 1); + if (scierr != SC_ERR_NONE) + goto exit; + +exit: + return (scierr == SC_ERR_NONE) ? 0 : 1; +} + +U_BOOT_CMD(snvs_clear_status, + 3, 1, do_snvs_clear_status, + "snvs clear status", + snvs_clear_status_help_text +); + +static char snvs_sec_status_help_text[] = + "snvs_sec_status\n" + "Display information about the security related to tamper and secvio"; + +static int do_snvs_sec_status(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) +{ + int scierr; + u32 idx; + + u32 data[5]; + + u32 pads[] = { + SC_P_CSI_D00, + SC_P_CSI_D01, + SC_P_CSI_D02, + SC_P_CSI_D03, + SC_P_CSI_D04, + SC_P_CSI_D05, + SC_P_CSI_D06, + SC_P_CSI_D07, + SC_P_CSI_HSYNC, + SC_P_CSI_VSYNC, + }; + + u32 fuses[] = { + 14, + 30, + 31, + 260, + 261, + 262, + 263, + 768, + }; + + struct snvs_reg { + u32 id; + u32 nb; + } snvs[] = { + /* Locks */ + {0x0, 1}, + {0x34, 1}, + /* Security violation */ + {0xc, 1}, + {0x10, 1}, + {0x18, 1}, + {0x40, 1}, + /* Temper detectors */ + {0x48, 2}, + {0x4c, 1}, + {0xa4, 1}, + /* */ + {0x44, 3}, + {0xe0, 1}, + {0xe4, 1}, + {0xe8, 2}, + /* Misc */ + {0x3c, 1}, + {0x5c, 2}, + {0x64, 1}, + {0xf8, 2}, + }; + + u32 dgo[] = { + 0x0, + 0x10, + 0x20, + 0x30, + 0x40, + 0x50, + }; + + /* Pins */ + printf("Pins:\n"); + for (idx = 0; idx < ARRAY_SIZE(pads); idx++) { + u8 pad_id = pads[idx]; + + scierr = sc_pad_get(-1, pad_id, &data[0]); + if (scierr == 0) + printf("\t- Pin %d: %.8x\n", pad_id, data[0]); + else + printf("Failed to read Pin %d\n", pad_id); + } + + /* Fuses */ + printf("Fuses:\n"); + for (idx = 0; idx < ARRAY_SIZE(fuses); idx++) { + u32 fuse_id = fuses[idx]; + + scierr = sc_misc_otp_fuse_read(-1, fuse_id, &data[0]); + if (scierr == 0) + printf("\t- Fuse %d: %.8x\n", fuse_id, data[0]); + else + printf("Failed to read Fuse %d\n", fuse_id); + } + + /* SNVS */ + printf("SNVS:\n"); + for (idx = 0; idx < ARRAY_SIZE(snvs); idx++) { + struct snvs_reg *reg = &snvs[idx]; + + scierr = sc_seco_secvio_config(-1, reg->id, 0, &data[0], + &data[1], &data[2], &data[3], + &data[4], reg->nb); + if (scierr == 0) { + int subidx; + + printf("\t- SNVS %.2x(%d):", reg->id, reg->nb); + for (subidx = 0; subidx < reg->nb; subidx++) + printf(" %.8x", data[subidx]); + printf("\n"); + } else { + printf("Failed to read SNVS %d\n", reg->id); + } + } + + /* DGO */ + printf("DGO:\n"); + for (idx = 0; idx < ARRAY_SIZE(dgo); idx++) { + u8 dgo_id = dgo[idx]; + + scierr = sc_seco_secvio_dgo_config(-1, dgo_id, 0, &data[0]); + if (scierr == 0) + printf("\t- DGO %.2x: %.8x\n", dgo_id, data[0]); + else + printf("Failed to read DGO %d\n", dgo_id); + } + + return 0; +} + +U_BOOT_CMD(snvs_sec_status, + 1, 1, do_snvs_sec_status, + "tamper pin configuration", + snvs_sec_status_help_text +); diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c b/board/freescale/imx8qxp_mek/imx8qxp_mek.c index b96f0da21e..93f0cd827c 100644 --- a/board/freescale/imx8qxp_mek/imx8qxp_mek.c +++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -111,6 +112,15 @@ int board_init(void) { board_gpio_init(); +#ifdef CONFIG_IMX_SNVS_SEC_SC_AUTO + { + int ret = snvs_security_sc_init(); + + if (ret) + return ret; + } +#endif + return 0; } diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index 227bc52873..3e38edbf5d 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -222,6 +222,34 @@ int sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, u32 val) return ret; } +int sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, u32 *val) +{ + struct udevice *dev = gd->arch.scu_dev; + int size = sizeof(struct sc_rpc_msg_s); + struct sc_rpc_msg_s msg; + int ret; + + if (!dev) + hang(); + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 2U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_PAD); + RPC_FUNC(&msg) = (u8)(PAD_FUNC_GET); + + RPC_U16(&msg, 0U) = (u16)(pad); + + ret = misc_call(dev, SC_FALSE, &msg, size, &msg, size); + if (ret) + printf("%s: pad:%d: res:%d\n", + __func__, pad, RPC_R8(&msg)); + + if (val) + *val = (u32)RPC_U32(&msg, 0U); + + return ret; +} + /* MISC */ int sc_misc_set_control(sc_ipc_t ipc, sc_rsrc_t resource, sc_ctrl_t ctrl, u32 val) @@ -996,8 +1024,8 @@ int sc_seco_get_mp_key(sc_ipc_t ipc, sc_faddr_t dst_addr, return ret; } -int sc_seco_update_mpmr(sc_ipc_t ipc, sc_faddr_t addr, uint8_t size_m, - uint8_t lock) +int sc_seco_update_mpmr(sc_ipc_t ipc, sc_faddr_t addr, u8 size_m, + u8 lock) { struct udevice *dev = gd->arch.scu_dev; struct sc_rpc_msg_s msg; @@ -1051,8 +1079,44 @@ int sc_seco_get_mp_sign(sc_ipc_t ipc, sc_faddr_t msg_addr, return ret; } -int sc_seco_secvio_dgo_config(sc_ipc_t ipc, uint8_t id, uint8_t access, - u32 *data) +int sc_seco_secvio_config(sc_ipc_t ipc, u8 id, u8 access, + u32 *data0, u32 *data1, u32 *data2, u32 *data3, + u32 *data4, u8 size) +{ + struct udevice *dev = gd->arch.scu_dev; + struct sc_rpc_msg_s msg; + int msg_size = sizeof(struct sc_rpc_msg_s); + int ret; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SIZE(&msg) = 7U; + RPC_SVC(&msg) = (u8)(SC_RPC_SVC_SECO); + RPC_FUNC(&msg) = (u8)(SECO_FUNC_SECVIO_CONFIG); + + RPC_U32(&msg, 0U) = (u32)(*data0); + RPC_U32(&msg, 4U) = (u32)(*data1); + RPC_U32(&msg, 8U) = (u32)(*data2); + RPC_U32(&msg, 12U) = (u32)(*data3); + RPC_U32(&msg, 16U) = (u32)(*data4); + RPC_U8(&msg, 20U) = (u8)(id); + RPC_U8(&msg, 21U) = (u8)(access); + RPC_U8(&msg, 22U) = (u8)(size); + + ret = misc_call(dev, SC_FALSE, &msg, msg_size, &msg, msg_size); + if (ret) + printf("%s, id:0x%x, access:%x, res:%d\n", + __func__, id, access, RPC_R8(&msg)); + + *data0 = (u32)RPC_U32(&msg, 0U); + *data1 = (u32)RPC_U32(&msg, 4U); + *data2 = (u32)RPC_U32(&msg, 8U); + *data3 = (u32)RPC_U32(&msg, 12U); + *data4 = (u32)RPC_U32(&msg, 16U); + + return ret; +} + +int sc_seco_secvio_dgo_config(sc_ipc_t ipc, u8 id, u8 access, u32 *data) { struct udevice *dev = gd->arch.scu_dev; struct sc_rpc_msg_s msg;