From patchwork Mon Jun 4 18:09:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 925188 X-Patchwork-Delegate: trini@ti.com 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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mQ9J/SIA"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4102zz6Kx0z9ry1 for ; Tue, 5 Jun 2018 04:10:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8F19DC21EA2; Mon, 4 Jun 2018 18:10:22 +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=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, 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 ECD31C21E85; Mon, 4 Jun 2018 18:10:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 12137C21F03; Mon, 4 Jun 2018 18:10:06 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by lists.denx.de (Postfix) with ESMTPS id BBF3FC21E88 for ; Mon, 4 Jun 2018 18:10:02 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id 94-v6so45105132wrf.5 for ; Mon, 04 Jun 2018 11:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hG8KY0xCi5+FZyQoqbl7WbaCf3u0TyO+MB07lAeS+kY=; b=mQ9J/SIAueclaBvBH1bcfkDTtEnqV1wALiczGU4jFzE3S212042cFYPFYjZTxUhfxB aGB/GItuvJivpzmUkNQQn4KOVi6UpdBuWbwbuLF9vFtEJTHs6MIO810BuvkDkE5Ij7Ca puf4LSGwx3TswEU101eNY38Bc5JSfcPu3mT1xxqgGgGgMCc0ZNWnlJt0XY5bmLtJDxG5 9xVD57oBOOGwGr6zCopdBcTS8Gp7blQ0d/FZLGeNShABDguo9tLxym+NGvO/rDt3CqqC en+PgcDNZYZo75Jq5qVXulGnqiyePKetTQU4GdbRAejrqqB0flMNZKzlgFwPBWLaVLwk hgfg== 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=hG8KY0xCi5+FZyQoqbl7WbaCf3u0TyO+MB07lAeS+kY=; b=h026v9sjFca2wQynp4IKzJJ6iUIwSTmaKIOlW+aRxc/oJ3YV4WfZ8Ls8fbt9kWd0x1 9aXmnaLGD927jYFOGjil8GIlYA0Av3hQQLBgrC+rSTxtIAD8OsRZfGbjNuj8zHXc81ZJ +EJkRh5ZAYB06wxT2pC6Sc6yhnCJPJjVFUjPJroIRfbHdtSJfqw3PgO6DI3B83IuaD+2 fPwm1jwr8iD3/BLRttPW5V3Pdusc6lS2ZMtfbs3zsTjAwrhi+RMl11Vz3S1pO+YWllNy AdjYM8rDxJQ2Fx6WuGktpJeiRE7CEtC9su2evx7VMtnNCq3AT/HMu6b4PnidEhuEEaSC j/2A== X-Gm-Message-State: ALKqPwejfPnkR6/SNScIFH3guB8eQKUk+RfVHOwfiygjHUm1Fg7ZGRE0 oNTsk82n2wPOLH20urGbkQIeWXVg X-Google-Smtp-Source: ADUXVKLAOBiNEjN/O3878kr74lovcxHyV/yWMmnuGRiuCY9MobvdX0lQiu57LB8on90H/pICXMnGMg== X-Received: by 2002:adf:e881:: with SMTP id d1-v6mr14933538wrm.43.1528135802115; Mon, 04 Jun 2018 11:10:02 -0700 (PDT) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id w15-v6sm15564341wro.52.2018.06.04.11.10.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 11:10:01 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 4 Jun 2018 20:09:55 +0200 Message-Id: <20180604180955.30850-2-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180604180955.30850-1-marek.vasut+renesas@gmail.com> References: <20180604180955.30850-1-marek.vasut+renesas@gmail.com> Cc: Tom Rini , Marek Vasut Subject: [U-Boot] [PATCH V3 2/2] bootm: Handle kernel_noload on arm64 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 ARM64 has 2 MiB alignment requirement for the kernel. When using fitImage, this requirement may by violated, the kernel will thus be executed from unaligned address and fail to boot. Do what booti does and run booti_setup() for kernel_noload images on arm64 to obtain a suitable aligned address to which the image shall be relocated. Signed-off-by: Marek Vasut Cc: Bin Chen Cc: Masahiro Yamada Cc: Tom Rini --- V2: Protect the ARM64 booti bit with if IS_ENABLED(CMD_BOOTI) V3: Use if() instead of #ifdef --- common/bootm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index e789f6818a..fad8480a7a 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -202,8 +202,23 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc, } if (images.os.type == IH_TYPE_KERNEL_NOLOAD) { - images.os.load = images.os.image_start; - images.ep += images.os.load; + if (CONFIG_IS_ENABLED(CMD_BOOTI) && + images.os.arch == IH_ARCH_ARM64) { + ulong image_addr; + ulong image_size; + + ret = booti_setup(images.os.image_start, &image_addr, + &image_size, 1); + if (ret != 0) + return 1; + + images.os.type = IH_TYPE_KERNEL; + images.os.load = image_addr; + images.ep = image_addr; + } else { + images.os.load = images.os.image_start; + images.ep += images.os.image_start; + } } images.os.start = map_to_sysmem(os_hdr);