From patchwork Mon Aug 23 07:37:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1519573 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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=VXY2Jx79; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4GtPKD0rVTz9sWS for ; Mon, 23 Aug 2021 17:40:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F1F583211; Mon, 23 Aug 2021 09:38:56 +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="VXY2Jx79"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F423831FD; Mon, 23 Aug 2021 09:38:25 +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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 419B9831C4 for ; Mon, 23 Aug 2021 09:38:09 +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-ej1-x62b.google.com with SMTP id w5so35018859ejq.2 for ; Mon, 23 Aug 2021 00:38:09 -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=TqBkYs60VbLNREGV0l1quTdpIMnEksLKfs73I4ZhW/4=; b=VXY2Jx79qpIQlqW5uoJtWsNZBXDhfW1KiLL+ryvgypGhJb6EUtLKuOFAn/wmmcNkgS n7enii5EFVw9RV0A3bEorQo/Fyu3ioo5VpM28vIkEtD+BBIjdlAxGFA5ObonGgoRToos 3XON8dJnNvcYthnNEhopDBG2/CY3dWzKqZuOjko7+ShoU9Yv4BOjuFQOAk9yfi23+W+Y RzUj4PVObU/bzN6bm9zn8854nBs5ylZMrxMIee25otrEhv+VTRMdqMLmjFf7aU6xUbmh RU7YPr/P8yEdsKhiGpzO7d1Jtn7KUsCt/o5fk8zCd8qrXQSksqMwGwyK/9yFY2/hioc7 Kzug== 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=TqBkYs60VbLNREGV0l1quTdpIMnEksLKfs73I4ZhW/4=; b=FgwOD4vxD8Dl3rRhOpUbnqxyMJnoqTiRYIYv+qqBZi+I0qstKAwF9BSnEaoksoUaun jJ0BweD+iDUyAkYPBNrfCyTG9tdCfR4SWv3C6J4NrRYRuZzLbvwlQ6u/MRvrj12LaAax EklUKksgoV3ooGEF5mCT0DnRoKJN6qFJhpFqKR/pXCNKdm9Wf/akvZbRN/5kjr3PdOpW Vs+pVvJRxDsj4uwvOEjfq8rfKAouNgNHDk1P4Y1iiknUpCuQRVJEqZi5130TbQV0EPAQ E66HisjtZAAZZxeCgF9nXcn+zCnSJd1BMzx9ebwB2jb5LV8I3cRrCY6UEOgl07cJ9nJT pG0A== X-Gm-Message-State: AOAM533VZAhwgRyJ0iNvR26PEtwva1hqLj/5BySmicp9gpw5uKAS5qDO zKDO0xJNM8Xr7WG2CDk2ErcjSw== X-Google-Smtp-Source: ABdhPJwFDbGx51s3j+MMTYcuSuZ9jgdVYxIKDTRKlNfdifXcXfGhrOCzrfxm6w2Ounmc8f+kl9wJDA== X-Received: by 2002:a17:906:6d85:: with SMTP id h5mr33670626ejt.305.1629704288899; Mon, 23 Aug 2021 00:38:08 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6:f666:9af6:3fed:e53b]) by smtp.gmail.com with ESMTPSA id b2sm535616ejj.124.2021.08.23.00.38.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Aug 2021 00:38:08 -0700 (PDT) From: Michal Simek To: andre.przywara@arm.com, u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Michal Simek , Simon Glass , T Karthik Reddy Subject: [PATCH 06/10] xilinx: zynqmp: Check that DT is 64bit aligned Date: Mon, 23 Aug 2021 09:37:53 +0200 Message-Id: <98ca061e3d0a5a1aebe4facbb2dbb485a126839e.1629704273.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: 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.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 --- Changes in v2: None 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);