]> git.sur5r.net Git - u-boot/commitdiff
mx28evk: Introduce a new target for saving env vars to NAND
authorFabio Estevam <fabio.estevam@freescale.com>
Thu, 7 Mar 2013 11:28:19 +0000 (11:28 +0000)
committerStefano Babic <sbabic@denx.de>
Wed, 3 Apr 2013 08:55:18 +0000 (10:55 +0200)
Introduce 'mx28evk_nand' target for saving environment variables into NAND.

The mx28evk board does not come with a NAND flash populated from the
factory. It comes with an empty slot (U23), which allows the insertion of a
48-pin TSOP flash device.

Tested with a K9LBG08U0D.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
boards.cfg
doc/README.mx28evk
include/configs/mx28evk.h

index 199fcfa0c130ba6976b2d5559d314ae8d3d873fb..7725a1534d4dec6dbbec7acd5168cddc1426b4c6 100644 (file)
@@ -196,7 +196,8 @@ mx23_olinuxino               arm         arm926ejs   mx23_olinuxino      olimex
 apx4devkit                   arm         arm926ejs   apx4devkit          bluegiga       mxs            apx4devkit
 mx23evk                      arm         arm926ejs   mx23evk             freescale      mxs            mx23evk
 m28evk                       arm         arm926ejs   m28evk              denx           mxs            m28evk
-mx28evk                      arm         arm926ejs   mx28evk             freescale      mxs            mx28evk
+mx28evk                      arm         arm926ejs   mx28evk             freescale      mxs            mx28evk:ENV_IS_IN_MMC
+mx28evk_nand                 arm         arm926ejs   mx28evk             freescale      mxs            mx28evk:ENV_IS_IN_NAND
 sc_sps_1                     arm         arm926ejs   sc_sps_1            schulercontrol mxs
 nhk8815                      arm         arm926ejs   nhk8815             st             nomadik
 nhk8815_onenand              arm         arm926ejs   nhk8815             st             nomadik       nhk8815:BOOT_ONENAND
index 2fc50696f5ef3175ea5211565d59f33d1280aedd..76db474bfb63e3ee7c8c64e377f122d575a8e865 100644 (file)
@@ -23,6 +23,24 @@ To boot MX28EVK from an SD card, set the boot mode DIP switches as:
    * VDD 5V: To the left (off)
    * Hold Button: Down (off)
 
+
+Environment Storage
+-------------------
+
+There are two targets for mx28evk:
+
+"make mx28evk_config"          - store enviroment variables into MMC
+
+or
+
+"make mx28evk_nand_config"     - store enviroment variables into NAND flash
+
+Choose the target accordingly.
+
+Note: The mx28evk board does not come with a NAND flash populated from the
+factory. It comes with an empty slot (U23), which allows the insertion of a
+48-pin TSOP flash device.
+
 Follow the instructions from doc/README.mx28_common to generate a bootable SD
 card.
 
index 428fe868ce2b75026af69686850322ba09c48931..d470b4733e52c8b7f021c60971aa4c472e821acd 100644 (file)
@@ -62,6 +62,7 @@
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_USB
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_CMD_NAND
 
 /* Memory configurations */
 #define CONFIG_NR_DRAM_BANKS           1               /* 1 bank of DRAM */
 #define CONFIG_APBH_DMA
 
 /* MMC Driver */
-#define CONFIG_ENV_IS_IN_MMC
 #ifdef CONFIG_ENV_IS_IN_MMC
  #define CONFIG_ENV_OFFSET     (256 * 1024)
  #define CONFIG_ENV_SIZE       (16 * 1024)
 #endif
 
 /* NAND Driver */
+#define CONFIG_ENV_SIZE                        (16 * 1024)
 #ifdef CONFIG_CMD_NAND
 #define CONFIG_NAND_MXS
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define CONFIG_SYS_NAND_BASE           0x60000000
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
+
+/* Environment is in NAND */
+#define CONFIG_ENV_SIZE_REDUND         CONFIG_ENV_SIZE
+#define CONFIG_ENV_SECT_SIZE           (128 * 1024)
+#define CONFIG_ENV_RANGE               (512 * 1024)
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET              0x300000
+#endif
+#define CONFIG_ENV_OFFSET_REDUND       \
+               (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
+
+#define CONFIG_CMD_UBI
+#define CONFIG_CMD_UBIFS
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_RBTREE
+#define CONFIG_LZO
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT                 "nand0=gpmi-nand"
+#define MTDPARTS_DEFAULT                       \
+       "mtdparts=gpmi-nand:"                   \
+               "3m(bootloader)ro,"             \
+               "512k(environment),"            \
+               "512k(redundant-environment),"  \
+               "4m(kernel),"                   \
+               "128k(fdt),"                    \
+               "8m(ramdisk),"                  \
+               "-(filesystem)"
 #endif
 
 /* Ethernet on SOC (FEC) */