Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp283425imu; Thu, 10 Jan 2019 23:46:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN59pHMbEcbG5CNnxrs1q+RDo5SQ7u/t37FeBq//HeFYMQ5g0Bs/0uw7MOmakexYvRvDo62/ X-Received: by 2002:a62:2044:: with SMTP id g65mr13378517pfg.127.1547192786265; Thu, 10 Jan 2019 23:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547192786; cv=none; d=google.com; s=arc-20160816; b=AbXnGkEL4vFauHxY631vjV8UVc6OPKc9KyqexvYZ88oJzulOqRYKyqKU0fgeed7ASP 9TMMYxMvbl//vis4a4zE0lM4AK7MfijdNxHbYV7x+03gu3ZO6Y4ezCo0rzbW7RbTmvJn QdIE3euF3cQvI1dkcDS2Uj38Qp5u3QLYP+UKVqu1yhO/+yfu0cWdQFb2paTGl/KkH98k maN1GIk3Rjiiw6BV9tmxBZCJkVdwv+sATqKUMZqikcdkn04dRRN0DIKpPTQMQAnOm0Pa 21qAB/C9+uTJMls4odkjcINCd6TiRwUMch/VH1qw7cR90dJn1EQ6mUPwHm76xtGzVKGh 13Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=+RNl0nk1HJ9YCprLzmpGpqsrszr5zUvcMfHu9qro0t0=; b=mRa+MCS9cAm2KSokhFEwy9+n8JaptzHGte9v0BymPMJZF+P4HelLGEVGmgSoICS5ag V/u2fiALXV0KiW2PGp7dOspglesrjJ8a4zu8kdpHlr948fEH3ycqGhzzAr4vPzo4fGov B6RlljmG88AmKqlYtj9cbrQlO+v8d5Ym1XaA8yYS+5DHi3aN1XhC6uEXM7ZVgRVsbUHp PXS/0cgrzPGSJKVsccWC9RazdX1HwJRRkfAsD5OGVUSv5DbDkKPy/FlYuO8BN2FZgptz V0YazdEdQCbKum4kABgKUGCMKDFbhh4mW/bovPMCBUj/hI5FHqBAUpyWzm0vgB5qdq+o wAGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=KFAkfYT8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si33103960pgl.211.2019.01.10.23.46.10; Thu, 10 Jan 2019 23:46:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=KFAkfYT8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730271AbfAKGWz (ORCPT + 99 others); Fri, 11 Jan 2019 01:22:55 -0500 Received: from mail-eopbgr20053.outbound.protection.outlook.com ([40.107.2.53]:42510 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728042AbfAKGWy (ORCPT ); Fri, 11 Jan 2019 01:22:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+RNl0nk1HJ9YCprLzmpGpqsrszr5zUvcMfHu9qro0t0=; b=KFAkfYT8xJevKYWqfuKgz/4a69VOz85q2Ll3iqfPxxiPnTtQoEZ9c/GgqK41YhYfjzze9UWfqzbV6BArvyJc0YQt3OMxoW/dVRaRYynsViyfl5UGnMy8SnCLZjktZ7rjVe0iXSRzVygLAI0qL8Mu37QIVqubhIytn2IiywVHn10= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3788.eurprd04.prod.outlook.com (52.134.72.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.14; Fri, 11 Jan 2019 06:22:50 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::59d2:55a0:dbe3:2a97]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::59d2:55a0:dbe3:2a97%6]) with mapi id 15.20.1516.016; Fri, 11 Jan 2019 06:22:50 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , Fabio Estevam , "linux@armlinux.org.uk" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support Thread-Topic: [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support Thread-Index: AQHUqXYTfowyprR/GkaKRunxZlhVwA== Date: Fri, 11 Jan 2019 06:22:50 +0000 Message-ID: <1547187469-14046-2-git-send-email-Anson.Huang@nxp.com> References: <1547187469-14046-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1547187469-14046-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR04CA0090.apcprd04.prod.outlook.com (2603:1096:202:15::34) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB3PR0402MB3788;6:V7SNeIKvBkWPfp+qo7yNXFnn70TsU2EbrydzuTsd8VsL1hZzMVdPuHh5jKwZyFEWF2WK+qLsG9a1f2GCzFmnSLtFwDvwFe14m1akyTKgkKhFmH5cCPD3HwSrZTnmyzTuY+q1U+3Mjv2XYzJuo1h3gDk+/grvsUdDg8XyTVnO3yexFxSmUF8RA0SvoYnnoxehCNqO3L6Tl6ckYpA3ypbzHQ1IbBO5kTGDIavlxw+wkQh1BlZueXhOwyrQsVwiLW+RczesMeOe7YXZjPisGMffrOpIn6FNdxngpGoGo2rfCB7zpyXxQj+qDjCk6e9gdRn9z6Yl8wdHWrthZ/kBvocVphTq1s8dK7w4Ix8zRPryqhx60DBFp1l2Cqrar84k4DkHt8OdFxK55iyJzZutgbnLq3EZNnznQuKnREt7I/+SYKPbK1LzvzQc3duq6K2SD3PpOXmoyU2EkUGPt+RMeGrQYg==;5:Ag97wcOxBMVcOSMayVOvUWMjtguhzRgh49ja6H/Y6QBxMey3UUk8NAEskqFMSKLgNLaKcO3WuLzkUEmFM/zyqSdeTK0hU7gpXnf3CjL5heyp3TLOzqMLX/bzY+uv9WRTy8e1vxP2fRWFMHGgTOpGbaZXp+mEraCGtybsNOH6kh75Yx+a0M+uVfPIWOfr1ksTDnw0Qfb+zFmuk9UWqyL8rw==;7:R46jlEg8jSphXSt2WqkKz1CzP/S9RU5drSvcm4m4919DU2Rj3Z6J/7KrGjRQ+H4q8qADNAzLt+BRfQkf9CEd6mMYPhI4mZdVC/eIwVaEPusqYOcW4avs1RYN7wVS5fqeh0Y3jZuaVEWnbx+PCtU+FQ== x-ms-office365-filtering-correlation-id: 507e45b1-b0e1-44c8-9128-08d6778d3602 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3788; x-ms-traffictypediagnostic: DB3PR0402MB3788: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(346002)(136003)(396003)(39860400002)(189003)(199004)(4326008)(486006)(106356001)(105586002)(53936002)(316002)(2616005)(102836004)(2906002)(25786009)(26005)(99286004)(186003)(386003)(6506007)(97736004)(6512007)(76176011)(6486002)(52116002)(71190400001)(71200400001)(256004)(2501003)(305945005)(478600001)(7736002)(446003)(36756003)(14454004)(11346002)(6436002)(6116002)(66066001)(476003)(3846002)(5660300001)(81156014)(68736007)(81166006)(8936002)(575784001)(86362001)(8676002)(50226002)(110136005)(2201001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3788;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: k8YRZJoYrggws1a4lSjcz2jbkrmneNTiqE+C9rav6RR1LHzMoT6Gbq4Ie83d/a3IllIlDJNS3NeiOXCxLY+Js8ZdwxpIHiKOF5wxrLruKo/sATsPrkj7flBD1F3RAf6VfVlv2o4Zfyrn3isV/ObwThV5xQVM7ZMTnFWf5wCMqyw4REb7dCUiRg+up/dr9Djh+haMbmsmOLi2oecM+g03UJjZ6+b2FInNzhB86UfaQUsBW3yNjR0b2Yronrzy1YsgEBXTJj+ofuJmYrriaaxfRpgXehB50yxEGcnDeh82OIMXpLRtoXqJAJQvkJMheffX+FL8878q2+NOALrKFfEVya4PU9FYi7Jj4IU4ilU+XKGvd+r0BQlIzcgBbG3wCKYMLRpA++JgfG7qSgbf2+5iRQrmPZ7BIDOqc2XoU25YuzE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 507e45b1-b0e1-44c8-9128-08d6778d3602 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 06:22:41.1943 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3788 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org i.MX7ULP SoC's revision info is inside the SIM module, bit[31:28] of JTAG_ID register defines revision as below from B0: 0001 B0 0010 B1 This patch adds SoC revision support for i.MX7ULP, test result as below: root@imx7ulp-evk ~$ cat /sys/devices/soc0/revision 2.1 Signed-off-by: Anson Huang --- arch/arm/mach-imx/mach-imx7ulp.c | 39 ++++++++++++++++++++++++++++++++++++= +++ 1 file changed, 39 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx7ulp.c b/arch/arm/mach-imx/mach-imx7= ulp.c index 19c5b30..11ac71a 100644 --- a/arch/arm/mach-imx/mach-imx7ulp.c +++ b/arch/arm/mach-imx/mach-imx7ulp.c @@ -6,18 +6,57 @@ */ =20 #include +#include #include +#include #include =20 #include "common.h" #include "cpuidle.h" #include "hardware.h" =20 +#define SIM_JTAG_ID_REG 0x8c + +static void __init imx7ulp_set_revision(void) +{ + struct regmap *sim; + u32 revision; + + sim =3D syscon_regmap_lookup_by_compatible("fsl,imx7ulp-sim"); + if (IS_ERR(sim)) { + pr_warn("failed to find fsl,imx7ulp-sim regmap!\n"); + return; + } + + if (regmap_read(sim, SIM_JTAG_ID_REG, &revision)) { + pr_warn("failed to read sim regmap!\n"); + return; + } + + /* + * bit[31:28] of JTAG_ID register defines revision as below from B0: + * 0001 B0 + * 0010 B1 + */ + switch (revision >> 28) { + case 1: + imx_set_soc_revision(IMX_CHIP_REVISION_2_0); + break; + case 2: + imx_set_soc_revision(IMX_CHIP_REVISION_2_1); + break; + default: + imx_set_soc_revision(IMX_CHIP_REVISION_1_0); + break; + } +} + static void __init imx7ulp_init_machine(void) { imx7ulp_pm_init(); =20 mxc_set_cpu_type(MXC_CPU_IMX7ULP); + imx7ulp_set_revision(); of_platform_default_populate(NULL, NULL, imx_soc_device_init()); } =20 --=20 2.7.4