lantiq: fix vr9 ubi handling
authorJohn Crispin <john@openwrt.org>
Thu, 3 Apr 2014 14:26:24 +0000 (14:26 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 3 Apr 2014 14:26:24 +0000 (14:26 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 40364

target/linux/lantiq/config-default
target/linux/lantiq/dts/FRITZ3370.dts
target/linux/lantiq/image/Makefile
target/linux/lantiq/image/ubinize-overlay.cfg [new file with mode: 0644]
target/linux/lantiq/xrx200/config-default
target/linux/lantiq/xrx200/profiles/avm.mk
target/linux/lantiq/xrx200/target.mk

index c42c20d..1efab8b 100644 (file)
@@ -87,8 +87,6 @@ CONFIG_LANTIQ_PHY=y
 CONFIG_LANTIQ_WDT=y
 CONFIG_LANTIQ_XRX200=y
 CONFIG_LEDS_GPIO=y
-# CONFIG_LZO_COMPRESS is not set
-# CONFIG_LZO_DECOMPRESS is not set
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MIPS=y
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
index 0017dde..c0202ba 100644 (file)
@@ -6,7 +6,7 @@
        model = "FRITZ3370 - Fritz!Box WLAN 3370";
 
        chosen {
-               bootargs = "console=ttyLTQ0,115200";
+               bootargs = "console=ttyLTQ0,115200 ubi.mtd=1,512 root=/dev/mtdblock9";
        };
 
        memory@0 {
                                #size-cells = <1>;
 
                                partition@0 {
-                                       label = "firmware";
-                                       reg = <0x00000 0x3400000>;
+                                       label = "kernel";
+                                       reg = <0x0 0x400000>;
+                               };
+
+                               partition@400000 {
+                                       label = "rootfs_ubi";
+                                       reg = <0x400000 0x3000000>;
                                };
 
                                partition@3400000 {
                                        lantiq,groups = "spi", "spi_cs4";
                                        lantiq,function = "gpio";
                                };
-                               nand_out {
-                                       lantiq,groups = "nand cle", "nand ale", "nand rd", "ebu a23", "ebu a24";
-                                       lantiq,function = "ebu";
-                                       lantiq,direction = <1>;
-                                       lantiq,pull = <0>;
-                               };
-                               nand_in {
-                                       lantiq,groups = "nand rdy";
-                                       lantiq,function = "ebu";
-                                       lantiq,direction = <0>;
-                                       lantiq,open-drain = <1>;
-                                       lantiq,pull = <2>;
-                               };
                                mdio {
                                        lantiq,groups = "mdio";
                                        lantiq,function = "mdio";
                                };
+                               nand {
+                                       lantiq,groups = "nand cle", "nand ale",
+                                                       "nand rd", "nand cs1", "nand rdy";
+                                       lantiq,function = "ebu";
+                                       lantiq,pull = <1>;
+                               };
                                phy-rst {
                                        lantiq,pins = "io37", "io44";
                                        lantiq,pull = <0>;
                                #size-cells = <0>;
                                reg = <0>;
                                mac-address = [ 00 11 22 33 44 55 ];
+                               lantiq,switch;
 
                                ethernet@0 {
                                        compatible = "lantiq,xrx200-pdi-port";
index 28cb96c..34591c7 100644 (file)
@@ -54,10 +54,10 @@ define TPLinkImageLzma
 endef
 
 define MkImageEVA
-       lzma2eva 0x80002000 0x80002000 $(KDIR)/vmlinux-$(1).lzma $(KDIR)/$(1).eva.prealign
-       dd if=$(KDIR)/$(1).eva.prealign of=$(KDIR)/$(1).eva.align.64k bs=64k conv=sync
-       dd if=$(KDIR)/$(1).eva.prealign of=$(KDIR)/$(1).eva.align.128k bs=128k conv=sync
-       cat ./eva.dummy.squashfs >> $(KDIR)/$(1).eva.align.64k
+       lzma2eva 0x80002000 0x80002000 $(KDIR)/vmlinux$(2)-$(1).lzma $(KDIR)/$(1)$(2).eva.prealign
+       dd if=$(KDIR)/$(1)$(2).eva.prealign of=$(KDIR)/$(1)$(2).eva.align.64k bs=64k conv=sync
+       dd if=$(KDIR)/$(1)$(2).eva.prealign of=$(KDIR)/$(1)$(2).eva.align.128k bs=128k conv=sync
+       cat ./eva.dummy.squashfs >> $(KDIR)/$(1)$(2).eva.align.64k
 endef
 
 define CompressGzip
@@ -93,6 +93,21 @@ define Image/BuildEVA/squashfs
        $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva)
 endef
 
+define Image/BuildEVA/ubifs
+
+ifneq ($($(PROFILE)_UBIFS_OPTS),)
+       $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubifs
+endif
+endef
+
+define Image/BuildEVA/ubi
+
+ifneq ($($(PROFILE)_UBI_OPTS),)
+       $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubi
+       $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs-overlay.ubi
+endif
+endef
+
 define Image/BuildLoader/squashfs
        dd if=$(KDIR)/loader-$(2).bin of=$(KDIR)/loader-$(2).bin.padded bs=1536k conv=sync
        cat $(KDIR)/loader-$(2).bin.padded $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
@@ -197,6 +212,12 @@ define Image/BuildKernelEVA/Template
        $(call MkImageEVA,$(1))
        $(CP) $(KDIR)/$(1).eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.64k
        $(CP) $(KDIR)/$(1).eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.128k
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+       $(call PatchKernelLzma,$(1),-initramfs)
+       $(call MkImageEVA,$(1),-initramfs)
+       $(CP) $(KDIR)/$(1)-initramfs.eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1)-initramfs.eva.align.64k
+       $(CP) $(KDIR)/$(1)-initramfs.eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1)-initramfs.eva.align.128k
+endif
 endef
 
 define Image/BuildKernelGzip/Template
diff --git a/target/linux/lantiq/image/ubinize-overlay.cfg b/target/linux/lantiq/image/ubinize-overlay.cfg
new file mode 100644 (file)
index 0000000..ce8e5d9
--- /dev/null
@@ -0,0 +1,21 @@
+[rootfs]
+# Volume mode (other option is static)
+mode=ubi
+# Source image
+image=root.squashfs
+# Volume ID in UBI image
+vol_id=0
+# Allow for dynamic resize
+vol_type=dynamic
+# Volume name
+vol_name=rootfs
+[rootfs_data]
+# Volume mode (other option is static)
+mode=ubi
+# Volume ID in UBI image
+vol_id=1
+# Allow for dynamic resize
+vol_type=dynamic
+# Volume name
+vol_name=rootfs_data
+vol_size=1MiB
index 4d25f21..4550431 100644 (file)
@@ -29,7 +29,7 @@ CONFIG_MTD_NAND_XWAY=y
 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_GLUEBI=y
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NLS=y
 CONFIG_PCIE_LANTIQ=y
index 77c1a0a..7eb6830 100644 (file)
@@ -7,4 +7,7 @@ define Profile/FRITZ3370
        ltq-vdsl-app ppp-mod-pppoa
 endef
 
+FRITZ3370_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
+FRITZ3370_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
+
 $(eval $(call Profile,FRITZ3370))
index 47d9be6..0c64668 100644 (file)
@@ -5,7 +5,7 @@ FEATURES:=squashfs atm mips16 jffs2 ubifs
 CPU_TYPE:=34kc
 CPU_SUBTYPE:=dsp
 
-DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug
+DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug swconfig
 
 define Target/Description
        Lantiq XRX200