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 874E6C43334 for ; Mon, 18 Jul 2022 11:00:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C037683F69; Mon, 18 Jul 2022 13:00:10 +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="OuitTeU8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3SbALDUP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 042CF8402A; Mon, 18 Jul 2022 13:00:09 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (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 0725883020 for ; Mon, 18 Jul 2022 13:00:05 +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 C1E071F9DB; Mon, 18 Jul 2022 11:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658142004; 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=TL1TY2vMwZRKa5l76QkdAaF/B/nOvvVuP2dvc9CJ5Zo=; b=OuitTeU8/OV2AgKn21dpVJ+j4M6RrnSq/MkJ0/zlnnEpEgK4f0EZ7ulRrqmshVfvbpG+6A cw51cTCaPK5XDzvG+LaOhJ5Rv5jF/pYahOGerYs/duU3RcIu8IiIEZiwe2PqU43PwBOW1Z cybsty8vHscX9jMoLY6S7ag1g6V6ANM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658142004; 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=TL1TY2vMwZRKa5l76QkdAaF/B/nOvvVuP2dvc9CJ5Zo=; b=3SbALDUPSaW1hqI5xbKHuxRrmbJJ3WLvhSbZB2x2IVxPE++i9hlO/UNXeD3ioFwq5LA2aW cslrAorGh2P+doBg== 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 5D3412C141; Mon, 18 Jul 2022 11:00:04 +0000 (UTC) Date: Mon, 18 Jul 2022 13:00:03 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Xavier Drudis Ferran Cc: Quentin Schulz , u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang Subject: Re: [PATCH v2 5/5] rockchip: rock-pi-4: dts: spi: Make the index of the spi flash the same in SPL and U-Boot proper Message-ID: <20220718110003.GQ17705@kitsune.suse.cz> References: <20220715163035.GF2143@begut> <20220718090956.GA2796@begut> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220718090956.GA2796@begut> 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 Mon, Jul 18, 2022 at 11:09:56AM +0200, Xavier Drudis Ferran wrote: > El Mon, Jul 18, 2022 at 10:33:18AM +0200, Quentin Schulz deia: > > Hi Xavier, > > > > On 7/15/22 18:30, Xavier Drudis Ferran wrote: > > > Spi0 is not needed in SPL and SPL could be a little smaller without it, > > > but then the SF_DEFAULT_BOOT would have to be 0 to refer to spi1, and > > > that's confusing, because once U-Boot proper runs, it numbers the bus 1. > > > > > > Add spi0 to the pre-reloc and spl trees so that the flash is always > > > connected to bus 1. > > > > > > > Mmmm... Could we instead make U-Boot use the bus number from the alias in > > the aliases DT node? I think the mmc subsystem does this already and it > > would mean we don't need to enable unnecessary devices. Also, relying on > > boot order for the bus number is brittle in Linux, I don't know about > > U-Boot, but if we can avoid this assumption, it'd be great :) > > > > See: https://source.denx.de/u-boot/u-boot/-/commit/2243d19e5618122d9d7aba23eb51f63f2719dba5 > > for how to do it today? > > > > Maybe I should just drop this patch and try to define > CONFIG_SPL_DM_SEQ_ALIAS in configs/rock-pi-4-rk3399 instead ? > Let me test this a little... > > I have CONFIG_DM_SEQ_ALIAS=y but CONFIG_SPL_DM_SEQ_ALIAS unset. > > > > > Your patch series got sent with each commit in their individual thread > > I know. Sorry for the lapsus. I did it right in v1, wrong in v2, and will do right in v3. What is actually the correct naming here? We have in arch/arm/mach-rockchip/rk3399/rk3399.c const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe330000", [BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d0000/flash@0", [BROM_BOOTSOURCE_SD] = "/mmc@fe320000", }; } spl_boot_devices_tbl[] = { { BOOT_DEVICE_MMC1, "/mmc@fe320000" }, { BOOT_DEVICE_MMC2, "/sdhci@fe330000" }, { BOOT_DEVICE_SPI, "/spi@ff1d0000" }, }; which then presumably gets converted in common/spl/spl_mmc.c SPL_LOAD_IMAGE_METHOD("MMC1", 0, BOOT_DEVICE_MMC1, spl_mmc_load_image); SPL_LOAD_IMAGE_METHOD("MMC2", 0, BOOT_DEVICE_MMC2, spl_mmc_load_image); SPL_LOAD_IMAGE_METHOD("MMC2_2", 0, BOOT_DEVICE_MMC2_2, spl_mmc_load_image); We then have this in rk3399.dtsi: sdio0: mmc@fe310000 { compatible = "rockchip,rk3399-dw-mshc", sdmmc: mmc@fe320000 { compatible = "rockchip,rk3399-dw-mshc", sdhci: mmc@fe330000 { compatible = "rockchip,rk3399-sdhci-5.1", "arasan,sdhci-5.1"; and this in rk3399-u-boot.dtsi mmc0 = &sdhci; mmc1 = &sdmmc; and this in arch/arm/dts/rk3399-pinebook-pro.dts aliases { mmc0 = &sdio0; mmc1 = &sdmmc; mmc2 = &sdhci; }; mmc@fe310000: 3 mmc@fe320000: 1 (SD) mmc@fe330000: 0 (eMMC) This is not consistent with any of the above. Also on upstream kernel eMMC is mmc0 and SD mmc1 (somewhat consistently with the above), while on downstream kernel it seems these are mmc1 and mmc2, respectively. Thanks Michal