From patchwork Wed Nov 21 10:30:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 10692345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 318F015A7 for ; Wed, 21 Nov 2018 10:30:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 200C72B71C for ; Wed, 21 Nov 2018 10:30:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 145752B742; Wed, 21 Nov 2018 10:30:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 66CAF2B71C for ; Wed, 21 Nov 2018 10:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729338AbeKUVEW (ORCPT ); Wed, 21 Nov 2018 16:04:22 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45799 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbeKUVEV (ORCPT ); Wed, 21 Nov 2018 16:04:21 -0500 Received: by mail-pl1-f195.google.com with SMTP id a14so4908703plm.12 for ; Wed, 21 Nov 2018 02:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:subject; bh=eCNYUkL14xsceqQ9IyIVxLL0pZR/2gwG1/eN2afYBU4=; b=ZtlhpFitvr3upOaltKWRf87X8KJh833sBEejR4Ts9ysgAPcRnhba9QpaEK+9Bjdbl2 w3orSkwboQBGZ51yt/vyArwqANHFg3vAwva8TAhR+nhLqxBDjM9w2AykSWE4O8pNkBD9 Eg0tJWJ7pE0V62aQaMxisjy55TTogiZHJXPDgNKQYEzNMRYYUFNPj4tpwb6HS/KdxuZJ rdHK/llAp+nu29ymlyGBYEJrLiYBnHWsUvxi+vxTlar0xWL09uWgrt6HcHcAtbn+flC3 pPR1kf8psAePnrPDp9uxCYgMbpOvxlICa5abPReEXhtSIJ4wEQEVP/21UpthJV20ODuw cilA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:date:message-id:subject; bh=eCNYUkL14xsceqQ9IyIVxLL0pZR/2gwG1/eN2afYBU4=; b=SV+dijSVepMp2snuJ8fSvVilOd3UGgar5WqkIjVLLqHg0w1rRTLprRPQLkJxIMRFNJ 3RKO+F0JVe5dp8NaYg7pcyX1RobDAMSV8hvTcmI1z720u4Q5c/J+FP/S3M16XIy4rucg NVaj/sbJ49yx8Yl6Ij4V/fJ2rPyho8Ftx4DdYN6Emm4/B+uqOK8a9tD8xhnP8oCrGKY+ zEnX3Tx9SwqGbAXyu4tZcmXW2ELAioTnubM1dhdWlXuMkXZKBxjV9f9iBvUwIXVdIqEd JrGxfAySgGTgbo/6B7cbYpagfTZb90vNn2NBeK75ALw79e+t5D5FIsuCnRYCR71NLGR4 puzg== X-Gm-Message-State: AA+aEWbMlBMYVO34drMwXncyASIqYOp1tuP3mAL83OlGcWLrSmhnWEnD 61KmlX9H/MqUgCzAqx9XYNT/B1ND X-Google-Smtp-Source: AFSGD/XOu4NWalVTO5L2lD3e7aQOvuI6bHr6HI1S+AjqXt3O75ziGPqDzFW5tHSF7jMfZ76juqlz4Q== X-Received: by 2002:a63:8742:: with SMTP id i63mr5392498pge.298.1542796229151; Wed, 21 Nov 2018 02:30:29 -0800 (PST) Received: from [127.0.0.1] (l193216.ppp.asahi-net.or.jp. [218.219.193.216]) by smtp.gmail.com with ESMTPSA id 202sm42502182pfy.87.2018.11.21.02.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Nov 2018 02:30:27 -0800 (PST) From: Magnus Damm To: linux-renesas-soc@vger.kernel.org Cc: Magnus Damm Date: Wed, 21 Nov 2018 19:30:48 +0900 Message-Id: <154279624819.29528.954090919447072739.sendpatchset@octo> Subject: [PATCH 00/05] Test R-Car Gen3 SYSC power domains used by FCPCS and VDPB 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 Test R-Car Gen3 SYSC power domains used by FCPCS and VDPB [PATCH 01/05] Hack FCP driver to poke at FCPCS and VDPB during probe [PATCH 02/05] arm64: dts: renesas: r8a7795: Add FCPCS+VDPB node for R-Car H3 [PATCH 03/05] arm64: dts: renesas: r8a7796: Add FCPCS+VDPB node for R-Car M3-W [PATCH 04/05] arm64: dts: renesas: r8a77965: Add FCPCS+VDPB node for R-Car M3-N [PATCH 05/05] arm64: dts: renesas: r8a77990: Add FCPCS+VDPB node for R-Car E3 These patches temporarily extend the FCP driver to manage power domain power and poke at FCPCS and VDPB devices after power on and optionally after power off as well. Access while power off is expected to fail and is currently disabled by #ifdef wrap. Example of console printout from H3 ULCB: [ 1.921670] Enabling FCPCS device (Runtime PM on) [ 1.926449] Power-on FCPCS version is 0x00000103 [ 1.931117] Power-on VDPB read at offset 0x200 is 0x00000000 [ 1.936819] Disabling FCPCS device (Runtime PM off) [ 1.941853] rcar_sysc_pd_power_off: a2vc1 [ 1.945960] sysc power off domain 26: 0000000e -> 0 [ 1.950892] rcar_sysc_pd_power_off: a3vc [ 1.954903] sysc power off domain 14: 0000000e -> 0 Register details for FCPCS and VDPB are omitted from the data sheet, however this code assumes the version register in FCPCS is available following same register layout as other documented FCP devices. As can be seen by the printout above, some sort of value is read out when the power domain is on. Reading out the same register when turned off triggers an exception on H3 ES2 as expected. Please note that repeated power on-off-on has not been performed. Also no verification has been made that devices actually are located in A2VC instead of for instance A3VC. Since A3VC is parent of A2VC an incorrect power domain pointer in DT to A2VC while the (rather undocumented) device is located in A3VC might result in some hidden errors. The VDPB register access results in all-zero value while powered on. Which actual register that should be used for poking remains guess work at this point. Reading VDPB while powered off results in an exception on H3 ES2. The basic testing performed by this series shows that A2VC power domain handling for H3 ES2 seems to work as expected. This series is not intended for upstream merge. Created as an example of how to test power domains for a certain device. I hope to use this approach to test IPMMU power domain support in the future. Not-Signed-off-by: Magnus Damm --- Developed on top of renesas-devel-20181119-v4.20-rc3 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 9 ++++++ arch/arm64/boot/dts/renesas/r8a7796.dtsi | 9 ++++++ arch/arm64/boot/dts/renesas/r8a77965.dtsi | 9 ++++++ arch/arm64/boot/dts/renesas/r8a77990.dtsi | 9 ++++++ drivers/media/platform/rcar-fcp.c | 42 ++++++++++++++++++++++++++++- drivers/soc/renesas/rcar-sysc.c | 1 6 files changed, 78 insertions(+), 1 deletion(-)