From patchwork Mon Jul 8 01:40:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1128829 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="LyDm2cKg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45hpVN2p7Mz9sN4 for ; Mon, 8 Jul 2019 11:57:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EA1E5C21DEC; Mon, 8 Jul 2019 01:50:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B53A0C21E5B; Mon, 8 Jul 2019 01:41:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D6DC0C21C93; Mon, 8 Jul 2019 01:40:12 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30055.outbound.protection.outlook.com [40.107.3.55]) by lists.denx.de (Postfix) with ESMTPS id 76E40C21E13 for ; Mon, 8 Jul 2019 01:40:09 +0000 (UTC) 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=ev7Xd8rsh4oKq3Abjst4/JfE9I3vJ05BNrRZ+vZCb9w=; b=LyDm2cKg+WTSk7ztFhBSsmzyhaICpn2D5kJsVDwXzgzLmS9pXobOKIRnI4lI/u9/VrVH7FazRhyBOJG6Aml6G9wY5yLhheaR9TuSt8nMEisOPyLAwoSVQeXjePmwJkiLHY4sxgwsVDT6i58x1MKq3JUaYjJ6ktJyxljKwUqMYfo= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5906.eurprd04.prod.outlook.com (20.178.202.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.16; Mon, 8 Jul 2019 01:40:08 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::2023:c0e5:8a63:2e47]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::2023:c0e5:8a63:2e47%5]) with mapi id 15.20.2052.020; Mon, 8 Jul 2019 01:40:08 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH V2 35/51] imx8mn: support get_cpu_rev Thread-Index: AQHVNS4TuY0G9m0fD0yYts0x7qyekw== Date: Mon, 8 Jul 2019 01:40:08 +0000 Message-ID: <20190708015333.20411-36-peng.fan@nxp.com> References: <20190708015333.20411-1-peng.fan@nxp.com> In-Reply-To: <20190708015333.20411-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0PR01CA0059.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::23) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cdbc80cf-6f2e-4473-69f5-08d7034535a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB5906; x-ms-traffictypediagnostic: AM0PR04MB5906: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-forefront-prvs: 00922518D8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(346002)(39860400002)(376002)(366004)(199004)(189003)(1076003)(2616005)(2501003)(6436002)(86362001)(14444005)(256004)(4326008)(446003)(6486002)(11346002)(5660300002)(73956011)(386003)(6506007)(99286004)(81166006)(66946007)(66446008)(64756008)(66556008)(52116002)(76176011)(8936002)(476003)(66476007)(44832011)(486006)(81156014)(8676002)(305945005)(7736002)(478600001)(102836004)(14454004)(36756003)(316002)(186003)(110136005)(54906003)(25786009)(6512007)(2906002)(66066001)(26005)(50226002)(71200400001)(71190400001)(53936002)(68736007)(3846002)(6116002)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5906; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: yP1R3SLb2oMsaJbz7vqG/KpoyeQfuIvnD8mcPH2EXglUbNjSG40/SUM5p/oAcNLszj3HbV2mZJ5OfyDWzc5Pbza7OptmO4NcFTHTdCHzlqvOusqMxbKy2kKJ31HOeYXDHOSoyEWQ1xNJMkEanvyXy/csZ2tJjd1XOOWsKY1EOD/sLSCpos882UrfM74e8FybiBBKh2UkVwPFnmzRr9PdlfYGasXcje7cIPgHI5VXbVcMO0ayeiPFEFpng12Kr8NSCei2LmMUetef6S/oUIRzzGdVtE8Nf4jJtfuc7Zslk32p+VqTDAaRmGTGd4C6PbikyZ9MxVo53PMTPKQqCfNnBQ8GNbkd9caOgqG1nMb4YUdvmSLpGqxSsrGQif6iUwRf+eJvPtYjBoD8s56IgCOTBbK3dzb9XV7dkdbKva5nhOI= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdbc80cf-6f2e-4473-69f5-08d7034535a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2019 01:40:08.5153 (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: peng.fan@nxp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5906 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH V2 35/51] imx8mn: support get_cpu_rev X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Add a dummy cpu type and support get_cpu_rev for i.MX8MN Signed-off-by: Peng Fan --- arch/arm/include/asm/arch-imx/cpu.h | 1 + arch/arm/include/asm/mach-imx/sys_proto.h | 1 + arch/arm/mach-imx/cpu.c | 2 ++ arch/arm/mach-imx/imx8m/soc.c | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h index 4296e47b9e..5392c926b0 100644 --- a/arch/arm/include/asm/arch-imx/cpu.h +++ b/arch/arm/include/asm/arch-imx/cpu.h @@ -31,6 +31,7 @@ #define MXC_CPU_IMX8MMDL 0x88 /* dummy ID */ #define MXC_CPU_IMX8MMS 0x89 /* dummy ID */ #define MXC_CPU_IMX8MMSL 0x8a /* dummy ID */ +#define MXC_CPU_IMX8MN 0x8b /* dummy ID */ #define MXC_CPU_IMX8QXP_A0 0x90 /* dummy ID */ #define MXC_CPU_IMX8QM 0x91 /* dummy ID */ #define MXC_CPU_IMX8QXP 0x92 /* 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 d01e71f506..344de1716f 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -51,6 +51,7 @@ #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_imx8qxp() (is_cpu_type(MXC_CPU_IMX8QXP)) #ifdef CONFIG_MX6 diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 6dc647b334..9c699e8f50 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -145,6 +145,8 @@ unsigned imx_ddr_size(void) const char *get_imx_type(u32 imxtype) { switch (imxtype) { + case MXC_CPU_IMX8MN: + return "8MNano";/* Quad-core version of the imx8mn */ 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 c4d842f097..a8cb6ca31c 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -200,7 +200,9 @@ u32 get_cpu_rev(void) reg &= 0xff; /* i.MX8MM */ - if (major_low == 0x41) { + if (major_low == 0x42) { + return (MXC_CPU_IMX8MN << 12) | reg; + } else if (major_low == 0x41) { type = get_cpu_variant_type(MXC_CPU_IMX8MM); } else { if (reg == CHIP_REV_1_0) {