All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
@ 2017-12-22  3:13 Tom Rini
  2017-12-22  3:13 ` [U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Tom Rini @ 2017-12-22  3:13 UTC (permalink / raw)
  To: u-boot

While the code in question here is used in SPL, it cannot be used in
interactive mode in SPL.  We need a compile-time guard here in order to
be able to not include further bits of code.

Cc: York Sun <york.sun@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/ddr/fsl/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ddr/fsl/main.c b/drivers/ddr/fsl/main.c
index d0a7b3f10763..b9f177f71d10 100644
--- a/drivers/ddr/fsl/main.c
+++ b/drivers/ddr/fsl/main.c
@@ -633,7 +633,7 @@ phys_size_t __fsl_ddr_sdram(fsl_ddr_info_t *pinfo)
 	last_ctrl = first_ctrl + pinfo->num_ctrls - 1;
 
 	/* Compute it once normally. */
-#ifdef CONFIG_FSL_DDR_INTERACTIVE
+#if defined(CONFIG_FSL_DDR_INTERACTIVE) && !defined(CONFIG_SPL_BUILD)
 	if (tstc() && (getc() == 'd')) {	/* we got a key press of 'd' */
 		total_memory = fsl_ddr_interactive(pinfo, 0);
 	} else if (fsl_ddr_interactive_env_var_exists()) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases
  2017-12-22  3:13 [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL Tom Rini
@ 2017-12-22  3:13 ` Tom Rini
  2018-01-10 16:44   ` [U-Boot] [U-Boot, " Tom Rini
  2017-12-22  3:13 ` [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists Tom Rini
  2017-12-22  5:29 ` [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL York Sun
  2 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2017-12-22  3:13 UTC (permalink / raw)
  To: u-boot

Given gcc-6.1 and later we can now safely have strings discarded when
the functions are unused.  This lets us drop certain cases of not
building something so that we don't have the strings brought in when the
code was discarded.  Simplify the code now by dropping guards we don't
need now.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Chander Kashyap <k.chander@samsung.com>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Vipin Kumar <vipin.kumar@st.com>
Cc: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/cpu/arm1136/mx31/Makefile   | 5 +----
 arch/arm/cpu/arm1136/mx35/Makefile   | 5 +----
 arch/arm/cpu/arm926ejs/mx25/Makefile | 6 +-----
 arch/arm/cpu/arm926ejs/mx27/Makefile | 6 +-----
 arch/sandbox/lib/Makefile            | 2 --
 board/atmel/common/Makefile          | 2 --
 board/samsung/arndale/Makefile       | 3 ---
 board/samsung/espresso7420/Makefile  | 2 --
 board/spear/spear600/Makefile        | 4 +---
 9 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/Makefile b/arch/arm/cpu/arm1136/mx31/Makefile
index dcbd57065bbc..774f352ece81 100644
--- a/arch/arm/cpu/arm1136/mx31/Makefile
+++ b/arch/arm/cpu/arm1136/mx31/Makefile
@@ -8,7 +8,4 @@
 obj-y	+= generic.o
 obj-y	+= timer.o
 obj-y	+= devices.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y  += relocate.o
-endif
+obj-y	+= relocate.o
diff --git a/arch/arm/cpu/arm1136/mx35/Makefile b/arch/arm/cpu/arm1136/mx35/Makefile
index 796db9c7cc75..e4c8e2e6849a 100644
--- a/arch/arm/cpu/arm1136/mx35/Makefile
+++ b/arch/arm/cpu/arm1136/mx35/Makefile
@@ -10,7 +10,4 @@
 obj-y	+= generic.o
 obj-y	+= timer.o
 obj-y	+= mx35_sdram.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y  += relocate.o
-endif
+obj-y	+= relocate.o
diff --git a/arch/arm/cpu/arm926ejs/mx25/Makefile b/arch/arm/cpu/arm926ejs/mx25/Makefile
index ebc0407ef42a..7d608c608255 100644
--- a/arch/arm/cpu/arm926ejs/mx25/Makefile
+++ b/arch/arm/cpu/arm926ejs/mx25/Makefile
@@ -4,8 +4,4 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-obj-y	= generic.o timer.o reset.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y	+= relocate.o
-endif
+obj-y	+= generic.o timer.o reset.o relocate.o
diff --git a/arch/arm/cpu/arm926ejs/mx27/Makefile b/arch/arm/cpu/arm926ejs/mx27/Makefile
index 0edf1445fe36..7d608c608255 100644
--- a/arch/arm/cpu/arm926ejs/mx27/Makefile
+++ b/arch/arm/cpu/arm926ejs/mx27/Makefile
@@ -4,8 +4,4 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-obj-y	= generic.o reset.o timer.o
-
-ifndef CONFIG_SPL_BUILD
-obj-y	+= relocate.o
-endif
+obj-y	+= generic.o timer.o reset.o relocate.o
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index 2e7802feac8a..a79ade7b1102 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -8,8 +8,6 @@
 #
 
 obj-y	+= interrupts.o
-ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_PCI)	+= pci_io.o
-endif
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o
diff --git a/board/atmel/common/Makefile b/board/atmel/common/Makefile
index 8a6850bc198b..f68dd74953ed 100644
--- a/board/atmel/common/Makefile
+++ b/board/atmel/common/Makefile
@@ -6,7 +6,5 @@
 #
 
 obj-y += board.o
-ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_I2C_EEPROM) += mac_eeprom.o
 obj-$(CONFIG_DM_VIDEO) += video_display.o
-endif
diff --git a/board/samsung/arndale/Makefile b/board/samsung/arndale/Makefile
index be2b3662ade6..01bbc0798ac9 100644
--- a/board/samsung/arndale/Makefile
+++ b/board/samsung/arndale/Makefile
@@ -5,7 +5,4 @@
 #
 
 obj-y	+= arndale_spl.o
-
-ifndef CONFIG_SPL_BUILD
 obj-y	+= arndale.o
-endif
diff --git a/board/samsung/espresso7420/Makefile b/board/samsung/espresso7420/Makefile
index d514dc2a457a..5248265b1f19 100644
--- a/board/samsung/espresso7420/Makefile
+++ b/board/samsung/espresso7420/Makefile
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
 obj-y	+= espresso7420.o
-endif
diff --git a/board/spear/spear600/Makefile b/board/spear/spear600/Makefile
index 7abfb9ad50ad..86a7fc4c7eda 100644
--- a/board/spear/spear600/Makefile
+++ b/board/spear/spear600/Makefile
@@ -5,6 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y	:= spear600.o
-endif
+obj-y	+= spear600.o
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists
  2017-12-22  3:13 [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL Tom Rini
  2017-12-22  3:13 ` [U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases Tom Rini
@ 2017-12-22  3:13 ` Tom Rini
  2017-12-22 13:29   ` Daniel Schwierzeck
                     ` (2 more replies)
  2017-12-22  5:29 ` [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL York Sun
  2 siblings, 3 replies; 14+ messages in thread
From: Tom Rini @ 2017-12-22  3:13 UTC (permalink / raw)
  To: u-boot

There are no CMDs to be run in SPL and no need for any of their lists.

CC: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jagan Teki <jagan@openedev.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: "Andreas Bießmann" <andreas@biessmann.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Wolfgang Denk <wd@denx.de>
Cc: York Sun <york.sun@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc:Wenyou Yang <wenyou.yang@atmel.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/cpu/arm1136/u-boot-spl.lds           | 3 +++
 arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds     | 3 +++
 arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 3 +++
 arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds   | 3 +++
 arch/arm/cpu/armv7/sunxi/u-boot-spl.lds       | 3 +++
 arch/arm/cpu/armv8/u-boot-spl.lds             | 3 +++
 arch/arm/cpu/u-boot-spl.lds                   | 3 +++
 arch/arm/mach-at91/arm926ejs/u-boot-spl.lds   | 3 +++
 arch/arm/mach-at91/armv7/u-boot-spl.lds       | 3 +++
 arch/arm/mach-omap2/u-boot-spl.lds            | 3 +++
 arch/arm/mach-zynq/u-boot-spl.lds             | 3 +++
 arch/microblaze/cpu/u-boot-spl.lds            | 3 +++
 arch/mips/cpu/u-boot-spl.lds                  | 3 +++
 arch/powerpc/cpu/mpc83xx/u-boot-spl.lds       | 3 +++
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds       | 3 +++
 arch/sandbox/cpu/u-boot-spl.lds               | 2 ++
 arch/x86/cpu/u-boot-spl.lds                   | 3 +--
 17 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds
index 97e4a8bc873f..6668e2edd654 100644
--- a/arch/arm/cpu/arm1136/u-boot-spl.lds
+++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
@@ -19,6 +19,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 	__start = .;
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index bf2ac13056bd..d39027db23b5 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -16,6 +16,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	. = CONFIG_SPL_TEXT_BASE;
 
 	. = ALIGN(4);
diff --git a/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds
index 6f7fca07e371..150451b88fd8 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds
@@ -27,6 +27,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 		__start = .;
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 47910d3e4f82..f9af63cd14de 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -21,6 +21,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 		__start = .;
diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
index 53f0cbd2b7ea..f9d27fa0c511 100644
--- a/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds
@@ -24,6 +24,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 		__start = .;
diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds
index 0d1b0c499304..40f112237a60 100644
--- a/arch/arm/cpu/armv8/u-boot-spl.lds
+++ b/arch/arm/cpu/armv8/u-boot-spl.lds
@@ -22,6 +22,9 @@ OUTPUT_ARCH(aarch64)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text : {
 		. = ALIGN(8);
 		*(.__image_copy_start)
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 65f7b68861e2..b5a89556b6b2 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -12,6 +12,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	. = 0x00000000;
 
 	. = ALIGN(4);
diff --git a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
index 1b0420611ed3..186dbd88d54e 100644
--- a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
+++ b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
@@ -15,6 +15,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 		__start = .;
diff --git a/arch/arm/mach-at91/armv7/u-boot-spl.lds b/arch/arm/mach-at91/armv7/u-boot-spl.lds
index d2e41a026c4d..dffd89a78af3 100644
--- a/arch/arm/mach-at91/armv7/u-boot-spl.lds
+++ b/arch/arm/mach-at91/armv7/u-boot-spl.lds
@@ -22,6 +22,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 		__start = .;
diff --git a/arch/arm/mach-omap2/u-boot-spl.lds b/arch/arm/mach-omap2/u-boot-spl.lds
index e9da2a9dd186..c70b19bdced7 100644
--- a/arch/arm/mach-omap2/u-boot-spl.lds
+++ b/arch/arm/mach-omap2/u-boot-spl.lds
@@ -19,6 +19,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text      :
 	{
 		__start = .;
diff --git a/arch/arm/mach-zynq/u-boot-spl.lds b/arch/arm/mach-zynq/u-boot-spl.lds
index 9a59164c876f..70d0b0fab82f 100644
--- a/arch/arm/mach-zynq/u-boot-spl.lds
+++ b/arch/arm/mach-zynq/u-boot-spl.lds
@@ -18,6 +18,9 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	. = ALIGN(4);
 	.text :
 	{
diff --git a/arch/microblaze/cpu/u-boot-spl.lds b/arch/microblaze/cpu/u-boot-spl.lds
index c60336ca5ca8..6814aaceb562 100644
--- a/arch/microblaze/cpu/u-boot-spl.lds
+++ b/arch/microblaze/cpu/u-boot-spl.lds
@@ -13,6 +13,9 @@ ENTRY(_start)
 
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	.text ALIGN(0x4):
 	{
 		__text_start = .;
diff --git a/arch/mips/cpu/u-boot-spl.lds b/arch/mips/cpu/u-boot-spl.lds
index 07004ea11155..19444e3e600e 100644
--- a/arch/mips/cpu/u-boot-spl.lds
+++ b/arch/mips/cpu/u-boot-spl.lds
@@ -11,6 +11,9 @@ OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	. = 0x00000000;
 
 	. = ALIGN(4);
diff --git a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
index 4101eaf3f327..66ba02ce434c 100644
--- a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
@@ -10,6 +10,9 @@
 OUTPUT_ARCH(powerpc)
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	. = 0xfff00000;
 	.text : {
 		*(.text*)
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index 889a4c24001a..f959272d9703 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -19,6 +19,9 @@ PHDRS
 #endif
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
+
 	. = CONFIG_SPL_TEXT_BASE;
 	.text : {
 		*(.text*)
diff --git a/arch/sandbox/cpu/u-boot-spl.lds b/arch/sandbox/cpu/u-boot-spl.lds
index 7e92b4ac66c8..bd4666e2ce88 100644
--- a/arch/sandbox/cpu/u-boot-spl.lds
+++ b/arch/sandbox/cpu/u-boot-spl.lds
@@ -8,6 +8,8 @@
 
 SECTIONS
 {
+	/* There are no CMDs in SPL */
+	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
 
 	. = ALIGN(4);
 	.u_boot_list : {
diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds
index 8a38d58f123d..d0c804fa829e 100644
--- a/arch/x86/cpu/u-boot-spl.lds
+++ b/arch/x86/cpu/u-boot-spl.lds
@@ -12,9 +12,8 @@ ENTRY(_start)
 
 SECTIONS
 {
-#ifndef CONFIG_CMDLINE
+	/* There are no CMDs in SPL */
 	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
-#endif
 
 	. = CONFIG_SPL_TEXT_BASE;	/* Location of bootcode in flash */
 	__text_start = .;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
  2017-12-22  3:13 [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL Tom Rini
  2017-12-22  3:13 ` [U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases Tom Rini
  2017-12-22  3:13 ` [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists Tom Rini
@ 2017-12-22  5:29 ` York Sun
  2017-12-22 12:36   ` Tom Rini
  2 siblings, 1 reply; 14+ messages in thread
From: York Sun @ 2017-12-22  5:29 UTC (permalink / raw)
  To: u-boot

Why not? I used it before.

York

Sent from my iPhone

> On Dec 21, 2017, at 19:13, Tom Rini <trini@konsulko.com> wrote:
> 
> While the code in question here is used in SPL, it cannot be used in
> interactive mode in SPL.  We need a compile-time guard here in order to
> be able to not include further bits of code.
> 
> Cc: York Sun <york.sun@nxp.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> drivers/ddr/fsl/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ddr/fsl/main.c b/drivers/ddr/fsl/main.c
> index d0a7b3f10763..b9f177f71d10 100644
> --- a/drivers/ddr/fsl/main.c
> +++ b/drivers/ddr/fsl/main.c
> @@ -633,7 +633,7 @@ phys_size_t __fsl_ddr_sdram(fsl_ddr_info_t *pinfo)
>    last_ctrl = first_ctrl + pinfo->num_ctrls - 1;
> 
>    /* Compute it once normally. */
> -#ifdef CONFIG_FSL_DDR_INTERACTIVE
> +#if defined(CONFIG_FSL_DDR_INTERACTIVE) && !defined(CONFIG_SPL_BUILD)
>    if (tstc() && (getc() == 'd')) {    /* we got a key press of 'd' */
>        total_memory = fsl_ddr_interactive(pinfo, 0);
>    } else if (fsl_ddr_interactive_env_var_exists()) {
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
  2017-12-22  5:29 ` [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL York Sun
@ 2017-12-22 12:36   ` Tom Rini
  2017-12-22 16:02     ` York Sun
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2017-12-22 12:36 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 22, 2017 at 05:29:31AM +0000, York Sun wrote:

> Why not? I used it before.

In SPL, rather than full U-Boot?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/0065a5de/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists
  2017-12-22  3:13 ` [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists Tom Rini
@ 2017-12-22 13:29   ` Daniel Schwierzeck
  2017-12-22 14:10     ` Tom Rini
  2017-12-22 14:37   ` Daniel Schwierzeck
  2017-12-22 16:58   ` Tom Rini
  2 siblings, 1 reply; 14+ messages in thread
From: Daniel Schwierzeck @ 2017-12-22 13:29 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On 22.12.2017 04:13, Tom Rini wrote:
> There are no CMDs to be run in SPL and no need for any of their lists.
> 
> CC: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Jagan Teki <jagan@openedev.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: "Andreas Bießmann" <andreas@biessmann.org>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Cc: Mario Six <mario.six@gdsys.cc>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: York Sun <york.sun@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc:Wenyou Yang <wenyou.yang@atmel.com>
> Cc: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/arm/cpu/arm1136/u-boot-spl.lds           | 3 +++
>  arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds     | 3 +++
>  arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 3 +++
>  arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds   | 3 +++
>  arch/arm/cpu/armv7/sunxi/u-boot-spl.lds       | 3 +++
>  arch/arm/cpu/armv8/u-boot-spl.lds             | 3 +++
>  arch/arm/cpu/u-boot-spl.lds                   | 3 +++
>  arch/arm/mach-at91/arm926ejs/u-boot-spl.lds   | 3 +++
>  arch/arm/mach-at91/armv7/u-boot-spl.lds       | 3 +++
>  arch/arm/mach-omap2/u-boot-spl.lds            | 3 +++
>  arch/arm/mach-zynq/u-boot-spl.lds             | 3 +++
>  arch/microblaze/cpu/u-boot-spl.lds            | 3 +++
>  arch/mips/cpu/u-boot-spl.lds                  | 3 +++
>  arch/powerpc/cpu/mpc83xx/u-boot-spl.lds       | 3 +++
>  arch/powerpc/cpu/mpc85xx/u-boot-spl.lds       | 3 +++
>  arch/sandbox/cpu/u-boot-spl.lds               | 2 ++
>  arch/x86/cpu/u-boot-spl.lds                   | 3 +--
>  17 files changed, 48 insertions(+), 2 deletions(-)
> 

...

> diff --git a/arch/mips/cpu/u-boot-spl.lds b/arch/mips/cpu/u-boot-spl.lds
> index 07004ea11155..19444e3e600e 100644
> --- a/arch/mips/cpu/u-boot-spl.lds
> +++ b/arch/mips/cpu/u-boot-spl.lds
> @@ -11,6 +11,9 @@ OUTPUT_ARCH(mips)
>  ENTRY(_start)
>  SECTIONS
>  {
> +	/* There are no CMDs in SPL */
> +	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
> +
>  	. = 0x00000000;
>  
>  	. = ALIGN(4);

does a DISCARD() work together with the KEEP() in this block?

#ifdef CONFIG_SPL_DM
	. = ALIGN(4);
	.u_boot_list : {
		KEEP(*(SORT(.u_boot_list*)));
	} > .spl_mem
#endif

I suggest to do something like this:

		KEEP(*(SORT(.u_boot_list_2_uclass*)));
		KEEP(*(SORT(.u_boot_list_2_driver*)));

Then all u_boot_list_* would be discarded by default except the two
lists above when a board selects CONFIG_SPL_DM. Also this would have the
benefit of discarding all u_boot_list_2_env* entries.

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/5dfff4d2/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists
  2017-12-22 13:29   ` Daniel Schwierzeck
@ 2017-12-22 14:10     ` Tom Rini
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2017-12-22 14:10 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 22, 2017 at 02:29:11PM +0100, Daniel Schwierzeck wrote:
> Hi Tom,
> 
> On 22.12.2017 04:13, Tom Rini wrote:
> > There are no CMDs to be run in SPL and no need for any of their lists.
[snip]
> > diff --git a/arch/mips/cpu/u-boot-spl.lds b/arch/mips/cpu/u-boot-spl.lds
> > index 07004ea11155..19444e3e600e 100644
> > --- a/arch/mips/cpu/u-boot-spl.lds
> > +++ b/arch/mips/cpu/u-boot-spl.lds
> > @@ -11,6 +11,9 @@ OUTPUT_ARCH(mips)
> >  ENTRY(_start)
> >  SECTIONS
> >  {
> > +	/* There are no CMDs in SPL */
> > +	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
> > +
> >  	. = 0x00000000;
> >  
> >  	. = ALIGN(4);
> 
> does a DISCARD() work together with the KEEP() in this block?
> 
> #ifdef CONFIG_SPL_DM
> 	. = ALIGN(4);
> 	.u_boot_list : {
> 		KEEP(*(SORT(.u_boot_list*)));
> 	} > .spl_mem
> #endif

Yes, we discard th cmd list, and then keep the rest, given the ordering.

> I suggest to do something like this:
> 
> 		KEEP(*(SORT(.u_boot_list_2_uclass*)));
> 		KEEP(*(SORT(.u_boot_list_2_driver*)));
> 
> Then all u_boot_list_* would be discarded by default except the two
> lists above when a board selects CONFIG_SPL_DM. Also this would have the
> benefit of discarding all u_boot_list_2_env* entries.

Ah, but this shows why we glob in all lists today.  We do need env in
SPL at times.  Now, it shouldn't take up space in SPL if we don't ahve
SPL_ENV_SUPPORT.  But I haven't checked either...

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/e33a8740/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists
  2017-12-22  3:13 ` [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists Tom Rini
  2017-12-22 13:29   ` Daniel Schwierzeck
@ 2017-12-22 14:37   ` Daniel Schwierzeck
  2017-12-22 16:58   ` Tom Rini
  2 siblings, 0 replies; 14+ messages in thread
From: Daniel Schwierzeck @ 2017-12-22 14:37 UTC (permalink / raw)
  To: u-boot



On 22.12.2017 04:13, Tom Rini wrote:
> There are no CMDs to be run in SPL and no need for any of their lists.
> 
> CC: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Jagan Teki <jagan@openedev.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: "Andreas Bießmann" <andreas@biessmann.org>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Cc: Mario Six <mario.six@gdsys.cc>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: York Sun <york.sun@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc:Wenyou Yang <wenyou.yang@atmel.com>
> Cc: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/arm/cpu/arm1136/u-boot-spl.lds           | 3 +++
>  arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds     | 3 +++
>  arch/arm/cpu/arm926ejs/orion5x/u-boot-spl.lds | 3 +++
>  arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds   | 3 +++
>  arch/arm/cpu/armv7/sunxi/u-boot-spl.lds       | 3 +++
>  arch/arm/cpu/armv8/u-boot-spl.lds             | 3 +++
>  arch/arm/cpu/u-boot-spl.lds                   | 3 +++
>  arch/arm/mach-at91/arm926ejs/u-boot-spl.lds   | 3 +++
>  arch/arm/mach-at91/armv7/u-boot-spl.lds       | 3 +++
>  arch/arm/mach-omap2/u-boot-spl.lds            | 3 +++
>  arch/arm/mach-zynq/u-boot-spl.lds             | 3 +++
>  arch/microblaze/cpu/u-boot-spl.lds            | 3 +++
>  arch/mips/cpu/u-boot-spl.lds                  | 3 +++
>  arch/powerpc/cpu/mpc83xx/u-boot-spl.lds       | 3 +++
>  arch/powerpc/cpu/mpc85xx/u-boot-spl.lds       | 3 +++
>  arch/sandbox/cpu/u-boot-spl.lds               | 2 ++
>  arch/x86/cpu/u-boot-spl.lds                   | 3 +--
>  17 files changed, 48 insertions(+), 2 deletions(-)
> 

for MIPS
Acked-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/b43addc7/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
  2017-12-22 12:36   ` Tom Rini
@ 2017-12-22 16:02     ` York Sun
  2017-12-22 16:06       ` Tom Rini
  0 siblings, 1 reply; 14+ messages in thread
From: York Sun @ 2017-12-22 16:02 UTC (permalink / raw)
  To: u-boot

If SPL is used, the full driver is in SPL. It initializes DDR. It only makes sense to have this feature there, not after relocation. We only disable this feature is the SPL size becomes a problem.

York

Sent from my iPhone

> On Dec 22, 2017, at 04:36, Tom Rini <trini@konsulko.com> wrote:
> 
>> On Fri, Dec 22, 2017 at 05:29:31AM +0000, York Sun wrote:
>> 
>> Why not? I used it before.
> 
> In SPL, rather than full U-Boot?
> 
> -- 
> Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
  2017-12-22 16:02     ` York Sun
@ 2017-12-22 16:06       ` Tom Rini
  2017-12-22 16:19         ` York Sun
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Rini @ 2017-12-22 16:06 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 22, 2017 at 04:02:49PM +0000, York Sun wrote:

> If SPL is used, the full driver is in SPL. It initializes DDR. It only
> makes sense to have this feature there, not after relocation. We only
> disable this feature is the SPL size becomes a problem.

OK, but I don't understand how you can get into that specific hunk of
code.  Is someone sending 'd' to the UART and that causes this code to
run?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/cabc9323/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
  2017-12-22 16:06       ` Tom Rini
@ 2017-12-22 16:19         ` York Sun
  2017-12-22 16:21           ` Tom Rini
  0 siblings, 1 reply; 14+ messages in thread
From: York Sun @ 2017-12-22 16:19 UTC (permalink / raw)
  To: u-boot

Either sending 'd' through UART, or save a variable ddr_interactive.

York

Sent from my iPhone

> On Dec 22, 2017, at 08:06, Tom Rini <trini@konsulko.com> wrote:
> 
>> On Fri, Dec 22, 2017 at 04:02:49PM +0000, York Sun wrote:
>> 
>> If SPL is used, the full driver is in SPL. It initializes DDR. It only
>> makes sense to have this feature there, not after relocation. We only
>> disable this feature is the SPL size becomes a problem.
> 
> OK, but I don't understand how you can get into that specific hunk of
> code.  Is someone sending 'd' to the UART and that causes this code to
> run?  Thanks!
> 
> -- 
> Tom

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL
  2017-12-22 16:19         ` York Sun
@ 2017-12-22 16:21           ` Tom Rini
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2017-12-22 16:21 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 22, 2017 at 04:19:26PM +0000, York Sun wrote:

> Either sending 'd' through UART, or save a variable ddr_interactive.

OK, thanks, withdrawn!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/ee6b0f79/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists
  2017-12-22  3:13 ` [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists Tom Rini
  2017-12-22 13:29   ` Daniel Schwierzeck
  2017-12-22 14:37   ` Daniel Schwierzeck
@ 2017-12-22 16:58   ` Tom Rini
  2 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2017-12-22 16:58 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 21, 2017 at 10:13:23PM -0500, Tom Rini wrote:

> There are no CMDs to be run in SPL and no need for any of their lists.
> 
> CC: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Jagan Teki <jagan@openedev.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: "Andreas Bießmann" <andreas@biessmann.org>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Cc: Mario Six <mario.six@gdsys.cc>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: York Sun <york.sun@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc:Wenyou Yang <wenyou.yang@atmel.com>
> Cc: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

So, discarding doesn't cause everything that could be garbage collected
to be garbage collected in this case (and I don't think that's really a
bug).  So I'm withdrawing this patch as well, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171222/bb6175da/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [U-Boot] [U-Boot, 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases
  2017-12-22  3:13 ` [U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases Tom Rini
@ 2018-01-10 16:44   ` Tom Rini
  0 siblings, 0 replies; 14+ messages in thread
From: Tom Rini @ 2018-01-10 16:44 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 21, 2017 at 10:13:22PM -0500, Tom Rini wrote:

> Given gcc-6.1 and later we can now safely have strings discarded when
> the functions are unused.  This lets us drop certain cases of not
> building something so that we don't have the strings brought in when the
> code was discarded.  Simplify the code now by dropping guards we don't
> need now.
> 
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Chander Kashyap <k.chander@samsung.com>
> Cc: Thomas Abraham <thomas.ab@samsung.com>
> Cc: Vipin Kumar <vipin.kumar@st.com>
> Cc: Wenyou Yang <wenyou.yang@microchip.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180110/2e3f0f7e/attachment.sig>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-01-10 16:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-22  3:13 [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL Tom Rini
2017-12-22  3:13 ` [U-Boot] [PATCH 2/3] build: Drop CONFIG_SPL_BUILD guards in some cases Tom Rini
2018-01-10 16:44   ` [U-Boot] [U-Boot, " Tom Rini
2017-12-22  3:13 ` [U-Boot] [PATCH 3/3] SPL: Do not include cmd lists Tom Rini
2017-12-22 13:29   ` Daniel Schwierzeck
2017-12-22 14:10     ` Tom Rini
2017-12-22 14:37   ` Daniel Schwierzeck
2017-12-22 16:58   ` Tom Rini
2017-12-22  5:29 ` [U-Boot] [PATCH 1/3] ddr: fsl: Do not allow for interactive mode in SPL York Sun
2017-12-22 12:36   ` Tom Rini
2017-12-22 16:02     ` York Sun
2017-12-22 16:06       ` Tom Rini
2017-12-22 16:19         ` York Sun
2017-12-22 16:21           ` Tom Rini

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.