]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
at91: Choose environment variables location within make config target
authorNicolas Ferre <nicolas.ferre@atmel.com>
Sat, 6 Dec 2008 12:11:14 +0000 (13:11 +0100)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Sat, 6 Dec 2008 12:11:14 +0000 (13:11 +0100)
This patch adds the possiblity to choose the media where the environment will
be located. This allow to choose this fundamental configuration without editing
config files.

Documentation file added.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Stelian Pop <stelian@popies.net>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Makefile
doc/README.at91 [new file with mode: 0644]
include/configs/at91sam9260ek.h
include/configs/at91sam9261ek.h
include/configs/at91sam9263ek.h
include/configs/at91sam9rlek.h

index befb6081a8221f0db92b36c2aa068d614f259fce..2ac8141f9c1a21fecc449d043c3d09a3a287d9c4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2582,17 +2582,63 @@ afeb9260_config:        unconfig
 at91cap9adk_config     :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm926ejs at91cap9adk atmel at91
 
+at91sam9260ek_nandflash_config \
+at91sam9260ek_dataflash_cs0_config \
+at91sam9260ek_dataflash_cs1_config \
 at91sam9260ek_config   :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91
+       @if [ "$(findstring _nandflash,$@)" ] ; then \
+               echo "#define CONFIG_SYS_USE_NANDFLASH 1"       >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in NAND FLASH" ; \
+       elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
+               echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1"   >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
+       else \
+               echo "#define CONFIG_SYS_USE_DATAFLASH_CS1 1"   >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; \
+       fi;
+       @$(MKCONFIG) -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91
 
+at91sam9261ek_nandflash_config \
+at91sam9261ek_dataflash_cs0_config \
+at91sam9261ek_dataflash_cs3_config \
 at91sam9261ek_config   :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91
+       @if [ "$(findstring _nandflash,$@)" ] ; then \
+               echo "#define CONFIG_SYS_USE_NANDFLASH 1"       >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in NAND FLASH" ; \
+       elif [ "$(findstring dataflash_cs3,$@)" ] ; then \
+               echo "#define CONFIG_SYS_USE_DATAFLASH_CS3 1"   >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in SPI DATAFLASH CS3" ; \
+       else \
+               echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1"   >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
+       fi;
+       @$(MKCONFIG) -a at91sam9261ek arm arm926ejs at91sam9261ek atmel at91
 
+at91sam9263ek_nandflash_config \
+at91sam9263ek_dataflash_config \
+at91sam9263ek_dataflash_cs0_config \
 at91sam9263ek_config   :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91
+       @if [ "$(findstring _nandflash,$@)" ] ; then \
+               echo "#define CONFIG_SYS_USE_NANDFLASH 1"       >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in NAND FLASH" ; \
+       else \
+               echo "#define CONFIG_SYS_USE_DATAFLASH 1"       >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
+       fi;
+       @$(MKCONFIG) -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91
 
+at91sam9rlek_nandflash_config \
+at91sam9rlek_dataflash_config \
+at91sam9rlek_dataflash_cs0_config \
 at91sam9rlek_config    :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
+       @if [ "$(findstring _nandflash,$@)" ] ; then \
+               echo "#define CONFIG_SYS_USE_NANDFLASH 1"       >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in NAND FLASH" ; \
+       else \
+               echo "#define CONFIG_SYS_USE_DATAFLASH 1"       >>$(obj)include/config.h ; \
+               $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
+       fi;
+       @$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
 
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
diff --git a/doc/README.at91 b/doc/README.at91
new file mode 100644 (file)
index 0000000..838769a
--- /dev/null
@@ -0,0 +1,88 @@
+Atmel AT91 Evaluation kits
+
+http://atmel.com/dyn/products/tools.asp?family_id=605#1443
+
+------------------------------------------------------------------------------
+AT91SAM9260EK
+------------------------------------------------------------------------------
+
+Memory map
+       0x20000000 - 23FFFFFF   SDRAM (64 MB)
+       0xC0000000 - Cxxxxxxx   Atmel Dataflash card (J13)
+       0xD0000000 - Dxxxxxxx   Soldered Atmel Dataflash
+
+Environment variables
+
+       U-Boot environment variables can be stored at different places:
+               - Dataflash on SPI chip select 1 (default)
+               - Dataflash on SPI chip select 0 (dataflash card)
+               - Nand flash.
+
+       You can choose your storage location at config step (here for at91sam9260ek) :
+               make at91sam9260ek_config               - use data flash (spi cs1) (default)
+               make at91sam9260ek_nandflash_config     - use nand flash
+               make at91sam9260ek_dataflash_cs0_config - use data flash (spi cs0)
+               make at91sam9260ek_dataflash_cs1_config - use data flash (spi cs1)
+
+
+------------------------------------------------------------------------------
+AT91SAM9261EK
+------------------------------------------------------------------------------
+
+Memory map
+       0x20000000 - 23FFFFFF   SDRAM (64 MB)
+       0xC0000000 - Cxxxxxxx   Soldered Atmel Dataflash
+       0xD0000000 - Dxxxxxxx   Atmel Dataflash card (J22)
+
+Environment variables
+
+       U-Boot environment variables can be stored at different places:
+               - Dataflash on SPI chip select 0 (default)
+               - Dataflash on SPI chip select 3 (dataflash card)
+               - Nand flash.
+
+       You can choose your storage location at config step (here for at91sam9260ek) :
+               make at91sam9261ek_config               - use data flash (spi cs0) (default)
+               make at91sam9261ek_nandflash_config     - use nand flash
+               make at91sam9261ek_dataflash_cs0_config - use data flash (spi cs0)
+               make at91sam9261ek_dataflash_cs3_config - use data flash (spi cs3)
+
+
+------------------------------------------------------------------------------
+AT91SAM9263EK
+------------------------------------------------------------------------------
+
+Memory map
+       0x20000000 - 23FFFFFF   SDRAM (64 MB)
+       0xC0000000 - Cxxxxxxx   Atmel Dataflash card (J9)
+
+Environment variables
+
+       U-Boot environment variables can be stored at different places:
+               - Dataflash on SPI chip select 0 (dataflash card)
+               - Nand flash.
+
+       You can choose your storage location at config step (here for at91sam9260ek) :
+               make at91sam9263ek_config               - use data flash (spi cs0) (default)
+               make at91sam9263ek_nandflash_config     - use nand flash
+               make at91sam9263ek_dataflash_cs0_config - use data flash (spi cs0)
+
+
+------------------------------------------------------------------------------
+AT91SAM9RLEK
+------------------------------------------------------------------------------
+
+Memory map
+       0x20000000 - 23FFFFFF   SDRAM (64 MB)
+       0xC0000000 - Cxxxxxxx   Soldered Atmel Dataflash
+
+Environment variables
+
+       U-Boot environment variables can be stored at different places:
+               - Dataflash on SPI chip select 0
+               - Nand flash.
+
+       You can choose your storage location at config step (here for at91sam9260ek) :
+               make at91sam9263ek_config               - use data flash (spi cs0) (default)
+               make at91sam9263ek_nandflash_config     - use nand flash
+               make at91sam9263ek_dataflash_cs0_config - use data flash (spi cs0)
index fbc470fbe0a0ef7a92a30227bb8d3234390f895a..2df8d549156291b6003dd6d9d8b3c1b698665b4b 100644 (file)
 #define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
 #define CONFIG_SYS_MEMTEST_END                 0x23e00000
 
-#undef CONFIG_SYS_USE_DATAFLASH_CS0
-#define CONFIG_SYS_USE_DATAFLASH_CS1           1
-#undef CONFIG_SYS_USE_NANDFLASH
-
 #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
index bd668235d3889e76a702b322585cf7f9feb7e175..0016b4fbfb7d2aa6a17daf19ea88d5860b35f6cf 100644 (file)
 #define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
 #define CONFIG_SYS_MEMTEST_END                 0x23e00000
 
-#define CONFIG_SYS_USE_DATAFLASH_CS0           1
-#undef CONFIG_SYS_USE_NANDFLASH
-
 #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH     1
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-#define CONFIG_ENV_OFFSET              0x4200
+#define CONFIG_ENV_OFFSET      0x4200
 #define CONFIG_ENV_ADDR                (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
 #define CONFIG_ENV_SIZE                0x4200
 #define CONFIG_BOOTCOMMAND     "cp.b 0xC0042000 0x22000000 0x210000; bootm"
                                "mtdparts=at91_nand:-(root) "           \
                                "rw rootfstype=jffs2"
 
+#elif CONFIG_SYS_USE_DATAFLASH_CS3
+
+/* bootstrap + u-boot + env + linux in dataflash on CS3 */
+#define CONFIG_ENV_IS_IN_DATAFLASH     1
+#define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 0x8400)
+#define CONFIG_ENV_OFFSET      0x4200
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_SIZE                0x4200
+#define CONFIG_BOOTCOMMAND     "cp.b 0xD0042000 0x22000000 0x210000; bootm"
+#define CONFIG_BOOTARGS                "console=ttyS0,115200 "                 \
+                               "root=/dev/mtdblock0 "                  \
+                               "mtdparts=at91_nand:-(root) "           \
+                               "rw rootfstype=jffs2"
+
 #else /* CONFIG_SYS_USE_NANDFLASH */
 
 /* bootstrap + u-boot + env + linux in nandflash */
index a2b09ca9f7c1eb27894f99ec7025627ffbc02bf8..fc7c94126e65a3e70c1ee38dcbfe95f13cec1f2e 100644 (file)
 #define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
 #define CONFIG_SYS_MEMTEST_END                 0x23e00000
 
-#define CONFIG_SYS_USE_DATAFLASH               1
-#undef CONFIG_SYS_USE_NANDFLASH
-
 #ifdef CONFIG_SYS_USE_DATAFLASH
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
index 35dac47ba1cccdbd3c33302233d9899e340a9da4..35fefc4213142e76ebd3e7fb8a8d5f19e8916094 100644 (file)
 #define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
 #define CONFIG_SYS_MEMTEST_END                 0x23e00000
 
-#define CONFIG_SYS_USE_DATAFLASH               1
-#undef CONFIG_SYS_USE_NANDFLASH
-
 #ifdef CONFIG_SYS_USE_DATAFLASH
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */