Re: [U-Boot] [RFC PATCH v2 2/9] spl: add initial support for a generic SPL framework

2011-07-18 Thread Wolfgang Denk
Dear Daniel Schwierzeck,

In message 
1310746944-32711-1-git-send-email-daniel.schwierz...@googlemail.com you wrote:
 Signed-off-by: Aneesh V ane...@ti.com
 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com

Thanks.

 +Overview
 +
 +
 +To unify all existing implementations for a secondary program loader (SPL)
 +and to allow simply adding of new implementations this generic SPL framework
 +have been created. With this framework almost all source files for a board

s/have/has/

 +How it works
 +
 +
 +There is a new directory TOPDIR/spl which contains only a Makefile.
 +All source files needed by SPL are recompiled inside this directory
 +and linked to the final binaries named u-boot-spl[.bin|.map].

The recompiled inside this directory might be misinterpreted.  How
about: are compiled such that the resulting object files are placed
into this directory or similar?

 +Thus makefiles and source files are able to build things differently for SPL.

Strictly speaking, the source files don't build anything themself.How
about: This way we can compile the source files with different
settings for SPL. ?

 +Because SPL images normally have a different test base, one have to be

s/test/text/


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Marriage is the sole cause of divorce.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH v2 2/9] spl: add initial support for a generic SPL framework

2011-07-18 Thread Daniel Schwierzeck
Dear Wolfgang,

sorry, I sent the new series too early and missed your answer.
I'll address your comments.

On Mon, Jul 18, 2011 at 6:06 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Daniel Schwierzeck,

 In message 
 1310746944-32711-1-git-send-email-daniel.schwierz...@googlemail.com you 
 wrote:
 Signed-off-by: Aneesh V ane...@ti.com
 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com

 Thanks.

 +Overview
 +
 +
 +To unify all existing implementations for a secondary program loader (SPL)
 +and to allow simply adding of new implementations this generic SPL framework
 +have been created. With this framework almost all source files for a board

 s/have/has/

 +How it works
 +
 +
 +There is a new directory TOPDIR/spl which contains only a Makefile.
 +All source files needed by SPL are recompiled inside this directory
 +and linked to the final binaries named u-boot-spl[.bin|.map].

 The recompiled inside this directory might be misinterpreted.  How
 about: are compiled such that the resulting object files are placed
 into this directory or similar?

 +Thus makefiles and source files are able to build things differently for 
 SPL.

 Strictly speaking, the source files don't build anything themself.How
 about: This way we can compile the source files with different
 settings for SPL. ?

 +Because SPL images normally have a different test base, one have to be

 s/test/text/


 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH,     MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 Marriage is the sole cause of divorce.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 2/9] spl: add initial support for a generic SPL framework

2011-07-15 Thread Daniel Schwierzeck
Signed-off-by: Aneesh V ane...@ti.com
Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com
---
Changes since RFC v1:
 added documentation for SPL

 README |   36 
 doc/README.SPL |   59 
 spl/.gitignore |4 ++
 spl/Makefile   |  101 
 4 files changed, 200 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.SPL
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

diff --git a/README b/README
index 1e2d4d3..63a897d 100644
--- a/README
+++ b/README
@@ -2236,6 +2236,42 @@ FIT uImage format:
Adds the MTD partitioning infrastructure from the Linux
kernel. Needed for UBI support.

+- SPL framework
+CONFIG_SPL
+Enable building of SPL globally.
+
+CONFIG_SPL_TEXT_BASE
+TEXT_BASE that is used when linking the SPL binary.
+
+CONFIG_SPL_LIBCOMMON_SUPPORT
+Support for common/libcommon.o in SPL binary
+
+CONFIG_SPL_LIBDISK_SUPPORT
+Support for disk/libdisk.o in SPL binary
+
+CONFIG_SPL_I2C_SUPPORT
+Support for drivers/i2c/libi2c.o in SPL binary
+
+CONFIG_SPL_GPIO_SUPPORT
+Support for drivers/gpio/libgpio.o in SPL binary
+
+CONFIG_SPL_MMC_SUPPORT
+Support for drivers/mmc/libmmc.o in SPL binary
+
+CONFIG_SPL_SERIAL_SUPPORT
+Support for drivers/serial/libserial.o in SPL binary
+
+CONFIG_SPL_SPI_FLASH_SUPPORT
+Support for drivers/mtd/spi/libspi_flash.o in SPL binary
+
+CONFIG_SPL_SPI_SUPPORT
+Support for drivers/spi/libspi.o in SPL binary
+
+CONFIG_SPL_FAT_SUPPORT
+Support for fs/fat/libfat.o in SPL binary
+
+CONFIG_SPL_LIBGENERIC_SUPPORT
+Support for lib/libgeneric.o in SPL binary

 Modem Support:
 --
diff --git a/doc/README.SPL b/doc/README.SPL
new file mode 100644
index 000..0a89821
--- /dev/null
+++ b/doc/README.SPL
@@ -0,0 +1,59 @@
+Generic SPL framework
+=
+
+Overview
+
+
+To unify all existing implementations for a secondary program loader (SPL)
+and to allow simply adding of new implementations this generic SPL framework
+have been created. With this framework almost all source files for a board
+can be reused. No code duplication or symlinking is necessary anymore.
+
+
+How it works
+
+
+There is a new directory TOPDIR/spl which contains only a Makefile.
+All source files needed by SPL are recompiled inside this directory
+and linked to the final binaries named u-boot-spl[.bin|.map].
+
+During the SPL build a variable named CONFIG_SPL_BUILD is exported
+in the make environment and also appended to CPPFLAGS with -DCONFIG_SPL_BUILD.
+Thus makefiles and source files are able to build things differently for SPL.
+
+For example:
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+COBJS-y += board_spl.o
+else
+COBJS-y += board.o
+endif
+
+COBJS-$(CONFIG_SPL_BUILD) += foo.o
+
+#ifdef CONFIG_SPL_BUILD
+foo();
+#endif
+
+
+The building of SPL images can be with:
+
+#define CONFIG_SPL
+
+Because SPL images normally have a different test base, one have to be
+configured by defining CONFIG_SPL_TEXT_BASE.
+
+To support generic U-Boot libraries and drivers in the SPL binary one can
+optionally define CONFIG_SPL_XXX_SUPPORT. Currently following options
+are supported:
+
+CONFIG_SPL_LIBCOMMON_SUPPORT (common/libcommon.o)
+CONFIG_SPL_LIBDISK_SUPPORT (disk/libdisk.o)
+CONFIG_SPL_I2C_SUPPORT (drivers/i2c/libi2c.o)
+CONFIG_SPL_GPIO_SUPPORT (drivers/gpio/libgpio.o)
+CONFIG_SPL_MMC_SUPPORT (drivers/mmc/libmmc.o)
+CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
+CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
+CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
+CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
diff --git a/spl/.gitignore b/spl/.gitignore
new file mode 100644
index 000..7c88147
--- /dev/null
+++ b/spl/.gitignore
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 000..f20092f
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,101 @@
+#
+# (C) Copyright 2000-2011
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2011
+# Daniel Schwierzeck, daniel.schwierz...@googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V ane...@ti.com
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+# Based on top-level Makefile.
+#
+
+CONFIG_SPL_BUILD := y
+export CONFIG_SPL_BUILD
+
+include