diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile index 8428bec6bc..b181e67c0e 100644 --- a/target/linux/mpc85xx/Makefile +++ b/target/linux/mpc85xx/Makefile @@ -16,17 +16,10 @@ SUBTARGETS:=generic p1020 KERNEL_PATCHVER:=4.9 -define Target/Description - Build images for the Freescale MPC85xx based boards. -endef +KERNELNAME:=zImage include $(INCLUDE_DIR)/target.mk -KERNEL_IMAGES := zImage -ifeq ($(SUBTARGET),generic) -KERNEL_IMAGES += cuImage.tl-wdr4900-v1 -endif - DEFAULT_PACKAGES += \ kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \ kmod-leds-gpio swconfig kmod-ath9k wpad-mini diff --git a/target/linux/mpc85xx/profiles/00-default.mk b/target/linux/mpc85xx/generic/profiles/00-default.mk similarity index 64% rename from target/linux/mpc85xx/profiles/00-default.mk rename to target/linux/mpc85xx/generic/profiles/00-default.mk index 7dcb8faaa3..67507ace8a 100644 --- a/target/linux/mpc85xx/profiles/00-default.mk +++ b/target/linux/mpc85xx/generic/profiles/00-default.mk @@ -1,15 +1,15 @@ # -# Copyright (C) 2013 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # define Profile/Default - NAME:=Default Profile (all drivers) + NAME:=Default Profile + PRIORITY:=1 endef define Profile/Default/Description - Default package set compatible with most boards. + Default package set compatible with most MPC85xx boards. endef + $(eval $(call Profile,Default)) diff --git a/target/linux/mpc85xx/generic/target.mk b/target/linux/mpc85xx/generic/target.mk index f8a79a7b90..2620a22899 100644 --- a/target/linux/mpc85xx/generic/target.mk +++ b/target/linux/mpc85xx/generic/target.mk @@ -1,4 +1,5 @@ BOARDNAME:=Generic +KERNELNAME:=cuImage.tl-wdr4900-v1 define Target/Description Build firmware images for generic MPC85xx based boards. diff --git a/target/linux/mpc85xx/image/Makefile b/target/linux/mpc85xx/image/Makefile index 4738dcf122..f7de3bc5ce 100644 --- a/target/linux/mpc85xx/image/Makefile +++ b/target/linux/mpc85xx/image/Makefile @@ -1,107 +1,77 @@ # -# Copyright (C) 2010 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define imgname -$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) +DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT + +define Device/Default + PROFILES := Default + DEVICE_DTS := $(1) + KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) + KERNEL_ENTRY := 0x00000000 + KERNEL_LOADADDR := 0x00000000 + KERNEL := kernel-bin endef -define sysupname -$(call imgname,$(1),$(2))-sysupgrade.bin +define Build/append-uImage-fakeramdisk-hdr + rm -f $@.fakeramdisk + $(STAGING_DIR_HOST)/bin/mkimage \ + -A $(LINUX_KARCH) -O linux -T ramdisk -C none \ + -n 'fakeramdisk' \ + -s \ + $@.fakeramdisk + cat $@.fakeramdisk >> $@ endef -define factoryname -$(call imgname,$(1),$(2))-factory.bin +define Build/tplink-v1-image + $(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) \ + -N "$(VERSION_DIST)" -V $(REVISION) \ + -k $(IMAGE_KERNEL) \ + -r $(IMAGE_ROOTFS) \ + -j \ + $(1) \ + -o $@ endef -zImage:=$(BIN_DIR)/$(IMG_PREFIX)-zImage - -DTS_TARGETS = hiveap-330 fsl/p1010rdb-pa tl-wdr4900-v1 fsl/p1020rdb - -define Build/empty-initramfs - -mkdir $(KDIR_TMP)/empty-initramfs; \ - cd $(KDIR_TMP)/empty-initramfs; \ - find . | cpio -o -H newc | gzip -9n > $(KDIR_TMP)/empty-initramfs.gpio.gz - - -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T ramdisk \ - -C gzip -n "empty initramfs" \ - -d $(KDIR_TMP)/empty-initramfs.gpio.gz \ - $(KDIR_TMP)/$(IMG_PREFIX)-empty-initramfs.image -endef - -define Image/BuildKernel - cp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage - $(foreach dts,$(DTS_TARGETS), - $(LINUX_DIR)/scripts/dtc/dtc -I dts -O dtb $(DTS_DIR)/$(dts).dts > $(BIN_DIR)/$(IMG_PREFIX)-$(notdir $(dts)).fdt - ) -endef - -define Image/BuildKernel/Initramfs - cp $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-initramfs-zImage ifeq ($(SUBTARGET),generic) - cp $(KDIR)/cuImage.tl-wdr4900-v1-initramfs $(BIN_DIR)/$(IMG_PREFIX)-tl-wdr4900-v1-initramfs.uImage + +define Device/tl-wdr4900-v1 + DEVICE_TITLE := TP-Link TL-WDR4900 + DEVICE_PACKAGES := kmod-ath9k wpad-mini + TPLINK_HWID := 0x49000001 + TPLINK_HWREV := 1 + TPLINK_FLASHLAYOUT := 16Mppc + KERNEL_NAME := cuImage.tl-wdr4900-v1 + IMAGES := fdt.bin factory.bin sysupgrade.bin + IMAGE/fdt.bin := append-dtb + IMAGE/factory.bin := tplink-v1-image + IMAGE/sysupgrade.bin := tplink-v1-image -s +endef +TARGET_DEVICES += tl-wdr4900-v1 + endif + ifeq ($(SUBTARGET),p1020) - cp $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-hiveap-330-initramfs.zImage + +define Device/hiveap-330 + DEVICE_TITLE := Aerohive HiveAP-330 + DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-tpm-i2c-atmel + BLOCKSIZE := 128k + KERNEL_NAME := zImage + KERNEL_SIZE := 8m + IMAGES := fdt.bin sysupgrade.bin + IMAGE/fdt.bin := append-dtb + IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \ + append-uImage-fakeramdisk-hdr | pad-to 256k | check-size 512k | \ + append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \ + append-kernel +endef +TARGET_DEVICES += hiveap-330 + endif -endef - -define Image/Build/Aerohive - $(call Build/empty-initramfs) -ifeq ($(2),hiveap-330) - ( \ - dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2).fdt bs=256k conv=sync; \ - dd if=$(KDIR_TMP)/$(IMG_PREFIX)-empty-initramfs.image bs=256k conv=sync; \ - dd if=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=40704k conv=sync; \ - dd if=$(KDIR)/zImage conv=sync; \ - ) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-sysupgrade.img -endif -endef - -define Image/Build/TPLINK - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \ - -k $(KDIR)/$(3) \ - -r $(KDIR)/root.$(1) \ - -o $(call factoryname,$(1),$(2)) - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \ - -k $(KDIR)/$(3) \ - -r $(KDIR)/root.$(1) \ - -o $(call sysupname,$(1),$(2)) -endef - -define Image/Build/Profile/hiveap-330 - $(call Image/Build/Aerohive,$(1),hiveap-330) -endef - -define Image/Build/Profile/TLWDR4900 - $(call Image/Build/TPLINK,$(1),tl-wdr4900-v1,cuImage.tl-wdr4900-v1,0x49000001,1,16Mppc) -endef - -define Image/Build/Profile/Default - $(call Image/Build/Profile/TLWDR4900,$(1)) -endef - -define Image/Build/ext2 - cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-ext2.img -endef - -define Image/Build/squashfs - $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) - cp $(KDIR)/root.squashfs $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs -endef - -PROFILE ?= Default - -define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/Profile/$(PROFILE),$(1)) -endef $(eval $(call BuildImage)) diff --git a/target/linux/mpc85xx/p1020/profiles/00-default.mk b/target/linux/mpc85xx/p1020/profiles/00-default.mk new file mode 100644 index 0000000000..67d43020a2 --- /dev/null +++ b/target/linux/mpc85xx/p1020/profiles/00-default.mk @@ -0,0 +1,15 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PRIORITY:=1 +endef + +define Profile/Default/Description + Default package set compatible with most P1020 boards. +endef + +$(eval $(call Profile,Default)) diff --git a/target/linux/mpc85xx/p1020/profiles/aerohive.mk b/target/linux/mpc85xx/p1020/profiles/aerohive.mk deleted file mode 100644 index 0f5ace6c39..0000000000 --- a/target/linux/mpc85xx/p1020/profiles/aerohive.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2017 Chris Blake -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/hiveap-330 - NAME:=Aerohive HiveAP-330 - PACKAGES:=kmod-usb-storage kmod-ath9k wpad-mini kmod-tpm-i2c-atmel -endef - -define Profile/hiveap-330/Description - Package set optimized for the Aerohive HiveAP-330. -endef -$(eval $(call Profile,hiveap-330)) diff --git a/target/linux/mpc85xx/profiles/tp-link.mk b/target/linux/mpc85xx/profiles/tp-link.mk deleted file mode 100644 index 18a7cddd83..0000000000 --- a/target/linux/mpc85xx/profiles/tp-link.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/TLWDR4900 - NAME:=TP-Link TL-WDR4900 - PACKAGES:=kmod-ath9k wpad-mini -endef - -define Profile/TLWDR4900/Description - Package set optimized for the TP-Link TL-WDR4900. -endef -$(eval $(call Profile,TLWDR4900))