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 9C927C00140 for ; Fri, 5 Aug 2022 20:07:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 839A78487A; Fri, 5 Aug 2022 22:07:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de 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=suse.de header.i=@suse.de header.b="Ym6w6ft/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="AcIpaJLm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BA6884897; Fri, 5 Aug 2022 22:07:01 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 C617B8486D for ; Fri, 5 Aug 2022 22:06:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 8FE2420A36; Fri, 5 Aug 2022 20:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1659730018; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oahgu9TwT1NqdOkO91eSkyV3llexoIrZgBpcYdy4Y/w=; b=Ym6w6ft/14VkEoowdCNuewNbTV6afCqpRwFpIRyWJInpx8RoVmzu0jK+ka0F2fVOpZT+Mq 9tosHC7RHoBNwtVw6IfDzdrhOJVl8bHL9IFUQ0IRBp28k6fahN/c0uiyZO/Z/LUNjGiM7H Z31p4Ee5otJl/v1PBKl8E2n2re3iFXU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1659730018; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oahgu9TwT1NqdOkO91eSkyV3llexoIrZgBpcYdy4Y/w=; b=AcIpaJLmEaql65WShTEy1OF9WrnX9+mAZNroaR3tU805TMj4NxbLdoOTZeVk0Czs3sD1N9 gMkBOSKoDixxzZDw== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E99492C141; Fri, 5 Aug 2022 20:06:57 +0000 (UTC) Date: Fri, 5 Aug 2022 22:06:56 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Simon Glass Cc: U-Boot Mailing List , Jaehoon Chung , Chris Morgan , Kever Yang Subject: Re: [PATCH] power: pmic: rk8xx: Workaround pmic failure when probed before relocation Message-ID: <20220805200656.GH17705@kitsune.suse.cz> References: <20220805113219.7316-1-msuchanek@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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.6 at phobos.denx.de X-Virus-Status: Clean On Fri, Aug 05, 2022 at 10:48:26AM -0600, Simon Glass wrote: > Hi Michal, > > On Fri, 5 Aug 2022 at 05:32, Michal Suchanek wrote: > > > > When the sysreset is added as child of the pmic the pmic is probed > > before relocation. That probe fails, and subsequent attempts to probe > > after reloaction fail as well. > > > > As a workaround do not bind the sysreset before relocation. > > > > Signed-off-by: Michal Suchanek > > --- > > drivers/power/pmic/rk8xx.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c > > index a239a18674..d12263c4f2 100644 > > --- a/drivers/power/pmic/rk8xx.c > > +++ b/drivers/power/pmic/rk8xx.c > > @@ -131,7 +131,7 @@ static int rk8xx_read(struct udevice *dev, uint reg, uint8_t *buff, int len) > > > > static int rk8xx_bind(struct udevice *dev) > > { > > - if (CONFIG_IS_ENABLED(SYSRESET)) { > > + if (CONFIG_IS_ENABLED(SYSRESET) && (gd->flags & GD_FLG_RELOC)) { > > device_bind_driver(dev, "rk8xx_sysreset", > > "rk8xx_sysreset", NULL); > > } > > -- > > 2.37.1 > > > > I think it is OK to avoid starting a device before relocation, or make > that device do something different. I really don't like the binding > being optional though...we have the 'u-boot,dm-pre-reloc' for that. So perhaps the flag should be dropped from rk8xx then. > > But missing from your commit message is exactly what fails? The pmic is an i2c device, all i2c tranferss fail if initialized pre-relocation. I supect it's the i2c bus that fails if initialized before reloc - the regulatorss that share the i2c bus also report i2c transfer failure. Thanks Michal