Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3456416ybz; Mon, 4 May 2020 03:23:48 -0700 (PDT) X-Google-Smtp-Source: APiQypLmkHwd0GNkNaYWASjyPcX6nrbHTwWx5xAZIGYWhrqnuJ3kMDt+kGw3c05bXtEGD/EmwvCB X-Received: by 2002:aa7:dd84:: with SMTP id g4mr14241402edv.273.1588587828638; Mon, 04 May 2020 03:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588587828; cv=none; d=google.com; s=arc-20160816; b=vRODMgvSxAPGsIkY7YPGOesq45+WH55uGxfzGUZPFCO0JmH3Mrhq48SmWJyOixIDXA WI3+E+QI5LfIinPBcTNOp0+/km8DwkzV9lomY48mLqeAvLQXiUEX6j9eNT0ZnGZFgP9t OYQ9BV7+CYdZRM0xYoalWVqy3JpsJHDQ1++VkuVjc1wHqvQk9TumfW+BmQSavnMV0vEk pPgjVqfWtFdsl7WP5/8+7pLG1542Y/alI6/D9pkApFiryarlYcCHZjC/TvGPS322J03/ hbYZ9PyUa0pwNjGZlIid6zvrs7nesTU5h0rvLvxfO+aHQDDz0pWzrxxcnv3UTz2/dC+8 OUog== 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=GuvdTl4tHlj+a6eQxt32uMIGY8O43dES5pX4A1PGJAA=; b=xarCNWZPjCyzN/W2V42blF4irMGYMeUp8LEjV0QEIZ9xRGvPhQWIRj7XsLNmpmn+J3 RrQxE4uIBIpzTL2cIsrtLq8f+mjHK4KZCs6SHTILPb6rf21aaza6Ywg2wSSDY5xfvh8H kByOEE3AIecndR86wPzVnoox5XSVeJAh/Ktvv+26spNfLmf6chKw2rfrnkdcrp/h+7x2 m+hepOJkEq6nVpEq2M/aDE2aJmFCnQtzE12/SKaJBnFBoYd6qPT6TYmT5yHFlMCB//3y b5ep1ilRhswUT0UpmaQY/XutJjvAc83hPBodWXY20Niq9SRXpbfhNxHMsIMrkfEzmp7J 0Low== ARC-Authentication-Results: i=1; mx.google.com; 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 c8si6269943edn.240.2020.05.04.03.23.25; Mon, 04 May 2020 03:23:48 -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; 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 S1728209AbgEDJTR (ORCPT + 99 others); Mon, 4 May 2020 05:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726467AbgEDJTQ (ORCPT ); Mon, 4 May 2020 05:19:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60C94C061A0E for ; Mon, 4 May 2020 02:19:16 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=localhost) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVXFl-0000mc-RS; Mon, 04 May 2020 11:19:09 +0200 Message-ID: <97aa62e8aaf8fa1c462c7db117fca9b6ea9bfec0.camel@pengutronix.de> Subject: Re: [PATCH] soc: imx: Add power domain driver support for i.mx8m family From: Lucas Stach To: Jacky Bai , Abel Vesa , Shawn Guo , Sascha Hauer , Liam Girdwood , Mark Brown Cc: Aisheng Dong , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List Date: Mon, 04 May 2020 11:19:08 +0200 In-Reply-To: References: <1587999532-30006-1-git-send-email-abel.vesa@nxp.com> <0d301ed303faea4895d30b682133ec5c9d44bd8b.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.1 (3.36.1-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb 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 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 ; Shawn > > Guo ; Sascha Hauer ; Liam > > Girdwood ; Mark Brown > > Cc: Aisheng Dong ; dl-linux-imx > > ; linux-arm-kernel@lists.infradead.org; Linux Kernel > > 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 makes > > > 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 established that > > we can't move all functionality for the power domains into the firmware, 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 does 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 patch below. > > > Why can't we just extend the existing GPCv2 driver with support for the other > > i.MX8M family members? > > > > The reason that why I don’t like to extend the GPCv2 is that when doing domain on/off, > We need to access some special control register in each domain & do some 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 complexity 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 partial 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. Regards, Lucas