From patchwork Fri Aug 11 08:52:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pantelis Antoniou X-Patchwork-Id: 800479 X-Patchwork-Delegate: sjg@chromium.org 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="signature verification failed" (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="kpI8WOtf"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xTJsM5MVhz9t2W for ; Fri, 11 Aug 2017 19:01:43 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 81177C21DB3; Fri, 11 Aug 2017 08:58: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_NONE, 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 A3226C21DF9; Fri, 11 Aug 2017 08:56:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CD407C21D7D; Fri, 11 Aug 2017 08:55:46 +0000 (UTC) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by lists.denx.de (Postfix) with ESMTPS id 4AF2DC21C4F for ; Fri, 11 Aug 2017 08:55:43 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id k71so11172603wrc.2 for ; Fri, 11 Aug 2017 01:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ov7QMgBR6DpT4Gf9v5+uwKAEp+hqDJUXmZZFY7hh39Q=; b=kpI8WOtfbZ3IkzPHVqbJiltqkC07Zxi6kOop8c8wa4fBEcwT0v3bgpSj9IT4izR6yu XE1lLH9toXP5HxfcL3AUiT5pil3wjmbuhgGnPSYjpb3WziuwTZo9nOpWJkt4l4oDOEZk TC9fh+496mU2UVc4yzbynQAkYpyi7gQX3NM14= 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; bh=ov7QMgBR6DpT4Gf9v5+uwKAEp+hqDJUXmZZFY7hh39Q=; b=X+F4H/9nOfz3O1pW7TZJLJKFOubOGtz4eZszQBjQfTugF2p5pULlEU8U22ar7UKvhl BPQ0XnqVM0Co+naq1RhpAZKvkKwYwKcCIXsMVK5pumcYFWjVKcS7dAZK4ThbXHrEKJ42 1ldYQD/zsK7Z1+CdeRQCST72U4sD5FgFLu0cEXUcSCiPqCD7Gub5E75dZ5O4EAnGTaxC xeaUtR7t1YNz3b6QKgcpCea3k1dtaQWHOlRBq6y5t2A1lAwKyVZevDdLRBID3w04661x B4Jg2XnoLUH8k/dwl6bcDRk9JSuVvcsXUBPMdxKszdkP8a1v/zEbocRuU1Q1oZIxhPBl QWUg== X-Gm-Message-State: AHYfb5hgAs6ifaxQ6IBe/WInuvGntM/lBmBbPav1tuMSVu0N4moGjbbj /7PZnSbCqCkm7SqA X-Received: by 10.223.146.164 with SMTP id 33mr10809631wrn.134.1502441742838; Fri, 11 Aug 2017 01:55:42 -0700 (PDT) Received: from localhost.localdomain ([195.97.110.117]) by smtp.gmail.com with ESMTPSA id o71sm759811wmg.15.2017.08.11.01.55.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Aug 2017 01:55:42 -0700 (PDT) From: Pantelis Antoniou To: Tom Rini Date: Fri, 11 Aug 2017 11:52:42 +0300 Message-Id: <1502441568-22896-5-git-send-email-pantelis.antoniou@konsulko.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1502441568-22896-1-git-send-email-pantelis.antoniou@konsulko.com> References: <1502441568-22896-1-git-send-email-pantelis.antoniou@konsulko.com> Cc: Marek Vasut , Pantelis Antoniou , Tero Kristo , u-boot@lists.denx.de, Maxime Ripard , Stefan Roese , Alan Ott Subject: [U-Boot] [PATCH v2 04/10] fdt-overlay: Spit out a descriptive failure warning 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" The most common trouble with overlays appears to be miscompiled blobs without the -@ option. In case of an error, spit out a descriptive error message. Signed-off-by: Pantelis Antoniou --- cmd/fdt.c | 8 ++++++++ common/image-fit.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cmd/fdt.c b/cmd/fdt.c index 05e19f8..9f192be 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -654,6 +654,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) unsigned long addr; struct fdt_header *blob; int ret; + bool has_symbols; if (argc != 3) return CMD_RET_USAGE; @@ -666,9 +667,16 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (!fdt_valid(&blob)) return CMD_RET_FAILURE; + ret = fdt_path_offset(working_fdt, "/__symbols__"); + has_symbols = ret >= 0; + ret = fdt_overlay_apply(working_fdt, blob); if (ret) { printf("fdt_overlay_apply(): %s\n", fdt_strerror(ret)); + if (!has_symbols) { + printf("working fdt does did not have a /__symbols__ node\n"); + printf("make sure you've compiled with -@\n"); + } return CMD_RET_FAILURE; } } diff --git a/common/image-fit.c b/common/image-fit.c index cb089ea..28140f1 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1946,6 +1946,7 @@ int boot_get_fdt_fit(bootm_headers_t *images, ulong addr, const char *uname; void *base, *ov; int i, err, noffset, ov_noffset; + bool has_symbols; #endif fit_uname = fit_unamep ? *fit_unamep : NULL; @@ -2038,9 +2039,18 @@ int boot_get_fdt_fit(bootm_headers_t *images, ulong addr, fdt_noffset = err; goto out; } + + err = fdt_path_offset(base, "/__symbols__"); + has_symbols = err >= 0; + err = fdt_overlay_apply(base, ov); if (err < 0) { - printf("failed on fdt_overlay_apply\n"); + printf("failed on fdt_overlay_apply(): %s\n", + fdt_strerror(err)); + if (!has_symbols) { + printf("base fdt does did not have a /__symbols__ node\n"); + printf("make sure you've compiled with -@\n"); + } fdt_noffset = err; goto out; }