kirkwood: add support for UBI (3.10.x)

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 38301
This commit is contained in:
Luka Perkov 2013-10-04 03:45:52 +00:00
parent e96695df10
commit fa3ab0c237
4 changed files with 56 additions and 10 deletions

View 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

View 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
endef
define Image/Build
$(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 ;
-I dts $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(board).dts
)
endef
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),
$(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 \

View file

@ -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

View file

@ -34,10 +34,9 @@
};
- partition@700000 {
- label = "root";
- reg = <0x0700000 0xf900000>;
+ partition@100000 {
+ label = "rootfs";
label = "root";
- reg = <0x0700000 0xf900000>;
+ reg = <0x100000 0xff00000>;
};
-