Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 595D5C433EF for ; Sat, 22 Jan 2022 14:12:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A78628209A; Sat, 22 Jan 2022 15:12:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DE00F82EBB; Sat, 22 Jan 2022 15:12:02 +0100 (CET) Received: from sibelius.xs4all.nl (sibelius.xs4all.nl [83.163.83.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7CAA281974 for ; Sat, 22 Jan 2022 15:12:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=mark.kettenis@xs4all.nl Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id bb135f97; Sat, 22 Jan 2022 15:11:58 +0100 (CET) Date: Sat, 22 Jan 2022 15:11:58 +0100 (CET) From: Mark Kettenis To: Simon Glass Cc: kettenis@openbsd.org, u-boot@lists.denx.de, jh80.chung@samsung.com, trini@konsulko.com, sven@svenpeter.dev, marcan@marcan.st, bmeng.cn@gmail.com In-Reply-To: (message from Simon Glass on Fri, 21 Jan 2022 18:40:23 -0700) Subject: Re: [PATCH 6/8] power: domain: apple: Add reset support References: <20220114110438.58452-1-kettenis@openbsd.org> <20220114110438.58452-7-kettenis@openbsd.org> Message-ID: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean > From: Simon Glass > Date: Fri, 21 Jan 2022 18:40:23 -0700 > > Hi Mark, > > On Fri, 14 Jan 2022 at 04:05, Mark Kettenis wrote: > > > > The power management controller found on Apple SoCs als provides > > a way to reset all devices within a power domain. This is needed > > to cleanly shutdown the NVMe controller before we hand over > > control to the OS. > > > > Signed-off-by: Mark Kettenis > > --- > > arch/arm/Kconfig | 1 + > > drivers/power/domain/apple-pmgr.c | 73 ++++++++++++++++++++++++++++++- > > 2 files changed, 73 insertions(+), 1 deletion(-) > > This should use devicetree instead of device_bind() and be a reset > driver in drivers/reset Not sure what you mean with "this should use devicetree". The reset and power domain functionality is integrated in the same hardware register and there is a single node that decsribes the device. The Linux driver implements the power domain and reset functionality in a single driver as well. I suppose I could move the reset code into a file of its own in drivers/reset, but I don't think it would make the code easier to understand. And I'd still need to bind the reset driver explicitly in apple_pmgr_probe() as it isn't possible to automatically bind two drivers to a single device tree node as far as I can tell.