All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4] ls1046ardb: SPL size reduction in case of non-xip boot
Date: Wed, 29 Mar 2017 15:36:45 +0000	[thread overview]
Message-ID: <VI1PR04MB14557EE1AD351A9BEC481F2B98350@VI1PR04MB1455.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <VI1PR0401MB26877A2FFBDA9E337EC57F009A350@VI1PR0401MB2687.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: york sun
> Sent: Wednesday, March 29, 2017 8:57 PM
> To: Sumit Garg <sumit.garg@nxp.com>; u-boot at lists.denx.de
> Cc: Ruchika Gupta <ruchika.gupta@nxp.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>; Mingkai Hu <mingkai.hu@nxp.com>; Vini
> Pillai <vinitha.pillai@nxp.com>
> Subject: Re: [PATCH v4] ls1046ardb: SPL size reduction in case of non-xip boot
> 
> On 03/29/2017 05:33 AM, Sumit Garg wrote:
> > Using changes in this patch we were able to reduce approx 4k size of
> > u-boot-spl.bin image. Following is breif description of changes to
> > reduce SPL size:
> > 1. Changes in board/freescale/ls1046ardb/Makefile to remove
> >    compilation of eth.c and cpld.c in case of SPL build.
> > 2. Changes in board/freescale/ls1046ardb/ls1046ardb.c to keep
> >    only ddr_init and board_early_init_f funcations in case of SPL
> >    build.
> > 3. Changes in ls1046a_common.h & ls1046ardb.h to remove driver
> >    specific macros due to which static data was being compiled in
> >    case of SPL build.
> > 4. Disable MMC driver from bieng compiled in case of SPL NAND
> >    build and NAND driver from bieng compiled in case of SPL MMC build.
> >
> > Signed-off-by: Vinitha Pillai <vinitha.pillai@nxp.com>
> > Signed-off-by: Sumit Garg <sumit.garg@nxp.com>
> > ---
> >
> > Changes in v4:
> > Rename macros in header files.
> >
> > Changes in v3:
> > Reorganised way to remove driver macros in ls1046a_common.h &
> > ls1046ardb.h files for easy maintainability.
> >
> > Changes in v2:
> > Rebased and fixed compilation warning on ls1046aqds.
> >
> >  board/freescale/ls1046aqds/Makefile     |  2 ++
> >  board/freescale/ls1046ardb/Makefile     |  4 +++-
> >  board/freescale/ls1046ardb/ls1046ardb.c | 16 +++++++++-------
> >  include/configs/ls1046a_common.h        | 23 +++++++++++++++++++++++
> >  include/configs/ls1046ardb.h            | 25 ++++++++++++++++++++++++-
> >  5 files changed, 61 insertions(+), 9 deletions(-)
> >
> > diff --git a/board/freescale/ls1046aqds/Makefile
> > b/board/freescale/ls1046aqds/Makefile
> > index df6e546..6267522 100644
> > --- a/board/freescale/ls1046aqds/Makefile
> > +++ b/board/freescale/ls1046aqds/Makefile
> > @@ -5,5 +5,7 @@
> >  #
> >
> >  obj-y += ddr.o
> > +ifndef CONFIG_SPL_BUILD
> >  obj-y += eth.o
> > +endif
> >  obj-y += ls1046aqds.o
> > diff --git a/board/freescale/ls1046ardb/Makefile
> > b/board/freescale/ls1046ardb/Makefile
> > index 348eb76..b92ed0b 100644
> > --- a/board/freescale/ls1046ardb/Makefile
> > +++ b/board/freescale/ls1046ardb/Makefile
> > @@ -4,7 +4,9 @@
> >  # SPDX-License-Identifier:	GPL-2.0+
> >  #
> >
> > -obj-y += cpld.o
> >  obj-y += ddr.o
> >  obj-y += ls1046ardb.o
> > +ifndef CONFIG_SPL_BUILD
> >  obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o
> > +obj-y += cpld.o
> > +endif
> > diff --git a/board/freescale/ls1046ardb/ls1046ardb.c
> > b/board/freescale/ls1046ardb/ls1046ardb.c
> > index 02b6c4c..0cc508b 100644
> > --- a/board/freescale/ls1046ardb/ls1046ardb.c
> > +++ b/board/freescale/ls1046ardb/ls1046ardb.c
> > @@ -24,6 +24,14 @@
> >
> >  DECLARE_GLOBAL_DATA_PTR;
> >
> > +int board_early_init_f(void)
> > +{
> > +	fsl_lsch2_early_init_f();
> > +
> > +	return 0;
> > +}
> > +
> > +#ifndef CONFIG_SPL_BUILD
> >  int checkboard(void)
> >  {
> >  	static const char *freq[2] = {"100.00MHZ", "156.25MHZ"}; @@ -56,13
> > +64,6 @@ int checkboard(void)
> >  	return 0;
> >  }
> >
> > -int board_early_init_f(void)
> > -{
> > -	fsl_lsch2_early_init_f();
> > -
> > -	return 0;
> > -}
> > -
> >  int board_init(void)
> >  {
> >  	struct ccsr_scfg *scfg = (struct ccsr_scfg
> > *)CONFIG_SYS_FSL_SCFG_ADDR; @@ -161,3 +162,4 @@ int
> > ft_board_setup(void *blob, bd_t *bd)
> >
> >  	return 0;
> >  }
> > +#endif
> > diff --git a/include/configs/ls1046a_common.h
> > b/include/configs/ls1046a_common.h
> > index 1ed7517..b77edda 100644
> > --- a/include/configs/ls1046a_common.h
> > +++ b/include/configs/ls1046a_common.h
> > @@ -7,6 +7,17 @@
> >  #ifndef __LS1046A_COMMON_H
> >  #define __LS1046A_COMMON_H
> >
> > +/* SPL build */
> > +#ifdef CONFIG_SPL_BUILD
> > +#define SPL_NO_QBMAN
> > +#define SPL_NO_FMAN_UCODE
> > +#define SPL_NO_CMD_ENV
> > +#define SPL_NO_MISC
> > +#endif
> > +#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_BOOT))
> #define
> > +SPL_NO_MMC #endif
> > +
> >  #define CONFIG_REMAKE_ELF
> >  #define CONFIG_FSL_LAYERSCAPE
> >  #define CONFIG_MP
> > @@ -109,20 +120,28 @@
> >  #define CONFIG_SYS_I2C_MXC_I2C4
> >
> >  /* Command line configuration */
> > +#ifndef SPL_NO_CMD_ENV
> >  #define CONFIG_CMD_ENV
> > +#endif
> >
> >  /* MMC */
> > +#ifndef SPL_NO_MMC
> >  #ifdef CONFIG_MMC
> >  #define CONFIG_FSL_ESDHC
> >  #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
> >  #endif
> > +#endif
> >
> > +#ifndef SPL_NO_QBMAN
> >  #define CONFIG_SYS_DPAA_QBMAN		/* Support Q/Bman */
> > +#endif
> >
> >  /* FMan ucode */
> > +#ifndef SPL_NO_FMAN_UCODE
> >  #define CONFIG_SYS_DPAA_FMAN
> >  #ifdef CONFIG_SYS_DPAA_FMAN
> >  #define CONFIG_SYS_FM_MURAM_SIZE	0x60000
> > +#endif
> >
> >  #ifdef CONFIG_SD_BOOT
> >  /*
> > @@ -156,6 +175,7 @@
> >  #define CONFIG_HWCONFIG
> >  #define HWCONFIG_BUFFER_SIZE		128
> >
> > +#ifndef SPL_NO_MISC
> >  /* Initial environment variables */
> >  #define CONFIG_EXTRA_ENV_SETTINGS		\
> >  	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
> > @@ -173,13 +193,16 @@
> >  #define CONFIG_BOOTARGS			"console=ttyS0,115200
> root=/dev/ram0 " \
> >  					"earlycon=uart8250,mmio,0x21c0500 " \
> >  					MTDPARTS_DEFAULT
> > +#endif
> >  /* Monitor Command Prompt */
> >  #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer
> Size */
> >  #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
> >  					sizeof(CONFIG_SYS_PROMPT) + 16)
> >  #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE /* Boot
> args buffer */
> >  #define CONFIG_SYS_LONGHELP
> > +#ifndef SPL_NO_MISC
> >  #define CONFIG_CMDLINE_EDITING		1
> > +#endif
> >  #define CONFIG_AUTO_COMPLETE
> >  #define CONFIG_SYS_MAXARGS		64	/* max command args
> */
> >
> > diff --git a/include/configs/ls1046ardb.h
> > b/include/configs/ls1046ardb.h index 2141b82..c01eb1f 100644
> > --- a/include/configs/ls1046ardb.h
> > +++ b/include/configs/ls1046ardb.h
> > @@ -9,6 +9,18 @@
> >
> >  #include "ls1046a_common.h"
> >
> > +/* SPL build */
> > +#ifdef CONFIG_SPL_BUILD
> > +#define SPL_NO_FMAN
> > +#define SPL_NO_QSPI
> > +#define SPL_NO_USB
> > +#define SPL_NO_SATA
> > +#define SPL_NO_ENV
> > +#endif
> > +#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT)) #define
> > +SPL_NO_IFC #endif
> 
> Are these RDB specific? Why not put this block into the common header?
> 
> York

Yes these macros are used to mask macros in RDB header file from inclusion during SPL build. Also this block can be put in common header but I am not sure how many of above macros relevant for the QDS header file.

Sumit

  reply	other threads:[~2017-03-29 15:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  0:01 [U-Boot] [PATCH v4] ls1046ardb: SPL size reduction in case of non-xip boot Sumit Garg
2017-03-29 15:26 ` york sun
2017-03-29 15:36   ` Sumit Garg [this message]
2017-03-29 15:44     ` york sun
2017-03-29 15:57       ` Sumit Garg

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=VI1PR04MB14557EE1AD351A9BEC481F2B98350@VI1PR04MB1455.eurprd04.prod.outlook.com \
    --to=sumit.garg@nxp.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.