From patchwork Fri Apr 22 06:27:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 8906241 Return-Path: X-Original-To: patchwork-linux-clk@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1C3D29F1D3 for ; Fri, 22 Apr 2016 06:39:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 728592020F for ; Fri, 22 Apr 2016 06:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6FAF200EC for ; Fri, 22 Apr 2016 06:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbcDVGhk (ORCPT ); Fri, 22 Apr 2016 02:37:40 -0400 Received: from mail-bl2on0097.outbound.protection.outlook.com ([65.55.169.97]:3136 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751973AbcDVGhf (ORCPT ); Fri, 22 Apr 2016 02:37:35 -0400 Received: from CH1PR03CA011.namprd03.prod.outlook.com (10.255.156.156) by DM2PR0301MB0717.namprd03.prod.outlook.com (10.160.97.13) with Microsoft SMTP Server (TLS) id 15.1.466.19; Fri, 22 Apr 2016 06:37:30 +0000 Received: from BL2FFO11FD045.protection.gbl (10.255.156.132) by CH1PR03CA011.outlook.office365.com (10.255.156.156) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Fri, 22 Apr 2016 06:37:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Fri, 22 Apr 2016 06:37:29 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u3M6b1CW016375; Thu, 21 Apr 2016 23:37:22 -0700 From: Yangbo Lu To: , , , , , , , , CC: , , Rob Herring , Russell King , Jochen Friedrich , Joerg Roedel , Claudiu Manoil , Bhupesh Sharma , Zhao Qiang , "Kumar Gala" , Santosh Shilimkar , , , Yangbo Lu Subject: [v8, 3/7] soc: fsl: add GUTS driver for QorIQ platforms Date: Fri, 22 Apr 2016 14:27:40 +0800 Message-ID: <1461306464-19521-4-git-send-email-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1461306464-19521-1-git-send-email-yangbo.lu@nxp.com> References: <1461306464-19521-1-git-send-email-yangbo.lu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131057806502734439; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(575784001)(86362001)(50466002)(92566002)(229853001)(11100500001)(87936001)(551934003)(1096002)(2950100001)(33646002)(5003940100001)(50226001)(106466001)(36756003)(48376002)(586003)(47776003)(105606002)(77096005)(1220700001)(50986999)(4326007)(81166005)(6806005)(189998001)(76176999)(5008740100001)(104016004)(2201001)(85426001)(19580405001)(19580395003)(2906002)(5001770100001)(7059030)(2101003)(473944003)(414714003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0717; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:7H4Qrv7v2EtVT65YKYU1avBPhG+s1/uU1we7CIurbbMh1awMm5CePPPNjBCoAicwtv4BU1SJcivAeUjWiTS9I6e3tyY7JM15Of+Ib9JuHQ/dGk4YZ5bCp0AfSLpG+fNRb+qoqpaaPpCZJtPGTwKpdYYTidveVZU57PAjcE+sDHBl1CRH0TTpM2OtKAKsOw3D9zwlIkvJHt+YcfmSuEYrrauNNI3G8DUWJG+EwmiKUe+m7pAR9A3xOFdI6fhqmrOsahPVD870lnO6JQ7F3qklj8VCTeW47KOhfbmZtHpLLpZK789PcZSm9OWGXOXtlRuwOo11Ow6OpiX3HzdJcZUY1ROYUr2vgdSuZmquMS+vZzfMo3UjRuia/z5Femk3Yz25hq01b1QgiDh+yChym2UMcAnSpBYwJf4S1owUhMzzTOMG7Z7IfZQ+DbaC+gD1Kg0vA1l8fDvcFVVsHL+YDo1EPh+UdZjBxvrJqot5DUtROXFq30cusxRXnsZapRC0h0wXuBZxmFq2pFpCWZmd0Wp+CDytMhv079HwJFqk2MKfhTjI4FW61r3MS80kDrqZwhbtWN5DPRsQ47INZYMBwWVIqZBNFNbvOSrfyZSraUghmxd9hVza5caTPwerlDfOxtYvvlylrctwUIxY1ZdrNUH3MwjB5XmSxsfOtKzBuaWWrzilDUotMLNIvcZ90HUlgdPznj+WsKxMqth/mxI3r3yLmpKRK8z18ovwy0Xt8yTPY/A= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: a7b58f5f-3726-453e-be22-08d36a789404 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 2:0Ojqid5fTAx6yYh7WJebR1UY4sJuZERRgk9yeDv3c8F3j2R47U8C18rKoatBfy9/BOuOF6wZFIEVnM671uSeiPYKYpalTH0zpU0hq489nsS9QpKcscyusbx+MPisBz6HSq+AeuQDnwzprbocsBh6P8l1Ek40lDCONk4dk1x9D6lEOVUKt8Laos8pi7ZkQsFh; 3:MIHfBfJBHo46BAIRtTe6YYVOEEMMhIq98v7KfE3EY+ov9fPvhNrtcX0znWB36iCtrZHMEbU6+O41RNuiEKlMIu3J2awHua4HMyvw53h6YDQ2n2xjIO1uej9IjWW+PGOQr4nY6wlRIe8PoqSqEhBUKXpvEjNFd7CUwmmDxI3gRM63ilUiW2dhlvTEvU/q9DxCwJrh1TSux7jCZEq6FQVNKNvOCDKzVUJI368B+fHBShw=; 25:rpS4vXjIVTtoIsd6FjXqkLfB8flzmX9gLVjWPCpnRJWVo1NfbCtAK/U0RESR093cyopUtIhX5Y/jeUWlSE6zNRkfpGEPUjeiUI0UpkaGvYDSuZPQJ8g4OnHl/B1a+3KLcIS3vzZazGme6zffd2zdkzFifrQwlUcdl/IxT+KdbsEktZnrRFhUMdoA6FF7A9RaiKTwAItjd4fOhswKI9hJauIPV0mChwM6vvS3PC/pIWZhwe7xYH3CmRONWhNSp9MD6015lwOLwm8rtByJBmf36m0pw/UbqG4sUKhhlPAob+/XhadxIAD7V0s7NijGbmZ821JXUwLcho8p7iGCF94Jog== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0717; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13017025)(8121501046)(5005006)(13018025)(13024025)(13023025)(3002001)(10201501046)(6055026); SRVR:DM2PR0301MB0717; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0717; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 4:KZ7UdRUCs0cNjCYJsS4gYyJtHBxadR1llZH7xgn7GKAQWjrj+4Il0G+2P07JNd62qZTfQdjOJq57cJ6Mn0oP/vriLlWX3DMovqHfCO/KgOJFJKORX7G+sUeU/Z7BXeBsYMKT8Ju2IiVmWrkO1NWzG1A8uFtAXeUB854BcTsPvpyNuKr4dMa/Rdh1s91f7+p2wDNhnk4wdOdW3g+Ilc0lgRbPbeVnQkZbSGK5C8GLU80gLJh4Fum8PlzX8qVtGaJjnQOKURjUbS8ASg1J0drsXocOP4tbmKdP4sXD8z0xW7q6kJRvW9SIDK32hTG5x7kga2FoPio0Ldv0fAfW2AwDwkIa1V+9+qyzjEkqdnD9D7a9VtgC9fNhwNFxGHRlnWq5tvhoaGea70nUGW9IGToDlbZUFNxZT11vMrmYa2v/WJsSpowWTUcTVeg2WOHcRtZuDNKB4S5Wh7Ts/tEt+5P5qUOS2JpxnUhf8v4favQRdkM= X-Forefront-PRVS: 0920602B08 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0717; 23:GUAQ2x0TDkYLrSuWVyKH3C2tUmEwnGGaKngsU5u?= =?us-ascii?Q?RmkI7+8RSQjXTKuOEI3uFnNtLeYuQ9c+ZCUmLLJFM3GO4tkUiq0fGTQikTwv?= =?us-ascii?Q?L8vUCD17lEIH9zbFbLaSMFvYqFa+MUjG2lIzZP5q9aPOq7sLGSSmGXY9MDGO?= =?us-ascii?Q?ID1a1XEfCTBJ68JkIwjwOg3yWe6xMPpeX/zUB+MAdpFNVh1THVkrVBDixkPH?= =?us-ascii?Q?MCGHKU0NYfJdBsdifYcKwBPsl28J53L5r8OZiuQkN9ZMaBo/1heMapmoXWew?= =?us-ascii?Q?ZkbQVlJ/LdKxluP+sB8+legC8N0UOClP4bCllT071bWqjkPh57x+q5xT5m7D?= =?us-ascii?Q?FjsjO2mByhPf7Ultt4rRiHIIkarCw9hgTkZSqscchKdkqRx3RWvQqsdvAHcO?= =?us-ascii?Q?T7hFCqPCQfn2rplUsQ1JuoSHIKNOwMNsRkQURBCnCwgmRAEH0Qj9XKn4cQAn?= =?us-ascii?Q?7uh1O2xy2cacAqhnHCr5MRZR9jRZbVvgmNGzu6u0z4f1Cthn+mX0w01qrChJ?= =?us-ascii?Q?xkmHvohhDCYuFluJUX97ZvKVEoVrG9sakFDjv+yQQTrHyK5IhSHWK5qR0NlJ?= =?us-ascii?Q?k3xeKmCGeot5j+qX/mXbP3SpDxDiUaj5Avepoze8jvILZHl+ETenS6ybigs2?= =?us-ascii?Q?Aoj4DmvSc+0MqP9Wv87A7kfk0bWmGow32BID8GZR3JoVsfZKzr7SAAVlndpy?= =?us-ascii?Q?hmaW7hcNEdQe6OK8fr/vHS+s8qMkxhAvNXkcQ5aV6Umn6a4bhLGo05DQnabX?= =?us-ascii?Q?TRk5bPNDQxAsTeDYjRkuVzFC2DsqYKG/Oe5qg+oROgJtow+qnZCDqvsYAnxj?= =?us-ascii?Q?IxSH5DQj+UIlq6BKwksd1dviKsBXzEN2Mdj/bIMsdF9FYwP6W+nbITN5+O6P?= =?us-ascii?Q?64MU7356SjdBKl5nmuSCFz+toZ6RmVPZfmIiFqjiHlmBJ+v56HOJLflvIDBA?= =?us-ascii?Q?hY307xFPik/UC0kzU7KwckA+/IdxHEsCqUsKhgUaFkXgp2/+EtYUigyIni4b?= =?us-ascii?Q?qQ39UypP/h6TQCtD738Zb9bW7454DQTIwo47W/NazhY3d1fqY0spU0SHStxv?= =?us-ascii?Q?diZfRrt7gpG1OByE+IIvPZTlCA9r5Hl5JHA/yorRwMl5JW217b3Fa5wJUddt?= =?us-ascii?Q?X5Uj1/lqqj9NDE9h5oNYs6dj9MjCUPPukZivRmEBXyGx5uiBF65bo9XM+MuA?= =?us-ascii?Q?UDtn5Bq5ExUpsO1k=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 5:D41llu7D3I65dGDTJTWJFfiaJAVPo/YAbYqluO7RnotWVMeYJMtacC6oJLrs2uBIjv3thFXnXukazLu1MnEVsEF+9+Uy0jVIlWGCivGJPRR1FDPLnKeI98ta7eW5PQde6ER50tjcFOntPdlxsnScpxSlL4eGriRGPYVI5E9Sd5lKZsqLx5fGhKf9kIJpLBoHzOYAHlq6IslMBKCHHtUHSA==; 24:f7TI17LmkE2OZz+YBD9JyTEGeBzpE2GHQfRGWVusycPy/y+MihD0lOJ4ec8zDqzkJJNX3BjreAZyvlO5wP8/z0Vgr7zvLMQdob9Q+4og56E=; 7:Le2zrFOPcPmOe4Z4lyKvyw2k+g5Wr8RgewDbDpis2MgyV2ZH9fof05JwOJU+/Bh01N3Q6ag36jnxSXZr7q7kENtZ6hYmcIoaiXOfyVBMZj03PvF7Ekef85diCM+1TnwZoOEu3AUST/S52+6OmfycbRk805McEdU9wIMZD2JY8C/iCsYEYwlXk+c0o2FPCuhjpf+6UHIasU7NYiY8MbG+gmMv51NLy7RF/mH3ux+W5NQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2016 06:37:29.5090 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0717 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The global utilities block controls power management, I/O device enabling, power-onreset(POR) configuration monitoring, alternate function selection for multiplexed signals,and clock control. This patch adds GUTS driver to manage and access global utilities block. Signed-off-by: Yangbo Lu Acked-by: Scott Wood --- Changes for v4: - Added this patch Changes for v5: - Modified copyright info - Changed MODULE_LICENSE to GPL - Changed EXPORT_SYMBOL_GPL to EXPORT_SYMBOL - Made FSL_GUTS user-invisible - Added a complete compatible list for GUTS - Stored guts info in file-scope variable - Added mfspr() getting SVR - Redefined GUTS APIs - Called fsl_guts_init rather than using platform driver - Removed useless parentheses - Removed useless 'extern' key words Changes for v6: - Made guts thread safe in fsl_guts_init Changes for v7: - Removed 'ifdef' for function declaration in guts.h Changes for v8: - Fixes lines longer than 80 characters checkpatch issue - Added 'Acked-by: Scott Wood' --- drivers/soc/Kconfig | 2 +- drivers/soc/fsl/Kconfig | 8 +++ drivers/soc/fsl/Makefile | 1 + drivers/soc/fsl/guts.c | 119 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/fsl/guts.h | 126 +++++++++++++++++++++++++++++------------------ 5 files changed, 207 insertions(+), 49 deletions(-) create mode 100644 drivers/soc/fsl/Kconfig create mode 100644 drivers/soc/fsl/guts.c diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index cb58ef0..7106463 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -2,7 +2,7 @@ menu "SOC (System On Chip) specific Drivers" source "drivers/soc/bcm/Kconfig" source "drivers/soc/brcmstb/Kconfig" -source "drivers/soc/fsl/qe/Kconfig" +source "drivers/soc/fsl/Kconfig" source "drivers/soc/mediatek/Kconfig" source "drivers/soc/qcom/Kconfig" source "drivers/soc/rockchip/Kconfig" diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig new file mode 100644 index 0000000..b313759 --- /dev/null +++ b/drivers/soc/fsl/Kconfig @@ -0,0 +1,8 @@ +# +# Freescale SOC drivers +# + +source "drivers/soc/fsl/qe/Kconfig" + +config FSL_GUTS + bool diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile index 203307f..02afb7f 100644 --- a/drivers/soc/fsl/Makefile +++ b/drivers/soc/fsl/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_QUICC_ENGINE) += qe/ obj-$(CONFIG_CPM) += qe/ +obj-$(CONFIG_FSL_GUTS) += guts.o diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c new file mode 100644 index 0000000..fa155e6 --- /dev/null +++ b/drivers/soc/fsl/guts.c @@ -0,0 +1,119 @@ +/* + * Freescale QorIQ Platforms GUTS Driver + * + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include + +struct guts { + struct ccsr_guts __iomem *regs; + bool little_endian; +}; + +static struct guts *guts; +static DEFINE_MUTEX(guts_lock); + +u32 fsl_guts_get_svr(void) +{ + u32 svr = 0; + + if (!guts || !guts->regs) { +#ifdef CONFIG_PPC + svr = mfspr(SPRN_SVR); +#endif + return svr; + } + + if (guts->little_endian) + svr = ioread32(&guts->regs->svr); + else + svr = ioread32be(&guts->regs->svr); + + return svr; +} +EXPORT_SYMBOL(fsl_guts_get_svr); + +/* + * Table for matching compatible strings, for device tree + * guts node, for Freescale QorIQ SOCs. + */ +static const struct of_device_id guts_of_match[] = { + /* For T4 & B4 Series SOCs */ + { .compatible = "fsl,qoriq-device-config-1.0", }, + /* For P Series SOCs */ + { .compatible = "fsl,qoriq-device-config-2.0", }, + { .compatible = "fsl,p1010-guts", }, + { .compatible = "fsl,p1020-guts", }, + { .compatible = "fsl,p1021-guts", }, + { .compatible = "fsl,p1022-guts", }, + { .compatible = "fsl,p1023-guts", }, + { .compatible = "fsl,p2020-guts", }, + /* For BSC Series SOCs */ + { .compatible = "fsl,bsc9131-guts", }, + { .compatible = "fsl,bsc9132-guts", }, + /* For MPC85xx Series SOCs */ + { .compatible = "fsl,mpc8536-guts", }, + { .compatible = "fsl,mpc8544-guts", }, + { .compatible = "fsl,mpc8548-guts", }, + { .compatible = "fsl,mpc8568-guts", }, + { .compatible = "fsl,mpc8569-guts", }, + { .compatible = "fsl,mpc8572-guts", }, + /* For Layerscape Series SOCs */ + { .compatible = "fsl,ls1021a-dcfg", }, + { .compatible = "fsl,ls1043a-dcfg", }, + { .compatible = "fsl,ls2080a-dcfg", }, + {} +}; + +int fsl_guts_init(void) +{ + struct device_node *np; + int ret; + + mutex_lock(&guts_lock); + /* Initialize guts only once */ + if (guts) { + ret = guts->regs ? 0 : -ENOMEM; + goto out; + } + + np = of_find_matching_node(NULL, guts_of_match); + if (!np) { + ret = -ENODEV; + goto out; + } + + guts = kzalloc(sizeof(*guts), GFP_KERNEL); + if (!guts) { + ret = -ENOMEM; + goto out; + } + + guts->little_endian = of_property_read_bool(np, "little-endian"); + + guts->regs = of_iomap(np, 0); + if (!guts->regs) { + ret = -ENOMEM; + kfree(guts); + goto out; + } + + of_node_put(np); + ret = 0; +out: + mutex_unlock(&guts_lock); + return ret; +} +EXPORT_SYMBOL(fsl_guts_init); diff --git a/include/linux/fsl/guts.h b/include/linux/fsl/guts.h index 649e917..7e1e22b 100644 --- a/include/linux/fsl/guts.h +++ b/include/linux/fsl/guts.h @@ -29,83 +29,113 @@ * #ifdefs. */ struct ccsr_guts { - __be32 porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */ - __be32 porbmsr; /* 0x.0004 - POR Boot Mode Status Register */ - __be32 porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */ - __be32 pordevsr; /* 0x.000c - POR I/O Device Status Register */ - __be32 pordbgmsr; /* 0x.0010 - POR Debug Mode Status Register */ - __be32 pordevsr2; /* 0x.0014 - POR device status register 2 */ + u32 porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */ + u32 porbmsr; /* 0x.0004 - POR Boot Mode Status Register */ + u32 porimpscr; /* 0x.0008 - POR I/O Impedance Status and + * Control Register + */ + u32 pordevsr; /* 0x.000c - POR I/O Device Status Register */ + u32 pordbgmsr; /* 0x.0010 - POR Debug Mode Status Register */ + u32 pordevsr2; /* 0x.0014 - POR device status register 2 */ u8 res018[0x20 - 0x18]; - __be32 porcir; /* 0x.0020 - POR Configuration Information Register */ + u32 porcir; /* 0x.0020 - POR Configuration Information + * Register + */ u8 res024[0x30 - 0x24]; - __be32 gpiocr; /* 0x.0030 - GPIO Control Register */ + u32 gpiocr; /* 0x.0030 - GPIO Control Register */ u8 res034[0x40 - 0x34]; - __be32 gpoutdr; /* 0x.0040 - General-Purpose Output Data Register */ + u32 gpoutdr; /* 0x.0040 - General-Purpose Output Data + * Register + */ u8 res044[0x50 - 0x44]; - __be32 gpindr; /* 0x.0050 - General-Purpose Input Data Register */ + u32 gpindr; /* 0x.0050 - General-Purpose Input Data + * Register + */ u8 res054[0x60 - 0x54]; - __be32 pmuxcr; /* 0x.0060 - Alternate Function Signal Multiplex Control */ - __be32 pmuxcr2; /* 0x.0064 - Alternate function signal multiplex control 2 */ - __be32 dmuxcr; /* 0x.0068 - DMA Mux Control Register */ + u32 pmuxcr; /* 0x.0060 - Alternate Function Signal + * Multiplex Control + */ + u32 pmuxcr2; /* 0x.0064 - Alternate function signal + * multiplex control 2 + */ + u32 dmuxcr; /* 0x.0068 - DMA Mux Control Register */ u8 res06c[0x70 - 0x6c]; - __be32 devdisr; /* 0x.0070 - Device Disable Control */ + u32 devdisr; /* 0x.0070 - Device Disable Control */ #define CCSR_GUTS_DEVDISR_TB1 0x00001000 #define CCSR_GUTS_DEVDISR_TB0 0x00004000 - __be32 devdisr2; /* 0x.0074 - Device Disable Control 2 */ + u32 devdisr2; /* 0x.0074 - Device Disable Control 2 */ u8 res078[0x7c - 0x78]; - __be32 pmjcr; /* 0x.007c - 4 Power Management Jog Control Register */ - __be32 powmgtcsr; /* 0x.0080 - Power Management Status and Control Register */ - __be32 pmrccr; /* 0x.0084 - Power Management Reset Counter Configuration Register */ - __be32 pmpdccr; /* 0x.0088 - Power Management Power Down Counter Configuration Register */ - __be32 pmcdr; /* 0x.008c - 4Power management clock disable register */ - __be32 mcpsumr; /* 0x.0090 - Machine Check Summary Register */ - __be32 rstrscr; /* 0x.0094 - Reset Request Status and Control Register */ - __be32 ectrstcr; /* 0x.0098 - Exception reset control register */ - __be32 autorstsr; /* 0x.009c - Automatic reset status register */ - __be32 pvr; /* 0x.00a0 - Processor Version Register */ - __be32 svr; /* 0x.00a4 - System Version Register */ + u32 pmjcr; /* 0x.007c - 4 Power Management Jog Control + * Register + */ + u32 powmgtcsr; /* 0x.0080 - Power Management Status and + * Control Register + */ + u32 pmrccr; /* 0x.0084 - Power Management Reset Counter + * Configuration Register + */ + u32 pmpdccr; /* 0x.0088 - Power Management Power Down Counter + * Configuration Register + */ + u32 pmcdr; /* 0x.008c - 4Power management clock disable + * register + */ + u32 mcpsumr; /* 0x.0090 - Machine Check Summary Register */ + u32 rstrscr; /* 0x.0094 - Reset Request Status and + * Control Register + */ + u32 ectrstcr; /* 0x.0098 - Exception reset control register */ + u32 autorstsr; /* 0x.009c - Automatic reset status register */ + u32 pvr; /* 0x.00a0 - Processor Version Register */ + u32 svr; /* 0x.00a4 - System Version Register */ u8 res0a8[0xb0 - 0xa8]; - __be32 rstcr; /* 0x.00b0 - Reset Control Register */ + u32 rstcr; /* 0x.00b0 - Reset Control Register */ u8 res0b4[0xc0 - 0xb4]; - __be32 iovselsr; /* 0x.00c0 - I/O voltage select status register + u32 iovselsr; /* 0x.00c0 - I/O voltage select status register Called 'elbcvselcr' on 86xx SOCs */ u8 res0c4[0x100 - 0xc4]; - __be32 rcwsr[16]; /* 0x.0100 - Reset Control Word Status registers + u32 rcwsr[16]; /* 0x.0100 - Reset Control Word Status registers There are 16 registers */ u8 res140[0x224 - 0x140]; - __be32 iodelay1; /* 0x.0224 - IO delay control register 1 */ - __be32 iodelay2; /* 0x.0228 - IO delay control register 2 */ + u32 iodelay1; /* 0x.0224 - IO delay control register 1 */ + u32 iodelay2; /* 0x.0228 - IO delay control register 2 */ u8 res22c[0x604 - 0x22c]; - __be32 pamubypenr; /* 0x.604 - PAMU bypass enable register */ + u32 pamubypenr; /* 0x.604 - PAMU bypass enable register */ u8 res608[0x800 - 0x608]; - __be32 clkdvdr; /* 0x.0800 - Clock Divide Register */ + u32 clkdvdr; /* 0x.0800 - Clock Divide Register */ u8 res804[0x900 - 0x804]; - __be32 ircr; /* 0x.0900 - Infrared Control Register */ + u32 ircr; /* 0x.0900 - Infrared Control Register */ u8 res904[0x908 - 0x904]; - __be32 dmacr; /* 0x.0908 - DMA Control Register */ + u32 dmacr; /* 0x.0908 - DMA Control Register */ u8 res90c[0x914 - 0x90c]; - __be32 elbccr; /* 0x.0914 - eLBC Control Register */ + u32 elbccr; /* 0x.0914 - eLBC Control Register */ u8 res918[0xb20 - 0x918]; - __be32 ddr1clkdr; /* 0x.0b20 - DDR1 Clock Disable Register */ - __be32 ddr2clkdr; /* 0x.0b24 - DDR2 Clock Disable Register */ - __be32 ddrclkdr; /* 0x.0b28 - DDR Clock Disable Register */ + u32 ddr1clkdr; /* 0x.0b20 - DDR1 Clock Disable Register */ + u32 ddr2clkdr; /* 0x.0b24 - DDR2 Clock Disable Register */ + u32 ddrclkdr; /* 0x.0b28 - DDR Clock Disable Register */ u8 resb2c[0xe00 - 0xb2c]; - __be32 clkocr; /* 0x.0e00 - Clock Out Select Register */ + u32 clkocr; /* 0x.0e00 - Clock Out Select Register */ u8 rese04[0xe10 - 0xe04]; - __be32 ddrdllcr; /* 0x.0e10 - DDR DLL Control Register */ + u32 ddrdllcr; /* 0x.0e10 - DDR DLL Control Register */ u8 rese14[0xe20 - 0xe14]; - __be32 lbcdllcr; /* 0x.0e20 - LBC DLL Control Register */ - __be32 cpfor; /* 0x.0e24 - L2 charge pump fuse override register */ + u32 lbcdllcr; /* 0x.0e20 - LBC DLL Control Register */ + u32 cpfor; /* 0x.0e24 - L2 charge pump fuse override + * register + */ u8 rese28[0xf04 - 0xe28]; - __be32 srds1cr0; /* 0x.0f04 - SerDes1 Control Register 0 */ - __be32 srds1cr1; /* 0x.0f08 - SerDes1 Control Register 0 */ + u32 srds1cr0; /* 0x.0f04 - SerDes1 Control Register 0 */ + u32 srds1cr1; /* 0x.0f08 - SerDes1 Control Register 0 */ u8 resf0c[0xf2c - 0xf0c]; - __be32 itcr; /* 0x.0f2c - Internal transaction control register */ + u32 itcr; /* 0x.0f2c - Internal transaction control + * register + */ u8 resf30[0xf40 - 0xf30]; - __be32 srds2cr0; /* 0x.0f40 - SerDes2 Control Register 0 */ - __be32 srds2cr1; /* 0x.0f44 - SerDes2 Control Register 0 */ + u32 srds2cr0; /* 0x.0f40 - SerDes2 Control Register 0 */ + u32 srds2cr1; /* 0x.0f44 - SerDes2 Control Register 0 */ } __attribute__ ((packed)); +u32 fsl_guts_get_svr(void); +int fsl_guts_init(void); /* Alternate function signal multiplex control */ #define MPC85xx_PMUXCR_QE(x) (0x8000 >> (x))