[U-Boot] [PATCH v3] arm: socfpga: fix SPL booting from fpga OnChip RAM

Marek Vasut marex at denx.de
Tue Oct 9 21:02:48 UTC 2018


On 10/09/2018 10:51 PM, Simon Goldschmidt wrote:
> This patch prevents disabling the FPGA bridges when
> SPL or U-Boot is executed from FPGA onchip RAM.
> 
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> ---
> 
> Changes in v3:
> - use __image_copy_start to check if we are executing from FPGA
> 
> Changes in v2:
> - use less ifdefs and more C code for address checks
>   (but this gives a checkpatch warning because of comparing two
>   upper case constants)
> - changed comments
> 
>  arch/arm/mach-socfpga/include/mach/base_addr_ac5.h |  4 ++++
>  arch/arm/mach-socfpga/misc_gen5.c                  | 10 +++++++++-
>  arch/arm/mach-socfpga/spl_gen5.c                   | 10 +++++++---
>  3 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-socfpga/include/mach/base_addr_ac5.h b/arch/arm/mach-socfpga/include/mach/base_addr_ac5.h
> index bb9e3faa29..dacb258020 100644
> --- a/arch/arm/mach-socfpga/include/mach/base_addr_ac5.h
> +++ b/arch/arm/mach-socfpga/include/mach/base_addr_ac5.h
> @@ -6,6 +6,10 @@
>  #ifndef _SOCFPGA_BASE_ADDRS_H_
>  #define _SOCFPGA_BASE_ADDRS_H_
>  
> +#define SOCFPGA_FPGA_SLAVES_ADDRESS	0xc0000000
> +#define IS_SOCFPGA_FPGA_SLAVES_ADDRESS(addr) \
> +	(((addr) >= SOCFPGA_FPGA_SLAVES_ADDRESS) && \
> +	 ((addr) < SOCFPGA_STM_ADDRESS))

Can we _please_ stop using macros ? Just turn it into a function with
proper type checking.

[...]

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list