Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21387411ybl; Mon, 6 Jan 2020 03:39:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwrZRGayJ552o8G9Se7lFz21yU77Ku+uBdBEcMUj9VPTjSgfIo4bpDA9RTaav5abCsWhn33 X-Received: by 2002:a9d:c42:: with SMTP id 60mr75881581otr.182.1578310780327; Mon, 06 Jan 2020 03:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578310780; cv=none; d=google.com; s=arc-20160816; b=Y5UusPpLPEXpvDS/atF99mUFp9j7DntyVQtlHWtmFIdUhm4aJl/aqY+ngAYfEz4Ym8 SsWFZE+eo07Hdmh01jHhOemQuRH+ZgXEZEi+dyr36/vmnQLAt29EozIYvwZmCUlPxn0+ NYvU7b1eE0b6gQ/UyKllAQwRmpMmIcNqiEPXQSDlw6P4EUhivvh6iKTyqi7cKYxKVHyQ z/hf1K77MMxsLehiCBwy5Dz4vCqd7jJBsm+U2kgUPXed2hNevvWhmksOXo0a3YcyTk4Q k0fLNUXUY7uDjm0f3TTe0pYxAKnW6716UHNpqM/BvpHR3GoKDpymABXKS499AgcGdI7D ThGg== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=wACuYKSz3Pb53MXVcZ6+8zG6iqEjDOmCNhBCZZwqKGw=; b=COx4MCPdVgANmxXAYQCf3IctNLo15PW7JHwyZpPsDq3m9twvUu8h19DAk3W7qDsUuy 3wgAVXoIMgdfn1k++PTw/Ut05lm439HCHVsAGJsDnfywqj+1Z+8J4su15b5d0tl9XBuU ZrLPoWLWM0hNxsSWLncuCxKzpA0XdWOJHMqW9dJdkm1arCwW7YOk5DwMneZ5vGd91tJc 4g4vg9JU9POyiqtaAtPnmYMWGMDiSdAmarJaCZybiJY+ZefYaEKp1gVWRhryKy6ZzzOh 1ri26qk7jZP8gQaZLRxXQp2ux8wmydDHZtnQUCWuGGDt+t4041QpRlq2TGtVZMoh1+OO G0BQ== 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 l26si32877101otn.48.2020.01.06.03.39.27; Mon, 06 Jan 2020 03:39:40 -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 S1726358AbgAFLii (ORCPT + 99 others); Mon, 6 Jan 2020 06:38:38 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:33425 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgAFLih (ORCPT ); Mon, 6 Jan 2020 06:38:37 -0500 Received: from kresse.hi.pengutronix.de ([2001:67c:670:100:1d::2a]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ioQiL-0004uf-AZ; Mon, 06 Jan 2020 12:38:29 +0100 Message-ID: Subject: Re: [PATCH V2 0/7] soc: imx: Enable additional functionality of i.MX8M Mini From: Lucas Stach To: Jacky Bai , Adam Ford , arm-soc Cc: Mark Rutland , devicetree , Peng Fan , Fabio Estevam , Sascha Hauer , Linux Kernel Mailing List , Rob Herring , dl-linux-imx , Pengutronix Kernel Team , Leonard Crestez , Shawn Guo Date: Mon, 06 Jan 2020 12:38:25 +0100 In-Reply-To: References: <20191213160542.15757-1-aford173@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::2a X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacky, On So, 2019-12-22 at 08:33 +0000, Jacky Bai wrote: > > -----Original Message----- > > From: Adam Ford > > Sent: Saturday, December 21, 2019 11:07 PM > > To: arm-soc > > Cc: Peng Fan ; Jacky Bai ; Rob > > Herring ; Mark Rutland ; > > Shawn Guo ; Sascha Hauer > > ; Pengutronix Kernel Team > > ; Fabio Estevam ; > > dl-linux-imx ; devicetree ; > > Linux Kernel Mailing List ; Leonard Crestez > > > > Subject: Re: [PATCH V2 0/7] soc: imx: Enable additional functionality of > > i.MX8M Mini > > > > On Fri, Dec 13, 2019 at 10:05 AM Adam Ford wrote: > > > The GPCv2 controller on the i.MX8M Mini is compatible with the driver > > > used for the i.MX8MQ except for the register locations and names. > > > The GPCv2 controller is used to enable additional periperals currently > > > unavailable on the i.MX8M Mini. In order to make them function, the > > > GPCv2 needs to be adapted so the drivers can associate their power > > > domain to the GPCv2 to enable them. > > > > > > This series makes one include file slightly more generic, adds the > > > iMX8M Mini entries, updates the bindings, adds them to the device > > > tree, then associates the new power domain to both the OTG and PCIe > > > controllers. > > > > > > Some peripherals may need additional power domain drivers in the > > > future due to limitations of the GPC driver, but the drivers for VPU > > > and others are not available yet. > > > > Before I do a V3 to address Rob's comments, I am thinking I'll drop the items > > on the GPC that Jacky suggested would not work, and we don't have drivers > > for those other peripherals (GPU, VPU, etc.) anyway. My main goal here was > > to try and get the USB OTG ports working, so I'd like to enabled enough of the > > items on the GPC that are similar to the i.MX8MQ and leave the more > > challenging items until we have either a better driver available and/or actual > > peripheral support coming. I haven't seen LCDIF or DSI drivers pushed > > upstream yet, so I doubt we'll see GPU or VPU yet until those are done. > > > > Does anyone from the NXP team have any other comments/concerns? > > > > If you look into NXP's release code, you will find that it is not easy to handle the > power domain more generically in GPCv2 driver for imx8mm. That's the reason why we use > SIP service to handle all the power domain in TF-A. we tried to upstream the SIP version > power domain that can be reused for all i.MX8M, but rejected by ARM guys. they think > we need to use SCMI to implement it. as there is no SCMI over SMC available, upstream is > on the way, so the power domain for i.MX8MM/MN is pending. Adding power domain support for i.MX8MM/MN to the GPCv2 driver does not prevent a SCMI solution to be used when available. I don't see why we should block this. > Actually, I am confused why we can't use SIP service, even if the SCMI over SMC is ready in > the future, It seems the SMCC function ID still need to choose from SIP service function id bank. > > Another concern for adding power domain support in GPCv2 is that, each time a new > SOC is added, we need to add hundred lines of code in GPCv2 driver. it is not a best way > to keep driver reuse. This is how all hardware specific stuff is handled in the driver. I see your use-case of having a single TF-A based driver for applications where you have more than on OS running on the system. For the very common case of only a single rich OS running on the system the code reuse doesn't really matter and in fact it's easier to fix any bugs by just updating the Linux kernel. > The GPCv2 driver is originally used for i.MX7D, then reused by i.MX8MQ, > as i.MX8MQ has very simple power domain design as i.MX7D. But for i.MX8MM, it is not the > case. I would be very interested in the details here. What is the big difference in the i.MX8MM that would make it hard to support it in the GPCv2 driver in the same way as we did with i.MX8MQ? > > There is another concern, we don't want to export GPC module to rich OS side, it is not a must. You are still free to remove the GPC DT node, as soon as the SCMI replacement is ready. But if you decide to handle the GPC stuff in TF-A, are you also going to handle the external supplies to the GPC domains in the TF-A? What about synchronous reset clocks that need to be running while the domain is powered up? Are you going to add a SCMI based replacement for the clock controller, which is currently also handled in the rich OS? Regards, Lucas > > BR > Jacky Bai > > > adam > > > Adam Ford (7): > > > soc: imx: gpcv2: Rename imx8mq-power.h to imx8m-power.h > > > soc: imx: gpcv2: Update imx8m-power.h to include iMX8M Mini > > > soc: imx: gpcv2: add support for i.MX8M Mini SoC > > > dt-bindings: imx-gpcv2: Update bindings to support i.MX8M Mini > > > arm64: dts: imx8mm: add GPC power domains > > > ARM64: dts: imx8mm: Fix clocks and power domain for USB OTG > > > arm64: dts: imx8mm: Add PCIe support > > > > > > .../bindings/power/fsl,imx-gpcv2.txt | 6 +- > > > arch/arm64/boot/dts/freescale/imx8mm.dtsi | 127 ++++++++- > > > arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 +- > > > drivers/soc/imx/gpcv2.c | 246 > > +++++++++++++++++- > > > .../power/{imx8mq-power.h => imx8m-power.h} | 14 + > > > 5 files changed, 387 insertions(+), 8 deletions(-) rename > > > include/dt-bindings/power/{imx8mq-power.h => imx8m-power.h} (57%) > > > > > > -- > > > 2.20.1 > > >