Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp592809ybl; Fri, 10 Jan 2020 03:41:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz5FPQhgj1Xw0HB4XQKevHGPZx0mzw/6cEEd0kK8GSzYogG7tu8ZWkjs11QyJ4dBCUeTiCR X-Received: by 2002:a9d:7590:: with SMTP id s16mr2048714otk.89.1578656482888; Fri, 10 Jan 2020 03:41:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578656482; cv=none; d=google.com; s=arc-20160816; b=D5PNkeLAx/JVk12ipt25fJcO5M7l9xT+hFpcxRmat3Ur9oRomaZ2swXa/MRoxgDXsA 28tRHVy/F2Rk8Dlcu/dwtGNkUN6TCHcZXKzmi87WrVhUu2huYMEOqQs1ctldGNAymb8b mf9QX7p9uZNCQuXL4XdOzHQ95Aju6ECm1S0dxWNZh5fS0rKML3rNsRIEKr2a2QYBxVFH FQNsLKgT3WBZhXkQGH2KFTgAAL0j2k49VbgRnjou7hMBlA0GoI6mzpteV6ppYqeShyl/ 2SixbY6PO7Cl0zLzv8/Q2DL6WGw9/xs7PITr68G+fGAX5wwQ2TGLawUUEfnSKvQOtO3C CwRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=fR4EfeDNS38wUcJv1ZzKOmC5sc++MRjsfcRc4D2AvZs=; b=SHbUUrtMD2y4biioIccmpLbti+LIKWYK2KQd58PKMw6W70PO+FAOcQulre4My0e6I6 mRH56UcFidLxFV1p9IKhH/btEWU48HPKSQABCAsEiNJ6lqg928BMBv67thA0PNjDCdAi 6Yb5yHqTvtSK2EDLA5mJFDsqb+XEHhuZPI5C4fr5o0AvZB+9NU8Jec/1qizg6Uo7tT8f jHwtjeEiPAMS9IL4Ge/IIcOCB91owj2d2gKVX05o5H2BIWsZMLoGx1nR+64VsqcmuyoA mGd3zORlmyxrmT3sd448EGi3Jp7A+M6zvaV0hc+yse7OKx3TBcMiS/DvqsvvLy5PRJbu XVWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si976839otq.144.2020.01.10.03.41.11; Fri, 10 Jan 2020 03:41:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727843AbgAJLkA (ORCPT + 99 others); Fri, 10 Jan 2020 06:40:00 -0500 Received: from foss.arm.com ([217.140.110.172]:42862 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgAJLkA (ORCPT ); Fri, 10 Jan 2020 06:40:00 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 75FAF1063; Fri, 10 Jan 2020 03:39:59 -0800 (PST) Received: from [10.1.194.52] (e112269-lin.cambridge.arm.com [10.1.194.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29DAA3F534; Fri, 10 Jan 2020 03:39:57 -0800 (PST) Subject: Re: [PATCH v2 4/7] drm/panfrost: Add support for a second regulator for the GPU To: Rob Herring , Nicolas Boichat Cc: Mark Rutland , Devicetree List , Tomeu Vizoso , David Airlie , lkml , Liam Girdwood , dri-devel , Mark Brown , "moderated list:ARM/Mediatek SoC support" , Alyssa Rosenzweig , Daniel Vetter , Hsin-Yi Wang , Matthias Brugger , linux-arm Mailing List References: <20200108052337.65916-1-drinkcat@chromium.org> <20200108052337.65916-5-drinkcat@chromium.org> <20200108132302.GA3817@sirena.org.uk> From: Steven Price Message-ID: Date: Fri, 10 Jan 2020 11:39:56 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/01/2020 16:56, Rob Herring wrote: > On Wed, Jan 8, 2020 at 4:52 PM Nicolas Boichat wrote: >> >> On Wed, Jan 8, 2020 at 9:23 PM Mark Brown wrote: >>> >>> On Wed, Jan 08, 2020 at 01:23:34PM +0800, Nicolas Boichat wrote: >>> >>>> Some GPUs, namely, the bifrost/g72 part on MT8183, have a second >>>> regulator for their SRAM, let's add support for that. >>> >>>> + pfdev->regulator_sram = devm_regulator_get_optional(pfdev->dev, "sram"); >>>> + if (IS_ERR(pfdev->regulator_sram)) { >>> >>> This supply is required for the devices that need it so I'd therefore >>> expect the driver to request the supply non-optionally based on the >>> compatible string rather than just hoping that a missing regulator isn't >>> important. >> >> That'd be a bit awkward to match, though... Currently all bifrost >> share the same compatible "arm,mali-bifrost", and it'd seem >> weird/wrong to match "mediatek,mt8183-mali" in this driver? I have no >> idea if any other Mali implementation will require a second regulator, >> but with the MT8183 we do need it, see below. > > The current number of supported bifrost platforms is 0. It's only a > matter of time until SoC specific compatibles need to be used in the > driver. This is why we require them. > > It could very well be that all bifrost implementations need 2 > supplies. On chip RAMs are very frequently a separate thing which are > synthesized differently from logic. At least within a specific IP > model, I somewhat doubt there's a variable number of supplies. It > could be possible to connect both to the same supply, but the correct > way to handle that is both -supply properties point to the same > regulator. To be honest I've no idea what different SoC designs have done, but one of the intentions of core stacks was that sets of GPU cores would be on different power supplies. (I think this is to avoid issues with inrush current etc, but I'm not a hardware engineer). So I would expect designs with a large number of cores to have more physical supplies than designs with fewer cores. However, from a driver perspective this is all meant to be hidden by the hardware PDC which the GPU talks to. So the actual power up/down of the supplies may be completely automatic and therefore not described in the DT. So the actual number of software-controllable supplies could be 1 or could be more if the individual physical supplies are visible to software. The Hikey960 for instance hides everything behind a mailbox interface, and it's simply a case of requesting a frequency. Steve