From patchwork Thu May 5 03:12:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 9020181 Return-Path: X-Original-To: patchwork-linux-clk@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7C25CBF29F for ; Thu, 5 May 2016 03:24:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BAF9203C0 for ; Thu, 5 May 2016 03:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51C62203DC for ; Thu, 5 May 2016 03:24:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756071AbcEEDWq (ORCPT ); Wed, 4 May 2016 23:22:46 -0400 Received: from mail-bl2on0084.outbound.protection.outlook.com ([65.55.169.84]:44576 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756046AbcEEDWk (ORCPT ); Wed, 4 May 2016 23:22:40 -0400 Received: from BN3PR0301CA0047.namprd03.prod.outlook.com (10.160.152.143) by BN3PR0301MB1219.namprd03.prod.outlook.com (10.161.207.19) with Microsoft SMTP Server (TLS) id 15.1.485.9; Thu, 5 May 2016 03:22:36 +0000 Received: from BY2FFO11FD041.protection.gbl (2a01:111:f400:7c0c::104) by BN3PR0301CA0047.outlook.office365.com (2a01:111:e400:401e::15) with Microsoft SMTP Server (TLS) id 15.1.485.9 via Frontend Transport; Thu, 5 May 2016 03:22:36 +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 BY2FFO11FD041.mail.protection.outlook.com (10.1.14.226) with Microsoft SMTP Server (TLS) id 15.1.485.4 via Frontend Transport; Thu, 5 May 2016 03:22:35 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u453M4sI004368; Wed, 4 May 2016 20:22:29 -0700 From: Yangbo Lu To: , , , , , , , , CC: , Scott Wood , Mark Rutland , Rob Herring , Russell King , Jochen Friedrich , Joerg Roedel , Claudiu Manoil , "Bhupesh Sharma" , Qiang Zhao , "Kumar Gala" , Santosh Shilimkar , , , Yangbo Lu Subject: [v10, 3/7] soc: fsl: add GUTS driver for QorIQ platforms Date: Thu, 5 May 2016 11:12:26 +0800 Message-ID: <1462417950-46796-4-git-send-email-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1462417950-46796-1-git-send-email-yangbo.lu@nxp.com> References: <1462417950-46796-1-git-send-email-yangbo.lu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131068921562268881; (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)(87936001)(229853001)(81166005)(4326007)(92566002)(5008740100001)(1220700001)(36756003)(19580405001)(50986999)(106466001)(77096005)(19580395003)(2201001)(105606002)(2950100001)(50466002)(586003)(48376002)(76176999)(189998001)(2906002)(85426001)(104016004)(50226002)(47776003)(11100500001)(8936002)(86362001)(575784001)(6806005)(551934003)(5003940100001)(5001770100001)(33646002)(7059030)(2101003)(473944003)(414714003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0301MB1219; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD041; 1:NxfVxH6JCE3DfJW5wjPePxRiffxgPr/mFi3ExdO/RzJ32aC7ln9p4t8u4S9l9dhLoDiqkszSJ7wz29Zv9UAuwVkXqYNJ+jJRxCnIfu84R7Ijrx91k+qHH/I9BMehx8fRvq2eegpa7sQgl00J2J1vaIov47BVtBJVZDE1Gn1lOTJuIaEv/UFaXmaCZE5yGWXNmU2saWJ3v6/MiWRfSOeeMrlU1Tb3VSsckCy5nBLez2xY5l1zn7XeyzwuKGnSp2K8O/eeG97f+Oh73aF60283yVWId9cNdJmP4Y5f44U/snE0NPtnM3Dw6YdhPzlEwfVHBLJR6I6s3HxGVua60HPHsjpgit6N11QarjiTnRVWCjkmbnENRmBr3JlEth1Ejn2yazDLU52Yioip2ftaNltjvqhryJ04ZLGbWW/0joCubs6ZIdsOb1scgZKcApLVRZoFWHF4QwP7D7rNB2ZVv3sfAD+QZ7Y3WjzV7APz6ApINoUPDEZL+98w6m7qG3moWEWTkDlvgdKpKLELrJyKZtFwve6eO0Zq1BPTvBay+2QlfjfwBSwgxYiqrFyGEcnv4QsAbPotfTbJ4lnuLCcYHfCjD3PQIS0jWipcP7pRgcPjoIXiHHlliz7GH7+2I39+5SE1Fd5f3zjXWCqNzZdgOWOhSEo3jyHg0vr3Q/X4cd0eqzwXfW5vjCl9EiqmvUnRuEvXL4eBhVR9nl6F0j1/Hc6K4d7Dh9axg5IriEbSCDf/hO4jPgYmsJCDH6XoNUSuuVsz MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3e46cf8d-c2a3-47d9-371b-08d37494812f X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1219; 2:nytnfdaZXzY/hzRpumITLsp1yvAGW9j360LMk/h1WDlBDQMd50W1WTvPC+5qXg9sbMbv8FgTPj3w63Wp81ACd7+Au+MfgQqRKfNiAE9XIfMNrWfgj7rjRWhUC4Nm9fWcqMmLpTtLMdyZK+x+FB4Q/eA2wwOJqBPL14XuPoZwhYTI74W87j/LdLwvP6WfH4k6; 3:4LNuNE5x/10xZJ6Ud7hLjmAShYu0VInGng9eJMvexwlGCM57ggRaVr2aRd0zuOp5m3nQbhJbjIxXTTrMB5Dbhzi4EsnUQBSz2ks8lqrrKYgPiK7TwVI8FkOTAVYZoevuqlEBSCVYihGcDIb/M32wUgAP3L2VePnCg9sjNxnl0EH6ddXjwFiuSu59nnJ44rujtW5LKpAK2yr36XHvrZaDx4IQiV5YUgzXha8uDlBcseo=; 25:IARfr3khsGWRXq0kSMhhfWzajkTtKs1jID6WaiEwQrn4WnIypOOIPysuOvZn35tk04GimnPgapxsRjFS7QW343K/TeV88tTNjgr8JDJUKMIrLbRLZ8mZmbNV5iHjwvkKZLCXlJSCL7JEEPytzQRQfKdjo4zJm0HrbUcUibveXBO6c8WOP5s4Jzc57lBAoC5v198t7ry2pbgG7VXDC8W68AjkDa8104qo3TkRMkvV2yX8Pdbg6CHXmScv+kQopxaDH3ZU+aKzFq1NQ/nOKRJcEF2fO2T6Z1v8nQzF+Vmux9Lung6fxBSKaHRtaYkGcuvLXnb6ECH2yA2yi5ros6XRz9N7r6Lcg3stmpkMuZF2ojcqIN0lH2U2dy8VeflMXEIIfyHlvpO1PnW+mbcEp8gfp5xdw+jizaHiY6Sm9DPCXKethS6gxVKV0nZsm3J6LmVz X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB1219; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13018025)(13015025)(13024025)(13017025)(13023025)(3002001)(10201501046)(6055026); SRVR:BN3PR0301MB1219; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR0301MB1219; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1219; 4:bxD1VlE467/GcvrbMxrm2AsIYYpp5UOb6GopaOVoadv8NujJJIN+R0HnILlM3pzA7jHEESZDCr6O+/7EKrWVkZgxr+NTKK49sgRAFh1IM2y3r5JQS4gQeeTJLMMO8krswMlnCq0QHpKvsBEjuJNA4/AS5PUyxpAyO5SRoKwV+y2Uzu63Pe5YIaD7kC5rxAy1CNaxqVwsVzgITu19mOKuuWP8sWCigLY2PKvUg1ruwUpvIbGXgrUBJOyBTEwEvaKrVVJHYPF5Sr3xFwt5NXH1jC+K42MGNClzA8Z8si6BTw4FZxiyP9vA8V+GgzMcyOsmMF9o9d8h6AuQQgO/feZhU3iHS6dmqYNtAtLodN9kiaKhmYM8SYQHPawAsTMg90CkWZBBjCyGcHjGAUNgdhRPWmo5Pd5im4PawTzP9r18UgMsVIq6FnNCUYHZMBBUtLO1ktiD8waOffV24+eIcPHVOHk1o9k2PA1dVXGdBcJW8I0= X-Forefront-PRVS: 0933E9FD8D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0301MB1219; 23:TroChI/ZoomNVr4qLZUoCoe5agyaRnll+9K6kre?= =?us-ascii?Q?X12iV6YsCu3a+Gys9Vxla1jusYMrtsJ2PaIIIRMS1kH4mziEhZ/Ejdv2K4cd?= =?us-ascii?Q?8uYuUYk6S6HWE+gbqWdnCFauuf1IZb4vFzl3754eGSKIYDMWsGxAh9E7Fpfe?= =?us-ascii?Q?lgYfVN0eBduUqL6uQ+iiAVNZblMtbNuqMCcKkpyEI6uZRq4UGo1VKQNijqLm?= =?us-ascii?Q?EupEj0Y6fjazoZ6DpLC4U+WvwBr39WHgsYaK6NjCGIFYW6hwXzGzq3wM9vr0?= =?us-ascii?Q?KEIZ7MCQL8VSYaKJVexOeh2VFEq4AFG8wEIeQso+wOj2Lx2Sa8mXMsJomG94?= =?us-ascii?Q?yzxaUlg54Hb0INJmEg0DbYDTheOhkedKWbh6b7qxbyrNqkqBqEDC3GXz23oZ?= =?us-ascii?Q?0goKUZJRhmMjcnyDhoC/YtzUhJIVm+mmFXvm10htinQVBRMv8+Dz3FDlnma6?= =?us-ascii?Q?dW5HFKKcgh9jgSk59lc+KsP2JW/Pn5FKEO+8TcYNisLMUTRfl/uSGHJEC7z7?= =?us-ascii?Q?pMmd1smYOXCuwDECTlCMSXaJjb+xtBRHiJFedMpmLibCCwtgtjHHWErYwm0d?= =?us-ascii?Q?ehYoVu4PjxoxqKXC24m3dOKdiy+yM6awwc9YToz6wJwkZjLv52OEHJY20xbe?= =?us-ascii?Q?s+oh3FkXxMYoG+5mVX4Bw/eQPFYIXlhaQjBzULdBVsyrYkIvD2TF5mh8NOG+?= =?us-ascii?Q?juclI6/2uC8EYi0jQVcfU1B81YU1+JyN4WceW+encF5RBliXEe4NMta+G3Bv?= =?us-ascii?Q?UiyckN33Lxj/m7Jbk4nC/FKn/+LyM/9Z9axnZTF7da5yOKRhHkoOGVyR0kTQ?= =?us-ascii?Q?RLwq3VUZIqAl3lLTthe/egF0WhHASsT1O8Hmu5s1EOMxs3JTM5JJVLhVJ52x?= =?us-ascii?Q?qVABNwVom3MZN+565hPWoOI8bR9fVuU9x5TSxKvIRsNAD3D45pLBSp3ZTV90?= =?us-ascii?Q?q6vQFWmdH6t34eNa2UZax9PY9FyO27oiEcu/4nk00E5lPw+W6/EzSB+qg7kr?= =?us-ascii?Q?NMik19UDVzfjSYU+0JqRLqBugc8ttaIr6ntjtb8kZgQOk/vHJrbx2KihQ1h9?= =?us-ascii?Q?sSoRZwskPU2SUBysp2MHByFEvKQsjH2iukLt0NI88g2a/QBXjMrTW1iWb1kb?= =?us-ascii?Q?3cyasjo3EhSXYDzbdtamRfszlTQ8D6kUnY3RKygXIdAOMLdbX3KsVcgO/qZn?= =?us-ascii?Q?6955sRo0d+3M7GR4=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0301MB1219; 5:hm2o5RRVaj7KCgGmLRCm1euwrbZ7zezh43FvexhTbA3GJgt4bWGAgR09ivQ13kbTkT/4RFXvsMrQkRlh+0bDcIVDnxbrTXPiVboLoOQIdBf+hPYHR4/PREIR1YHf9SOlpGL+osvHbKZMjtSrvshDA9biUnixgOy4wb2ozpSj8AI=; 24:7JpTUSwVDb6jagcRfDpYUXP5ihlK2JzRFvNQ927Hqs/OkTSFotDTN0JOz54G9dwPY5pHGB5zlQEgdyskvaaF6f21xN/tZt0rr6Jc9oYUNuw=; 7:+N66dpO0ERMsuLp9zAUu0HkSqxZfrUqOh116EGGv5kTVWLWhOPrf3cUmFDGi87rG0jfcg8UeLcLvoCTn3hL62QGtEqXF5izhyfaUK+pOLyJIqJuN7NEG1I6UqGoc/K3aoZnXO+TbFW3BI+oxbjAripf1IktKUBGtFelhJaThMbOexMibmlNOhSOI6vZ/Xd7l SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2016 03:22:35.8836 (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: BN3PR0301MB1219 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Spam-Status: No, score=-9.0 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' Changes for v9: - None Changes for v10: - None --- 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))