From patchwork Sat Jan 29 15:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1586194 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=kgpdPnoH; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JmJB33pftz9sSs for ; Sun, 30 Jan 2022 02:28:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A2F1F820FE; Sat, 29 Jan 2022 16:28:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kgpdPnoH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC50683868; Sat, 29 Jan 2022 16:28:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (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 5411F80FE1 for ; Sat, 29 Jan 2022 16:28:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ej1-x634.google.com with SMTP id jx6so27083536ejb.0 for ; Sat, 29 Jan 2022 07:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bxltigL/k3FefoaeyQ3cBAXAyuXRFEPltBdLaamlHqk=; b=kgpdPnoHkz8OLlTT8xPQJRlzNWeMIy1RzR/S2Lf+LAxhU2ev1sXosISUWz7b8Gnpkt EiRjL+CKfuNyaO+r7F5a/Ln2FrQQ6uM9fTbEaEtu0jkUTnMZ8aDUweu4v9w+HLQzLd9Q QaXbv3vpDiJPZEmxxnoy2g02SnDeAAjbZfxQC4l3quyUzFQU149tYnT6D9fAoBnhHOnn iqFYcgp6Rl+GkW8A5s0z41u/dhrgwBpXpcq5iaDGXCWPeXiDXEEIO8Cd9nYg5Gh09Wki 7q/s52oeOHNTAveLLwR0TD8slN9x1IJi804/B9BxAZuhBEtZi3eZOFYGoys/lA47AtF+ BTMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bxltigL/k3FefoaeyQ3cBAXAyuXRFEPltBdLaamlHqk=; b=SCuPU4a39ZTuOuYQAxEv04bYlZJY1qmRPIuuUGW7aDGAAQgdKylOqkTIj1F2TDCvzR huMfbfqHUvpNR9wE6/prVTnD/kjLoA6sA5Si3tXVnMB1GALUojrzZTF7s9lPR/tqZt9O VsOJbtWvam1KSVegymiWfGt93yL7TqVYu4F4Fw0OhzIlOJste5uJD8rGwlXsCzoKrSUw TNc8FU69mYUZKZl4KqvtZNaAoXMfY4+H1ElMq6Tyio6/ogwRKK0swe3l0m6Dh/P4ZD/0 TD3tIyJ3GPnJwW66z5qLMRhS6D2A8Tvr0wNqRXMQGEk9znO4FjGl6oE9rDSkHvmrOp2H /2Zg== X-Gm-Message-State: AOAM533lmIfKKuHNLjZAn1thd14x7JFG7CTrYe9+A/EnoFNoaKYt2yTK UKY3kDSZJ90HxERdk5bTiYBw34WPQmkvbQ== X-Google-Smtp-Source: ABdhPJxWG9SjYirUlZBM9b57fDuxpk7ZZAlIJ1lc5KJ9d8XM+P/VitaQcNAr9KdFnUJ7Ajh419Tp7Q== X-Received: by 2002:a17:906:c14e:: with SMTP id dp14mr10956945ejc.9.1643470083953; Sat, 29 Jan 2022 07:28:03 -0800 (PST) Received: from localhost.localdomain ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id kq16sm11153027ejb.163.2022.01.29.07.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 07:28:03 -0800 (PST) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Kever Yang , Simon Glass , Philipp Tomsich , Alper Nebi Yasak Subject: [PATCH] rockchip: Set default LNX_KRNL_IMG_TEXT_OFFSET_BASE to SYS_TEXT_BASE Date: Sat, 29 Jan 2022 18:27:56 +0300 Message-Id: <20220129152756.15951-1-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean U-Boot can be chainloaded from vendor firmware on ARM64 chromebooks from a GPT partition (roughly the same as in doc/chromium/chainload.rst), but an appropriate image header must be built-in to the U-Boot binary by enabling LINUX_KERNEL_IMAGE_HEADER. This header has a field for an image load offset from 2MiB alignment which must also be customized through LNX_KRNL_IMG_TEXT_OFFSET_BASE. Set it equal to SYS_TEXT_BASE by default for Rockchip boards, which happens to make this offset zero and works fine on chromebook_kevin both for chainloading and bare-metal use. Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- Looks like ARM64 chromebooks also need POSITION_INDEPENDENT=y to chainload that way, but I'm not enabling the configs here. I'm thinking of selecting these from new configs that also enable binman definitions for the kernel partition and legacy boot images. arch/arm/mach-rockchip/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 92f35309e4a6..308dc09b0389 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -390,6 +390,9 @@ config ROCKCHIP_SPI_IMAGE containing U-Boot. The image is built by binman. U-Boot sits near the start of the image. +config LNX_KRNL_IMG_TEXT_OFFSET_BASE + default SYS_TEXT_BASE + source "arch/arm/mach-rockchip/px30/Kconfig" source "arch/arm/mach-rockchip/rk3036/Kconfig" source "arch/arm/mach-rockchip/rk3128/Kconfig"