From patchwork Thu Dec 17 06:57:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 7869781 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4FA039F1C2 for ; Thu, 17 Dec 2015 06:55:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50B8C203F3 for ; Thu, 17 Dec 2015 06:55:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 587CA201FE for ; Thu, 17 Dec 2015 06:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655AbbLQGze (ORCPT ); Thu, 17 Dec 2015 01:55:34 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36577 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752917AbbLQGze (ORCPT ); Thu, 17 Dec 2015 01:55:34 -0500 Received: by mail-pa0-f52.google.com with SMTP id q3so17163118pav.3 for ; Wed, 16 Dec 2015 22:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=SIniaSfw78OG07/hch+AMm+t5M4F8+dkUA8tJg/qabQ=; b=UHucCFnLjgBXta2E4IDG4xi0cKmZevf18bm9Xco1CY2eLNmFfQvLma6yCEcTC8Pl+s nwOgMJzZ281XcnQiYScFwnKFkbe6RxIsCpML0I91z89Y9EhItgZ4Wd1T1Tv1aOUTS/7k +zwopx3iJVWB9C8tIRbB3dkeYUrKOnYPvEJq+1inQ7zPw0KhxpqoFtAJazZw78oFCdJH feO6Q14q60OSj/RB376NV23/OlUclwAoJ6pzLiCs+k1nslc31uT6ydBnFa7ZvTyO3E0D fXyeZcLbonl4Q3K/k8oUiHrOkZkXBvs2p7fdA0Us3398cO1P85r4oxJrAQ7zHlyqRgYz LLVw== X-Received: by 10.66.162.38 with SMTP id xx6mr69965810pab.57.1450335333904; Wed, 16 Dec 2015 22:55:33 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id q67sm8910835pfi.81.2015.12.16.22.55.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Dec 2015 22:55:32 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: horms+renesas@verge.net.au, Magnus Damm , laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be Date: Thu, 17 Dec 2015 15:57:15 +0900 Message-Id: <20151217065715.31261.43936.sendpatchset@little-apple> Subject: [PATCH] ARM: shmobile: r8a7795: DU and IPMMU prototype hack Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Magnus Damm This prototype hack tries to hook up the r8a7795 DU/VSPD/FCPVD instance to the IPMMU device and hack the driver to get something to work. The IPMMU device has been proven to work with other on-chip r8a7795 devices with upstream support, however the DU devices are not yet working and seem to be a moving target. Developed on top on older renesas-drivers release that has the DU patch stack included. More recent releases have the DU patch stack excluded due to merge issues. Needs more work. Not-Yet-Signed-off-by: Magnus Damm --- Developed on top of renesas-drivers-2015-12-08-v4.4-rc4 and [PATCH 00/06] iommu/ipmmu-vmsa: IPMMU multi-arch update [PATCH/RFC 00/10] iommu/ipmmu-vmsa: Experimental r8a7795 support [PATCH/RFC 00/03] ARM: shmobile: r8a7795 Salvator-X IPMMU test code arch/arm64/boot/dts/renesas/r8a7795.dtsi | 15 +++++++++++++-- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 2 ++ drivers/media/platform/vsp1/vsp1_wpf.c | 3 +++ 4 files changed, 20 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0028/arch/arm64/boot/dts/renesas/r8a7795.dtsi +++ work/arch/arm64/boot/dts/renesas/r8a7795.dtsi 2015-12-17 11:28:23.700513000 +0900 @@ -325,7 +325,14 @@ compatible = "renesas,ipmmu-r8a7795"; reg = <0 0xe6740000 0 0x1000>; /* IPMMU-DS0 */ #iommu-cells = <1>; - status = "okay"; + status = "disabled"; + }; + + ipmmu_vi: mmu@febd0000 { + compatible = "renesas,ipmmu-r8a7795"; + reg = <0 0xfebd0000 0 0x1000>; + #iommu-cells = <1>; + status = "disabled"; }; dmac0: dma-controller@e6700000 { @@ -936,6 +943,7 @@ reg = <0 0xfea20000 0 0x8000>; interrupts = ; clocks = <&cpg CPG_MOD 623>; + iommus = <&ipmmu_vi 8>; renesas,has-lif; renesas,has-lut; @@ -948,6 +956,7 @@ reg = <0 0xfea28000 0 0x8000>; interrupts = ; clocks = <&cpg CPG_MOD 622>; + iommus = <&ipmmu_vi 9>; renesas,has-lif; renesas,has-lut; @@ -960,6 +969,7 @@ reg = <0 0xfea30000 0 0x8000>; interrupts = ; clocks = <&cpg CPG_MOD 621>; + iommus = <&ipmmu_vi 10>; renesas,has-lif; renesas,has-lut; @@ -972,6 +982,7 @@ reg = <0 0xfea38000 0 0x8000>; interrupts = ; clocks = <&cpg CPG_MOD 620>; + iommus = <&ipmmu_vi 11>; renesas,has-lif; renesas,has-lut; @@ -996,7 +1007,7 @@ clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0"; status = "disabled"; - vsps = <&vspd0 &vspd1 &vspd2 &vspd3>; + vsps = <&vspd0>; ports { #address-cells = <1>; --- 0001/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ work/drivers/gpu/drm/rcar-du/rcar_du_drv.c 2015-12-17 11:10:01.380513000 +0900 @@ -138,13 +138,13 @@ static const struct rcar_du_device_info .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_EXT_CTRL_REGS | RCAR_DU_FEATURE_VSP1_SOURCE, - .num_crtcs = 4, + .num_crtcs = 1, .routes = { /* R8A7795 has one RGB output, one LVDS output and two * (currently unsupported) HDMI outputs. */ [RCAR_DU_OUTPUT_DPAD0] = { - .possible_crtcs = BIT(3), + .possible_crtcs = BIT(0), .encoder_type = DRM_MODE_ENCODER_NONE, .port = 0, }, --- 0001/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ work/drivers/gpu/drm/rcar-du/rcar_du_vsp.c 2015-12-17 11:10:01.380513000 +0900 @@ -329,6 +329,8 @@ int rcar_du_vsp_init(struct rcar_du_vsp vsp->vsp = &pdev->dev; + rcdu->ddev->dev = vsp->vsp; // HACK + ret = vsp1_du_init(vsp->vsp); if (ret < 0) return ret; --- 0001/drivers/media/platform/vsp1/vsp1_wpf.c +++ work/drivers/media/platform/vsp1/vsp1_wpf.c 2015-12-17 11:11:46.790513000 +0900 @@ -158,6 +158,9 @@ static int wpf_s_stream(struct v4l2_subd if (vsp1->pdata.uapi) mutex_lock(wpf->ctrls.lock); outfmt |= wpf->alpha->cur.val << VI6_WPF_OUTFMT_PDV_SHIFT; +#if 1 + outfmt |= (1 << 20); +#endif vsp1_wpf_write(wpf, VI6_WPF_OUTFMT, outfmt); if (vsp1->pdata.uapi) mutex_unlock(wpf->ctrls.lock);