Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1529551ybk; Thu, 21 May 2020 09:01:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMxAqaztHP+EOdYqgF59dWyWowFvngw2/BToHpNuDOxGCv8WBKaeG+CNt92oMyl9hepUI9 X-Received: by 2002:a50:d553:: with SMTP id f19mr8028630edj.219.1590076860144; Thu, 21 May 2020 09:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590076860; cv=none; d=google.com; s=arc-20160816; b=Tx0Z700aW6eVwzoVA0NffsIso+qKultFvWHkxYexlJ2UuP/fBB1r0ALylBt65FK05X RutcYcebNgva0+4x4Y+jmdg2qvOqXvzsJgLqFscgPawZCSofQ4gz9paI2RnMhNrFf5Zo HOtUs2I5Q4JG/wlPbzCobsHEjsefO5oBibNrv+K/t12h5stbDpjQZ8yaHdXm8lq/vEpL UtkQ6qCmpvl7RqScipxfGhrVKRxidYh57mKc3+FWefddtRPrua25qaFEeA5GUeK45oEg rkjLrGdxBD1HW9iYj7B+za/v/qyfEW8rFbrVC3NkFZAZBIZVpVj+XbJGFR80pauNkJx7 8quw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8vYYXmeN5jPKZ8yHl1zcQTrk3+2MBfEvZOrsg6uMWz0=; b=0ppA8rnnifpYUCpupeZokvDkvfuSpVopkT52dUr/86weNuz6FKTYPO7l1CHnFFiiEu HpdMuG0veVUvZZmx8K1cj7pFX+olVA892eh2RzMRclC50x53mmNwVYQhRvypTdXKdrQw wD6361z8khF3wR07zKUxP+WyWXT7Zq2MpbIorGn4sy+u8m1Bdk5HOiRfRFajjrqbBHM7 YOaitfmFkZ3Vzu6UUwayuUyTaAgAM7WUwxq96mS9b79aMySHyF1fWFDBi+K9phxc3/zj X4p9C4RjLyf+K3jhuR7Wx9qEA1o4FPSoSGIQ+/Tdugi6f+ZV7qFSc35cgZ+LZNt0On0B 9F0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=slV1NT9K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si3547480ejh.219.2020.05.21.09.00.35; Thu, 21 May 2020 09:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gateworks-com.20150623.gappssmtp.com header.s=20150623 header.b=slV1NT9K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728464AbgEUP4R (ORCPT + 99 others); Thu, 21 May 2020 11:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbgEUP4R (ORCPT ); Thu, 21 May 2020 11:56:17 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 260CFC061A0E for ; Thu, 21 May 2020 08:56:17 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id r25so6621327oij.4 for ; Thu, 21 May 2020 08:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8vYYXmeN5jPKZ8yHl1zcQTrk3+2MBfEvZOrsg6uMWz0=; b=slV1NT9Kmw9gIGPFL64AKgnZtLSVTVxRMvTeUjYnQctDiz/6T8czmC8Q3Ok+HDigX5 1o5tk5qs9S8evmRNALsJRSQRmIj5vVxTU6dVNIYK+UmM/YU3cNy8YuO0AE+YS2PnMzBE f+Z8wOIiXlnpnYOtkZNn9/LWFqoixCsaVY3LZRBoe7o4whn1qo7J8eWFXIBGZJXY3lpk tXWL2zGiF2WIDZJWLX5AcnkSBZFI0pGmMlEXP+NlirYU6HKGTuBcSNSc1tDLDtJpIo3r WOLGBP9ud/kFhAZpqMuhShW/4CGzi0RRkt4VpBawsZAfzlPCYBrUclxGvj0dtSk7t+qw aIRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8vYYXmeN5jPKZ8yHl1zcQTrk3+2MBfEvZOrsg6uMWz0=; b=KD1mVhlUcx4TzU0PcUQV5ilTAeJN0O+VN4OLx7sKVTbUa3Kwt07dm596LXrjyt5GA4 MXKwYIdKp15vGQurGHq/FBYmYHbj1CZDs1yt7Ql/ZML+mrSNkK/kZ9cDyi2kFU+ECXvl 8z2n666kFI3C/I/nb2EjZGbSfi+Hudq9dMN72lGlf/62Dp20E22fcMxkAAy5Fs/hJqOM ++AB+n5dkvdekWBCexsZl75zMZDeMKwORqqLSxfYc1ipBnuDQe6JyEzNSh/yFLZHw/Zo bpLVVsiaDugHWnCpFsN/F9CeyEllHOA5+Qad9HElCXAm0S2nm6EM8pebCxzGaoOZGUTk CW+g== X-Gm-Message-State: AOAM531Ysln+9YiWmrtatl6D7r5yUELTl5/gFwdqeznatf5I3+woXJfg Lx5HVpnf6EqMgditwb1043cFccizVrb8B7eRjq6yQg== X-Received: by 2002:aca:534c:: with SMTP id h73mr6942846oib.52.1590076576468; Thu, 21 May 2020 08:56:16 -0700 (PDT) MIME-Version: 1.0 References: <1587999532-30006-1-git-send-email-abel.vesa@nxp.com> <0d301ed303faea4895d30b682133ec5c9d44bd8b.camel@pengutronix.de> <97aa62e8aaf8fa1c462c7db117fca9b6ea9bfec0.camel@pengutronix.de> In-Reply-To: <97aa62e8aaf8fa1c462c7db117fca9b6ea9bfec0.camel@pengutronix.de> From: Tim Harvey Date: Thu, 21 May 2020 08:56:04 -0700 Message-ID: Subject: Re: [PATCH] soc: imx: Add power domain driver support for i.mx8m family To: Jacky Bai , Abel Vesa , Aisheng Dong Cc: Shawn Guo , Sascha Hauer , Liam Girdwood , Mark Brown , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List , Lucas Stach , Adam Ford Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 4, 2020 at 2:19 AM Lucas Stach wrote: > > Am Montag, den 27.04.2020, 15:37 +0000 schrieb Jacky Bai: > > > -----Original Message----- > > > From: Lucas Stach > > > Sent: Monday, April 27, 2020 11:11 PM > > > To: Abel Vesa ; Jacky Bai ; Shaw= n > > > Guo ; Sascha Hauer ; Liam > > > Girdwood ; Mark Brown > > > Cc: Aisheng Dong ; dl-linux-imx > > > ; linux-arm-kernel@lists.infradead.org; Linux Kern= el > > > Mailing List > > > Subject: Re: [PATCH] soc: imx: Add power domain driver support for i.= mx8m > > > family > > > > > > Am Montag, den 27.04.2020, 17:58 +0300 schrieb Abel Vesa: > > > > From: Jacky Bai > > > > > > > > The i.MX8M family is a set of NXP product focus on delivering the > > > > latest and greatest video and audio experience combining > > > > state-of-the-art media-specific features with high-performance > > > > processing while optimized for lowest power consumption. > > > > > > > > i.MX8MQ, i.MX8MM, i.MX8MN, even the furture i.MX8MP are all belong = to > > > > this family. A GPC module is used to manage all the PU power domain > > > > on/off. But the situation is that the number of power domains & the > > > > power up sequence has significate difference on those SoCs. Even on > > > > the same SoC. The power up sequence still has big difference. It ma= kes > > > > us hard to reuse the GPCv2 driver to cover the whole i.MX8M family. > > > > Each time a new SoC is supported in the mainline kernel, we need to > > > > modify the GPCv2 driver to support it. We need to add or modify > > > > hundred lines of code in worst case. > > > > It is a bad practice for the driver maintainability. > > > > > > > > This driver add a more generic power domain driver that the actual > > > > power on/off is done by TF-A code. the abstraction give us the > > > > possibility that using one driver to cover the whole i.MX8M family = in > > > > kernel side. > > > > > > > > > > Again: what does this driver bring to the table, other than moving a = fraction of > > > the power domain functionality into the firmware? > > > > > > The discussions on the last submissions of this driver already establ= ished that > > > we can't move all functionality for the power domains into the firmwa= re, as > > > controlling regulators is probably not easy to do from this context. = Also the > > > TF-A side implementation of this driver is "interesting" IMHO, it doe= s stuff like > > > accessing the clock controller registers without any locking or other= means of > > > mutual exclusion with the Linux kernel clock controller driver. > > > > > > > The clock handling is in kernel side through CCF, not in ATF. See the p= atch below. > > > > > Why can't we just extend the existing GPCv2 driver with support for t= he other > > > i.MX8M family members? > > > > > > > The reason that why I don=E2=80=99t like to extend the GPCv2 is that wh= en doing domain on/off, > > We need to access some special control register in each domain & do som= e special flow, > > These control register(mediamix block control, vpumix block control) is= not in GPC > > module's address range. No benefit to reuse the GPCv2. Only bring compl= exity to the > > GPCv2 driver each time a new SoC is added. > > > > Yes, the i.MX8M power domain support has been pending for a while. ARM = guys rejected this patchset > > because they suggest us to use SCMI rather than SiP. But SCMI is only p= artial suitable for our > > case. > > Can you please point me to the most resent version of the TF-A side > implementation of this? The i.MX8MM implementation in the > imx_5.4.3_2.0.0 branch in the codeaurora imx-atf repo still contains > writes to the clock controller register range. > > Also I would love to learn why the GPC needs to access Mediamix and > VPUmix domain registers. If you are talking about the NOC configuration > I would strongly suggest that those should be handled by a Linux side > interconnect driver, this has nothing to do with the power domain > sequencing, it just happens to lose state over the power down and needs > to be reprogrammed after power on. The NOC configuration though is use- > case dependent, so this should be properly handled in a rich OS driver. > > Sure we needs to extend the Linux side GPC driver for each new SoC > generation, but that's no different from any other hardware driver in > Linux. Drivers are the abstraction around the hardware, there is no > need to invent another one if there are no clear benefits. > Jacky / Abel, Any movement on this? As I see it the lack of imx8mm power-domain support in the kernel is holding up USB, PCIe, VPU, and perhaps GPU/CSI as well. I would tend to agree that hiding this functionality in the TF-A is probably not the best approach especially as that requires a NXP version of the TF-A. I really don't see the issue with the gpc driver getting a little more complicated if it needs to. There is bound to be some complication as there is such a large variation of IMX8 products out there! (talk about confusing!). Best Regards, Tim