s5p: enable making ubifs image and ubinizing features
authorDonggeun Kim <dg77.kim@samsung.com>
Mon, 4 Oct 2010 10:02:33 +0000 (19:02 +0900)
committerDonggeun Kim <dg77.kim@samsung.com>
Mon, 4 Oct 2010 10:02:33 +0000 (19:02 +0900)
Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
common/cmd_usbd.c
include/configs/s5pc1xx_universal.h
include/configs/s5pc210_universal.h

index e3957f5..b332adf 100644 (file)
@@ -1149,11 +1149,66 @@ static int process_data(struct usbd_ops *usbd)
                else
                        printf("CSA Clear will be skipped temporary\n");
 
+#ifdef CONFIG_UBIFS_MK
+#include <mkfs.ubifs.h>
+               void *dest_addr;
+               void *src_addr = (void *) down_ram_addr;
+               int leb_size, max_leb_cnt, mkfs_min_io_size;
+#ifdef CONFIG_S5PC110
+               mkfs_min_io_size = 4096;
+               leb_size = 248 * 1024;
+               max_leb_cnt = 4096;
+#elif CONFIG_S5PC210
+               mkfs_min_io_size = 2048;
+               leb_size = 126 * 1024;
+               max_leb_cnt = 4096;
+#endif
+               unsigned long ubifs_dest_size, ubi_dest_size;
+               printf("Start making ubifs\n");
+               ret = mkfs(src_addr, len, &dest_addr, &ubifs_dest_size,
+                          mkfs_min_io_size, leb_size, max_leb_cnt);
+               if (ret) {
+                       printf("Error : making ubifs failed\n");
+                       goto out;
+               }
+               printf("Complete making ubifs\n");
+#endif
+
+#ifdef CONFIG_UBINIZE
+#include <ubinize.h>
+               int peb_size, ubi_min_io_size, subpage_size, vid_hdr_offs;
+#ifdef CONFIG_S5PC110
+               ubi_min_io_size = 4096;
+               peb_size = 256 * 1024;
+               subpage_size = 4096;
+               vid_hdr_offs = 0;
+#elif CONFIG_S5PC210
+               ubi_min_io_size = 2048;
+               peb_size = 128 * 1024;
+               subpage_size = 512;
+               vid_hdr_offs = 512;
+#endif
+               printf("Start ubinizing\n");
+               ret = ubinize(dest_addr, ubifs_dest_size,
+                             src_addr, &ubi_dest_size,
+                             peb_size, ubi_min_io_size,
+                             subpage_size, vid_hdr_offs);
+               if (ret) {
+                       printf("Error : ubinizing failed\n");
+                       goto out;
+               }
+               printf("Complete ubinizing\n");
+
+               len = (unsigned int) ubi_dest_size;
+
+               free(dest_addr);
+#endif
                /* Write : arg (0 Modem) / (1 CSA) */
                if (!arg) {
                        sprintf(length, "%x", (unsigned int) len);
                        ret = nand_cmd(1, ramaddr, offset, length);
                }
+out:
                break;
 
 #ifdef CONFIG_CMD_MMC
index 48b4497..a1b7c34 100644 (file)
@@ -73,7 +73,7 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 1024 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 15 * 1024 * 1024)
 #define CONFIG_SYS_GBL_DATA_SIZE       128     /* size in bytes for initial data */
 
 /*
 #define CONFIG_LZO
 #endif
 
+/* To enable make ubifs and ubinized image*/
+#define CONFIG_LZO_COMPRESSION
+#define CONFIG_UBIFS_MK
+#define CONFIG_UBINIZE
+
 /* To use the TFTPBOOT over USB, Please enable the CONFIG_CMD_NET */
 #undef CONFIG_CMD_NET
 
index 8c44f95..b7ddb19 100644 (file)
@@ -67,7 +67,7 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 1024 * 1024)
+#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 15 * 1024 * 1024)
 #define CONFIG_SYS_GBL_DATA_SIZE       128     /* size in bytes for initial data */
 
 /*
 #define CONFIG_LZO
 #endif
 
+/* To enable make ubifs and ubinized image*/
+#define CONFIG_LZO_COMPRESSION
+#define CONFIG_UBIFS_MK
+#define CONFIG_UBINIZE
+
 /* To use the TFTPBOOT over USB, Please enable the CONFIG_CMD_NET */
 #undef CONFIG_CMD_NET