[U-Boot] [PATCH] mc : Add support to run MC in 128 MB DDR size

Meenakshi Aggarwal meenakshi.aggarwal at nxp.com
Tue Feb 12 05:26:56 UTC 2019



> -----Original Message-----
> From: Ashish Kumar
> Sent: Tuesday, February 12, 2019 10:12 AM
> To: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>; u-
> boot at lists.denx.de; Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Subject: RE: [PATCH] mc : Add support to run MC in 128 MB DDR size
> 
> 
> 
> > -----Original Message-----
> > From: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> > Sent: Tuesday, February 12, 2019 2:44 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] mc : Add support to run MC in 128 MB DDR size
> Ashish: Rephrase to "Reduce MC memory size to 128M" from the above it sound
> like system DDR is 128MB
> >
> > ls2088, ls1088 : minimum DDR size for MC is 128 MB
> > lx2 : minimum DDR size for MC is 256 MB
> >
> > Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> > ---
> >  drivers/net/fsl-mc/mc.c          | 20 +++++++++++++++++---
> >  include/configs/ls1088a_common.h |  2 +-
> > include/configs/ls2080a_common.h
> > |  2 +-  include/configs/lx2160a_common.h |  2 +-
> >  4 files changed, 20 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index
> > fa0a05d..98c57ed 100644
> > --- a/drivers/net/fsl-mc/mc.c
> > +++ b/drivers/net/fsl-mc/mc.c
> > @@ -684,7 +684,15 @@ int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr)
> >  	size_t mc_ram_size = mc_get_dram_block_size();
> >
> >  	mc_ram_num_256mb_blocks = mc_ram_size /
> MC_RAM_SIZE_ALIGNMENT;
> > -	if (mc_ram_num_256mb_blocks < 1 || mc_ram_num_256mb_blocks >
> > 0xff) {
> > +
> > +	/*
> > +	 * To support 128 MB DDR Size for MC
> > +	 */
> Ashish: How does the MC grow now, wrt to MC base ?.
> Earlier it was 2 blocks of 256 up and rest down.
No changes done in this respect, it is same as before depending on MC size.
For 128 MB, we are reserving only 128 M up and rest down.

> Considering MC base alignment is 512. 256 MB  is always wasted from top of the
> memory, now since the minimum block is 128MB
We are reserving only DDR memory according to the size of MC, so if it is 128 M, 
then we are reserving only 128 M (surely, base address is 512 MB aligned).
Rest DDR memory is available for uboot to use and is marked as free.

> > +	if (mc_ram_num_256mb_blocks == 0) {
> > +		mc_ram_num_256mb_blocks = 0xFF;
> > +	}
> > +
> > +	if (mc_ram_num_256mb_blocks > 0xff) {
> >  		error = -EINVAL;
> >  		printf("fsl-mc: ERROR: invalid MC private RAM size (%lu)\n",
> >  		       mc_ram_size);
> > @@ -731,8 +739,14 @@ int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr)
> >  	/*
> >  	 * Tell MC what is the address range of the DRAM block assigned to it:
> >  	 */
> > -	reg_mcfbalr = (u32)mc_ram_addr |
> > -		      (mc_ram_num_256mb_blocks - 1);
> > +	if (mc_ram_num_256mb_blocks < 0xFF) {
> > +		reg_mcfbalr = (u32)mc_ram_addr |
> > +				(mc_ram_num_256mb_blocks - 1);
> > +	} else {
> > +		reg_mcfbalr = (u32)mc_ram_addr |
> > +				(mc_ram_num_256mb_blocks);
> > +	}
> > +
> >  	out_le32(&mc_ccsr_regs->reg_mcfbalr, reg_mcfbalr);
> >  	out_le32(&mc_ccsr_regs->reg_mcfbahr,
> >  		 (u32)(mc_ram_addr >> 32));
> > diff --git a/include/configs/ls1088a_common.h
> > b/include/configs/ls1088a_common.h
> > index 89133c2..1509292 100644
> > --- a/include/configs/ls1088a_common.h
> > +++ b/include/configs/ls1088a_common.h
> > @@ -154,7 +154,7 @@ unsigned long long get_qixis_addr(void);
> >   */
> >
> >  #if defined(CONFIG_FSL_MC_ENET)
> > -#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE
> 	(512UL *
> > 1024 * 1024)
> > +#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE
> 	(128UL *
> > 1024 * 1024)
> >  #endif
> >  /* Command line configuration */
> >  #define CONFIG_CMD_CACHE
> > diff --git a/include/configs/ls2080a_common.h
> > b/include/configs/ls2080a_common.h
> > index ab38981..7c1d35b 100644
> > --- a/include/configs/ls2080a_common.h
> > +++ b/include/configs/ls2080a_common.h
> > @@ -159,7 +159,7 @@ unsigned long long get_qixis_addr(void);
> >   * 512MB aligned, so the min size to hide is 512MB.
> >   */
> >  #ifdef CONFIG_FSL_MC_ENET
> > -#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE
> 	(512UL *
> > 1024 * 1024)
> > +#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE
> 	(128UL *
> > 1024 * 1024)
> >  #endif
> >
> >  /* Command line configuration */
> > diff --git a/include/configs/lx2160a_common.h
> > b/include/configs/lx2160a_common.h
> > index 0f1a621..c4bbe96 100644
> > --- a/include/configs/lx2160a_common.h
> > +++ b/include/configs/lx2160a_common.h
> > @@ -102,7 +102,7 @@
> >   * 512MB aligned, so the min size to hide is 512MB.
> >   */
> >  #ifdef CONFIG_FSL_MC_ENET
> > -#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE	(512UL * 1024
> *
> > 1024)
> > +#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE	(256UL * 1024
> *
> > 1024)
> >  #endif
> >
> >  /* I2C bus multiplexer */
> > --
> > 1.9.1



More information about the U-Boot mailing list