aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/apm821xx/image/Makefile
diff options
context:
space:
mode:
authorChris Blake <chrisrblake93@gmail.com>2016-07-20 15:44:51 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-22 09:48:12 +0200
commita57d6e2d47688cfa392d6ea7f36ae6f9d84affc5 (patch)
treed2e04f9253dd23c513a662eed52c37ee959b5729 /target/linux/apm821xx/image/Makefile
parent3827ce2c3dc1849033d6de52e58fcbccc7ed74a2 (diff)
downloadupstream-a57d6e2d47688cfa392d6ea7f36ae6f9d84affc5.tar.gz
upstream-a57d6e2d47688cfa392d6ea7f36ae6f9d84affc5.tar.bz2
upstream-a57d6e2d47688cfa392d6ea7f36ae6f9d84affc5.zip
apm821xx: add support for the Cisco Meraki MR24
This patch adds support for the Cisco Meraki MR24 Access point to the apm821xx target. Board: MR24 - Meraki MR24 Cloud Managed Access Point CPU: APM82181 SoC 800 MHz (PLB=200 OPB=100 EBC=100) Flash size: 32MiB RAM Size: 128MiB Wireless: Atheros AR9380 5.0GHz + Atheros AR9380 2.4GHz Ethernet ports: 1x Gigabit Atheros AR8035 WARNING: The serial port needs a TTL/RS-232 v3.3 level converter! For flashing instructions, visit: <https://github.com/riptidewave93/Openwrt-MR24/blob/master/README.md#flashing> Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Diffstat (limited to 'target/linux/apm821xx/image/Makefile')
-rw-r--r--target/linux/apm821xx/image/Makefile81
1 files changed, 71 insertions, 10 deletions
diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile
index 48ada70d3f..ba11bb22ee 100644
--- a/target/linux/apm821xx/image/Makefile
+++ b/target/linux/apm821xx/image/Makefile
@@ -4,19 +4,80 @@
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
+include $(INCLUDE_DIR)/host.mk
-IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
-
-DEVICE_VARS += DTS IMAGE_SIZE
+DEVICE_VARS += DEVICE_DTS DEVICE_PROFILE IMAGE_SIZE DTB_SIZE
define Device/Default
- BOARDNAME :=
- DEVICE_PROFILE = $$(BOARDNAME)
- PROFILES = Default $$(DEVICE_PROFILE)
- KERNEL_DEPENDS = $$(wildcard ../dts/$$(DTS).dts)
- KERNEL := kernel-bin | lzma | uImage lzma
- KERNEL_INITRAMFS := kernel-bin | lzma | uImage lzma
+ KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
+ DEVICE_PROFILE :=
+ DEVICE_DTS :=
+ KERNEL_ENTRY := 0x00000000
+ KERNEL_LOADADDR := 0x00000000
+endef
+
+define Build/dtb
+ $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE))
+endef
+
+ifeq ($(SUBTARGET),nand)
+
+define Image/cpiogz
+ ( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(KDIR_TMP)/$(IMG_PREFIX)-rootfs.cpio.gz )
+endef
+
+define Build/copy-file
+ cat "$(1)" > "$@"
+endef
+
+define Build/MerakiAdd-dtb
+ $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
+ ( \
+ dd if=$@.dtb bs=$(DTB_SIZE) conv=sync; \
+ dd if=$@ bs=$(BLOCKSIZE) conv=sync; \
+ ) > $@.new
+ @mv $@.new $@
endef
-TARGET_DEVICES += Default
+
+define Build/MerakiAdd-initramfs
+ $(call Image/cpiogz)
+
+ -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T ramdisk \
+ -C gzip -n "$(PROFILE) rootfs" \
+ -d $(KDIR_TMP)/$(IMG_PREFIX)-rootfs.cpio.gz \
+ $(KDIR_TMP)/$(IMG_PREFIX)-uramdisk.image.gz
+
+ ( \
+ dd if=$@ bs=1k conv=sync; \
+ dd if=$(KDIR_TMP)/$(IMG_PREFIX)-uramdisk.image.gz bs=$(BLOCKSIZE) conv=sync; \
+ ) > $@.new
+ @mv $@.new $@
+endef
+
+define Build/MerakiNAND
+ -$(STAGING_DIR_HOST)/bin/mkmerakifw \
+ -B $(DEVICE_PROFILE) -s \
+ -i $@ \
+ -o $@.new
+ @cp $@.new $@
+endef
+
+define Device/mr24
+ DEVICE_TITLE := Cisco Meraki MR24
+ DEVICE_PACKAGES := kmod-spi-gpio kmod-ath9k wpad-mini
+ DEVICE_PROFILE := MR24
+ DEVICE_DTS := MR24
+ BLOCKSIZE := 64512
+ IMAGES := sysupgrade.tar
+ DTB_SIZE := 64512
+ KERNEL_SIZE := 2048k
+ IMAGE_SIZE := 8191k
+ KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | MerakiNAND
+ KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND
+ IMAGE/sysupgrade.tar := sysupgrade-nand
+endef
+TARGET_DEVICES += mr24
$(eval $(call BuildImage))
+
+endif