From patchwork Tue Sep 3 07:52:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Leontiev X-Patchwork-Id: 1156857 X-Patchwork-Delegate: trini@ti.com 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; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ks3VSuvY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Mzh92myrz9s7T for ; Tue, 3 Sep 2019 17:52:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 64D53C21DFD; Tue, 3 Sep 2019 07:52:32 +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=FREEMAIL_FROM, 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 CD690C21C50; Tue, 3 Sep 2019 07:52:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1DF6AC21C50; Tue, 3 Sep 2019 07:52:29 +0000 (UTC) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by lists.denx.de (Postfix) with ESMTPS id A69EAC21BE5 for ; Tue, 3 Sep 2019 07:52:28 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id e17so4022038ljf.13 for ; Tue, 03 Sep 2019 00:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A1NftoCLdX6sGFZRISkyoZXaidD8UGYy6Vgx/TFDHMM=; b=ks3VSuvYXbnLPoLnHkH+33ophd56XD49gHUQsF/KLEisigEVjIGmylu/o1ymMtBaPh BDf9ZdstDAvz5Rp0NY36Yc0eleXn7m0CYUSSoLw3vb86NKJdUQXqC6ancvu70//60zJc tS6soVL0fiokbcNaceNEhsVeWYoSo/yDloEAoTmfzQ/l5Bx/O9KhXcOcliUBf7sBePe/ Tu2yq/HWmf2YF8a2f1w0NKLGoF8GNzx5hfquZGev98gYWEIm+q+GCxj8/lW14DCGmtIu FjNNxntguMI4uHGDFaga59AZEKlhmXlg4OUX0tJWtA/6yY7Zpgk/xmnDpHoc7k8bz/y2 3rwA== 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=A1NftoCLdX6sGFZRISkyoZXaidD8UGYy6Vgx/TFDHMM=; b=eD5NycLT020Fb/V+R61r4gLZDfAIV34/BJAJ00pPjdjM+sRMvIjq/osm9v8BzlfE8d 6YXMZbIgEvfLRzSTcaPGvWyJlqQhKewKnAluoFdwHFOF8IdwlpVmGPOVpG7igVfYRMLg Cr4wZ3I5TL4pU2V9s5EGJjm4BaRhQJweDikiwlltTOS/J32Mj12sZs7mJir5GseFQup1 v0sgUeOBavVkjGMIYMdzTOKrzZtjlmYitk68YFnt4r4Kyfl7x3MGlqsO0bj5titz9Jaf v8eiis+JzkTbk6589zVAzmMtPeJim2ADVHzhF/XV/NThvf6HaqJzg984g9pJt+EtxBJ0 G9Og== X-Gm-Message-State: APjAAAXvaQASDO5ySL8AtDdjSj/DcC+1bLHSlhTnFvbPPDgbhwqhhW59 AaN4Wp+/rrWqyMzVO7h64cg1CQ8H X-Google-Smtp-Source: APXvYqySZJk+HuvxUfMIZvScvVvGZbKF9A01BUSaqiVbKXB5P+kNfE2PsWabxS3mf2iflh/pA/vbWw== X-Received: by 2002:a2e:9b13:: with SMTP id u19mr19300207lji.40.1567497147844; Tue, 03 Sep 2019 00:52:27 -0700 (PDT) Received: from vostrobook.elvees.com ([37.203.242.33]) by smtp.gmail.com with ESMTPSA id a23sm911961lfl.66.2019.09.03.00.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 00:52:27 -0700 (PDT) From: Anton Leontiev To: u-boot@lists.denx.de Date: Tue, 3 Sep 2019 10:52:24 +0300 Message-Id: <20190903075224.9404-1-scileont@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190823144043.26792-1-scileont@gmail.com> References: <20190823144043.26792-1-scileont@gmail.com> MIME-Version: 1.0 Cc: Anton Leontiev Subject: [U-Boot] [PATCH v2] cmd: pxe: Use internal FDT if retrieving from FDTDIR fails 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Anton Leontiev As FDTDIR label doesn't specify exact file to be loaded, it should not fail if no file exists in the directory. In this case try to boot with internal FDT if it exists. Signed-off-by: Anton Leontiev --- cmd/pxe.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/cmd/pxe.c b/cmd/pxe.c index 2059975446..1eec6d29bf 100644 --- a/cmd/pxe.c +++ b/cmd/pxe.c @@ -727,11 +727,14 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) /* * fdt usage is optional: - * It handles the following scenarios. All scenarios are exclusive + * It handles the following scenarios. * - * Scenario 1: If fdt_addr_r specified and "fdt" label is defined in - * pxe file, retrieve fdt blob from server. Pass fdt_addr_r to bootm, - * and adjust argc appropriately. + * Scenario 1: If fdt_addr_r specified and "fdt" or "fdtdir" label is + * defined in pxe file, retrieve fdt blob from server. Pass fdt_addr_r to + * bootm, and adjust argc appropriately. + * + * If retrieve fails and no exact fdt blob is specified in pxe file with + * "fdt" label, try Scenario 2. * * Scenario 2: If there is an fdt_addr specified, pass it along to * bootm, and adjust argc appropriately. @@ -795,9 +798,13 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) int err = get_relfile_envaddr(cmdtp, fdtfile, "fdt_addr_r"); free(fdtfilefree); if (err < 0) { - printf("Skipping %s for failure retrieving fdt\n", - label->name); - goto cleanup; + bootm_argv[3] = NULL; + + if (label->fdt) { + printf("Skipping %s for failure retrieving FDT\n", + label->name); + goto cleanup; + } } } else { bootm_argv[3] = NULL;