From patchwork Wed May 25 08:58:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 9135011 X-Patchwork-Delegate: geert@linux-m68k.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 17A5560221 for ; Wed, 25 May 2016 08:58:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A30A280D2 for ; Wed, 25 May 2016 08:58:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F301E282DA; Wed, 25 May 2016 08:58:39 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 9C520282C0 for ; Wed, 25 May 2016 08:58:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753005AbcEYI6j (ORCPT ); Wed, 25 May 2016 04:58:39 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:10018 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754005AbcEYI6f (ORCPT ); Wed, 25 May 2016 04:58:35 -0400 Received: from vsmta12.fe.internet.bosch.com (unknown [10.4.98.52]) by imta24.fe.bosch.de (Postfix) with ESMTP id 9EDB7D80219 for ; Wed, 25 May 2016 10:58:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1464166713; bh=sHtRNENUSXnmEJ1oul/2uq/zBm/0ca7I/cGM2LYXyrM=; l=10; h=From:From:Reply-To:Sender; b=txJ28UOrD06d6wfE+Rvmms6EpshZD70FKxfgALbvL9ARX/Jo3fYsz5Lqo+gvazSxe +TlOWJnvNG4RMBQyA0ItkI/HiBzUFIW9UuTIUdOeXRbtOLJj5MpPf1CdfmDFxx8NYH wDsPfwYNJO9ysbABHFMIcXE7Noj41aQjkNf9EqNM= Received: from FE-HUB1001.de.bosch.com (vsgw23.fe.internet.bosch.com [10.4.98.23]) by vsmta12.fe.internet.bosch.com (Postfix) with ESMTP id 4F4111B803D9 for ; Wed, 25 May 2016 10:58:33 +0200 (CEST) Received: from hi-z08if.hi.de.bosch.com (10.34.209.31) by FE-HUB1001.de.bosch.com (10.4.103.109) with Microsoft SMTP Server id 14.3.195.1; Wed, 25 May 2016 10:58:32 +0200 Received: from hi-z08if.hi.de.bosch.com (localhost [127.0.0.1]) by hi-z08if.hi.de.bosch.com (Postfix) with ESMTP id 9BD34625EC0; Wed, 25 May 2016 10:58:30 +0200 (CEST) From: Dirk Behme To: Geert Uytterhoeven , Simon Horman , , Koji Matsuoka CC: Dirk Behme Subject: [PATCH 1/4] ARM: Renesas: R-Car3: Add product register support Date: Wed, 25 May 2016 10:58:25 +0200 Message-ID: <1464166708-18320-2-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1464166708-18320-1-git-send-email-dirk.behme@de.bosch.com> References: <1464166708-18320-1-git-send-email-dirk.behme@de.bosch.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22342.006 X-TMASE-MatchedRID: NKGAuCCEJLODzdmvk4Gt0hHRbGr1ECgH0ZXcgm+a343SYAzZ6KmqWiac nbShnMCcBLueWOOTKZV3ySUvXJkJaxCgP4uv/JEph2VzUlo4HVN51GakW92m5gR5ZehN/PGg00t CqrwqeGa36SL29gBZ5t52diAVzqN2Z5W5bfHsIDW4jAucHcCqnZYcYQ11P5U/TlW+AO5oMKTZTA EszxrPVBsP2NCVh9x0Y5pMvCTQy4YTqqg1ekHcnBIMDPFEv6Ux7f6JAS2hKPjCVT8AizGeFAF/C mr5NdIiJmL4F1ztDueAMuqetGVetnyef22ep6XYsjvNV98mpPPhuXc5+ZtX1DW5ubBoJNwd229z 4O9Nrx8FzNx22DCKZwEvp8A1qTIqftwZ3X11IV0= Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The product register of the Renesas R-Car3 isn't part of any SoC module, but "just" a register at address 0xFFF00044. It provides some configuration information about the SoC itself, like the number of the CA57, CA53 and CR7 cores, the product description (R-Car H3, R-Car M3-W etc) and the sample revision. This information is needed by some drivers to enable or disable specific features which are present or not in the SoC. Signed-off-by: Dirk Behme --- drivers/soc/renesas/Makefile | 4 ++-- drivers/soc/renesas/rcar3-prr.c | 49 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 drivers/soc/renesas/rcar3-prr.c diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile index cd85cd5..d39990a 100644 --- a/drivers/soc/renesas/Makefile +++ b/drivers/soc/renesas/Makefile @@ -4,5 +4,5 @@ obj-$(CONFIG_ARCH_R8A7791) += rcar-sysc.o r8a7791-sysc.o # R-Car M2-N is identical to R-Car M2-W w.r.t. power domains. obj-$(CONFIG_ARCH_R8A7793) += rcar-sysc.o r8a7791-sysc.o obj-$(CONFIG_ARCH_R8A7794) += rcar-sysc.o r8a7794-sysc.o -obj-$(CONFIG_ARCH_R8A7795) += rcar-sysc.o r8a7795-sysc.o -obj-$(CONFIG_ARCH_R8A7796) += rcar-sysc.o r8a7796-sysc.o +obj-$(CONFIG_ARCH_R8A7795) += rcar-sysc.o r8a7795-sysc.o rcar3-prr.o +obj-$(CONFIG_ARCH_R8A7796) += rcar-sysc.o r8a7796-sysc.o rcar3-prr.o diff --git a/drivers/soc/renesas/rcar3-prr.c b/drivers/soc/renesas/rcar3-prr.c new file mode 100644 index 0000000..8fda1c2 --- /dev/null +++ b/drivers/soc/renesas/rcar3-prr.c @@ -0,0 +1,49 @@ +/* + * R-Car3 Product Register (PRR) support + * + * Copyright (C) 2016 Robert Bosch Car Multimedia GmbH + * Dirk Behme + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include +#include + +unsigned int __rcar3_prr; +EXPORT_SYMBOL(__rcar3_prr); + +static const struct of_device_id rcar3_prr_ids[] __initconst = { + { .compatible = "renesas,rcar-gen3-prr" }, + {} +}; + +static int __init rcar3_read_prr(void) +{ + struct device_node *np; + void __iomem *prr; + + np = of_find_matching_node(NULL, rcar3_prr_ids); + if (!np) { + pr_err("can't find renesas,rcar-gen3-prr device node"); + return -ENOENT; + } + + prr = of_iomap(np, 0); + if (!prr) { + pr_err("failed to map product register"); + of_node_put(np); + return -ENOMEM; + } + + __rcar3_prr = ioread32(prr); + + iounmap(prr); + of_node_put(np); + + return 0; +} +early_initcall(rcar3_read_prr);