From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AC12C4338F for ; Thu, 19 Aug 2021 11:21:13 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7F7360720 for ; Thu, 19 Aug 2021 11:21:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B7F7360720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E901C83143; Thu, 19 Aug 2021 13:20:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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="oGNKXz0h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A58D682E67; Thu, 19 Aug 2021 13:20:09 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 F04758311C for ; Thu, 19 Aug 2021 13:20:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wr1-x42e.google.com with SMTP id z9so8497684wrh.10 for ; Thu, 19 Aug 2021 04:20:03 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=zJHf92KmvebZfnJDEYv7FAN96muIOAWQRLqByvjCIic=; b=oGNKXz0heV0SfDK4TnniwyTGB7y1OImfUz/3RavN7/OIxHfx8icLbzMCbCgtVecXrC Dq1rPcLk7kaY++pe9HXAfrEkTicxh9EArtfj2mlvFwvFHru7mVfeUMdQpYxSo5R30s0O Oi/rJDsWwYr6Pyibm0ULg9ihWl+eYkV09NTWC4dkrSIEIGd6BJspPNAclxvoCERnnK6q zFxnGrknIYRW1s0hwAOarE8SAlsGBFLvJpV3UAWIspRZJn+hTPzER8GyqFGREOPyuaJW jEMpfd11JdGrwP8yULWsEyA4/F8wGiSr5e30PZvWlM2sO3pi6T2p613xXmkMDUWRThip 7g4Q== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=zJHf92KmvebZfnJDEYv7FAN96muIOAWQRLqByvjCIic=; b=HclOA3bWUOLM6VTeGT4OHFhxVl3KdZoWFd+GTq+maftDZwqtiSLRXOIXjKpNNc0d/9 YYj1I+8B4qfPMeOx4o+A2nvhpuIBSokWiD1ow7rXdI3z9+6pdsxM6K4X+7coPrnjfzXq uPkrkCqIU3fVijQzOuZp5/KmjvboY9fgELIGFZAxSH/s+uBWDrio575511I/AbozPJZn EXPocvk9ExQfSVQQHU85ow8XPnlduin84TUc29qKwBZh55aaWkJnpr14691LtBnreRpB KJXe7BL5MtiTVNmESj3Efdwy+PE8jjCYTPE+T0grhDPaznU6+rW/uvD8mpdLTfQaSZCT G+5A== X-Gm-Message-State: AOAM533ZEKBik+VYEb3Lpovd02BP1w1dyWyNwT+OPGYsf+DwkcQUwIhi xm5ZA4lxf5KdKi62sDTLSz4J95mh13JPtHvn X-Google-Smtp-Source: ABdhPJyp5iA5vYKJuLVGvfc3sKp5UbrDdVLfzErEc43bLYsgXTrDBwQxHbnz038cQCOTP+81+ChW+w== X-Received: by 2002:adf:a2c4:: with SMTP id t4mr3162236wra.258.1629372003346; Thu, 19 Aug 2021 04:20:03 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id d8sm2748459wrv.20.2021.08.19.04.20.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Aug 2021 04:20:03 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Simon Glass , T Karthik Reddy Subject: [PATCH 06/10] xilinx: zynqmp: Check that DT is 64bit aligned Date: Thu, 19 Aug 2021 13:19:45 +0200 Message-Id: <1b7f2726c54f1a8cc3cab22a1e4084dc86da1063.1629371983.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean DT needs to be 64bit aligned. If it is not fdt64_to_cpu will fail when try to read information about reserved memory. The system ends in exception without any clue what's going it. That's why detect not aligned DT and panic to show where the issue is coming from. Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index e43177ea4e48..ea15e62eb21e 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -470,6 +470,9 @@ ulong board_get_usable_ram_top(ulong total_size) phys_addr_t reg; struct lmb lmb; + if (!IS_ALIGNED((ulong)gd->fdt_blob, 0x8)) + panic("Not 64bit aligned DT location: %p\n", gd->fdt_blob); + /* found enough not-reserved memory to relocated U-Boot */ lmb_init(&lmb); lmb_add(&lmb, gd->ram_base, gd->ram_size); -- 2.32.0