[PATCH] MTD partition support, JFFS2 support
authorMichal Simek <monstr@monstr.eu>
Tue, 24 Apr 2007 21:01:02 +0000 (23:01 +0200)
committerMichal Simek <monstr@monstr.eu>
Tue, 24 Apr 2007 21:01:02 +0000 (23:01 +0200)
fs/jffs2/compr_zlib.c
include/configs/ml401.h
include/linux/stat.h

index 1b35585eee59232ea2d2375e8a3dc801941a42a8..d88d0f8f36e349db35317f84bb118a282735bd15 100644 (file)
@@ -45,7 +45,7 @@
 long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
                      __u32 srclen, __u32 destlen)
 {
-    return (decompress_block(cpage_out, data_in + 2, ldr_memcpy));
+    return (decompress_block(cpage_out, data_in + 2, (void *) ldr_memcpy));
 
 }
 
index 15c2fe7ecd1ca22850a9bc050a8788bc5985585e..acaa1e4f2b945addd08c55bf741f4a51e53a6f27 100644 (file)
@@ -40,7 +40,7 @@
 
 /* ethernet */
 #define CONFIG_EMACLITE                1
-#define XPAR_EMAC_0_DEVICE_ID  XPAR_XEMAC_NUM_INSTANCES
+#define XPAR_EMAC_0_DEVICE_ID  XPAR_OPB_ETHERNET_0_DEVICE_ID
 
 /* gpio */
 #define        CFG_GPIO_0              1
        #define CFG_FLASH_EMPTY_INFO    1       /* ?empty sector */
        #define CFG_MAX_FLASH_BANKS     1       /* max number of memory banks */
        #define CFG_MAX_FLASH_SECT      128     /* max number of sectors on one chip */
+       #define CFG_FLASH_PROTECTION            /* hardware flash protection */
 
        #ifdef  RAMENV
                #define CFG_ENV_IS_NOWHERE      1
        #define CFG_ENV_IS_NOWHERE      1
        #define CFG_ENV_SIZE            0x1000
        #define CFG_ENV_ADDR            (CFG_MONITOR_BASE - CFG_ENV_SIZE)
+       #define CFG_FLASH_PROTECTION            /* hardware flash protection */
 #endif /* !FLASH */
 
 #ifdef FLASH
                                CFG_CMD_CACHE |\
                                CFG_CMD_FAT |\
                                CFG_CMD_EXT2 |\
+                               CFG_CMD_JFFS2 |\
+                               CFG_CMD_ECHO |\
                                CFG_CMD_IMLS |\
                                CFG_CMD_FLASH |\
                                CFG_CMD_PING \
                                CFG_CMD_ENV |\
                                CFG_CMD_FAT |\
                                CFG_CMD_EXT2 |\
+                               CFG_CMD_JFFS2 |\
+                               CFG_CMD_ECHO |\
                                CFG_CMD_SAVES \
                                )
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
+#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
+/* JFFS2 partitions */
+#define CONFIG_JFFS2_CMDLINE   /* mtdparts command line support */
+#define MTDIDS_DEFAULT         "nor0=ml401-0"
+
+/* default mtd partition table */
+#define MTDPARTS_DEFAULT       "mtdparts=ml401-0:256k(u-boot),"\
+                               "256k(env),3m(kernel),1m(romfs),"\
+                               "1m(cramfs),-(jffs2)"
+#endif
+
 /* Miscellaneous configurable options */
 #define        CFG_PROMPT      "U-Boot-mONStR> "
 #define        CFG_CBSIZE      512     /* size of console buffer */
 #define        CFG_LONGHELP
 #define        CFG_LOAD_ADDR   0x12000000 /* default load address */
 
-#define        CONFIG_BOOTDELAY        30
+#define        CONFIG_BOOTDELAY        30
 #define        CONFIG_BOOTARGS         "root=romfs"
 #define        CONFIG_HOSTNAME         "ml401"
 #define        CONFIG_BOOTCOMMAND      "base 0;tftp 11000000 image.img;bootm"
 #define        CFG_SYSTEMACE_WIDTH     XILINX_SYSACE_MEM_WIDTH
 #define        CONFIG_DOS_PARTITION
 
+#define        CONFIG_PREBOOT          "echo U-BOOT for ML401;setenv preboot;echo"
+
+#define        CONFIG_EXTRA_ENV_SETTINGS       "unlock=yes\0" /* hardware flash protection */\
+                                       "nor0=ml401-0\0"\
+                                       "mtdparts=mtdparts=ml401-0:"\
+                                       "256k(u-boot),256k(env),3m(kernel),"\
+                                       "1m(romfs),1m(cramfs),-(jffs2)\0"
+
 #endif /* __CONFIG_H */
index f9422cb1fafcf2d2bb24e2b36ece2fe39335bda2..39386f1220a03ff604e11eba30f36fb614b2cdeb 100644 (file)
@@ -67,7 +67,8 @@ struct stat {
 
 #endif /* __PPC__ */
 
-#if defined (__ARM__) || defined (__I386__) || defined (__M68K__) || defined (__blackfin__)
+#if defined (__ARM__) || defined (__I386__) || defined (__M68K__) || defined (__blackfin__) ||\
+       defined (__microblaze__)
 
 struct stat {
        unsigned short st_dev;