From patchwork Thu Sep 29 22:21:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 9357197 X-Patchwork-Delegate: horms@verge.net.au 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 50010600C8 for ; Thu, 29 Sep 2016 22:22:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C2E0299C4 for ; Thu, 29 Sep 2016 22:22:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30DD029A5E; Thu, 29 Sep 2016 22:22:01 +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.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 7EC3E299C4 for ; Thu, 29 Sep 2016 22:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934925AbcI2WV7 (ORCPT ); Thu, 29 Sep 2016 18:21:59 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:35334 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934691AbcI2WV6 (ORCPT ); Thu, 29 Sep 2016 18:21:58 -0400 Received: by mail-lf0-f44.google.com with SMTP id l131so92269122lfl.2 for ; Thu, 29 Sep 2016 15:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=5otytoKJMDa4R7XAM/6KUtMOJufNBE2GZQWwes/ULA0=; b=fQOib+tQi5bWl1kWf6vWmbiZvaoCJWvHGMaysLmJoSuFV1fgalI7x9+LQ7k0yb+72a 0Nw/R6BNsy+R9nNPCKVpbORwvlNuI/Z/84q75VhWXgUdW22l8OKydhqGCGkJcr2ZqoBC 6OS9WS+hioZQwTSuVQf1Va3sHEPL+AjYI7P8hxWUUiM9MSzW5IgWyHntjKg6Vd9FjKQa qE4Awk5TVCPBkJZrkcmtn4xIFeOlGkiFnd3ziMXQrpPQ2NL4q0lgYia/+yg4BspjkSlC W5IpUPIjqocKI7rSq8saUHj1X1Xh3CcwumW7VGZZt4+kxqmr34mWu3ls2qaQnW+wOAQd 1n+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=5otytoKJMDa4R7XAM/6KUtMOJufNBE2GZQWwes/ULA0=; b=QCf9/1fbEEcKlEvNIodiM64wczSj/p1Vy3TCMR5H0li0hJG14z77YKxVuBnuML9ENP eU8r0aS/DWyVAplSJEAVay2JQMoTFx2o4R+ODUnVB2q+XGTo2E0EU2Bipay1OHQ64c3r 79NxEW9oqd+8/234O8z2kR4t8QHT1e6L9VF10nY+oDoHdqDDkzESToffv3quH4hWFqO8 n5z/JsJ0ZRmOGxIzgQQgpc06LLvDdEltKimDKA6TQKpua2yblAzBjfIHhLyXwFs6iWv4 u+qPHygzVwIQ1F6AWGeLV2txEoKocQROUG5zt6iXMJtEvVZqGo706OQImSW7fYTEflor a/ng== X-Gm-Message-State: AA6/9RkvcjXfItQGaYAcoHnqKv47HnSFQ67SyeoC9hah/zdFyHoJ5uoY+3bjcZW+eZ0UAg== X-Received: by 10.25.153.17 with SMTP id b17mr1754141lfe.44.1475187716771; Thu, 29 Sep 2016 15:21:56 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.85.95]) by smtp.gmail.com with ESMTPSA id u18sm1515168lja.11.2016.09.29.15.21.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 15:21:56 -0700 (PDT) From: Sergei Shtylyov To: horms@verge.net.au, linux-renesas-soc@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, linux-pm@vger.kernel.org Cc: magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC v2 3/12] soc: renesas: rcar-sysc: add R8A7743 support Date: Fri, 30 Sep 2016 01:21:54 +0300 Message-ID: <1979633.oxsqSuXO5u@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.10 (Linux/4.7.4-100.fc23.x86_64; KDE/4.14.20; x86_64; ; ) In-Reply-To: <1987532.PE2ex6PrJ5@wasted.cogentembedded.com> References: <1987532.PE2ex6PrJ5@wasted.cogentembedded.com> MIME-Version: 1.0 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 Add support for RZ/G1M (R8A7743) SoC power areas to the R-Car SYSC driver. Based on the original (and large) patch by Dmitry Shifrin . Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven --- Changes in version 2: - documented the R8A7743 SYSC device tree binding; - added "R-Car" to the patch description; - added Geert's tag. Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt | 7 +- drivers/soc/renesas/Makefile | 1 drivers/soc/renesas/r8a7743-sysc.c | 32 ++++++++++ drivers/soc/renesas/rcar-sysc.c | 3 drivers/soc/renesas/rcar-sysc.h | 1 5 files changed, 41 insertions(+), 3 deletions(-) Index: renesas/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt =================================================================== --- renesas.orig/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt +++ renesas/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt @@ -1,12 +1,13 @@ -DT bindings for the Renesas R-Car System Controller +DT bindings for the Renesas R-Car (RZ/G) System Controller == System Controller Node == -The R-Car System Controller provides power management for the CPU cores and -various coprocessors. +The R-Car (RZ/G) System Controller provides power management for the CPU cores +and various coprocessors. Required properties: - compatible: Must contain exactly one of the following: + - "renesas,r8a7743-sysc" (RZ/G1M) - "renesas,r8a7779-sysc" (R-Car H1) - "renesas,r8a7790-sysc" (R-Car H2) - "renesas,r8a7791-sysc" (R-Car M2-W) Index: renesas/drivers/soc/renesas/Makefile =================================================================== --- renesas.orig/drivers/soc/renesas/Makefile +++ renesas/drivers/soc/renesas/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_ARCH_R8A7743) += rcar-sysc.o r8a7743-sysc.o obj-$(CONFIG_ARCH_R8A7779) += rcar-sysc.o r8a7779-sysc.o obj-$(CONFIG_ARCH_R8A7790) += rcar-sysc.o r8a7790-sysc.o obj-$(CONFIG_ARCH_R8A7791) += rcar-sysc.o r8a7791-sysc.o Index: renesas/drivers/soc/renesas/r8a7743-sysc.c =================================================================== --- /dev/null +++ renesas/drivers/soc/renesas/r8a7743-sysc.c @@ -0,0 +1,32 @@ +/* + * Renesas RZ/G1M System Controller + * + * Copyright (C) 2016 Cogent Embedded Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; of the License. + */ + +#include +#include + +#include + +#include "rcar-sysc.h" + +static const struct rcar_sysc_area r8a7743_areas[] __initconst = { + { "always-on", 0, 0, R8A7743_PD_ALWAYS_ON, -1, PD_ALWAYS_ON }, + { "ca15-scu", 0x180, 0, R8A7743_PD_CA15_SCU, R8A7743_PD_ALWAYS_ON, + PD_SCU }, + { "ca15-cpu0", 0x40, 0, R8A7743_PD_CA15_CPU0, R8A7743_PD_CA15_SCU, + PD_CPU_NOCR }, + { "ca15-cpu1", 0x40, 1, R8A7743_PD_CA15_CPU1, R8A7743_PD_CA15_SCU, + PD_CPU_NOCR }, + { "sgx", 0xc0, 0, R8A7743_PD_SGX, R8A7743_PD_ALWAYS_ON }, +}; + +const struct rcar_sysc_info r8a7743_sysc_info __initconst = { + .areas = r8a7743_areas, + .num_areas = ARRAY_SIZE(r8a7743_areas), +}; Index: renesas/drivers/soc/renesas/rcar-sysc.c =================================================================== --- renesas.orig/drivers/soc/renesas/rcar-sysc.c +++ renesas/drivers/soc/renesas/rcar-sysc.c @@ -275,6 +275,9 @@ finalize: } static const struct of_device_id rcar_sysc_matches[] = { +#ifdef CONFIG_ARCH_R8A7743 + { .compatible = "renesas,r8a7743-sysc", .data = &r8a7743_sysc_info }, +#endif #ifdef CONFIG_ARCH_R8A7779 { .compatible = "renesas,r8a7779-sysc", .data = &r8a7779_sysc_info }, #endif Index: renesas/drivers/soc/renesas/rcar-sysc.h =================================================================== --- renesas.orig/drivers/soc/renesas/rcar-sysc.h +++ renesas/drivers/soc/renesas/rcar-sysc.h @@ -50,6 +50,7 @@ struct rcar_sysc_info { unsigned int num_areas; }; +extern const struct rcar_sysc_info r8a7743_sysc_info; extern const struct rcar_sysc_info r8a7779_sysc_info; extern const struct rcar_sysc_info r8a7790_sysc_info; extern const struct rcar_sysc_info r8a7791_sysc_info;