From patchwork Sat Jan 20 14:38:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 863972 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; secure) header.d=nelint.com header.i=@nelint.com header.b="jIoG/k3y"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zP0kD4zGrz9s7M for ; Sun, 21 Jan 2018 01:41:08 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4F8CBC22029; Sat, 20 Jan 2018 14:41:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7E4F9C21F3A; Sat, 20 Jan 2018 14:41:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E4BEFC21F1F; Sat, 20 Jan 2018 14:41:01 +0000 (UTC) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by lists.denx.de (Postfix) with ESMTPS id 3DD3BC21CB1 for ; Sat, 20 Jan 2018 14:41:01 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id t12so3616143pfg.2 for ; Sat, 20 Jan 2018 06:41:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nelint.com; s=google; h=from:to:cc:subject:date:message-id; bh=Bu6DTh44wBeDJia/wekmWhuAJ6WJmqWXSL2MIiRCkjs=; b=jIoG/k3yi2tBKaPbKVsbV5fpGWjjuaktvSgCehaFzvAOYg3l27gwZMyKxvxR+HP1za LjjdjIjj1v8Qu5AvqA30vvGkH3l4y7F2dbSS21uIegwTLLskV+kfQpm9+adGmB+mYUzy aUG9Dw4mKpVt9qjM6s1YRSs19RFzaxvIKpO24= 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; bh=Bu6DTh44wBeDJia/wekmWhuAJ6WJmqWXSL2MIiRCkjs=; b=Ybt7QGuXVTUmEl0dxBgrWzS5BbP0l95pYHqsh9jkFhjq/YsCvlM3F+0vXDZkfj+Zgg 5cGAsf9CQMqWVcuoUA2Rnd6y7+MyWN/Gq19dZ0Vi3ym2rWYM5uNyg7R53JJz5fOdObUx hAJvJgQJkBnItCc99WxpLSwGa/GA4JnLOjLRykJYnrEpcjjmM/Wq67HqXNFLnd5jquyd MTgG1CsT7caJWe4RCoVBwcSriRXryDaJNslW8N2bl4SKTVQFQUQipc8RzQdjilu3+OvX qqs6eUgWfMujdvWtpA3wouatgECIVWAxP5+zQWhqhX5+Hcpy9smuLqO7SrFKbsCkLPbF /8rw== X-Gm-Message-State: AKwxytcV7/+DJajSX6rzkDHVKSqczspbr6aTkMICtZ5wYjuZLqtE64jj x7y8846f3mXN7xFwZvk78NqdnpPb X-Google-Smtp-Source: AH8x227kcf/ww2vyh98E/VYf5GqtXNxb8cu0oSw+8j04fqRAACs9OKXZdcZHUkG8FO2KOx2RSKhUyw== X-Received: by 10.99.121.132 with SMTP id u126mr2181224pgc.275.1516459259338; Sat, 20 Jan 2018 06:40:59 -0800 (PST) Received: from localhost.localdomain ([2600:8800:1301:f1a0:402b:86ab:eb61:5468]) by smtp.gmail.com with ESMTPSA id s89sm3388843pfk.35.2018.01.20.06.40.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jan 2018 06:40:58 -0800 (PST) From: Eric Nelson To: u-boot@lists.denx.de Date: Sat, 20 Jan 2018 07:38:53 -0700 Message-Id: <1516459133-10105-1-git-send-email-eric@nelint.com> X-Mailer: git-send-email 2.7.4 Cc: fabio.estevam@nxp.com, stefan.agner@toradex.com Subject: [U-Boot] [RFC PATCH] SPL: allow fall-back to SDP boot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When SDP is enabled, allow it to be invoked as a fall-back to allow re-programming a board with a full U-Boot loaded over USB. Signed-off-by: Eric Nelson --- Since SDP loading is triggered through BOOT_DEVICE_BOARD, I'm not sure if this should be specific to SDP. common/spl/spl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index 76c1963..5bbd4ed 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -373,6 +373,9 @@ static int boot_from_devices(struct spl_image_info *spl_image, void board_init_r(gd_t *dummy1, ulong dummy2) { +#ifdef CONFIG_SPL_USB_SDP_SUPPORT + int i; +#endif u32 spl_boot_list[] = { BOOT_DEVICE_NONE, BOOT_DEVICE_NONE, @@ -417,6 +420,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2) #endif board_boot_order(spl_boot_list); +#ifdef CONFIG_SPL_USB_SDP_SUPPORT + for (i = 0; i < ARRAY_SIZE(spl_boot_list); i++) { + if (spl_boot_list[i] == BOOT_DEVICE_NONE) { + spl_boot_list[i] = BOOT_DEVICE_BOARD; + break; + } + } +#endif + if (boot_from_devices(&spl_image, spl_boot_list, ARRAY_SIZE(spl_boot_list))) { puts("SPL: failed to boot from all boot devices\n");