From patchwork Fri Sep 4 14:41:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1357552 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=dPvf5AtD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjgNr1RCzz9sVW for ; Sat, 5 Sep 2020 00:41:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6E3F682273; Fri, 4 Sep 2020 16:41:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="dPvf5AtD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 822B382286; Fri, 4 Sep 2020 16:41:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) (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 A69C281F67 for ; Fri, 4 Sep 2020 16:41:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x541.google.com with SMTP id q21so6378065edv.1 for ; Fri, 04 Sep 2020 07:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eCx4exhUYPUzg0NZonOh0gDq+oFZslpPkwNldU7PD28=; b=dPvf5AtDH/xk0wl9ww70gXziHmQqoZ3TO/9SBhGgl05ZNOxI/8/vhtAHmp0M5vbWps U48DOoWbJyrsM7vmf98f0TO2pPRG/QU+svcbz4ewKg+x/ZheeHk5P2MlEQ/y7PZY4Iu3 fGZYGMUyerXKprEnLBflvM2XHM124rY7/3MHqfVsvLu7nWE59RWTkixZq2IPqIcXCGkr wdBJVL4EyDPSp81CDgXYaVzLihM+Kj0d7hY2mFb+HkhPHmf3vz1O+O0s7l8VKkSj9WhM qipHEP23UI8Im6PkT+7cCwrXXG06+PKmZm50JjR9UmD5cV2b/3NvbTRFSiv3pCirXgci KtfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=eCx4exhUYPUzg0NZonOh0gDq+oFZslpPkwNldU7PD28=; b=kjCdnXJ/QAK3GI1hTUm88A2DlKB7q6swKnFl+4QQnnF+WXgC7t1o8Cr0NEb8789DWH 5IsxaeEdjI5ofqO9UotykBhUTROb/EcWNsvfhRU+Bkv8/ihXQU1I31QS3GdvRBmALRss 0/CUsMCeDJ3b2jD1Q6gSTZ36BB+MeFc+uom//X9FJ4jQoUfjMNfbkhZNCA/UXih1RT5V GMF8Muq2J1VhJaM+/L8AifF6DnMnEWHOVVv0EJK439EFbsuG9AgULfJbVlHrjGq/vqCh y2YdhrxHhHppNYCN5zz5bq1poDVbBQy+YLOy3VecVFQPxlx3H0SeCn3aaqCVTKgrPDJ8 8haQ== X-Gm-Message-State: AOAM53395YlKMiw5clBbjwTc1G5roNye2a34p4Gh1Gbk3QOo2vON/Y1i EXDgZn9eDxETZJP3kP/+3smIIEG163+sPg== X-Google-Smtp-Source: ABdhPJx0kKYZGouKTF3KO4P64zRK9j0+vf6zQOVSI0+/P+7x2q4kt9lnp0WBJM/62L3xZ/szOw1+JA== X-Received: by 2002:a05:6402:1584:: with SMTP id c4mr9102507edv.192.1599230490924; Fri, 04 Sep 2020 07:41:30 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id v17sm6267397eju.22.2020.09.04.07.41.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Sep 2020 07:41:29 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com, edgar.iglesias@xilinx.com Cc: Ibai Erkiaga , Michal Simek , Simon Glass Subject: [PATCH] xilinx: common: Do not save fdt_blob to bss section Date: Fri, 4 Sep 2020 16:41:25 +0200 Message-Id: <863bbbb48c57f6f5e0d6edeb771da4239389ab51.1599230483.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean For SPL flow without specifying address for DT loading DTB is automatically appended behind U-Boot code. Specifically _end symbol is used. Just behind it there is place for bss section. It means if early code is using static variable and there is a write to this variable DTB file is corrupted if variable is located between DTB start and end. In this particular case offset of this variable from bss section start is very small (0x40) that's why DT is currupted which breaks this boot flow. Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 569a418dbbff..06331cd88311 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -45,7 +45,7 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) #if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE) void *board_fdt_blob_setup(void) { - static void *fdt_blob; + void *fdt_blob; #if !defined(CONFIG_VERSAL_NO_DDR) && !defined(CONFIG_ZYNQMP_NO_DDR) fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;