[U-Boot] [PATCH] drivers: net: mc: Report extra memory to Linux

Prabhakar Kushwaha prabhakar.kushwaha at nxp.com
Tue May 14 10:28:27 UTC 2019


Dear Meenakshi,

> -----Original Message-----
> From: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Sent: Friday, April 5, 2019 7:57 PM
> To: u-boot at lists.denx.de; Prabhakar Kushwaha
> <prabhakar.kushwaha at nxp.com>
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Subject: [PATCH] drivers: net: mc: Report extra memory to Linux
> 
> MC firmware need to be aligned to 512M, so minimum 512MB DDR is
> reserved.
> But MC support to work with 128MB or 256MB DDR memory also, in this case,
> rest of the memory is not usable.
> So reporting this extra memory to Linux through dtb memory fixup.
> 
> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> ---
>  board/freescale/ls1088a/ls1088a.c       | 31
> ++++++++++++++++++++++++++++---
>  board/freescale/ls2080ardb/ls2080ardb.c | 32
> +++++++++++++++++++++++++++++---
>  board/freescale/lx2160a/lx2160a.c       | 31
> ++++++++++++++++++++++++++++---
>  drivers/net/fsl-mc/mc.c                 | 10 ++++++++++
>  include/fsl-mc/fsl_mc.h                 |  1 +
>  5 files changed, 96 insertions(+), 9 deletions(-)
> 
> diff --git a/board/freescale/ls1088a/ls1088a.c
> b/board/freescale/ls1088a/ls1088a.c
> index 6d11a13..96f0871 100644
> --- a/board/freescale/ls1088a/ls1088a.c
> +++ b/board/freescale/ls1088a/ls1088a.c
> @@ -738,11 +738,26 @@ void fsl_fdt_fixup_flash(void *fdt)  int
> ft_board_setup(void *blob, bd_t *bd)  {
>  	int i;
> -	u64 base[CONFIG_NR_DRAM_BANKS];
> -	u64 size[CONFIG_NR_DRAM_BANKS];
> +	bool mc_memory_bank = false;
> +
> +	u64 *base;
> +	u64 *size;
> +	u64 mc_memory_base = 0;
> +	u64 mc_memory_size = 0;
> +	u16 total_memory_banks;
> 
>  	ft_cpu_setup(blob, bd);
> 
> +	fdt_fixup_mc_ddr(&mc_memory_base, &mc_memory_size);
> +
> +	if (mc_memory_base != 0)
> +		mc_memory_bank = true;
> +
> +	total_memory_banks = CONFIG_NR_DRAM_BANKS +
> mc_memory_bank;
> +

mc_memory_bank has been assigned as "true" and you are adding it to total_memory_banks.
You cannot assume "true"as 1

Please fix it.

--pk



More information about the U-Boot mailing list