From mboxrd@z Thu Jan 1 00:00:00 1970 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 60B5BC433F5 for ; Sat, 22 Jan 2022 17:17:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12ED483811; Sat, 22 Jan 2022 18:17:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kJOpcQJe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C51188378B; Sat, 22 Jan 2022 18:17:28 +0100 (CET) Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1F3F881FF1 for ; Sat, 22 Jan 2022 18:17:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x929.google.com with SMTP id b16so22901309uaq.4 for ; Sat, 22 Jan 2022 09:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k3kWYLru4KaKTdT8unc2IDFVGKtDMxWL2fKNWBGyIGc=; b=kJOpcQJeXDeidarXxiK+Vrpfz9/nkk59KVlUHdfI0/tNJ9MgUpyBjaQpxyLCSCVyrl FlOxyeI9KhwP3bX50qHvMHIKMvU54CqQFdsozYaZoIieP1jaid42I/jq/wJ+FF1r7xAb HZcYr39xQNAehxt8X2yEOVcc936ZJk77aHgi8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k3kWYLru4KaKTdT8unc2IDFVGKtDMxWL2fKNWBGyIGc=; b=j/n9TBEEDVVyMDb9gLTbs20RJiqg/qoP+yAV9giV7UuTBC+38V8u9slpvXIS8lsNVT fvy756qs6B6DsrK3h8MQ+4rbFQs/cU1sW9FnKqMzM4vWv+On53BEqDIDF+emRYMG+Go9 94it5WJorgdRt9LXfta00fI4Gf8m+iJ9LAqAo+JwKwT3S0oW0dE6P59ScjniOJGL3MJq X3CxcGAwRZuui76s2VXFihMDnw72H/l00hlFrn59djsSQFCH9LzYt9WjnYcczQpNbGhM oFGH866G5yEXXvuH1iJJi1xIwOIESYrH/rjUr3qckk/LYnfmZtbrXci7xh2Q3ULz1Kvu 1h4g== X-Gm-Message-State: AOAM532HxHwoN5YLTMq2O6bHPAoliDFbasN2CgYYnquhD01VPXrSgPiN 1BPzRwpGsC7Ut9TVPZtzBWwswNMN7CrQ9KO4+JxgmA== X-Google-Smtp-Source: ABdhPJxTLDAnT6qB4Mz4lfbmpdmGeONQvVDII7i/QoTjVMcpkdR6nSCevsFjBRSxIo6Uw11FosRDRnDu86Je0Y90rOE= X-Received: by 2002:a67:cc1b:: with SMTP id q27mr3489759vsl.71.1642871844719; Sat, 22 Jan 2022 09:17:24 -0800 (PST) MIME-Version: 1.0 References: <20220114110438.58452-1-kettenis@openbsd.org> <20220114110438.58452-7-kettenis@openbsd.org> In-Reply-To: From: Simon Glass Date: Sat, 22 Jan 2022 10:17:10 -0700 Message-ID: Subject: Re: [PATCH 6/8] power: domain: apple: Add reset support To: Mark Kettenis Cc: Mark Kettenis , U-Boot Mailing List , Jaehoon Chung , Tom Rini , sven@svenpeter.dev, marcan@marcan.st, Bin Meng Content-Type: text/plain; charset="UTF-8" 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 Hi Mark, On Sat, 22 Jan 2022 at 07:12, Mark Kettenis wrote: > > > 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. It seems odd that Linux does this sort of thing. The normal U-Boot approach would be to create a parent MFD driver with children for each uclass. Does linux do that these days? Driver model cannot create two drivers from one device tree node, although you can create one manually later as you have done. It seems OK to follow along with Linux, if it makes it easier to maintain. Otherwise, drivers/reset would be better for the reset driver. Either way: Reviewed-by: Simon Glass Tested on: Macbook Air M1 Tested-by: Simon Glass Regards, Simon