summaryrefslogtreecommitdiff
path: root/target/linux/kirkwood
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2013-10-14 19:46:40 +0000
committerLuka Perkov <luka@openwrt.org>2013-10-14 19:46:40 +0000
commit73246d2f646eec821ad59a2c9177ac3e0b2e75fd (patch)
tree1b51c62e56fe44271e0f62dc657c82faca2e96a5 /target/linux/kirkwood
parent4da854bcd00842894558aba10b3521d7171ba1e3 (diff)
downloadmtk-20170518-73246d2f646eec821ad59a2c9177ac3e0b2e75fd.zip
mtk-20170518-73246d2f646eec821ad59a2c9177ac3e0b2e75fd.tar.gz
mtk-20170518-73246d2f646eec821ad59a2c9177ac3e0b2e75fd.tar.bz2
kirkwood: upgrade to 3.10.15
Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 38402
Diffstat (limited to 'target/linux/kirkwood')
-rw-r--r--target/linux/kirkwood/Makefile8
-rw-r--r--target/linux/kirkwood/base-files/etc/uci-defaults/01_leds8
-rw-r--r--target/linux/kirkwood/base-files/etc/uci-defaults/02_network16
-rw-r--r--target/linux/kirkwood/base-files/lib/kirkwood.sh5
-rw-r--r--target/linux/kirkwood/image/Makefile103
-rw-r--r--target/linux/kirkwood/profiles/100-generic.mk21
-rw-r--r--target/linux/kirkwood/profiles/110-nas.mk23
7 files changed, 128 insertions, 56 deletions
diff --git a/target/linux/kirkwood/Makefile b/target/linux/kirkwood/Makefile
index 4739760..ba1d259 100644
--- a/target/linux/kirkwood/Makefile
+++ b/target/linux/kirkwood/Makefile
@@ -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))
diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
index 18ac43c..7e20188 100644
--- a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
@@ -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
diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network
index 8c04fdb..42724ef 100644
--- a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network
@@ -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
index 4fcd760..0000000
--- a/target/linux/kirkwood/base-files/lib/kirkwood.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-kirkwood_hardware_name() {
- grep ^Hardware /proc/cpuinfo | sed "s/Hardware.*: \(.*\)/\1/g"
-}
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index c63f606..1bc17c2 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -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
index 0000000..da45604
--- /dev/null
+++ b/target/linux/kirkwood/profiles/100-generic.mk
@@ -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
index 0000000..28b1802
--- /dev/null
+++ b/target/linux/kirkwood/profiles/110-nas.mk
@@ -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))