All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Peter Hoyes <peter.hoyes@arm.com>
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
Date: Thu, 11 Nov 2021 17:10:53 +0000	[thread overview]
Message-ID: <20211111171053.193cfe62@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <20211111092603.774415-5-peter.hoyes@arm.com>

On Thu, 11 Nov 2021 09:26:02 +0000
Peter Hoyes <peter.hoyes@arm.com> wrote:

> From: Peter Hoyes <Peter.Hoyes@arm.com>
> 
> 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 <Peter.Hoyes@arm.com>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

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
>  


  reply	other threads:[~2021-11-11 17:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11  9:25 [PATCH v2 0/5] VExpress64 board family improvements Peter Hoyes
2021-11-11  9:25 ` [PATCH v2 1/5] doc: Add documentation for the Arm VExpress64 board configs Peter Hoyes
2021-11-11 17:10   ` Andre Przywara
2022-01-07 17:03   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 2/5] vexpress64: Refactor header file to make it easier to add new FVPs Peter Hoyes
2021-11-11 17:10   ` Andre Przywara
2022-01-07 17:03   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 3/5] vexpress64: Clean up BASE_FVP boot configuration Peter Hoyes
2021-11-11 17:10   ` Andre Przywara
2022-01-07 17:04   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 4/5] vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64 Peter Hoyes
2021-11-11 17:10   ` Andre Przywara [this message]
2022-01-07 17:03   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 5/5] vexpress64: Enable VIRTIO_NET network driver Peter Hoyes
2021-11-11 17:11   ` Andre Przywara
2022-01-07 17:03   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211111171053.193cfe62@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=diego.sueiro@arm.com \
    --cc=peter.hoyes@arm.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.