From patchwork Thu Mar 12 09:17: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: 11433695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D957A921 for ; Thu, 12 Mar 2020 09:24:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B30222067C for ; Thu, 12 Mar 2020 09:24:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PUxtdYkb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="AMUoGfEM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B30222067C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j+0VJqHNaS+j6Xx0K/mE47+/pvI2x+8DCrAWkcwQLjk=; b=PUxtdYkbuaXmKm yS5na+XhofMlC1SsuUohjzRrSdryYCr3RUNQY378PqSV4tk8WkUjXyqORDN6Qxn6p61fsTKUd9w97 CCCbzHAP6i5LeXZaeWq/wNGdOAh7PXGdoU2xzJk44odDuWsKNjGHuJYnGt9+bP1xUfZHdt1Zbekag bE/JhGWWoDkI7FpJz8zll7sK7ChDk0Q0IIm5liDQ252PfRt4n89SP713NRz2wdzsluAXt8eMCrJLa 3Y2CZ8B2f2daM2twudCU3QYjHmQFi0Op0ajTZa0iFTrgzrXE6Xh0kFrcQ2wnZiaat15YkxtHKKfyI 5uPr5eMRirvqIsQP4+Zg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK58-0004T9-Az; Thu, 12 Mar 2020 09:24:46 +0000 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK4d-0003wX-C0 for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2020 09:24:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oeU4KfNJ/9Q53rKK2h2UtNRkaFFVXvuuk9ryQOi7SfHGlAkFtAc0uFpqNcpzyQI3RyDgUwYU1nawz/8z78DN/m+kTFPY14M6h1P40cjJ2w68wwmD/CBDrS8fq3YmzT7Mr5o9payZRotfmnvrnBUulSEPJGEcgkwG9XGZ2eePiMomtlVYCAZ+UfIV38YHooHg2lHZ0oXnMx2fm5D7Ldj8lILpeb/xBk62oxLtaC+MGiKFfUZclgEkx496Y7L0s5l9b0G915fe5iODNQxw1RnRKIRX+loCTHD2r1jjIEvkz7rvF0f05cmwHpHV+J/cFxNaB0ID/XNCf8KmnmBl+krDJg== 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=SSc0wLoVfGMlBt9BsItn/Q2w7BgQbkJ38ahG/ciGDs8=; b=Rz3cUV3879+VI8KBN7cc269bfFQVxSz1zgXZx4Wa0eEHxbvlquKXGr5yWhmDG/8Axg6PbZcNcueoJNQTcfX2XV05KNwVBu6bjWysVB3HSEJjrRp8kKtSJ4iRjFY9orzRFZIzmgf+OILx+rUF0Kr0q0yDvWNqTdkqdBf5I7LkqjUyGOpAKaPFRyNSxfhPILUj6bHTHF/uhXa0ZyKEkXxbooUzeiLEAj/TfUGgW/z3d1L7zXW2ZDjBdJFTeZGKgavpS+Wq4P2EXEt89trdCVZkrMGD5SnJbMd95rwiP5C+rd9TysJjpLswNahIFc8kkfd7zXoR/uN1Ylxfm9daFySyCA== 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=SSc0wLoVfGMlBt9BsItn/Q2w7BgQbkJ38ahG/ciGDs8=; b=AMUoGfEMKHUQl13wqHEozleRrM7JnIe7xhctEk220WuuTbJg8DoJDXVauL+InVeysnP6H1z3RI07K+qqs+eLVrEZwFTF/bCjdnU8tQ+yfQEbXp5X4d3VT+y3/xdH9muZoOXvlY2dIx+ZdX/x8ZXu2R012EmNzuOFkisxKN6XiOo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5042.eurprd04.prod.outlook.com (20.177.41.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Thu, 12 Mar 2020 09:24:11 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11%6]) with mapi id 15.20.2793.018; Thu, 12 Mar 2020 09:24:11 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH V1 1/4] ARM: imx: use device_initcall for imx_soc_device_init Date: Thu, 12 Mar 2020 17:17:22 +0800 Message-Id: <1584004645-26720-2-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> References: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2835.7 via Frontend Transport; Thu, 12 Mar 2020 09:24:07 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f8bffde1-002b-493d-21ca-08d7c6671fd4 X-MS-TrafficTypeDiagnostic: AM0PR04MB5042:|AM0PR04MB5042: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(396003)(376002)(39860400002)(346002)(199004)(316002)(52116002)(8676002)(8936002)(6506007)(36756003)(81166006)(81156014)(186003)(6666004)(9686003)(6486002)(16526019)(4326008)(66556008)(66476007)(26005)(7416002)(6512007)(956004)(5660300002)(86362001)(478600001)(2616005)(2906002)(66946007)(69590400007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5042; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; 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: a0bivvowreIU5QUCIh74WbCJkk1fM3L7dde76TcRBczlzw95pien7DT3uG75bXUg3/5JFLjg2I143n3ZAZR1GmWNefUe6sFenkUT8yM5qfCWuvQ871ZbQT4HkxItL3jx3NO7iElxSyIz61Hzmo4aWBW2jBdjZr8CnGFD/nN6HS+0d+Idgp+LK1ltm0akscwl9QZ0ggIrpZ6LGJ4GPoLc8/a4+qvCVNzOyNpcy4q7QjnW8czbj/pcrg8HoJpkEfJh9cll+l1Iou1j6fZ4SVANjf7KT+wAgJPRjrojQ7IZQnqrCMDLqAyhx8jXbA/lHGsXL4lhqVFBg/JkmxxGMFpWVSQqcze9Jbnfst/7mqpAJgKPUOjCNEL/A1OQ23ADcVG2M8Of1jrfwZZsyP6OJK8ItMadpLl1Opv33R9zwmAbC20gsGzmsQ5I63fjPGE0tpu/4ObelFtNz37CmFgGb9rNOPv9oFBsIPozvTDS6cq53gjGXB1DEEwG0K5JVzQvc6dO X-MS-Exchange-AntiSpam-MessageData: h+6Txow9OH8260OZ56d+i9yNyKdBNbm1ke1JI3Em5jMptmuiuus0XQWkeOGVBjzjPV9yoUPMMGC24Og3U+4n8JjJb7ljSCASk4FiE/8JjhIhxW9D2FqCfjXdP5qr2p3xbL527qHLkWgb7dspBMRi4w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8bffde1-002b-493d-21ca-08d7c6671fd4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2020 09:24:11.7159 (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: 5I/6PUme3jPCU2bdxkDOjQqy1EkTolemW+J4HvIaEN8ssKmGsjCoMnUCWMQnQy7UTWj2Rcv5NqNfgvI2773SaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5042 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200312_022415_447628_E3A51B15 X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Peng Fan , abel.vesa@nxp.com, Anson.Huang@nxp.com, ard.biesheuvel@linaro.org, festevam@gmail.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, git@andred.net, leonard.crestez@nxp.com, info@metux.net, allison@lohutok.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan This is preparation to move imx_soc_device_init to drivers/soc/imx/ There is no reason to must put dt devices under /sys/devices/soc0, they could also be under /sys/devices/platform, so we could pass NULL as parent when calling of_platform_default_populate. Following soc-imx8.c soc-imx-scu.c using device_initcall, need to change return type to int type for imx_soc_device_init. Signed-off-by: Peng Fan --- arch/arm/mach-imx/common.h | 1 - arch/arm/mach-imx/cpu.c | 9 +++++---- arch/arm/mach-imx/mach-imx6q.c | 8 +------- arch/arm/mach-imx/mach-imx6sl.c | 8 +------- arch/arm/mach-imx/mach-imx6sx.c | 8 +------- arch/arm/mach-imx/mach-imx6ul.c | 8 +------- arch/arm/mach-imx/mach-imx7d.c | 6 ------ arch/arm/mach-imx/mach-imx7ulp.c | 2 +- 8 files changed, 10 insertions(+), 40 deletions(-) diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 5aa5796cff0e..72c3fcc32910 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -49,7 +49,6 @@ void imx_aips_allow_unprivileged_access(const char *compat); int mxc_device_init(void); void imx_set_soc_revision(unsigned int rev); void imx_init_revision_from_anatop(void); -struct device *imx_soc_device_init(void); void imx6_enable_rbc(bool enable); void imx_gpc_check_dt(void); void imx_gpc_set_arm_power_in_lpm(bool power_off); diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 06f8d64b65af..2df649a84697 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -83,7 +83,7 @@ void __init imx_aips_allow_unprivileged_access( } } -struct device * __init imx_soc_device_init(void) +static int __init imx_soc_device_init(void) { struct soc_device_attribute *soc_dev_attr; const char *ocotp_compat = NULL; @@ -97,7 +97,7 @@ struct device * __init imx_soc_device_init(void) soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) - return NULL; + return PTR_ERR(soc_dev_attr); soc_dev_attr->family = "Freescale i.MX"; @@ -219,7 +219,7 @@ struct device * __init imx_soc_device_init(void) if (IS_ERR(soc_dev)) goto free_serial_number; - return soc_device_to_device(soc_dev); + return 0; free_serial_number: kfree(soc_dev_attr->serial_number); @@ -227,5 +227,6 @@ struct device * __init imx_soc_device_init(void) kfree(soc_dev_attr->revision); free_soc: kfree(soc_dev_attr); - return NULL; + return -ENOMEM; } +device_initcall(imx_soc_device_init); diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 284bce1112d2..85c084a716ab 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -245,21 +245,15 @@ static void __init imx6q_axi_init(void) static void __init imx6q_init_machine(void) { - struct device *parent; - if (cpu_is_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_2_0) imx_print_silicon_rev("i.MX6QP", IMX_CHIP_REVISION_1_0); else imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", imx_get_soc_revision()); - parent = imx_soc_device_init(); - if (parent == NULL) - pr_warn("failed to initialize soc device\n"); - imx6q_enet_phy_init(); - of_platform_default_populate(NULL, NULL, parent); + of_platform_default_populate(NULL, NULL, NULL); imx_anatop_init(); cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init(); diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index e27a6889cc56..f6e87363d605 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c @@ -45,13 +45,7 @@ static void __init imx6sl_init_late(void) static void __init imx6sl_init_machine(void) { - struct device *parent; - - parent = imx_soc_device_init(); - if (parent == NULL) - pr_warn("failed to initialize soc device\n"); - - of_platform_default_populate(NULL, NULL, parent); + of_platform_default_populate(NULL, NULL, NULL); if (cpu_is_imx6sl()) imx6sl_fec_init(); diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c index d5310bf307ff..781e2a94fdd7 100644 --- a/arch/arm/mach-imx/mach-imx6sx.c +++ b/arch/arm/mach-imx/mach-imx6sx.c @@ -63,13 +63,7 @@ static inline void imx6sx_enet_init(void) static void __init imx6sx_init_machine(void) { - struct device *parent; - - parent = imx_soc_device_init(); - if (parent == NULL) - pr_warn("failed to initialize soc device\n"); - - of_platform_default_populate(NULL, NULL, parent); + of_platform_default_populate(NULL, NULL, NULL); imx6sx_enet_init(); imx_anatop_init(); diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index 3b0e16ccd59d..e018e716735f 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c @@ -55,13 +55,7 @@ static inline void imx6ul_enet_init(void) static void __init imx6ul_init_machine(void) { - struct device *parent; - - parent = imx_soc_device_init(); - if (parent == NULL) - pr_warn("failed to initialize soc device\n"); - - of_platform_default_populate(NULL, NULL, parent); + of_platform_default_populate(NULL, NULL, NULL); imx6ul_enet_init(); imx_anatop_init(); imx6ul_pm_init(); diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c index ebb27592a9f7..879c35929a13 100644 --- a/arch/arm/mach-imx/mach-imx7d.c +++ b/arch/arm/mach-imx/mach-imx7d.c @@ -78,12 +78,6 @@ static inline void imx7d_enet_init(void) static void __init imx7d_init_machine(void) { - struct device *parent; - - parent = imx_soc_device_init(); - if (parent == NULL) - pr_warn("failed to initialize soc device\n"); - imx_anatop_init(); imx7d_enet_init(); } diff --git a/arch/arm/mach-imx/mach-imx7ulp.c b/arch/arm/mach-imx/mach-imx7ulp.c index 11ac71aaf965..128cf4c92aab 100644 --- a/arch/arm/mach-imx/mach-imx7ulp.c +++ b/arch/arm/mach-imx/mach-imx7ulp.c @@ -57,7 +57,7 @@ static void __init imx7ulp_init_machine(void) mxc_set_cpu_type(MXC_CPU_IMX7ULP); imx7ulp_set_revision(); - of_platform_default_populate(NULL, NULL, imx_soc_device_init()); + of_platform_default_populate(NULL, NULL, NULL); } static const char *const imx7ulp_dt_compat[] __initconst = { From patchwork Thu Mar 12 09:17: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: 11433697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE55D921 for ; Thu, 12 Mar 2020 09:25:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B017C206F1 for ; Thu, 12 Mar 2020 09:25:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EoDWkdp/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Xc8HqMM5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B017C206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hIG7vDBKJ2RympxihjT+qGCUDxcQGEYJlt/v5FEGflk=; b=EoDWkdp/x+4s2z U1kB9wJAqQ4NVOjhstXasyOrOC6m4gjFSH118heohZ0Zg6zBWV5TT5XMU3SggNr7qZbryGIsuNnAe QBdRJRzWPU2EOo9tTq3Ee1BU0C8HV8qHmtbTaMTcWxQ8kHNxvSk2oIuB8Sb1dC46RG8zaNY+witnK jL5661AZf+pG4H5Elk6K7m09wuB9KFsHyMO+xuv/8fF8kgDeB6ngWdaJyhRxPVfjacCymj27ZEIAF g50e/i8zhgymWME0ETr1eb9BVZ+v98cQF2iSjO0xxUobNuQV8jUIImgCKYu7FztGt972ZxnhBNtrQ xgpbYFO33saUSDR1yhcg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK5b-00064A-V9; Thu, 12 Mar 2020 09:25:16 +0000 Received: from mail-eopbgr130042.outbound.protection.outlook.com ([40.107.13.42] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK4i-00041E-AO for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2020 09:24:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bbTy9YcfDgEc6FiN5xz4MEwC6AGmOayOl7CeDOuFbA+3HeFwCQsrYzoNMMYDA9+rqG8VXxXXScZidhoqoUOR5uGiCS2S68SNJjEESStfqo8ZpWSiyt9PTajBPzYBN1Ijy2wVsR/6d951ERq2DMQcD335uQMD+px+E8JX81S4UUaPXcMj8tYU9Xgak0g0sHANIONrMHZn/0t0HPhb+bqIb90St4IOTr/oLUbUZp1149g/Cnq/YgcdEvyca1Xyq8tuorX83OWh5oApPRXBNGmDjkwRJYA35BPGcjYmuE7T41LVA+7IqT0kLDrNnVltyufHP0GsVFDk1NVJM/rH68Lv5w== 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=lxKkVhLNDncdktlbMyFcIMnEzxgzpLoSZ4lKJrsQzqA=; b=U9ND0W4ZD3j7vfkSNrfzHCdvfb+YRw9IaagbCV5xkWj/Y2B2Zk2MyxfT1hLF0seWGJGkYTfCqRs4J+71biExcTda+7Lfwfg+swfgKkLprhadPjKTzN3tC4FY25pA6GrWAofZ9AjLnDsNnaxMlcpZCW3Fd9cDiDSX23IU63QvsFxDrQ7f9+oISOxw/zeGsI7n+g6eIdCmfskjiytxxcI99csWm+OGZg8PE5WYimhR9kjW5eQkrMlFF07SATt9qWCoj9j50LBMHWye4G+faeYHEfuRDih/i8FhuQGliVIo56xbgYV7oEfNyVhTq4gvhvX7aVa0cMRXaNquQDHXr1v8dg== 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=lxKkVhLNDncdktlbMyFcIMnEzxgzpLoSZ4lKJrsQzqA=; b=Xc8HqMM5NDd8W97V5P5qFYzoCc5p7jVv8ePmCHPSptd0wK3ywxl5p9qnP7MfZmxgCxzVoHE7dRiUvA+qP5HFAKIv+Ze+YzUhB5/Tp/JQ3l6P3ce4ByGQcH63InTNv9ymktOp7oKTYltBRfki/F5HrJ/mWiJYvneyWrA89amP9bY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5042.eurprd04.prod.outlook.com (20.177.41.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Thu, 12 Mar 2020 09:24:16 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11%6]) with mapi id 15.20.2793.018; Thu, 12 Mar 2020 09:24:16 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH V1 2/4] ARM: imx: cpu: drop dead code Date: Thu, 12 Mar 2020 17:17:23 +0800 Message-Id: <1584004645-26720-3-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> References: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2835.7 via Frontend Transport; Thu, 12 Mar 2020 09:24:12 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 99dd4fc0-0166-4b25-6cdd-08d7c6672297 X-MS-TrafficTypeDiagnostic: AM0PR04MB5042:|AM0PR04MB5042: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(396003)(376002)(39860400002)(346002)(199004)(316002)(52116002)(8676002)(8936002)(6506007)(36756003)(81166006)(81156014)(186003)(6666004)(9686003)(6486002)(16526019)(4326008)(66556008)(66476007)(26005)(7416002)(6512007)(956004)(5660300002)(86362001)(478600001)(2616005)(2906002)(66946007)(69590400007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5042; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; 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: 8BBvXZj/uBzj6i1TR9Urqmx7+9EWk7USnHdqqn6RKLBH+ebHB8AGinQDSW2PNSa31Mfg20K5CIEHn/nMmjxVRbN6gNCsXSAZZNIBHw+lGsI3U17XlwbF0hFBHpvHZ1XSX5ugVtyqEuaLq9ViOJv78GY3hbREVRlPNez07VBVy4FUB0Q+UoQYJJm2ImsWyTkX3XcTaT+q3VUcf3EF3qkeuZv8AGerW+TApnrmYA7PJlVDsgpcmqqh6yKaNwiM6UNKAkzBqkU7101V6FUlRjIKdf5PLhLBkcgRu/zScVJ9osDnK0ihS5xohAqJ14ysRuQOPSTIBp835Jzx6FmHG5xlLfHFwhOzw26+tQVBlou0oMcCthco8hXHa8rim7vkxsz62D9ttUjPJCFOZYNwRynqcQMtT40MwSwfKh2yLKFiJ/ISv1pqKaDTFPlxLM8x6D7+jYD2+K8AJ3dJEZyE/vhAD60HZMgvxuzbcwDGvSMhZHYbd4BZ5n1XT/yUkz6dA813 X-MS-Exchange-AntiSpam-MessageData: 9DXdf7J7javGG65UdJ12VCrNC0hthwa49PAbwN8tcVauZ5Ru9w2hnOw0w1UHDowr/DxGCHcga7uBhM8Y4AwNx/k96OkQJl+ZAIAW1gnmUoyp52uHrpTatXe+YzrrsWhdBLcfArdPdMwZefd1w1SQGw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99dd4fc0-0166-4b25-6cdd-08d7c6672297 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2020 09:24:16.3732 (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: 0UTVTjSGR1WsQex0T47HyFY+ebDYnJE+qL92+JMmmUitFiZ+7dyiFC5waEvO/6z54vhuNJGYoGfIIxc9jOsVag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5042 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200312_022420_390749_7B2D6A38 X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Peng Fan , abel.vesa@nxp.com, Anson.Huang@nxp.com, ard.biesheuvel@linaro.org, festevam@gmail.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, git@andred.net, leonard.crestez@nxp.com, info@metux.net, allison@lohutok.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan imx_soc_device_init is only called by i.MX6Q/SL/SX/UL/7D/7ULP. So we could drop the switch case for i.MX1/2/3/5 which are dead code that never be executed. Signed-off-by: Peng Fan --- arch/arm/mach-imx/cpu.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 2df649a84697..0302cb66134b 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -108,30 +108,6 @@ static int __init imx_soc_device_init(void) goto free_soc; switch (__mxc_cpu_type) { - case MXC_CPU_MX1: - soc_id = "i.MX1"; - break; - case MXC_CPU_MX21: - soc_id = "i.MX21"; - break; - case MXC_CPU_MX25: - soc_id = "i.MX25"; - break; - case MXC_CPU_MX27: - soc_id = "i.MX27"; - break; - case MXC_CPU_MX31: - soc_id = "i.MX31"; - break; - case MXC_CPU_MX35: - soc_id = "i.MX35"; - break; - case MXC_CPU_MX51: - soc_id = "i.MX51"; - break; - case MXC_CPU_MX53: - soc_id = "i.MX53"; - break; case MXC_CPU_IMX6SL: ocotp_compat = "fsl,imx6sl-ocotp"; soc_id = "i.MX6SL"; From patchwork Thu Mar 12 09:17: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: 11433703 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B49C921 for ; Thu, 12 Mar 2020 09:25:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D336206F1 for ; Thu, 12 Mar 2020 09:25:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pR5Fa/Ag"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="AymwMeaV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D336206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MbEVcgF2fqxsX4S9ItQrnagjA0fl2klsnOhh+qsOwg4=; b=pR5Fa/Ag87Fzoh 3sobBhGPAMz25DQnMNG/5Qnn62tlzWOflfgXeBpCJWEK6Wts/sIYRX13YG3yLV4hzFIabmZLa5rEu kvOQN7VU8Who/ExMfFumFzTA1rqPC7Qeg/e4+HjWhCMrMBLMK3X15W9+2Vm8T+qplXeUiv4wdCWAG Yq8rn25too75YHfwPPn6pcFIm2NHsE+x3dvnjvW2uco6J2XwYTiOH0GdNPUZJCXZ6kDlkloVQ5ihm 73iKY2wqyMzoaGc8lXQUBFejATAPkYowMkmYwYZSTJWt7Hwn88zIrQV8Bgun4L0RvORp5rytlVW0t 1dZGMqOhpjZOYQuKjgOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK5s-0006LK-89; Thu, 12 Mar 2020 09:25:32 +0000 Received: from mail-eopbgr70045.outbound.protection.outlook.com ([40.107.7.45] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK4m-00049Q-U8 for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2020 09:24:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ER1EAvLitKRts18IFl+MYar6ZTWi+w4gwbTm6KMdQiD+gCtZYP8lJUreTx3ZgRTQf9210PxM6TFK02t3xqzzXdLR28V9tT/J3x8A/RCYbRTcpUt8qojtAQKiuA9xC4JPxZKRgm08zpwS5P4zPmfDHRae0fKr69kYLYaMTcQmLhL8tSJWoZe3uK9ZVJbRwFOZ3NtBNE+Pu6JPcl7md5Fq2GKAMJ3GL525nSli9fPWVZqMalGsvW1XytV22N38jI4M8f43mMMoPRWiJtQNVgbzB/PwDo7ZHZqz1vmfvfZLjLd+WqLA0uFpS/dkwPG6KrcXKoETKahhL+HpGqbQ9P8Oew== 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=G0CMnX4vMzPYzS9g30+XGH16lJIrzgO4jK1RlzhTYEw=; b=VbGxkuh609XNHr6heiXGTls5b+ZvikoqfTO4Qlntpw860SqGrAkCfs3ScDb0ixBtyZRBOyY0m7bu7VSqsLtbkvXx+HXKtC1i1lUKdhfvUajU+GiJmkryLWMBxVHI1Z30fg4R/cYqTirBsQVWZusJASDLDspvyWKQ1edsVisObnX+YpmSt/NO5gJ9c4jD9phs1LoLuhIyF8Lj9N7TwqhVHKC2wo3kE7dbjVkfhCsTqU7Dl8gFCqyEmIrkKskiYKPZXh5dFHv/wK10jRM7UV6IpoeYPLmvxPfeHBZU5cfda5NOGWlQy1wU3zooNaari7wU8P/bGyEhHxEI6q1xm7pmaQ== 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=G0CMnX4vMzPYzS9g30+XGH16lJIrzgO4jK1RlzhTYEw=; b=AymwMeaVx/frPOqJ7P3GEThhatjWNXazi6fGugBrY8TTYIsxBe2SsyFhx+NUxtqgspYTZuBjzKP68kSVKm1jG5CyqbF5UwP2mj/6qrbg5u5buifosXBjQgDocDBiCkmVt8MhTp1Bw+bvpN7RBcBQQNtRH+07w/9Sp/Gsb7k6wn4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5588.eurprd04.prod.outlook.com (20.178.119.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16; Thu, 12 Mar 2020 09:24:21 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11%6]) with mapi id 15.20.2793.018; Thu, 12 Mar 2020 09:24:21 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH V1 3/4] ARM: imx: move cpu definitions into a header Date: Thu, 12 Mar 2020 17:17:24 +0800 Message-Id: <1584004645-26720-4-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> References: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2835.7 via Frontend Transport; Thu, 12 Mar 2020 09:24:16 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7d5423a9-3aff-444e-5376-08d7c6672564 X-MS-TrafficTypeDiagnostic: AM0PR04MB5588:|AM0PR04MB5588: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(376002)(366004)(396003)(39860400002)(199004)(8936002)(478600001)(66946007)(81156014)(86362001)(6486002)(6512007)(69590400007)(52116002)(9686003)(81166006)(26005)(2906002)(4326008)(8676002)(6506007)(7416002)(5660300002)(2616005)(36756003)(316002)(66556008)(6666004)(66476007)(956004)(186003)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5588; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; 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: PBOGHYBxUL8FGXL4WX07nhT3dTcUOhq+LnZlVm6P1B6S+KisnV4BShZFAnNJZOzzHEyfC3HPP6LtcUQwPRxCMQB48DW71CLASy1yFweCE8edum/kW57vmHwPeyW5Rj0wnS1UYWfPtPbGXufSPCCyl5Xy7K75dQSrEKxSlz7j/FoLM73nJ+MpfIFD1ppKYzq587hu1BoaTfvqZ3wYKPPmzknLxfYMLbLJ5v8G5xTSP359EL36hXxzgRfSFShkax2PdoilOnDurIqe9gpx/JADdZjXn+pM6ta5ZPYoXs0jNaShx0Gi29XfFmXx7khh9zdbOKpoESjtGOce7MKC/AtcykoSSobjbUDbLytU3O9ZXMaPczxuEtn3dlZjaLqLSJcHUV4J720wxoa6QjOEs0CGQKq/G5dAi/uiNZwxWuJmw7VMqOLlkv5Rao14SSw6OMIBfmkB1gMnDD9ZpsocKWNmAXHo8lagMjANDeaDrJiErbycffjuzvKuHVe1U1edaET9 X-MS-Exchange-AntiSpam-MessageData: dyNYyDdcFUHdCzl5QrCI0vQJxM7+mEus1foNhA2vkkf3df8Z3fKTULVIpsoWNkmDraT7yFZFMEICvwt1qn3dA4ilM3fpyN+e5TGxCDlLLhIl2oqCd4Am3mq1MBh6Ew21/Qit2+uJ4GE7OyhlEddJng== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d5423a9-3aff-444e-5376-08d7c6672564 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2020 09:24:20.9346 (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: NLvHly9FcFqfzUeqV9hYz7/2lFvU9UzjJjqrEBPEXCXV8/HadndJq2jhb09zbsPf1ypchOzP3XYllzfy4kDveA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5588 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200312_022424_999645_0F632BF8 X-CRM114-Status: GOOD ( 11.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.7.45 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.7.45 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Peng Fan , abel.vesa@nxp.com, Anson.Huang@nxp.com, ard.biesheuvel@linaro.org, festevam@gmail.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, git@andred.net, leonard.crestez@nxp.com, info@metux.net, allison@lohutok.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan The soc device register code will be moved to drivers/soc/imx/, the code needs the cpu type definitions. So let's move the cpu type definitions to a header. Signed-off-by: Peng Fan --- arch/arm/mach-imx/mxc.h | 22 +--------------------- include/soc/imx/cpu.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 include/soc/imx/cpu.h diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h index 2bfd2d59b4a6..fe2d0f5abfcc 100644 --- a/arch/arm/mach-imx/mxc.h +++ b/arch/arm/mach-imx/mxc.h @@ -8,35 +8,15 @@ #define __ASM_ARCH_MXC_H__ #include +#include #ifndef __ASM_ARCH_MXC_HARDWARE_H__ #error "Do not include directly." #endif -#define MXC_CPU_MX1 1 -#define MXC_CPU_MX21 21 -#define MXC_CPU_MX25 25 -#define MXC_CPU_MX27 27 -#define MXC_CPU_MX31 31 -#define MXC_CPU_MX35 35 -#define MXC_CPU_MX51 51 -#define MXC_CPU_MX53 53 -#define MXC_CPU_IMX6SL 0x60 -#define MXC_CPU_IMX6DL 0x61 -#define MXC_CPU_IMX6SX 0x62 -#define MXC_CPU_IMX6Q 0x63 -#define MXC_CPU_IMX6UL 0x64 -#define MXC_CPU_IMX6ULL 0x65 -/* virtual cpu id for i.mx6ulz */ -#define MXC_CPU_IMX6ULZ 0x6b -#define MXC_CPU_IMX6SLL 0x67 -#define MXC_CPU_IMX7D 0x72 -#define MXC_CPU_IMX7ULP 0xff - #define IMX_DDR_TYPE_LPDDR2 1 #ifndef __ASSEMBLY__ -extern unsigned int __mxc_cpu_type; #ifdef CONFIG_SOC_IMX6SL static inline bool cpu_is_imx6sl(void) diff --git a/include/soc/imx/cpu.h b/include/soc/imx/cpu.h new file mode 100644 index 000000000000..0669fc08a501 --- /dev/null +++ b/include/soc/imx/cpu.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef __IMX_CPU_H__ +#define __IMX_CPU_H__ + +#define MXC_CPU_MX1 1 +#define MXC_CPU_MX21 21 +#define MXC_CPU_MX25 25 +#define MXC_CPU_MX27 27 +#define MXC_CPU_MX31 31 +#define MXC_CPU_MX35 35 +#define MXC_CPU_MX51 51 +#define MXC_CPU_MX53 53 +#define MXC_CPU_IMX6SL 0x60 +#define MXC_CPU_IMX6DL 0x61 +#define MXC_CPU_IMX6SX 0x62 +#define MXC_CPU_IMX6Q 0x63 +#define MXC_CPU_IMX6UL 0x64 +#define MXC_CPU_IMX6ULL 0x65 +/* virtual cpu id for i.mx6ulz */ +#define MXC_CPU_IMX6ULZ 0x6b +#define MXC_CPU_IMX6SLL 0x67 +#define MXC_CPU_IMX7D 0x72 +#define MXC_CPU_IMX7ULP 0xff + +#ifndef __ASSEMBLY__ +extern unsigned int __mxc_cpu_type; +#endif + +#endif From patchwork Thu Mar 12 09:17: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: 11433705 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D1A12921 for ; Thu, 12 Mar 2020 09:25:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A817E2067C for ; Thu, 12 Mar 2020 09:25:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l+VUqYA7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="sHLLeNx+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A817E2067C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/VMwANQGt9rF8S97zxUvJS/sHkk1sxiJHZK6KgnBwmA=; b=l+VUqYA7tEp7y2 t/KpeWoRk6JLM7Kwn9ejTdjjK0LeTRa8tAh7ID+aDPoYZsuaB+JaIVXnxc1CoX6hR+mLhVvcIQmww 7HaUoLuG6uhH0WYv/XAHWcGDyCG9Lmcm0PdQT6kQToTKlUZ6Nsx8CHlwfvnAtFdCLXN4Ps70jkne/ khVVdeqOmb8UC4GN3LtVRFzQTROzbt0oxem73pZzKW78fnc2SjqKXaRmGYwSCW6IBCXRu7ZuX+KNs /Cj7baQDRJOd/cEqvIdDCVr8T43qLDkjz9uL6Yrq+ByrxC5koS7/yU3FbPyVLMHegTmRpzsOMwv2j BqwWUYKS9in59kheuMgw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK65-0006ZO-JX; Thu, 12 Mar 2020 09:25:45 +0000 Received: from mail-eopbgr130055.outbound.protection.outlook.com ([40.107.13.55] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCK4r-0004Cs-3k for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2020 09:24:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dnWP8mUaITGFhfNz0bqsJkhqZPMqVvTFan5sNydU5EQvKPq47k15WzWtuLBlV1y3EpoLrk5ygD7mUI55GlRqPjY1Oi1Msb+V1OYZ4lw6EpY5exwSLJBz0o9Y+UOgDoCa9WLwKcyuK5hkXcxyS2CBwbRCoQCMFK/NlkQ6jy2unUnqk5L8LjwzaRAZLhlDS0hzT/vqv7/e4MHDzk7jgNiMixvIsaAQgceyRFsurBOt6UoQMrJrwD2+KM9BSrCBLWoHBM6EBjZIy2jIvpmd3OJRIBOdqneodIMttFO9kiUfQzVNaZaUkNT9/5bhGCnOIgCCoE3vwNa0APz78Xa7NmgyqA== 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=YqvdGD/HwGf711iaWqfgq2vY+0tQlzWLLV3Ax9eNSwY=; b=fAabO8XzBw99Pyihbeux2drvVscpxn85hacm9F93z65SStpU+y6BqlrCKXqt4nvaYEmvYROIy1uodcuaI8B9rMryJcSvLLdVs+stkMdjC3qqD2E+GzAb+XU+1ik0hipWDe3uodt4zpb9QOpwhpe2pDlsIKeIVLJJsrbKS1lhs63it6eNYjZ9opR/EIJBDxneaRtRH6vIUfqBjc/qiO3SfaPCBo2xpcppkc4Hg2yFExggCfvTJ8zHw/vTjVomsh8oMz6eYGWPU2id4cjcMKzmH/u/ywDSQTLgo9Nm1LMuRNPe0SDil6nLlHWUudwUDY2/xkD7KkxDaET8/GbMLWW3oQ== 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=YqvdGD/HwGf711iaWqfgq2vY+0tQlzWLLV3Ax9eNSwY=; b=sHLLeNx+AfKInsqFcd230J11tFj25znB+eE+7/pqmJ5xNFSvUlDZxbCVRERlsjmnmdz8UoL41esxI0MUgoafJJjxeI3CmxwfGbbAJc2KKC7WSTko9uYQyWhurHvWcos9mXbMXsEa8rmGGc6SR0FiYfAiY3JJlGgVtLk6rgMqWXQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB5042.eurprd04.prod.outlook.com (20.177.41.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Thu, 12 Mar 2020 09:24:25 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::548f:4941:d4eb:4c11%6]) with mapi id 15.20.2793.018; Thu, 12 Mar 2020 09:24:25 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH V1 4/4] soc: imx: move cpu code to drivers/soc/imx Date: Thu, 12 Mar 2020 17:17:25 +0800 Message-Id: <1584004645-26720-5-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> References: <1584004645-26720-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR0302CA0001.apcprd03.prod.outlook.com (2603:1096:3:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2835.7 via Frontend Transport; Thu, 12 Mar 2020 09:24:21 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eeed14d5-8454-4bd0-78c3-08d7c6672815 X-MS-TrafficTypeDiagnostic: AM0PR04MB5042:|AM0PR04MB5042: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:108; X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(396003)(376002)(39860400002)(346002)(199004)(316002)(52116002)(8676002)(8936002)(6506007)(36756003)(81166006)(81156014)(186003)(9686003)(6486002)(16526019)(4326008)(66556008)(66476007)(26005)(7416002)(6512007)(956004)(5660300002)(86362001)(478600001)(2616005)(2906002)(66946007)(69590400007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5042; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; 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: g/deKmNwBhEC2w/iROf/lW+wb3CKHmGdPKoVTlIpa1Ul9se4Xz/7fEhcIuO2qI3JlhxHjUFY+EvO0Wm8OXptuXVBn2QHTySJTnsieoxOrABE6gapf7nQDnud9NV1Cqsu4y5LkXMirFGlRtnL6y26SYkHmhsHON8Y6rQZ8mBNCPr5OTflyDfmEovlqI1NLcW9aYFYhf/PFp4BEgFb+0diq9ERnudIJaRX5s3d2Ed+PCmWM3iUBhJbCX4lVKm4nyRua8XWRubpRPzJEibj1il7XDDEGP6PJe6LcN4cr5DpPDgGKfE5wRS4BD0ZZRw8hV73/FByISP26i+woGkY8yHx8j+JvPBxzESpThr06/xbxte147OBKsf73GqfwFnyn1vAjE3f+M46r9r1okjXcNQBXWwMei0VADEsKK226ekqzfU1a8LeCi/GHIzcfhIZ4wOs4ZF6MCEUteUCO8VzNCsNhmKiypuMY3nw345utYxrlEyfymV5pLIyyc5Q0636rdKx X-MS-Exchange-AntiSpam-MessageData: tw05M+UVVRJGgG8Qb6hZvOH6Jtv14hZ/mF9CmPuPte8Jxrfqmnb4hljB7Ze96hy2Qs9ruASJNilVI8LxUwhGjHUca+S5NekhSfn5pNeXCLFxgs5EkirnnPYEKu0d4mXK6d+nYKtN2TeOV7BoHciS/g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eeed14d5-8454-4bd0-78c3-08d7c6672815 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2020 09:24:25.5979 (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: 51jsrLCFv+ikQ+jkMeg8PQVs9nzNljd2eMsKr/3TyajwS0CPQ/ROEezEByRLlovCYOMEbn8sbpK+qPWcSY2bKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5042 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200312_022429_207518_793E7341 X-CRM114-Status: GOOD ( 16.58 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.13.55 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Peng Fan , abel.vesa@nxp.com, Anson.Huang@nxp.com, ard.biesheuvel@linaro.org, festevam@gmail.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, git@andred.net, leonard.crestez@nxp.com, info@metux.net, allison@lohutok.net Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Move the soc device register code to drivers/soc/imx to align with i.MX8. Signed-off-by: Peng Fan --- arch/arm/mach-imx/cpu.c | 136 ------------------------------------------ drivers/soc/imx/Makefile | 3 + drivers/soc/imx/soc-imx.c | 146 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 136 deletions(-) create mode 100644 drivers/soc/imx/soc-imx.c diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 0302cb66134b..65c7224f5250 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -1,25 +1,13 @@ // SPDX-License-Identifier: GPL-2.0 #include -#include #include #include #include #include -#include -#include -#include #include "hardware.h" #include "common.h" -#define OCOTP_UID_H 0x420 -#define OCOTP_UID_L 0x410 - -#define OCOTP_ULP_UID_1 0x4b0 -#define OCOTP_ULP_UID_2 0x4c0 -#define OCOTP_ULP_UID_3 0x4d0 -#define OCOTP_ULP_UID_4 0x4e0 - unsigned int __mxc_cpu_type; static unsigned int imx_soc_revision; @@ -82,127 +70,3 @@ void __init imx_aips_allow_unprivileged_access( imx_set_aips(aips_base_addr); } } - -static int __init imx_soc_device_init(void) -{ - struct soc_device_attribute *soc_dev_attr; - const char *ocotp_compat = NULL; - struct soc_device *soc_dev; - struct device_node *root; - struct regmap *ocotp = NULL; - const char *soc_id; - u64 soc_uid = 0; - u32 val; - int ret; - - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); - if (!soc_dev_attr) - return PTR_ERR(soc_dev_attr); - - soc_dev_attr->family = "Freescale i.MX"; - - root = of_find_node_by_path("/"); - ret = of_property_read_string(root, "model", &soc_dev_attr->machine); - of_node_put(root); - if (ret) - goto free_soc; - - switch (__mxc_cpu_type) { - case MXC_CPU_IMX6SL: - ocotp_compat = "fsl,imx6sl-ocotp"; - soc_id = "i.MX6SL"; - break; - case MXC_CPU_IMX6DL: - ocotp_compat = "fsl,imx6q-ocotp"; - soc_id = "i.MX6DL"; - break; - case MXC_CPU_IMX6SX: - ocotp_compat = "fsl,imx6sx-ocotp"; - soc_id = "i.MX6SX"; - break; - case MXC_CPU_IMX6Q: - ocotp_compat = "fsl,imx6q-ocotp"; - soc_id = "i.MX6Q"; - break; - case MXC_CPU_IMX6UL: - ocotp_compat = "fsl,imx6ul-ocotp"; - soc_id = "i.MX6UL"; - break; - case MXC_CPU_IMX6ULL: - ocotp_compat = "fsl,imx6ull-ocotp"; - soc_id = "i.MX6ULL"; - break; - case MXC_CPU_IMX6ULZ: - ocotp_compat = "fsl,imx6ull-ocotp"; - soc_id = "i.MX6ULZ"; - break; - case MXC_CPU_IMX6SLL: - ocotp_compat = "fsl,imx6sll-ocotp"; - soc_id = "i.MX6SLL"; - break; - case MXC_CPU_IMX7D: - ocotp_compat = "fsl,imx7d-ocotp"; - soc_id = "i.MX7D"; - break; - case MXC_CPU_IMX7ULP: - ocotp_compat = "fsl,imx7ulp-ocotp"; - soc_id = "i.MX7ULP"; - break; - default: - soc_id = "Unknown"; - } - soc_dev_attr->soc_id = soc_id; - - if (ocotp_compat) { - ocotp = syscon_regmap_lookup_by_compatible(ocotp_compat); - if (IS_ERR(ocotp)) - pr_err("%s: failed to find %s regmap!\n", __func__, ocotp_compat); - } - - if (!IS_ERR_OR_NULL(ocotp)) { - if (__mxc_cpu_type == MXC_CPU_IMX7ULP) { - regmap_read(ocotp, OCOTP_ULP_UID_4, &val); - soc_uid = val & 0xffff; - regmap_read(ocotp, OCOTP_ULP_UID_3, &val); - soc_uid <<= 16; - soc_uid |= val & 0xffff; - regmap_read(ocotp, OCOTP_ULP_UID_2, &val); - soc_uid <<= 16; - soc_uid |= val & 0xffff; - regmap_read(ocotp, OCOTP_ULP_UID_1, &val); - soc_uid <<= 16; - soc_uid |= val & 0xffff; - } else { - regmap_read(ocotp, OCOTP_UID_H, &val); - soc_uid = val; - regmap_read(ocotp, OCOTP_UID_L, &val); - soc_uid <<= 32; - soc_uid |= val; - } - } - - soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d", - (imx_soc_revision >> 4) & 0xf, - imx_soc_revision & 0xf); - if (!soc_dev_attr->revision) - goto free_soc; - - soc_dev_attr->serial_number = kasprintf(GFP_KERNEL, "%016llX", soc_uid); - if (!soc_dev_attr->serial_number) - goto free_rev; - - soc_dev = soc_device_register(soc_dev_attr); - if (IS_ERR(soc_dev)) - goto free_serial_number; - - return 0; - -free_serial_number: - kfree(soc_dev_attr->serial_number); -free_rev: - kfree(soc_dev_attr->revision); -free_soc: - kfree(soc_dev_attr); - return -ENOMEM; -} -device_initcall(imx_soc_device_init); diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index 103e2c93c342..45dd49df3044 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -1,5 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o +obj-$(CONFIG_SOC_IMX6)+= soc-imx.o +obj-$(CONFIG_SOC_IMX7D)+= soc-imx.o +obj-$(CONFIG_SOC_IMX7ULP)+= soc-imx.o obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o obj-$(CONFIG_IMX_SCU_SOC) += soc-imx-scu.o diff --git a/drivers/soc/imx/soc-imx.c b/drivers/soc/imx/soc-imx.c new file mode 100644 index 000000000000..e01c7ccf1f4b --- /dev/null +++ b/drivers/soc/imx/soc-imx.c @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2020 NXP. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#define OCOTP_UID_H 0x420 +#define OCOTP_UID_L 0x410 + +#define OCOTP_ULP_UID_1 0x4b0 +#define OCOTP_ULP_UID_2 0x4c0 +#define OCOTP_ULP_UID_3 0x4d0 +#define OCOTP_ULP_UID_4 0x4e0 + +static int __init imx_soc_device_init(void) +{ + struct soc_device_attribute *soc_dev_attr; + const char *ocotp_compat = NULL; + struct soc_device *soc_dev; + struct device_node *root; + struct regmap *ocotp = NULL; + const char *soc_id; + u64 soc_uid = 0; + u32 val; + int ret; + + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + if (!soc_dev_attr) + return PTR_ERR(soc_dev_attr); + + soc_dev_attr->family = "Freescale i.MX"; + + root = of_find_node_by_path("/"); + ret = of_property_read_string(root, "model", &soc_dev_attr->machine); + of_node_put(root); + if (ret) + goto free_soc; + + switch (__mxc_cpu_type) { + case MXC_CPU_IMX6SL: + ocotp_compat = "fsl,imx6sl-ocotp"; + soc_id = "i.MX6SL"; + break; + case MXC_CPU_IMX6DL: + ocotp_compat = "fsl,imx6q-ocotp"; + soc_id = "i.MX6DL"; + break; + case MXC_CPU_IMX6SX: + ocotp_compat = "fsl,imx6sx-ocotp"; + soc_id = "i.MX6SX"; + break; + case MXC_CPU_IMX6Q: + ocotp_compat = "fsl,imx6q-ocotp"; + soc_id = "i.MX6Q"; + break; + case MXC_CPU_IMX6UL: + ocotp_compat = "fsl,imx6ul-ocotp"; + soc_id = "i.MX6UL"; + break; + case MXC_CPU_IMX6ULL: + ocotp_compat = "fsl,imx6ull-ocotp"; + soc_id = "i.MX6ULL"; + break; + case MXC_CPU_IMX6ULZ: + ocotp_compat = "fsl,imx6ull-ocotp"; + soc_id = "i.MX6ULZ"; + break; + case MXC_CPU_IMX6SLL: + ocotp_compat = "fsl,imx6sll-ocotp"; + soc_id = "i.MX6SLL"; + break; + case MXC_CPU_IMX7D: + ocotp_compat = "fsl,imx7d-ocotp"; + soc_id = "i.MX7D"; + break; + case MXC_CPU_IMX7ULP: + ocotp_compat = "fsl,imx7ulp-ocotp"; + soc_id = "i.MX7ULP"; + break; + default: + soc_id = "Unknown"; + } + soc_dev_attr->soc_id = soc_id; + + if (ocotp_compat) { + ocotp = syscon_regmap_lookup_by_compatible(ocotp_compat); + if (IS_ERR(ocotp)) + pr_err("%s: failed to find %s regmap!\n", __func__, ocotp_compat); + } + + if (!IS_ERR_OR_NULL(ocotp)) { + if (__mxc_cpu_type == MXC_CPU_IMX7ULP) { + regmap_read(ocotp, OCOTP_ULP_UID_4, &val); + soc_uid = val & 0xffff; + regmap_read(ocotp, OCOTP_ULP_UID_3, &val); + soc_uid <<= 16; + soc_uid |= val & 0xffff; + regmap_read(ocotp, OCOTP_ULP_UID_2, &val); + soc_uid <<= 16; + soc_uid |= val & 0xffff; + regmap_read(ocotp, OCOTP_ULP_UID_1, &val); + soc_uid <<= 16; + soc_uid |= val & 0xffff; + } else { + regmap_read(ocotp, OCOTP_UID_H, &val); + soc_uid = val; + regmap_read(ocotp, OCOTP_UID_L, &val); + soc_uid <<= 32; + soc_uid |= val; + } + } + + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d", + (imx_get_soc_revision() >> 4) & 0xf, + imx_get_soc_revision() & 0xf); + if (!soc_dev_attr->revision) + goto free_soc; + + soc_dev_attr->serial_number = kasprintf(GFP_KERNEL, "%016llX", soc_uid); + if (!soc_dev_attr->serial_number) + goto free_rev; + + soc_dev = soc_device_register(soc_dev_attr); + if (IS_ERR(soc_dev)) + goto free_serial_number; + + return 0; + +free_serial_number: + kfree(soc_dev_attr->serial_number); +free_rev: + kfree(soc_dev_attr->revision); +free_soc: + kfree(soc_dev_attr); + return -ENOMEM; +} +device_initcall(imx_soc_device_init);