kirkwood: add support for UBI (3.10.x)
authorLuka Perkov <luka@openwrt.org>
Fri, 4 Oct 2013 03:45:52 +0000 (03:45 +0000)
committerLuka Perkov <luka@openwrt.org>
Fri, 4 Oct 2013 03:45:52 +0000 (03:45 +0000)
Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 38301

target/linux/kirkwood/config-3.10
target/linux/kirkwood/image/Makefile
target/linux/kirkwood/image/ubinize.cfg [new file with mode: 0644]
target/linux/kirkwood/patches-3.10/110-ib62x0.patch

index 06051994c81fee1b485ea324125226127995405c..298870c5cb8c28140f3ef00708106b41298effe0 100644 (file)
@@ -46,6 +46,8 @@ CONFIG_CPU_PM=y
 CONFIG_CPU_TLB_FEROCEON=y
 CONFIG_CPU_USE_DOMAINS=y
 CONFIG_CRC16=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 # CONFIG_DEBUG_PINCTRL is not set
 # CONFIG_DEBUG_USER is not set
@@ -129,6 +131,8 @@ CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_REGULATOR is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
 CONFIG_M25PXX_USE_FAST_READ=y
 # CONFIG_MACH_D2NET_V2 is not set
 CONFIG_MACH_DLINK_KIRKWOOD_DT=y
@@ -164,6 +168,11 @@ CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_ORION=y
 CONFIG_MTD_OF_PARTS=y
 # CONFIG_MTD_SM_COMMON is not set
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_MV643XX_ETH=y
 CONFIG_MVEBU_CLK_CORE=y
 CONFIG_MVEBU_CLK_GATING=y
@@ -236,6 +245,11 @@ CONFIG_SPI_ORION=y
 CONFIG_SPLIT_PTLOCK_CPUS=999999
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+# CONFIG_UBIFS_FS_XZ is not set
+CONFIG_UBIFS_FS_ZLIB=y
 CONFIG_UID16=y
 CONFIG_UIDGID_CONVERTED=y
 CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
@@ -258,4 +272,6 @@ CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=y
 CONFIG_ZONE_DMA_FLAG=0
index 51af440d34e4c93d6bcc563cdc62cdfec5e45b87..b3d25f56b016eb914a6afc5222a1180aa5282d64 100644 (file)
@@ -8,21 +8,39 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
 NAND_BLOCKSIZE := 2048:128k
+UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 -U
+UBINIZE_OPTS := -m 2048 -p 128KiB -s 512
 
 define Image/BuildKernel
-       cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+       $(CP) $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+
 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
        $(CP) $(KDIR)/uImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs
 endif
+
+ $(foreach board,$(BOARDS),
+       $(LINUX_DIR)/scripts/dtc/dtc \
+         -O dtb -o $(BIN_DIR)/$(IMG_PREFIX)-$(board).dtb \
+         -I dts $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(board).dts
+ )
 endef
 
-define Image/Build
+define Image/InstallKernel
+ ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
+       $(INSTALL_DIR) $(TARGET_DIR)/boot
+       $(CP) $(KDIR)/uImage $(TARGET_DIR)/boot/
+ endif
+
+ ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
+       $(INSTALL_DIR) $(TARGET_DIR)/boot
        $(foreach board,$(BOARDS),
-               $(LINUX_DIR)/scripts/dtc/dtc \
-                       -O dtb -o $(BIN_DIR)/$(IMG_PREFIX)-$(board).dtb \
-                       -I dts $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(board).dts ;
+         $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(board).dtb $(TARGET_DIR)/boot/
        )
+ endif
+endef
 
+define Image/Build
        $(if $(Image/Build/$(1)), \
                $(call Image/Build/$(1),$(1)), \
                $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
diff --git a/target/linux/kirkwood/image/ubinize.cfg b/target/linux/kirkwood/image/ubinize.cfg
new file mode 100644 (file)
index 0000000..e4149ec
--- /dev/null
@@ -0,0 +1,13 @@
+[rootfs]
+# Volume mode (other option is static)
+mode=ubi
+# Source image
+image=root.ubifs
+# Volume ID in UBI image
+vol_id=0
+# Allow for dynamic resize
+vol_type=dynamic
+# Volume name
+vol_name=rootfs
+# Autoresize volume at first mount
+vol_flags=autoresize
index 7404decd7eb39b27c1d6ea0dc8943fedf903dfb4..3659b9587b88ae4a8e9a71c7cad254f357fea4b7 100644 (file)
                        };
  
 -                      partition@700000 {
--                              label = "root";
--                              reg = <0x0700000 0xf900000>;
 +                      partition@100000 {
-+                              label = "rootfs";
+                               label = "root";
+-                              reg = <0x0700000 0xf900000>;
 +                              reg = <0x100000 0xff00000>;
                        };
 -