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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A41C433F5 for ; Thu, 11 Nov 2021 17:11:11 +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 8AFE761212 for ; Thu, 11 Nov 2021 17:11:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8AFE761212 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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 9B1C583A51; Thu, 11 Nov 2021 18:11:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3418B83A51; Thu, 11 Nov 2021 18:11:04 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id F0AA983A45 for ; Thu, 11 Nov 2021 18:10:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3642D101E; Thu, 11 Nov 2021 09:10:56 -0800 (PST) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 95C313F718; Thu, 11 Nov 2021 09:10:55 -0800 (PST) Date: Thu, 11 Nov 2021 17:10:53 +0000 From: Andre Przywara To: Peter Hoyes Cc: u-boot@lists.denx.de, diego.sueiro@arm.com Subject: Re: [PATCH v2 4/5] vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64 Message-ID: <20211111171053.193cfe62@donnerap.cambridge.arm.com> In-Reply-To: <20211111092603.774415-5-peter.hoyes@arm.com> References: <20211111092603.774415-1-peter.hoyes@arm.com> <20211111092603.774415-5-peter.hoyes@arm.com> Organization: ARM X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 11 Nov 2021 09:26:02 +0000 Peter Hoyes wrote: > From: Peter Hoyes > > Capture x0 in lowlevel_init.S as potential fdt address. Modify > board_fdt_blob_setup to use fdt address from either vexpress_aemv8.h > or lowlevel_init.S. > Thanks, looks good now: > Signed-off-by: Peter Hoyes Reviewed-by: Andre Przywara Cheers, Andre > --- > board/armltd/vexpress64/Makefile | 2 +- > board/armltd/vexpress64/lowlevel_init.S | 12 ++++++++++++ > board/armltd/vexpress64/vexpress64.c | 26 +++++++++++++++++++++++++ > 3 files changed, 39 insertions(+), 1 deletion(-) > create mode 100644 board/armltd/vexpress64/lowlevel_init.S > > diff --git a/board/armltd/vexpress64/Makefile b/board/armltd/vexpress64/Makefile > index 868dc4f629..1878fbed4e 100644 > --- a/board/armltd/vexpress64/Makefile > +++ b/board/armltd/vexpress64/Makefile > @@ -3,5 +3,5 @@ > # (C) Copyright 2000-2004 > # Wolfgang Denk, DENX Software Engineering, wd@denx.de. > > -obj-y := vexpress64.o > +obj-y := vexpress64.o lowlevel_init.o > obj-$(CONFIG_TARGET_VEXPRESS64_JUNO) += pcie.o > diff --git a/board/armltd/vexpress64/lowlevel_init.S b/board/armltd/vexpress64/lowlevel_init.S > new file mode 100644 > index 0000000000..3dcfb85d0e > --- /dev/null > +++ b/board/armltd/vexpress64/lowlevel_init.S > @@ -0,0 +1,12 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * (C) Copyright 2021 Arm Limited > + */ > + > +.global save_boot_params > +save_boot_params: > + > + adr x8, prior_stage_fdt_address > + str x0, [x8] > + > + b save_boot_params_ret > diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c > index d2f307cca5..d17b463be5 100644 > --- a/board/armltd/vexpress64/vexpress64.c > +++ b/board/armltd/vexpress64/vexpress64.c > @@ -85,7 +85,15 @@ int dram_init_banksize(void) > return 0; > } > > +/* Assigned in lowlevel_init.S > + * Push the variable into the .data section so that it > + * does not get cleared later. > + */ > +unsigned long __section(".data") prior_stage_fdt_address; > + > #ifdef CONFIG_OF_BOARD > + > +#ifdef CONFIG_TARGET_VEXPRESS64_JUNO > #define JUNO_FLASH_SEC_SIZE (256 * 1024) > static phys_addr_t find_dtb_in_nor_flash(const char *partname) > { > @@ -130,9 +138,11 @@ static phys_addr_t find_dtb_in_nor_flash(const char *partname) > > return ~0; > } > +#endif > > void *board_fdt_blob_setup(int *err) > { > +#ifdef CONFIG_TARGET_VEXPRESS64_JUNO > phys_addr_t fdt_rom_addr = find_dtb_in_nor_flash(CONFIG_JUNO_DTB_PART); > > *err = 0; > @@ -142,6 +152,22 @@ void *board_fdt_blob_setup(int *err) > } > > return (void *)fdt_rom_addr; > +#endif > + > +#ifdef VEXPRESS_FDT_ADDR > + if (fdt_magic(VEXPRESS_FDT_ADDR) == FDT_MAGIC) { > + *err = 0; > + return (void *)VEXPRESS_FDT_ADDR; > + } > +#endif > + > + if (fdt_magic(prior_stage_fdt_address) == FDT_MAGIC) { > + *err = 0; > + return (void *)prior_stage_fdt_address; > + } > + > + *err = -ENXIO; > + return NULL; > } > #endif >