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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 C7027C4338F for ; Sun, 25 Jul 2021 23:32:49 +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 13A3C60F11 for ; Sun, 25 Jul 2021 23:32:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 13A3C60F11 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=yifangu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50D9883250; Mon, 26 Jul 2021 01:32:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=yifangu.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id F2CE58323E; Mon, 26 Jul 2021 01:16:49 +0200 (CEST) Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (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 29A6483232 for ; Mon, 26 Jul 2021 01:16:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=yifangu.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=gyf304@gmail.com Received: by mail-qt1-f182.google.com with SMTP id h10so5865312qth.5 for ; Sun, 25 Jul 2021 16:16:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jjANarusn9/hj9n7M6Mm879s28pRoMQVeNyqL93uqy8=; b=q3PiJOYtsVLcSvNoftTMRXumyXfCznufLiIW3uB3pe9yhtxJ42nlI1yGFn6IiWvZnc AgLyrOR/i1Gyo9g18tnU3ziuJgzsjIn3eUw+vunXfgFgaUBIVSKqZAGwe2ik4gNBCWGu 57V+TdGo3rD6zdnSM1xHh3oR63qRwVz6JPileTLc17nokkJH0KXB7jm2reBLsmFmKxAa O3jadfHiCkX9iNZMh2UKPmGaI4bf8uXfxA7Q7yWctEy5sbFtKowVcPsjUFjnpqcVlmEi Xxy+Ms0sN+urqIjXmXMPX9NIIx4VVZUYCQ/oh+JHWvcH3PztAmfnXpC+GbCGBGmCaSGu QM0A== X-Gm-Message-State: AOAM531M7prOauYSGTLhyLAIInkaB3NFIpCQMEDVfsks8W6NB16XyHCQ 6q0T5qNm6blyuA5V2G43ivhiSBy0asNGcaUA X-Google-Smtp-Source: ABdhPJyvFEaRfqCaAT3+EuLfIcQtEnXXVfS2Hl+xvVuwoxpmjSv+nfn3Bql4qzWw/U9cOVKiSwCd2w== X-Received: by 2002:a05:622a:1105:: with SMTP id e5mr13282031qty.268.1627255000806; Sun, 25 Jul 2021 16:16:40 -0700 (PDT) Received: from yifangu-Virtual-Machine.mshome.net (pool-100-6-159-43.pitbpa.fios.verizon.net. [100.6.159.43]) by smtp.gmail.com with ESMTPSA id u184sm17754694qkd.53.2021.07.25.16.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jul 2021 16:16:40 -0700 (PDT) From: Yifan Gu To: u-boot@lists.denx.de Cc: Yifan Gu , Jagan Teki , Andre Przywara , Icenowy Zheng , George Hilliard Subject: [PATCH 05/27] sunxi: suniv: add boot sequence for SPL to try Date: Sun, 25 Jul 2021 19:16:14 -0400 Message-Id: <20210725231636.879913-6-me@yifangu.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210725231636.879913-1-me@yifangu.com> References: <20210725231636.879913-1-me@yifangu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 26 Jul 2021 01:32:10 +0200 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.103.2 at phobos.denx.de X-Virus-Status: Clean From: Icenowy Zheng The BROM of suniv do not pass the info of boot media to SPL. Add boot sequence for SPL to try again for the available boot media. Signed-off-by: Icenowy Zheng Signed-off-by: Yifan Gu --- arch/arm/mach-sunxi/board.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c index 3b1a79eb5e..e84687973a 100644 --- a/arch/arm/mach-sunxi/board.c +++ b/arch/arm/mach-sunxi/board.c @@ -334,10 +334,32 @@ unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc, return sector; } + +#ifndef CONFIG_MACH_SUNIV u32 spl_boot_device(void) { return sunxi_get_boot_device(); } +#else +/* + * suniv BROM do not pass the boot media type to SPL, so we try with the + * boot sequence in BROM: mmc0->spinor->fail. + */ +void board_boot_order(u32 *spl_boot_list) +{ + /* + * See the comments above in sunxi_get_boot_device() for infomation + * about FEL boot. + */ + if (!is_boot0_magic(SPL_ADDR + 4)) { + spl_boot_list[0] = BOOT_DEVICE_BOARD; + return; + } + + spl_boot_list[0] = BOOT_DEVICE_MMC1; + spl_boot_list[1] = BOOT_DEVICE_SPI; +} +#endif void board_init_f(ulong dummy) { -- 2.25.1