From patchwork Tue Nov 12 11:00:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 1193426 X-Patchwork-Delegate: matthias.bgg@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="J6bYFsUC"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47C4ZH0TmXz9sP4 for ; Tue, 12 Nov 2019 22:01:59 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9A1F8C21EBD; Tue, 12 Nov 2019 11:00:54 +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=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 0484FC21C2C; Tue, 12 Nov 2019 11:00:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DD7CEC21CB1; Tue, 12 Nov 2019 11:00:38 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 6AD20C21C2C for ; Tue, 12 Nov 2019 11:00:38 +0000 (UTC) Received: from ziggy.de (unknown [37.223.138.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E6EC921783; Tue, 12 Nov 2019 11:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573556437; bh=2W9Pe+aRCWrdnZHcGfGNQTaz1BgTzpHJB5Boe4yo2yU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6bYFsUCpko6/gIz57L8lMLhXoq5ARU8uVRuKXYCWoQ7RVjsyN4ePaKXEIJVK8OUe hvTBLcm/8jluayy9B0El8tkHGB9uUnhSv4XIUjOGYQRcfNwS1YfYtrbS7d4rxyV8a6 hBKylIhokXEoAtWQ3wYtFD0Z4kIvT89QpYaxGZtM= From: matthias.bgg@kernel.org To: u-boot@lists.denx.de, Alexander Graf , fvogt@suse.com, matthias.bgg@kernel.org Date: Tue, 12 Nov 2019 12:00:26 +0100 Message-Id: <20191112110029.847-2-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112110029.847-1-matthias.bgg@kernel.org> References: <20191112110029.847-1-matthias.bgg@kernel.org> MIME-Version: 1.0 Cc: Matthias Brugger Subject: [U-Boot] [PATCH v3 1/4] rpi: push fw_dtb_pointer in the .data section 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Matthias Brugger The fw_dtb_pointer was defined in the assembly code, which makes him live in section .text_rest Put that's not necessary, we can push the variable in the .data section. This will prevent relocation errors like: board/raspberrypi/rpi/rpi.c:317:(.text.board_get_usable_ram_top+0x8): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `fw_dtb_pointer' defined in .text section in board/raspberrypi/rpi/built-in.o Signed-off-by: Matthias Brugger --- Changes in v3: - fix armv7 build Changes in v2: - push fw_dtb_pointer into the .data section board/raspberrypi/rpi/lowlevel_init.S | 12 ++---------- board/raspberrypi/rpi/rpi.c | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/board/raspberrypi/rpi/lowlevel_init.S b/board/raspberrypi/rpi/lowlevel_init.S index 435eed521f..8c39b3e12e 100644 --- a/board/raspberrypi/rpi/lowlevel_init.S +++ b/board/raspberrypi/rpi/lowlevel_init.S @@ -6,15 +6,6 @@ #include -.align 8 -.global fw_dtb_pointer -fw_dtb_pointer: -#ifdef CONFIG_ARM64 - .dword 0x0 -#else - .word 0x0 -#endif - /* * Routine: save_boot_params (called after reset from start.S) * Description: save ATAG/FDT address provided by the firmware at boot time @@ -28,7 +19,8 @@ save_boot_params: adr x8, fw_dtb_pointer str x0, [x8] #else - str r2, fw_dtb_pointer + ldr r8, =fw_dtb_pointer + str r2, [r8] #endif /* Returns */ diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 9e0abdda31..0e05d59e1f 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -27,8 +27,8 @@ DECLARE_GLOBAL_DATA_PTR; -/* From lowlevel_init.S */ -extern unsigned long fw_dtb_pointer; +/* Assigned in lowlevel_init.S */ +unsigned long fw_dtb_pointer = 0x1; /* TODO(sjg@chromium.org): Move these to the msg.c file */ struct msg_get_arm_mem {