Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1028297iob; Fri, 13 May 2022 20:12:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0xZ/O7QEJANyriwUCIBocH/RLMtHyULCYSUqL541HWRInH7Ftp/hEvzB6GwFMl4P5iO3t X-Received: by 2002:a7b:ce0a:0:b0:394:41e:2517 with SMTP id m10-20020a7bce0a000000b00394041e2517mr17746933wmc.135.1652497971788; Fri, 13 May 2022 20:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652497971; cv=none; d=google.com; s=arc-20160816; b=C9xd4QrxKhai6jXfhKh1IlbuyD7VEzCeynnshFXkgMOuVF2Skm+T4cQrbOnQV/pyRL kgwFCFb9TlW8t8d8RFGL8q8S1ilzvDmwd+hLY6phs4zQVuHr4bJKeMYHkfPiVrQux6r9 189TYtjtvvm+eo78olLr0bfwwIPxn6xqvJBH27VE3v2MoMLEHg2Y7LMzj2APb+HBa0nE 1aSLMgipAfG56cItPwbEHkygG2TeFVW3cyS1+QS6Md4M+6hOo/p0daU6N4OAnxo99xk9 YHohLFXxnqbdzwSJB2HcWCI565IxRhBBKqy3KrBNHcfEmG6fBlpcW6LsFycZ2q2wcaZq z1xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BZCyN3u0ukyiZuNWrYZZ3V7T3RNpHS+LzDDyyBy2MCs=; b=0XxkayJ+uPyEUHb8wG5IQ0O8t4EOBRT3eHhfkbNLCy1vNZLEeD1dJg0QpZi01G/ZDa DyAbeC/NtyJgNwJGSbXqpLxWM8l9YK9CD/y9eq1o74tfXBPUhwPOY07cN17RFlUc6I+P S/Hnw4q3BlnFtdIOWRHtISaGL8qXoTHKpuFYbMdXEbanpTUn24ltvOGCeoF3apgLAxWB 0OzxpekGBn5FmVIX7TwOgA03I1keI8n3ZS/jdDm/V64TlOSFfpvg64BBquZK5qFqQ4YY PfYnCCduT+pH6sSt6xxK/uaA54/ZbB8YiY8c424WQS5CgSTF9LXXXJ4CrHkXgXEdpRHi bLmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kMUJVOVr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m3-20020adfc583000000b0020ae099a2ebsi3643795wrg.939.2022.05.13.20.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kMUJVOVr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA6C63D3419; Fri, 13 May 2022 16:52:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358227AbiELUAL (ORCPT + 99 others); Thu, 12 May 2022 16:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232085AbiELUAK (ORCPT ); Thu, 12 May 2022 16:00:10 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADA83663C7; Thu, 12 May 2022 13:00:06 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id g6so12361024ejw.1; Thu, 12 May 2022 13:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BZCyN3u0ukyiZuNWrYZZ3V7T3RNpHS+LzDDyyBy2MCs=; b=kMUJVOVrC2EWJo16vfWhonvgaJjhET679TIiqxfNCeleLoffDUkiF39CbiThlLevuM fUsyHPb/cvs5VpggCiTKlkiYY3AdltcxuEGiMhoe2whAeOotH/qu78sNWJw549+B2PeO u3eX1m6gPbnsFMYXCfdQ1ly7yMpGxZqBHJT3rGLrlaeiX2WQBhhTLOrl5fBZUOav9GLM bQxH0OSR33aaSLA99C2uR2OGLcIOaheqx1elAFnmdFXGJCQ+sUWjP0MrgLLRWEoiEOmI W2vUOOf3I5THXk20qQTCV5K9s0SfMVXEAZ+Z1atUdqelaE+TwjEpK3go/erZu/wqD3bW Z3/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BZCyN3u0ukyiZuNWrYZZ3V7T3RNpHS+LzDDyyBy2MCs=; b=tTdJyKoxCJrel0/k20j/rBiprGzE9ucfWvoj6Asaxc2SvwZhVkV9GNvRTzCVXv4E1w FDI+ZWf7zMaeuCkGllH6RXvFkxM8lm/jcQKfZ1UL1q6JIGF3R9HP2tCGxdkTR4wtALt1 BCmnAH5CyhHweyFYZhf6ko2RxytZfBAAlcrgS7aFMFnq7Hnc1jRIqSOQDy7J3BkOc/Vv XKWZjuRR7DLYrtRg5vOZ41gS0Xtl0WKoQFlJMUURMQ6qfammqO8k5EsOFR7bqDorYdmK 7oKTX6BnAfLc7pvadsIrUxmI3t50dJY8KHYxp/cRYcDYmq2/AmrnurOQswYxcWCN7OZ5 AzKQ== X-Gm-Message-State: AOAM530OcXc+wpfTeLyV543HJxcCJUGJAZHDB6o5aLYwxH4tlWRjkHO+ bNVvbvk3gO9mAqNEs7VsS/nd0ehiKj/nZQ== X-Received: by 2002:a17:907:6d1e:b0:6f9:ffbd:477a with SMTP id sa30-20020a1709076d1e00b006f9ffbd477amr1410718ejc.104.1652385605026; Thu, 12 May 2022 13:00:05 -0700 (PDT) Received: from archbook.localnet (84-72-105-84.dclient.hispeed.ch. [84.72.105.84]) by smtp.gmail.com with ESMTPSA id h16-20020a1709066d9000b006f3ef214e73sm55712ejt.217.2022.05.12.13.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 13:00:04 -0700 (PDT) From: Nicolas Frattaroli To: Ezequiel Garcia Cc: Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , devicetree , linux-arm-kernel , "open list:ARM/Rockchip SoC..." , Linux Kernel Mailing List Subject: Re: [PATCH v2 3/3] arm64: dts: rockchip: Add Hantro encoder node to rk356x Date: Thu, 12 May 2022 22:00:03 +0200 Message-ID: <14624530.8YKtBhKLIE@archbook> In-Reply-To: References: <20220508202544.501981-1-frattaroli.nicolas@gmail.com> <1959188.DQhRDO7MrQ@archbook> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Donnerstag, 12. Mai 2022 16:16:52 CEST Ezequiel Garcia wrote: > On Tue, May 10, 2022 at 12:28 PM Nicolas Frattaroli > wrote: > > > > Hi Ezequiel, > > > > On Montag, 9. Mai 2022 16:17:03 CEST Ezequiel Garcia wrote: > > > Hi Nicolas, > > > > > > On Sun, May 8, 2022 at 5:26 PM Nicolas Frattaroli > > > wrote: > > > > > > > > The RK3566 and RK3568 come with a dedicated Hantro instance solely for > > > > encoding. This patch adds a node for this to the device tree, along with > > > > a node for its MMU. > > > > > > > > Signed-off-by: Nicolas Frattaroli > > > > --- > > > > arch/arm64/boot/dts/rockchip/rk356x.dtsi | 21 +++++++++++++++++++++ > > > > 1 file changed, 21 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > > > > index 7cdef800cb3c..2e3c9e1887e3 100644 > > > > --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi > > > > +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi > > > > @@ -508,6 +508,27 @@ gpu: gpu@fde60000 { > > > > status = "disabled"; > > > > }; > > > > > > > > + vepu: video-codec@fdee0000 { > > > > + compatible = "rockchip,rk3568-vepu"; > > > > + reg = <0x0 0xfdee0000 0x0 0x800>; > > > > + interrupts = ; > > > > + interrupt-names = "vepu"; > > > > > > It this block "encoder only" and if so, maybe we should remove the > > > "interrupt-names" [1]? > > > > > > The driver is able to handle it. See: > > > > > > https://elixir.bootlin.com/linux/latest/source/drivers/staging/media/hantro/hantro_drv.c#L962 > > > > > > You might have to adjust the dt-bindings for this. > > > > > > [1] https://lore.kernel.org/linux-media/20210324151715.GA3070006@robh.at.kernel.org/ > > > > What the Linux driver can handle should not matter to the device tree; > > device trees are independent of drivers and kernels. > > > > I guess my message wasn't clear, no need to lecture me on Device > Trees, although I appreciate > your friendly reminder of what a Device Tree is. > > Having said that, the binding is designed to support both decoders and encoders > for instance: > > vpu: video-codec@ff9a0000 { > compatible = "rockchip,rk3288-vpu"; > reg = <0x0 0xff9a0000 0x0 0x800>; > interrupts = , > ; > interrupt-names = "vepu", "vdpu"; > clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>; > clock-names = "aclk", "hclk"; > iommus = <&vpu_mmu>; > power-domains = <&power RK3288_PD_VIDEO>; > }; > > Hence the question is why do you splitted the encoder to its own node? It has its own IOMMU and is in a different power domain than the decoder. I think I have mentioned this multiple times before, including in the cover letter. Assuming you do not believe me, feel free to check the TRM, of which I am sure you also have a copy: page 475 of Part 1 shows the VPU being in PD_VPU while the JPEG encoder is in PD_RGA. Pages 478 and 479 of Part 2, Section 10.5, shows that the JPEG encoder (VEPU121)'s base is not the same as the Hantro decoder (VDPU121)'s base, and their IOMMUs which are based relative to their base offset are therefore also not at the same address. If you think the TRM must be wrong then, consider the fact that I have actually run this patch set, presumably being the only person to do so, and found that it works, so no, the addresses and power domains are correct. I do not see any way in which it would make sense to put this into the same node as the decoder. It would not even be possible to do this in your bindings, as they specify a maxItems for power-domains and iommus of 1. Even if I modified them the driver wouldn't know which PD and IOMMU belongs to decoder and encoder. I think if we put this encoder in the same node as the decoder, we might as well take this to its natural conclusion and put the entire device tree into a single very large node. It's not the same hardware, it cannot be modelled as being the same hardware, just because the bindings lets people model some separate hardware as the same hardware doesn't mean this applies to this hardware. Long story short, why did I split the encoder to its own node? The answer is that I didn't. I simply refused to combine it into a node that it has nothing to do with. > If we have good reasons to have separated Device Tree nodes, > then having interrupt-names = "vepu" for its only interrupt line > doesn't make sense. How does it not make sense? The bindings allow for a vdpu only interrupt-names, which in my understanding makes the same amount of sense. Regards, Nicolas Frattaroli > > > What does matter though is to be consistent in the bindings. > > interrupt-names is a required property even if there's only a vdpu > > interrupt. I modelled my vepu-only binding after this case. > > > > The current binding models the idea of decoder and encoder > being the same device. This has never been really really accurate, > as the encoder and decoders have always been more or less independent. > > The reason for having them on a single device are mostly historical, > some old devices shared some resource. I don't think this is the case anymore, > but the binding was still modeled to support that. > > Hopefully this makes sense! > Thanks, > Ezequiel > > > > If robh thinks there is no value to having the interrupt show up > > as anything other than "default" in /proc/interrupts, then I respectfully > > disagree with that opinion and point out that this should have been brought > > up when the vdpu-only case in the bindings was made to require > > interrupt-names also. > > > > Changing the binding now that there theoretically could be drivers out > > in the wild (though I doubt it) that do require interrupt-names, because > > the binding told them that this is okay to do, seems unwise to me. > > > > Regards, > > Nicolas Frattaroli > > > > > > > > Thanks, > > > Ezequiel > > > > > > > + clocks = <&cru ACLK_JENC>, <&cru HCLK_JENC>; > > > > + clock-names = "aclk", "hclk"; > > > > + iommus = <&vepu_mmu>; > > > > + power-domains = <&power RK3568_PD_RGA>; > > > > + }; > > > > + > > > > + vepu_mmu: iommu@fdee0800 { > > > > + compatible = "rockchip,rk3568-iommu"; > > > > + reg = <0x0 0xfdee0800 0x0 0x40>; > > > > + interrupts = ; > > > > + clocks = <&cru ACLK_JENC>, <&cru HCLK_JENC>; > > > > + clock-names = "aclk", "iface"; > > > > + power-domains = <&power RK3568_PD_RGA>; > > > > + #iommu-cells = <0>; > > > > + }; > > > > + > > > > sdmmc2: mmc@fe000000 { > > > > compatible = "rockchip,rk3568-dw-mshc", "rockchip,rk3288-dw-mshc"; > > > > reg = <0x0 0xfe000000 0x0 0x4000>; > > > > -- > > > > 2.36.0 > > > > > > > > > > > > _______________________________________________ > > > > Linux-rockchip mailing list > > > > Linux-rockchip@lists.infradead.org > > > > http://lists.infradead.org/mailman/listinfo/linux-rockchip > > > > > > > > > > > >