From patchwork Wed Jan 30 14:41:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 1033584 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; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="DsZwZuxI"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43qR0C40Hsz9sBZ for ; Thu, 31 Jan 2019 01:42:03 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3CFE1C21DD7; Wed, 30 Jan 2019 14:42:00 +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=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 50702C21C2C; Wed, 30 Jan 2019 14:41:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8E5FEC21C2C; Wed, 30 Jan 2019 14:41:57 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lists.denx.de (Postfix) with ESMTPS id 19FF2C21C27 for ; Wed, 30 Jan 2019 14:41:56 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0UEfrj9001423; Wed, 30 Jan 2019 08:41:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1548859313; bh=lCaBMBz+wuuc0A3gu3Qge4uuyhIc6TIC8crFhjnTr9o=; h=From:To:CC:Subject:Date; b=DsZwZuxIkJae1YGTTVqMVSKBX6pfPJkat76Z3lCR703DOYaVFShG9QWBtnRIQZX8i l3Pl8fZ8+jcngZG2iijij1SqwnjSbQUiFIsjh4SLo1wyuvYz3zzfSbbJa98/fuMlvZ hfcfs9n0vGNxK2EqTpI/FVuChqc4O4txoQcOfZJE= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0UEfrNf070064 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Jan 2019 08:41:53 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 30 Jan 2019 08:41:53 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 30 Jan 2019 08:41:53 -0600 Received: from a0393675ula.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0UEfnct019547; Wed, 30 Jan 2019 08:41:50 -0600 From: Keerthy To: , , Date: Wed, 30 Jan 2019 20:11:45 +0530 Message-ID: <20190130144145.5389-1-j-keerthy@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: t-kristo@ti.com, u-boot@lists.denx.de Subject: [U-Boot] [RFC PATCH] common: fdt_support: Remove fdt_add_mem_rsv in fdt_shrink_to_minimum 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" With introduction of commit: a156c47e39ad: tftp: prevent overwriting reserved memory tftp with loadaddr is failing for Images of the size bigger than SPL. The issue is that SPL image is located at bootaddr and dtb is allocated at bootaddr + spl_size. The region where dtb is present is marked reserved. So when the tftp tries to load the Image it tries to find a location from loadaddr to the first reserved memory region which is the dtb base address. The max_size obtained is pretty less and hence tftp fails with the below error: TFTP error: trying to overwrite reserved memory... Signed-off-by: Keerthy --- I am sure there are better solutions so just wanted to know if there is one. common/fdt_support.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 42583e3ed8..2bb101e56e 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -633,11 +633,6 @@ int fdt_shrink_to_minimum(void *blob, uint extrasize) /* Change the fdt header to reflect the correct size */ fdt_set_totalsize(blob, actualsize); - /* Add the new reservation */ - ret = fdt_add_mem_rsv(blob, map_to_sysmem(blob), actualsize); - if (ret < 0) - return ret; - return actualsize; }