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 DCF8FC54EE9 for ; Tue, 20 Sep 2022 09:53:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A5B984C55; Tue, 20 Sep 2022 11:53:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1663667635; bh=zZmkqKaE9ulTwj4Qxqub/DiK3T6bdhju55fk3Wau91Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XHJho+a0Poswby8lsF8PMrsr4ZJK9ZeBqBjhtnHyFLAlgAdJ0O2XH4PgR0Y4x9GEW 89xUV7ZBOmOZF6YqyFsLWx4yrEQYEiwajyAyRV0LYCz2Lef+lfCrHtrNmm22gPjqvn CIxvBtjZd+Mwu9VYbdUirqzHDZTNzNsPSmzLkxfaQIZnHnXQzqL+z6ecNJKQXu81WT UB55Zr0fRJCm4gqQBvfXttohdhw2++2dn+H0gflg/JswDv7al78yWd1MJdewJ9yY3S l4Mza/N1mIn8MEE1b7WUFLShiU00nErG3GpLEm0xf5Ubo8ftlfy1Xs0WlzjTl8NE7c mQQuUX5ZRlo/w== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 70C9D810F6; Tue, 20 Sep 2022 11:53:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1663667633; bh=zZmkqKaE9ulTwj4Qxqub/DiK3T6bdhju55fk3Wau91Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SBmO9/k4UHd1m+Kypg8B+SLJwP0VausY5Mn/z1ItosyLsmgZPMuqzrQcO/SRZSWk6 5vG9LalKWJOjDENZRUEX1xa2Djmig/3CfVcWbfPgutbS+4hcB2Bfzn7LrFICSZwkgL gSWgKhoIap0GuWUbOZ9XiVnGL6hMyJMS+S2d7PGb6/79/4wtYUf0gcBDa1omaooZOI b3/tkINOVw4rzf+3dVfw6oBu3D+Nc2UWDxoIHZqPpYVu8mDFMA7ggUBos2UOYqLMVw KXw0WmINKDkm+YGqRGWM1J+FNP6yOn7MhWEEVja97v1Re0mBR6BakRudeHPblQlNrY UtTyyz6g0U7yw== Message-ID: <87fcb53f-e703-da09-2788-27100a702459@denx.de> Date: Tue, 20 Sep 2022 11:53:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] gpio: Get rid of gpio_hog_probe_all() To: Quentin Schulz , u-boot@lists.denx.de Cc: Heinrich Schuchardt , Samuel Holland , Simon Glass References: <20220919194502.106252-1-marex@denx.de> <9a6ef64c-e4c1-9714-887b-0079ffa06fcc@theobroma-systems.com> Content-Language: en-US From: Marek Vasut In-Reply-To: <9a6ef64c-e4c1-9714-887b-0079ffa06fcc@theobroma-systems.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 9/20/22 11:00, Quentin Schulz wrote: > Hi Marek, Hi, > On 9/19/22 21:45, Marek Vasut wrote: >> The gpio_hog_probe_all() functionality can be perfectly well replaced by >> DM_FLAG_PROBE_AFTER_BIND DM flag, which would trigger .probe() callback >> of each GPIO hog driver instance after .bind() and thus configure the >> hogged GPIO accordingly. >> >> Signed-off-by: Marek Vasut > > This patch breaks the U-Boot proper loading fallback mechanism on Puma > RK3399. > > https://lore.kernel.org/u-boot/20220915091432.789294-1-foss+uboot@0leil.net/ is the base I used, on top of commit d6a03711fd with your patch applied on top. > > I need the GPIO hogs to be probed before the SPL starts looking for > storage media for U-Boot proper because the GPIO hog is necessary on the > HW level for the eMMC and SPI-NOR flash to be usable. That _should_ still work. Look at common/spl/spl.c board_init_r() calls spl_init() calls spl_common_init() -> dm_init_and_scan() . That should bind and probe the GPIO hogs for you . The old gpio_hog_probe_all() happened AFTER all this. Can you use e.g. dm_dump_all() call in or around spl_board_init() to check whether the hogs got probed in SPL ? > Basically, we have a switch on the board disabling eMMC and SPI-NOR so > that we can boot from SD card, but we want to be able to load U-Boot > proper from eMMC/SPI-NOR. The GPIO hog overrides this HW switch. Use > case is to recover from a corrupted SPL without touching U-Boot proper. I don't quite get this -- isn't board_boot_order() or spl_boot_device() used for the purpose of selecting boot media , including fallback ? [...]