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

Prabhakar Kushwaha prabhakar.kushwaha at nxp.com
Thu May 23 03:47:43 UTC 2019


> -----Original Message-----
> From: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Sent: Thursday, May 23, 2019 2:33 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 v3] 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>
> ---
> changed for v1:
>         - Incorporated review comments in one board, Missed for
> 	  other boards
> changed for v2:
> 	- Incorporated review comments in all boards changed for v3:
>         - Include revision history in patch
> ---
>  board/freescale/ls1088a/ls1088a.c       | 34
> +++++++++++++++++++++++++++++---
>  board/freescale/ls2080ardb/ls2080ardb.c | 35
> ++++++++++++++++++++++++++++++---
>  board/freescale/lx2160a/lx2160a.c       | 34
> +++++++++++++++++++++++++++++---
>  drivers/net/fsl-mc/mc.c                 | 10 ++++++++++
>  include/fsl-mc/fsl_mc.h                 |  1 +
>  5 files changed, 105 insertions(+), 9 deletions(-)
> 
> diff --git a/board/freescale/ls1088a/ls1088a.c
> b/board/freescale/ls1088a/ls1088a.c
> index 6d11a13..88c34cb 100644
> --- a/board/freescale/ls1088a/ls1088a.c
> +++ b/board/freescale/ls1088a/ls1088a.c
> @@ -28,6 +28,9 @@
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> +#define TRUE						1
> +#define FALSE						0
> +
>  #ifdef CONFIG_TARGET_LS1088AQDS
>  #ifdef CONFIG_TFABOOT
>  struct ifc_regs ifc_cfg_ifc_nor_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = {
> @@ -738,11 +741,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;
> +
             Use at u8 or u16 or u32. Don't use as bool

> +	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;
> +

Please avoid TRUE and FALSE for increment.  
Directly do mc_memory_bank++

--pk


More information about the U-Boot mailing list