kirkwood: upgrade to 3.10.15
authorLuka Perkov <luka@openwrt.org>
Mon, 14 Oct 2013 19:46:40 +0000 (19:46 +0000)
committerLuka Perkov <luka@openwrt.org>
Mon, 14 Oct 2013 19:46:40 +0000 (19:46 +0000)
Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 38402

target/linux/kirkwood/Makefile
target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
target/linux/kirkwood/base-files/etc/uci-defaults/02_network
target/linux/kirkwood/base-files/lib/kirkwood.sh [deleted file]
target/linux/kirkwood/image/Makefile
target/linux/kirkwood/profiles/100-generic.mk [new file with mode: 0644]
target/linux/kirkwood/profiles/110-nas.mk [new file with mode: 0644]

index 4739760dec2ca9a09ea8bfc278b5987d912a1fbd..ba1d259d64791a16e1f233c63f610091fc97ceaf 100644 (file)
@@ -9,16 +9,14 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=kirkwood
 BOARDNAME:=Marvell Kirkwood
-FEATURES:=targz usb jffs2_nand
+FEATURES:=targz usb jffs2_nand ubifs
 CPU_TYPE:=xscale
 MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
 
-LINUX_VERSION:=3.3.8
+LINUX_VERSION:=3.10.15
 
 include $(INCLUDE_DIR)/target.mk
 
-KERNELNAME:="uImage"
-
-DEFAULT_PACKAGES +=
+KERNELNAME:="zImage dtbs"
 
 $(eval $(call BuildTarget))
index 18ac43c86acb63b5d8c1cb0a41d17224eeabf1e8..7e2018853a66fed8b4139170e31c07b14763ba3e 100644 (file)
@@ -1,19 +1,15 @@
 #!/bin/sh
 #
-# Copyright (C) 2012 OpenWrt.org
+# Copyright (C) 2012-2013 OpenWrt.org
 #
 
 . /lib/functions/uci-defaults.sh
-. /lib/kirkwood.sh
 
-hardware=$(kirkwood_hardware_name)
-
-case "$hardware" in
+case "`cat /proc/device-tree/model`" in
 "Seagate FreeAgent DockStar")
        ucidef_set_led_netdev "eth0" "dockstar:orange:misc" "eth0"
        ucidef_set_led_default "health" "dockstar:green:health" "1"
        ;;
-
 *)
        ;;
 esac
index 8c04fdbf2856f42f9d93e509863233ce1736d1b1..42724ef706a0863b70507b77ea57af7b5b376167 100644 (file)
@@ -1,10 +1,12 @@
 #!/bin/sh
 #
-# Copyright (C) 2012 OpenWrt.org
+# Copyright (C) 2012-2013 OpenWrt.org
 #
 
 [ -e /etc/config/network ] && exit 0
 
+touch /etc/config/network
+
 set_lan_dhcp() {
        local ifname=$1
        uci batch <<EOF
@@ -19,23 +21,17 @@ EOF
 }
 
 . /lib/functions/uci-defaults.sh
-. /lib/kirkwood.sh
-
-touch /etc/config/network
 
 ucidef_set_interface_loopback
 
-hardware=$(kirkwood_hardware_name)
-
-case "$hardware" in
-"Seagate FreeAgent DockStar")
+case "`cat /proc/device-tree/model`" in
+"Seagate FreeAgent Dockstar")
        set_lan_dhcp "eth0"
        ;;
 
-"RaidSonic ICY BOX IB-NAS6210")
+"RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
        set_lan_dhcp "eth0"
        ;;
-
 *)
        ucidef_set_interface_lan "eth0"
        ;;
diff --git a/target/linux/kirkwood/base-files/lib/kirkwood.sh b/target/linux/kirkwood/base-files/lib/kirkwood.sh
deleted file mode 100644 (file)
index 4fcd760..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-kirkwood_hardware_name() {
-       grep ^Hardware /proc/cpuinfo | sed "s/Hardware.*: \(.*\)/\1/g"
-}
index c63f606c69f445c7df085f2e4472d3c1a063367b..1bc17c28763788e11afbe9a07d433e5e55cafb76 100644 (file)
@@ -9,67 +9,110 @@ include $(INCLUDE_DIR)/image.mk
 
 NAND_BLOCKSIZE := 2048:128k
 
-define Image/BuildKernel
-       $(CP) $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
+define Image/BuildKernel/Template
+
+       $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
+       echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage
+       $(call Image/BuildKernel/MkuImageARM, \
+               0x00008000, \
+               $(BIN_DIR)/$(IMG_PREFIX)-zImage, \
+               $(BIN_DIR)/$(IMG_PREFIX)-uImage \
+       )
 
-ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
-       $(CP) $(KDIR)/uImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs
-endif
+ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+       $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
+       echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
+       $(call Image/BuildKernel/MkuImageARM, \
+               0x00008000, \
+               $(BIN_DIR)/$(IMG_PREFIX)-zImage-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
- )
+ ifneq ($(1),)
+       $(CP) $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(1).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb
+
+       $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
+       cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
+       $(call Image/BuildKernel/MkuImageARM, \
+               0x00008000, \
+               $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage, \
+               $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage \
+       )
+
+  ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+       $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
+       cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
+       $(call Image/BuildKernel/MkuImageARM, \
+               0x00008000, \
+               $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \
+               $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \
+       )
+  endif
+ endif
 endef
 
-define Image/InstallKernel
+define Image/InstallKernel/Template
+
  ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
        $(INSTALL_DIR) $(TARGET_DIR)/boot
-       $(CP) $(KDIR)/uImage $(TARGET_DIR)/boot/
+       $(CP) $(BIN_DIR)/$(IMG_PREFIX)-zImage $(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/
-       )
+  ifneq ($(1),)
+       $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/
+  endif
  endif
 endef
 
-define Image/Build
-       $(if $(Image/Build/$(1)), \
-               $(call Image/Build/$(1),$(1)), \
-               $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
-       )
-endef
-
 define Image/Build/jffs2-nand-2048-128k
-       dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
+       dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img \
                bs=2048 conv=sync
 endef
 
 define Image/Build/squashfs
        $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
        ( \
-               dd if=$(KDIR)/uImage bs=4096k conv=sync; \
+               dd if=$(KDIR)/zImage bs=4096k conv=sync; \
                dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
-       ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
+       ) > $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img
 endef
 
 define Image/Build/ubifs
 
- ifdef UBIFS_OPTS
-       $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
+ ifneq ($($(PROFILE)_UBIFS_OPTS),)
+       $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-ubifs.img
  endif
 endef
 
 define Image/Build/ubi
 
- ifdef UBI_OPTS
-       $(call Image/Build/ubifs,$(1))
+ ifneq ($($(PROFILE)_UBI_OPTS),)
+       $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-ubi.img
  endif
 endef
 
+Image/BuildKernel/Template/Generic=$(call Image/BuildKernel/Template)
+Image/InstallKernel/Template/Generic=$(call Image/InstallKernel/Template)
+
+Image/BuildKernel/Template/IB62X0=$(call Image/BuildKernel/Template,ib62x0)
+Image/InstallKernel/Template/IB62X0=$(call Image/InstallKernel/Template,ib62x0)
+
+define Image/BuildKernel
+       $(call Image/BuildKernel/Template/$(PROFILE))
+endef
+
+define Image/InstallKernel
+       $(call Image/InstallKernel/Template/$(PROFILE))
+endef
+
+define Image/Build
+       $(if $(Image/Build/$(1)), \
+               $(call Image/Build/$(1),$(1)), \
+               $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img \
+       )
+endef
+
 $(eval $(call BuildImage))
diff --git a/target/linux/kirkwood/profiles/100-generic.mk b/target/linux/kirkwood/profiles/100-generic.mk
new file mode 100644 (file)
index 0000000..da45604
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Generic
+  NAME:=Generic (default)
+  PACKAGES:= \
+       kmod-mmc kmod-mvsdio kmod-usb2 kmod-usb-storage \
+       kmod-of-i2c kmod-i2c-core kmod-i2c-mv64xxx \
+       kmod-ata-core kmod-ata-marvell-sata \
+       kmod-rtc-marvell kmod-thermal-kirkwood
+endef
+
+define Profile/Generic/Description
+ Package set compatible with most Marvell Kirkwood based boards.
+endef
+
+$(eval $(call Profile,Generic))
diff --git a/target/linux/kirkwood/profiles/110-nas.mk b/target/linux/kirkwood/profiles/110-nas.mk
new file mode 100644 (file)
index 0000000..28b1802
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/IB62X0
+  NAME:=RaidSonic ICY BOX IB-NAS62x0
+  PACKAGES:= \
+       kmod-ata-core kmod-ata-marvell-sata \
+       kmod-rtc-marvell kmod-usb2 kmod-usb-storage \
+       uboot-envtools
+endef
+
+define Profile/IB62X0/Description
+ Package set compatible with RaidSonic ICY BOX IB-NAS62x0 board.
+endef
+
+IB62X0_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096 -U"
+IB62X0_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
+
+$(eval $(call Profile,IB62X0))