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 00E2BC00140 for ; Fri, 5 Aug 2022 11:32:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C436984205; Fri, 5 Aug 2022 13:32:28 +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="oynS0ptK"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="KDJQq5++"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0DA1E84205; Fri, 5 Aug 2022 13:32:27 +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 0708E84377 for ; Fri, 5 Aug 2022 13:32:25 +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 C8F1B20DD8; Fri, 5 Aug 2022 11:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1659699144; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CODCse/t/ttu1iC3ny9k9cMLOJG8LBGILlYuwv58rYw=; b=oynS0ptK6JD67epv0zGVlZG1yuBvsEoIf9GShhZsAAud7HEFguU0kClOA+kBGHASBN/sil mcCnv0MzEW07XgKr0BaxA0kTsmYGRt1dTnDbO5oKsrzRBQsdhmC8WIUU9RR4l0VkLFq27j 2MWBgQYG8q31wDZDwbyA5saeCOZofzM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1659699144; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CODCse/t/ttu1iC3ny9k9cMLOJG8LBGILlYuwv58rYw=; b=KDJQq5++JTYYJFGouCIARlZq/0hiFXMiQ6pncHRbY9gs8rSo9TAae/kG1iRQYZl4w3lhKb NCNvAUC820gGIKBA== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 2599C2C141; Fri, 5 Aug 2022 11:32:24 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Jaehoon Chung , Chris Morgan , Kever Yang Subject: [PATCH] power: pmic: rk8xx: Workaround pmic failure when probed before relocation Date: Fri, 5 Aug 2022 13:32:19 +0200 Message-Id: <20220805113219.7316-1-msuchanek@suse.de> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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