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 X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3593DC4708F for ; Wed, 2 Jun 2021 02:19:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2723761159 for ; Wed, 2 Jun 2021 02:19:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2723761159 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B715382B51; Wed, 2 Jun 2021 04:19:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cU/yqjhr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFFBA82CB2; Wed, 2 Jun 2021 04:19:22 +0200 (CEST) Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (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 D8D4B82AC4 for ; Wed, 2 Jun 2021 04:19:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=email2tema@gmail.com Received: by mail-io1-xd2e.google.com with SMTP id r4so888339iol.6 for ; Tue, 01 Jun 2021 19:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ucvvlLwonsk1xnpWSJerjuXXAOt1FF6O8Jp5aE5aQkE=; b=cU/yqjhrcjENG7uL+kOx/hqD/RDUNtURnatDdd/6mxVypl+wRcP1+ToXX0zwNp7CN6 kzyRxc76aN1/yfSDaS/RK2rglH01/Loyt6c5za4FkQJoyDy7KnL0rFsVLr2PlLY6cAai 4dCkpe1Yf5EA+43kdGv6n6H5ftlKz1iNgQbYx4A2Wq0ghDRpFN6Gu3yGSHZGzj41gvXa FB9gbbas0hqsB8fanoLNfmivc+jzpscMZHAVo4H6nEUF3eNtkDpEzQm9sos6bXtUKjdx btPXuKZN6USssu2o7+RkYMQyhyR2UBZqb4KfsHUqQS61c1eUAaOvDkHP0BgS/Mq0aY6e krig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ucvvlLwonsk1xnpWSJerjuXXAOt1FF6O8Jp5aE5aQkE=; b=rKxNS5tltfs/BfE7NP3sJah+YIoWwlBRdxu+sYTt+1q/aq+vUMQyHrjlSyn6PwLcR2 s3wc2f9Iu9IrNtGHuwQtnqiH5SrJC+2P0LyJjyHCoIrKx7ukwpKO5Ef2veagiCYVsZK4 yq8xcbuFlBWyZIxcHDt5Nt7A+fTXWIJOaQwhjzqMxuG+letC7GvU+FrEv6tEaFQRSnqE QJAtqoTbkuAMV5PfIQ1ubdenQdrAcfA4aITYAPghdxGB/Oumx7Xs4GtHzRDFyF1Z0vwG pEWAefTiBPqMWwJ7PeueK5dgbKsvXvQKRJHW7s+l3WE1Z/aS2HlmPxWsSo/cIdk5bc+0 sm+Q== X-Gm-Message-State: AOAM531jF8KNrlBsMo0i3TLcapDqqcjPUEgB8K4XT5+FVEMrt5KVRarD hU77XZSb08iEEnQou/teOX0Il5ByE+cOixQuPRk= X-Google-Smtp-Source: ABdhPJydGKJOSC4YxhjBp8F8+Xz5Q0TGuyfzYYHFoShCDwWiw2uJfvpcXWvcDlgmLzGuXuRT8u07D1DYqhZkfyiK39Q= X-Received: by 2002:a6b:c9c2:: with SMTP id z185mr11019197iof.27.1622600358578; Tue, 01 Jun 2021 19:19:18 -0700 (PDT) MIME-Version: 1.0 References: <20210526093227.273974-1-art@khadas.com> <19b5f7b1-f77e-4e0b-827e-4485fd373fba@rock-chips.com> In-Reply-To: <19b5f7b1-f77e-4e0b-827e-4485fd373fba@rock-chips.com> From: Art Nikpal Date: Wed, 2 Jun 2021 10:19:06 +0800 Message-ID: Subject: Re: [PATCH] rk3399: boot_devices fix spinor node name To: Kever Yang Cc: sjg@chromium.org, Jagan Teki , sunil@amarulasolutions.com, u-boot@lists.denx.de, Artem Lapkin , nick@khadas.com, Gouwa Wang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean hi > why "/spi@ff1d0000" is not work, this drivers should be work for other bo= ards before. i`m sure now is not work (maybe nobody test it ) i have test it and can see its doesn't works properly because /spi@ff1d0000 just spi bus node - its not SPINOR-Flash node as was written before if we check u-boot,spl-boot-order for rk3399 boards is must be bootable devices list (for example &norflash | &spi_flash | &spliflash is alias for /spi@ff1d0000/flash@0 ) grep same-as-spl arch/arm/dts/*rk3399* | grep flash arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi: u-boot,spl-boot-order =3D "same-as-spl", &sdhci, &spiflash, &sdmmc; arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi: "same-as-spl", &norflash, &sdhci, &sdmmc; arch/arm/dts/rk3399-rockpro64-u-boot.dtsi: u-boot,spl-boot-order =3D "same-as-spl", &spi_flash, &sdmmc, &sdhci; arch/arm/dts/rk3399-roc-pc-u-boot.dtsi: u-boot,spl-boot-order =3D "same-as-spl", &spi_flash, &sdhci, &sdmmc; "same-as-spl" same must be translated to same devices ( &spi_flash, &sdhci, &sdmmc ) grep "same device the SPL was" -A22 arch/arm/mach-rockchip/spl-boot-order.c /* Handle the case of 'same device the SPL was loaded from' */ if (strncmp(conf, "same-as-spl", 11) =3D=3D 0) { conf =3D board_spl_was_booted_from(); if (!conf) continue; } /* First check if the list element is an alias */ alias =3D fdt_get_alias(blob, conf); if (alias) conf =3D alias; /* Try to resolve the config item (or alias) as a path */ node =3D fdt_path_offset(blob, conf); if (node < 0) { debug("%s: could not find %s in FDT\n", __func__, conf); continue; } /* Try to map this back onto SPL boot devices */ boot_device =3D spl_node_to_boot_device(node); if (boot_device < 0) { debug("%s: could not map node @%x to a boot-device\n", grep "UCLASS_SPI_FLASH" arch/arm/mach-rockchip/spl-boot-order.c } else if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node, if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent)) grep SPINOR arch/arm/mach-rockchip/rk3399/rk3399.c [BROM_BOOTSOURCE_SPINOR] =3D "/spi@ff1d0000", but its not SPI_FLASH and spl_node_to_boot_device(/spi@ff1d0000) return always -1 and u-boot,spl-boot-order =3D "same-as-spl" never works properly for spinorflas= h PS: i have test spi@ff1d0000/flash@0 works properly as expected On Tue, Jun 1, 2021 at 8:09 PM Kever Yang wrote= : > > Hi Artem, > > On 2021/5/26 =E4=B8=8B=E5=8D=885:32, Artem Lapkin wrote: > > Problem: board_spl_was_booted_from return wrong boot_devices[3] value > > /spi@ff1d0000 and same-as-spl dont work properly for SPINOR flash > > because arch/arm/mach-rockchip/spl-boot-order.c spl_node_to_boot_device > > need parse SPINOR flash node as UCLASS_SPI_FLASH > > > > spl-boot-order: same-as-spl > *** BOOT_SOURCE_ID 3 (2:emmc 3:spi 5:sd .= .. > > /spi@ff1d0000 > board_boot_order: could not map node @618 to a boot-dev= ice > > /sdhci@fe330000 > /mmc@fe320000 > > > > Solution: just change it to /spi@ff1d0000/flash@0 > > I don't understand why the solution is add "/flash@0" and why > "/spi@ff1d0000 " is not work, this drivers should be work for other > boards before. > > > Thanks, > > - Kever > > > > > spl-boot-order: same-as-spl > *** BOOT_SOURCE_ID 3 (2:emmc 3:spi 5:sd .= .. > > /spi@ff1d0000/flash@0 > /sdhci@fe330000 > /mmc@fe320000 > > > > Signed-off-by: Artem Lapkin > > --- > > arch/arm/mach-rockchip/rk3399/rk3399.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-roc= kchip/rk3399/rk3399.c > > index 869d2159..69e0c8c2 100644 > > --- a/arch/arm/mach-rockchip/rk3399/rk3399.c > > +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c > > @@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR; > > > > const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] =3D { > > [BROM_BOOTSOURCE_EMMC] =3D "/sdhci@fe330000", > > - [BROM_BOOTSOURCE_SPINOR] =3D "/spi@ff1d0000", > > + [BROM_BOOTSOURCE_SPINOR] =3D "/spi@ff1d0000/flash@0", > > [BROM_BOOTSOURCE_SD] =3D "/mmc@fe320000", > > }; > > > >