From patchwork Tue Sep 6 08:28:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 9316093 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52B1360752 for ; Tue, 6 Sep 2016 08:56:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D99B28BCA for ; Tue, 6 Sep 2016 08:56:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51EA628BEE; Tue, 6 Sep 2016 08:56:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3D0028BCB for ; Tue, 6 Sep 2016 08:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932370AbcIFI4h (ORCPT ); Tue, 6 Sep 2016 04:56:37 -0400 Received: from mail-sn1nam01on0056.outbound.protection.outlook.com ([104.47.32.56]:10336 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755618AbcIFIzk (ORCPT ); Tue, 6 Sep 2016 04:55:40 -0400 Received: from DM2PR03CA0044.namprd03.prod.outlook.com (10.141.96.43) by CY1PR0301MB2010.namprd03.prod.outlook.com (10.164.2.16) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Tue, 6 Sep 2016 08:40:53 +0000 Received: from BN1AFFO11OLC003.protection.gbl (2a01:111:f400:7c10::125) by DM2PR03CA0044.outlook.office365.com (2a01:111:e400:2428::43) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Tue, 6 Sep 2016 08:40:53 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11OLC003.mail.protection.outlook.com (10.58.53.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Tue, 6 Sep 2016 08:40:53 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u868e7Np032344; Tue, 6 Sep 2016 01:40:45 -0700 From: Yangbo Lu To: , , Scott Wood , Arnd Bergmann CC: , , , , , , , , Mark Rutland , Rob Herring , Russell King , Jochen Friedrich , Joerg Roedel , Claudiu Manoil , "Bhupesh Sharma" , Qiang Zhao , "Kumar Gala" , Santosh Shilimkar , , , Yangbo Lu Subject: [v11, 5/8] soc: fsl: add GUTS driver for QorIQ platforms Date: Tue, 6 Sep 2016 16:28:20 +0800 Message-ID: <1473150503-9550-6-git-send-email-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1473150503-9550-1-git-send-email-yangbo.lu@nxp.com> References: <1473150503-9550-1-git-send-email-yangbo.lu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131176248537279732; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(76176999)(5001770100001)(626004)(50226002)(104016004)(19580405001)(19580395003)(5003940100001)(4326007)(586003)(189998001)(11100500001)(47776003)(87936001)(2950100001)(2906002)(7416002)(105606002)(36756003)(305945005)(48376002)(7846002)(8666005)(551934003)(92566002)(5660300001)(229853001)(77096005)(97736004)(68736007)(81156014)(81166006)(8936002)(85426001)(50466002)(86362001)(356003)(33646002)(8676002)(575784001)(50986999)(106466001)(7059030)(2004002)(473944003)(414714003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2010; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC003; 1:YZg4IR/A2Rv7GKA3nQh44Jv07/+b8R8/sNiIl/qYSxUqtguM7m0ckEKJGy5c9ov5naO/MfjGOc++tgAeMSGgDWer4yLRyhIB5fvR20Hjf2NyCk6SONMKC+s2Z/k+n06UfQv2GQVJlImCpFOb+Liz2QQ70Z61Z2YIhFYUwHYRCqoKxjNh13P5PUqdgzx45BvETHIleMZEMIEOkg5Jaat2H3HNtGKDzNrF6lCwsgIrqEX2AJWl3WpwX6EE4xJGHXVdOujXfdbLWVK0Tu1mFiFHrlLJ2rn2q7VUBJ56fq29c0Ghchwm6dP+qRNOVu06/Z2BlK7nR9KskolhuzmFWUWEAFJ1MWB0AhxcYKXGwCGv1FOetTtIivkRaW0U5Hy7h5bCDIL1NkOlag9wEOQLeSg4TnqJpbgqfXEH+/WBTDfslruWf+UhVdIL1YxOfC4cEhAY7bEXRXWw2FsEU2p9NRWZOPik+nC4VM852h2zbnrToTG7UhVgndH9zUWqi4AzxN8KmLK8YJ/GeyUWgTPke9KjSK1+GF37nxXzsZAZcYqPpDkFyYgpoCNLgEDioOqNcfXPeCxe3ze3YsE0Vj0b/t+QObDjjgwa4fw+luf304xlYZ70tKR5RCndDmrT3jVhlf/8OFSFXcEYnEm+l+Amjr41zIOtqDSrdQHENZOklqdcNeiaPUdEpZmjuu9vPvB4bsbCiPsticE0Sun7/Fzit/tCrGz4tPt62A2Mpz4nKO0xZzpn39qlv+6575d7UGKc2bCT MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 120e8df8-d29d-46cc-61fc-08d3d631836c X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 2:q6YIjR4XAr0KVu1s93ZlabE9Mn1EIlPMB9AKguioAeOxQGn/xwKkJ7ba9NalDhmpMZB0otOB4/Vv2MEjXkTgThlplW4Zc9WgBSy4V/xGZh4z7NdF1nsifqUOyIh716u1i5UA6Y3ArFFL9FfNqu0+izBe++d4mwrfjOuoCok2BzJwBR6MPzLdSz1pUaCLik/W; 3:mQnbwFPUl3eKUNIdTDQzo/5f3rfKyzjmqARR8VERlP36scfdFI7Rodt9Y4N4cqMqI2YtGhJfXjpjYRu2YhZsHOkcxxMi0vXB8Rd7Q21iCoKAOTmOiRkBC45OzIiIgZT8Hnc7jWDpTq0x7lPV8Z59hWwcyabt+cxmQMJbqjwbzvuM6HP4CmpOzXzFld7g1b8AsD1x78455JjOWIQo0jLS8pYA0Xo2gdnqGMq7hkcGMG4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2010; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 25:G/+zEWH1vzZDftzNvpjAv9KVjTJ7PhFiwll0MREawDPzEYqI2aCgjlrIaRW8vRI7J0iFoCnNcP8J15RJx0mlmMeon5j1r+tIggU58/m5mdeDuiUK4KwD6vUkc4wrIjJL3g4yXY0rbpLMyd85qfqW8eUxjq0HATjBxcqWboK428acV4nKH8s08WVEYMAWSiPiS8Ob6+nxLLvSrw8oyQQWIifO1yH4bN+0M50GKVhkZU27ZSry2evTfmAejn/zhiJlEqLKUX9hRvUb+9uwGL5RgJFwnOMoaRrLI5ZUm02nxsUPxroL2jOy/kaopYg9CQs8j5LD2mnBFrNJ1yYjgTP3SaCeY1Z2YKCgi2LDqGfUdOQNL+r0kfE2riCt/kCGttNTZGlfjVtO1TUnwyLlXcd6w7BIGkPMLpQVeCH/M9DF7yPadZXdYWex8xexbw+65b9yYnOKpzBFv8IIRBd1PjEUesFpmmqtmD5HO+9ObvkBzogzZ5+I0XMhJYZ/jfzkJ80qiqMa0jONfpUZ30h4xKt639CpRdEB4qp4BYZRR5P2nMTxMhjCExISCKselSGn5+MjMcMq1mWdLFERpLVWNgtdXYNWPgo2dWPaIjXQUCzdPjXFyig45eoCJn9PENc6Cky5go1mXgD7g6qTJm+Vbb1mxyM7WNgMtjSEDA0Q/DSaiOj9FN8g+OpTj4Za7DQcPKvjj7CxnIXak6UO+3SfPckxpA==; 31:n083qdivv5yEoUTuJwT8ud9zayv6qb/v5Ki59F09KyIrBjXeoa6BLBt8dXV6q4KaZbIP7fwPvjkdDSFWl5vmSqKJUmVsHtMRu/7FVTNlQsYCEgC1YGo+CPLhrTyLGY7uBx1b4aKqeM4nByRmvvOdAXEkWGj2muC1ODDovo6R61V65UlZT4ko7mAtD/+2ayXQw323Jijl936 8OocrW3wz1iQNBphMIcVGzsRdlniwa0U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170088055959)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(13015025)(13017025)(13024025)(13023025)(13018025)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB2010; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2010; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 4:6XRKoH9pCLOfSAV7hTqXckmiA+ZgDSp7K3mlXyyuJ23/EFfp/Mk8qw+doM8aYk3lroncsjppcaZfJ7W1X2YECdtLXPKvbSvm2vpOxXQgrGFscO5XWWwNVmfWH5lWvzO1MeDdnSk/7zT16mvnivNjI/8xFJmXV0UYKVYxlN9WD7oq8SfkNJFMedoGoYZvxvHtxsolE3/a4i76n+KDfafd1qkka5xQlqJnK6R9Kduw24Q/RCWX6/33ZejcygSPt6nSlhENuS0/bGRZOdeZI8NoSTCF35CAj/s59k6s7t8h/SCHxdJxNpBkJrsGlcdYimBu5ueW03sboig56qGTY1aE61v2NHRnPCZ8nXaG2ZSrp6nbC/jKvyho0NT0Z6YhWUk16EqFO5hooV/3lTlypRRCi8rptM/2b6/tUdOprVeSIvSgSJgKHad+SfyB2tOReGliwXGSotYiPmqxRyudHcbfLbB2eJ0kZlJVFql28Nr0YdXJxlzEMDuzMEROai4Pb/Y9nx/xQe8GbGQI7WTUJd2A5hXinZf43yTtEP5HAdJK6BcEbvPIr7JI0E/7HarBLdaD4bMBCM8uyFHgCy32xBKLWA== X-Forefront-PRVS: 0057EE387C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2010; 23:lRplxSbEW4UFMqwawMDeyrpEmOQGTNn4ut+V3Bs?= =?us-ascii?Q?MtjONW7xOxEgmXZ7tXGBY4rJRqknkqZ5fpMsecVnIuQJRMOuAwkKhLuBOpCY?= =?us-ascii?Q?NtAz9bTTVYA5WUchiQEvWHixX0JywEO623AZP0UiGtppOmb1fT5Uif4Hfe+r?= =?us-ascii?Q?bj2DOwJ/NZsOckaiHI/f9IiphETrqH7lJvW4XVIGnPkbxCy1UrM4oR6mrk6J?= =?us-ascii?Q?ZJok3v8ioZRNUsXOTy7nggGml1UDMxsmP5caf1BAM4JpolkLH+UBwAjN2nB2?= =?us-ascii?Q?Q8FDPvg6pCyF7lhSwOD1J49eCaIhLMLLutEVsJ8qMPqLWfnTu6MWYBjHEXoC?= =?us-ascii?Q?uTvp+Yd1reFgs+0zankm5jzz9eqzzoKdTgS0H15Hhi3evr6A5cWxLZEX0A5O?= =?us-ascii?Q?tnnXSCzzw+WKGM6yjUxX8Pd9vjR1InRVYj3e3uQ/aCJaaLjrFh49fueTaBhx?= =?us-ascii?Q?9lngIE/38OUWjp99dPzsn55W9r/kmu9Sa+RMlrZwYx/e+ifxeFCtP1pZ9Trw?= =?us-ascii?Q?1A/8uuJX3Yiu24d8dSNNfMkPpndBfUI0gAuUjhWAy+6sreK7eUO2/NeN1wtW?= =?us-ascii?Q?bRVg0ywPZHAZRZITJgBtu0MlIh4Aclhz8nzW1RXrqYhEr73i6vb7DRBQ0VfT?= =?us-ascii?Q?WZZPZ4yufF6b+craT2Bdh1lniSShKB15R4CdCWObN+p0hflM6SeOWStVxF7E?= =?us-ascii?Q?wW/xBmnmeJllWe4gmIlxre1peJZPBcw7ko2GX0seU64PcrcJJunZvrDSP59q?= =?us-ascii?Q?+GhL0MmYT6czxuj8Rh2PERpqXr9z5e1ykderrjUwNF0+iIL8FdEIr8BVTlTy?= =?us-ascii?Q?0FSxgeeTO0hrGQQaP1svfTAv9hO8YngjtGawr+sbxFuULggOPOBSRsnbjlXc?= =?us-ascii?Q?Rr5EvIfasv1voFph6gmCHVstsi8UaGMKCE/6nXchnX3CaCA41OR1ZfLS9EE5?= =?us-ascii?Q?SMWM2UHKet7I3GYj14Tdd4n2CVgGm3drpVPYc++xHMKq8zM4wSDWkdokaSWY?= =?us-ascii?Q?HSV728w45YtN0mD5hUI2j1enlP8wcLZFvksp+4Jg0CPnyf8vQ/VI2dwS9sjh?= =?us-ascii?Q?mcZAULD+QFcm1GKha+0X+0gqhY09azrTEwQgrt/haGftMqiMSh20czlJsj65?= =?us-ascii?Q?vt4h9jxpxiZpumdXQYoUtE38c40sSCJ/QNcIakHgXdTD0tZmJAO0N3F65wBv?= =?us-ascii?Q?rr1AGfXgdGj6VhC3Fn6zbK8p5ryNyx+hVNyn9ZomqnpacEBjY/8iJTU4FQIs?= =?us-ascii?Q?8QrnivrAwDhK7DZNMCoBhmAlaiwUkImtvIEVLnJar2IE84ln0l7wZn/qj/xz?= =?us-ascii?Q?Hb59JFCxDD8NrNEzrKeQuqnY=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 6:Lrsd1yXOpiWyH5yAmaiV0VCU2hqgSEdt4ZaHU2V4SzJ8jqupEHEUxb7n59Jot2wYcgBaJQHVyGRRXdwPnpJC61+V7Kmr3Z86tuo4bAmQTezg6QHpMkjyuUrqBK4XYPzIcWvmzFzOZYx7VpwDSSfFDS0+XHqubhr9aDPaTSstjxD/7mvdA5rbtOFqpmWLyKRuPOroV8db6sk8jp+E1LHwvekn5WopenNh/mjd3QLoVpRBv+c1utdUOzSZqYRxbCNGsbvfxh6DrwduHWkGTUu1U1dBBdrLfKMnacSDHbt1TWE=; 5:lGo11gGMvxtKNwOnFryLyMWpzC9eTFqvIZdwsxPSudLerUSC+G7TVlU80wsPjafkzV7J2Dhp9cb+kzj9RJfRANdai+acdr4RFH+dHODQb2ZMOMoyTNESePYaiSiQTCbgqAtEL2olVeqR8qhHhfPyZY8nSKmD/Q4/K+MFTeLnXMQ=; 24:orViIaF4zIYd2kQfgjejcaW5ejw7J0rM76ijPNFytwe+XFfsWXftZZR0qUkIfzUX2EpUrVd2YZNnZId9qeQ4Q2Hua0kFHdVMJ4oGhMbtu1A=; 7:2LnR0zZqSyjshG5KHEkgh7AXnIsbmQVakZV9K1LpyHWVNPYhz1spI4eb7sY5ShlvNbKsW3G01A+aOn0P8+7cltX0EL82khCqh9AWPpzYX/zciIi479op+UyOlM5Mz4C2tts6zzN3msdO2pkJ/pfR4c6OCgsOX28eaxduraT3e/evf5E1iizF3DHITmUWSpl81mXhC6mMQ0xhHa/Yibagy3Wmd+1Q9z4pcuAYY+h4PMulm+ZcYwRURY9mUhWs4qmw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2016 08:40:53.2599 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB2010 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.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 a driver to manage and access global utilities block. Initially only reading SVR and registering soc device are supported. Other guts accesses, such as reading RCW, should eventually be moved into this driver as well. Signed-off-by: Yangbo Lu Signed-off-by: Scott Wood Signed-off-by: Scott Wood Signed-off-by: Yangbo Lu --- 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 Changes for v11: - Changed to platform driver - Registered soc device --- drivers/soc/Kconfig | 2 +- drivers/soc/fsl/Kconfig | 20 ++ drivers/soc/fsl/Makefile | 1 + drivers/soc/fsl/guts.c | 483 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/fsl/guts.h | 127 ++++++++----- 5 files changed, 584 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 fe42a2f..f31bceb 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -1,7 +1,7 @@ menu "SOC (System On Chip) specific Drivers" source "drivers/soc/bcm/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..439998d --- /dev/null +++ b/drivers/soc/fsl/Kconfig @@ -0,0 +1,20 @@ +# +# Freescale SOC drivers +# + +source "drivers/soc/fsl/qe/Kconfig" + +config FSL_GUTS + bool "Freescale QorIQ GUTS driver" + select SOC_BUS + select GLOB + help + 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 driver is to manage and access global utilities block. + Initially only reading SVR and registering soc device are supported. + Other guts accesses, such as reading RCW, should eventually be moved + into this driver as well. + + If you want GUTS driver support, you should say Y here. 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..93c39315 --- /dev/null +++ b/drivers/soc/fsl/guts.c @@ -0,0 +1,483 @@ +/* + * 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 +#include +#include +#include + +struct guts { + struct ccsr_guts __iomem *regs; + bool little_endian; +}; + +static struct guts *guts; +static struct soc_device_attribute *soc_dev_attr; +static struct soc_device *soc_dev; + + +/* SoC attribute definition for QorIQ platform */ +static const struct soc_device_attribute qoriq_soc[] = { +#ifdef CONFIG_PPC + /* + * Power Architecture-based SoCs T Series + */ + + /* SoC: T1024/T1014/T1023/T1013 Rev: 1.0 */ + { .soc_id = "svr:0x85400010,name:T1024,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x85480010,name:T1024E,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x85440010,name:T1014,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x854C0010,name:T1014E,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x85410010,name:T1023,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x85490010,name:T1023E,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x85450010,name:T1013,die:T1024", + .revision = "1.0", + }, + { .soc_id = "svr:0x854D0010,name:T1013E,die:T1024", + .revision = "1.0", + }, + /* SoC: T1040/T1020/T1042/T1022 Rev: 1.0/1.1 */ + { .soc_id = "svr:0x85200010,name:T1040,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85280010,name:T1040E,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85210010,name:T1020,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85290010,name:T1020E,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85200210,name:T1042,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85280210,name:T1042E,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85210210,name:T1022,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85290210,name:T1022E,die:T1040", + .revision = "1.0", + }, + { .soc_id = "svr:0x85200011,name:T1040,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85280011,name:T1040E,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85210011,name:T1020,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85290011,name:T1020E,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85200211,name:T1042,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85280211,name:T1042E,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85210211,name:T1022,die:T1040", + .revision = "1.1", + }, + { .soc_id = "svr:0x85290211,name:T1022E,die:T1040", + .revision = "1.1", + }, + /* SoC: T2080/T2081 Rev: 1.0/1.1 */ + { .soc_id = "svr:0x85300010,name:T2080,die:T2080", + .revision = "1.0", + }, + { .soc_id = "svr:0x85380010,name:T2080E,die:T2080", + .revision = "1.0", + }, + { .soc_id = "svr:0x85310010,name:T2081,die:T2080", + .revision = "1.0", + }, + { .soc_id = "svr:0x85390010,name:T2081E,die:T2080", + .revision = "1.0", + }, + { .soc_id = "svr:0x85300011,name:T2080,die:T2080", + .revision = "1.1", + }, + { .soc_id = "svr:0x85380011,name:T2080E,die:T2080", + .revision = "1.1", + }, + { .soc_id = "svr:0x85310011,name:T2081,die:T2080", + .revision = "1.1", + }, + { .soc_id = "svr:0x85390011,name:T2081E,die:T2080", + .revision = "1.1", + }, + /* SoC: T4240/T4160/T4080 Rev: 1.0/2.0 */ + { .soc_id = "svr:0x82400010,name:T4240,die:T4240", + .revision = "1.0", + }, + { .soc_id = "svr:0x82480010,name:T4240E,die:T4240", + .revision = "1.0", + }, + { .soc_id = "svr:0x82410010,name:T4160,die:T4240", + .revision = "1.0", + }, + { .soc_id = "svr:0x82490010,name:T4160E,die:T4240", + .revision = "1.0", + }, + { .soc_id = "svr:0x82400020,name:T4240,die:T4240", + .revision = "2.0", + }, + { .soc_id = "svr:0x82480020,name:T4240E,die:T4240", + .revision = "2.0", + }, + { .soc_id = "svr:0x82410020,name:T4160,die:T4240", + .revision = "2.0", + }, + { .soc_id = "svr:0x82490020,name:T4160E,die:T4240", + .revision = "2.0", + }, + { .soc_id = "svr:0x82410220,name:T4080,die:T4240", + .revision = "2.0", + }, + { .soc_id = "svr:0x82490220,name:T4080E,die:T4240", + .revision = "2.0", + }, +#endif /* CONFIG_PPC */ +#if defined(CONFIG_ARCH_MXC) || defined(CONFIG_ARCH_LAYERSCAPE) + /* + * ARM-based SoCs LS Series + */ + + /* SoC: LS1021A/LS1020A/LS1022A Rev: 1.0/2.0 */ + { .soc_id = "svr:0x87001110,name:LS1021A,die:LS1021A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87081110,name:LS1021AE,die:LS1021A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87001010,name:LS1020A,die:LS1021A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87081010,name:LS1020AE,die:LS1021A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87001210,name:LS1022A,die:LS1021A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87081210,name:LS1022AE,die:LS1021A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87001120,name:LS1021A,die:LS1021A", + .revision = "2.0", + }, + { .soc_id = "svr:0x87081120,name:LS1021AE,die:LS1021A", + .revision = "2.0", + }, + { .soc_id = "svr:0x87001020,name:LS1020A,die:LS1021A", + .revision = "2.0", + }, + { .soc_id = "svr:0x87081020,name:LS1020AE,die:LS1021A", + .revision = "2.0", + }, + { .soc_id = "svr:0x87001220,name:LS1022A,die:LS1021A", + .revision = "2.0", + }, + { .soc_id = "svr:0x87081220,name:LS1022AE,die:LS1021A", + .revision = "2.0", + }, + /* SoC: LS1046A/LS1026A Rev: 1.0 */ + { .soc_id = "svr:0x87070110,name:LS1046A,die:LS1046A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87070010,name:LS1046AE,die:LS1046A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87070910,name:LS1026A,die:LS1046A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87070810,name:LS1026AE,die:LS1046A", + .revision = "1.0", + }, + /* SoC: LS1043A/LS1023A Rev: 1.0 Package: 21*21 */ + { .soc_id = "svr:0x87920110,name:LS1043A,die:LS1043A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87920010,name:LS1043AE,die:LS1043A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87920910,name:LS1023A,die:LS1043A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87920810,name:LS1023AE,die:LS1043A", + .revision = "1.0", + }, + /* SoC: LS1043A/LS1023A Rev: 1.0 Package: 23*23 */ + { .soc_id = "svr:0x87920310,name:LS1043A,die:LS1043A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87920210,name:LS1043AE,die:LS1043A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87920B10,name:LS1023A,die:LS1043A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87920A10,name:LS1023AE,die:LS1043A", + .revision = "1.0", + }, + /* SoC: LS1012A Rev: 1.0 */ + { .soc_id = "svr:0x87040110,name:LS1012A,die:LS1012A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87040010,name:LS1012AE,die:LS1012A", + .revision = "1.0", + }, + /* SoC: LS2088A/LS2048A/LS2084A/LS2044A Rev: 1.0 */ + { .soc_id = "svr:0x87090110,name:LS2088A,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87090010,name:LS2088AE,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87092110,name:LS2048A,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87092010,name:LS2048AE,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87091110,name:LS2084A,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87091010,name:LS2084AE,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87093110,name:LS2044A,die:LS2088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87093010,name:LS2044AE,die:LS2088A", + .revision = "1.0", + }, + /* SoC: LS2080A/LS2040A Rev: 1.0 */ + { .soc_id = "svr:0x87011010,name:LS2080AE,die:LS2080A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87013010,name:LS2040AE,die:LS2080A", + .revision = "1.0", + }, + /* SoC: LS2085A Rev: 1.0 */ + { .soc_id = "svr:0x87010110,name:LS2085A,die:LS2085A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87010010,name:LS2085AE,die:LS2085A", + .revision = "1.0", + }, + /* SoC: LS1088A/LS1048A/LS1084A/LS1044A Rev: 1.0 */ + { .soc_id = "svr:0x87030110,name:LS1088A,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87030010,name:LS1088AE,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87032110,name:LS1048A,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87032010,name:LS1048AE,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87030310,name:LS1084A,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87030210,name:LS1084AE,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87032310,name:LS1044A,die:LS1088A", + .revision = "1.0", + }, + { .soc_id = "svr:0x87032210,name:LS1044AE,die:LS1088A", + .revision = "1.0", + }, +#endif /* CONFIG_ARCH_MXC || CONFIG_ARCH_LAYERSCAPE */ + { }, +}; + +static const struct soc_device_attribute *fsl_soc_device_match( + unsigned int svr, const struct soc_device_attribute *matches) +{ + char svr_match[50]; + int n; + + n = sprintf(svr_match, "*%08x*", svr); + + do { + if (!matches->soc_id) + return NULL; + if (glob_match(svr_match, matches->soc_id)) + break; + } while (matches++); + + return matches; +} + +unsigned int fsl_guts_get_svr(void) +{ + unsigned int svr = 0; + + if (!guts || !guts->regs) + 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); + +static int fsl_guts_probe(struct platform_device *pdev) +{ + struct device_node *np; + const struct soc_device_attribute *fsl_soc; + const char *machine; + unsigned int svr; + int ret = 0; + + np = pdev->dev.of_node; + + /* Initialize guts */ + guts = kzalloc(sizeof(*guts), GFP_KERNEL); + if (!guts) + return -ENOMEM; + + guts->little_endian = of_property_read_bool(np, "little-endian"); + + guts->regs = of_iomap(np, 0); + if (!guts->regs) { + ret = -ENOMEM; + goto out_free; + } + + /* Register soc device */ + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + if (!soc_dev_attr) { + ret = -ENOMEM; + goto out_unmap; + } + + machine = of_flat_dt_get_machine_name(); + if (machine) + soc_dev_attr->machine = kasprintf(GFP_KERNEL, "%s", machine); + + soc_dev_attr->family = kasprintf(GFP_KERNEL, "QorIQ"); + + svr = fsl_guts_get_svr(); + fsl_soc = fsl_soc_device_match(svr, qoriq_soc); + if (fsl_soc) { + soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%s", + fsl_soc->soc_id); + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%s", + fsl_soc->revision); + } else { + soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "0x%08x", svr); + soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d", + SVR_MAJ(svr), SVR_MIN(svr)); + } + + soc_dev = soc_device_register(soc_dev_attr); + if (IS_ERR(soc_dev)) { + ret = -ENODEV; + goto out; + } else { + pr_info("Detected: %s\n", soc_dev_attr->machine); + pr_info("Detected SoC family: %s\n", soc_dev_attr->family); + pr_info("Detected SoC ID: %s, revision: %s\n", + soc_dev_attr->soc_id, soc_dev_attr->revision); + } + return 0; +out: + kfree(soc_dev_attr->machine); + kfree(soc_dev_attr->family); + kfree(soc_dev_attr->soc_id); + kfree(soc_dev_attr->revision); + kfree(soc_dev_attr); +out_unmap: + iounmap(guts->regs); +out_free: + kfree(guts); + return ret; +} + +static int fsl_guts_remove(struct platform_device *dev) +{ + kfree(soc_dev_attr->machine); + kfree(soc_dev_attr->family); + kfree(soc_dev_attr->soc_id); + kfree(soc_dev_attr->revision); + kfree(soc_dev_attr); + soc_device_unregister(soc_dev); + iounmap(guts->regs); + kfree(guts); + return 0; +} + +/* + * Table for matching compatible strings, for device tree + * guts node, for Freescale QorIQ SOCs. + */ +static const struct of_device_id fsl_guts_of_match[] = { + { .compatible = "fsl,qoriq-device-config-1.0", }, + { .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", }, + { .compatible = "fsl,bsc9131-guts", }, + { .compatible = "fsl,bsc9132-guts", }, + { .compatible = "fsl,mpc8536-guts", }, + { .compatible = "fsl,mpc8544-guts", }, + { .compatible = "fsl,mpc8548-guts", }, + { .compatible = "fsl,mpc8568-guts", }, + { .compatible = "fsl,mpc8569-guts", }, + { .compatible = "fsl,mpc8572-guts", }, + { .compatible = "fsl,ls1021a-dcfg", }, + { .compatible = "fsl,ls1043a-dcfg", }, + { .compatible = "fsl,ls2080a-dcfg", }, + {} +}; + +static struct platform_driver fsl_guts_driver = { + .driver = { + .name = "fsl-guts", + .of_match_table = fsl_guts_of_match, + }, + .probe = fsl_guts_probe, + .remove = fsl_guts_remove, +}; + +module_platform_driver(fsl_guts_driver); diff --git a/include/linux/fsl/guts.h b/include/linux/fsl/guts.h index 649e917..c5e24cf 100644 --- a/include/linux/fsl/guts.h +++ b/include/linux/fsl/guts.h @@ -29,83 +29,114 @@ * #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)); +#ifdef CONFIG_FSL_GUTS +unsigned int fsl_guts_get_svr(void); +#endif /* Alternate function signal multiplex control */ #define MPC85xx_PMUXCR_QE(x) (0x8000 >> (x))