diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 8b2577961c..5f8614f060 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .89 +LINUX_VERSION-5.4 = .91 -LINUX_KERNEL_HASH-5.4.89 = 268dd5177b6df1867d4ed2452ffb11a016d955c43aba5e07940886f347ab0aaf +LINUX_KERNEL_HASH-5.4.91 = 0e0161bb034b9ba59e58a20985e49ecfb38104586602f53f37b382f508fc5c17 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile index b0d466f7b9..f66472fa9c 100644 --- a/package/boot/at91bootstrap/Makefile +++ b/package/boot/at91bootstrap/Makefile @@ -14,6 +14,7 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git +PKG_MIRROR_HASH:=06753d673756edc9753932db00f4e5b8c1f9fa7708337c4d6ce280573efb86b4 PKG_SOURCE_VERSION:=d96833a4b6680b237708eb4dc9f10708b9e709d8 PKG_BUILD_DIR = \ $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index f2ad9562aa..a8a71239a3 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -12,6 +12,7 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/linux4sam/u-boot-at91.git +PKG_MIRROR_HASH:=4f106d215c01c4d024c4612bbd3ef189188d19abc1ab2cc316b257d308534feb PKG_SOURCE_VERSION:=0e1d1b6efb7f8e27c372279a906fcd2524df09da include $(INCLUDE_DIR)/u-boot.mk diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 8bc2c00ba5..dda9d6be9c 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=17 +PKG_RELEASE:=20 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index dedf7160f0..4b84766814 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -48,6 +48,12 @@ netgear,wnr2200-16m|\ netgear,wnr612-v2|\ ocedo,koala|\ ocedo,raccoon|\ +openmesh,mr600-v1|\ +openmesh,mr600-v2|\ +openmesh,mr900-v1|\ +openmesh,mr900-v2|\ +openmesh,mr1750-v1|\ +openmesh,mr1750-v2|\ openmesh,om5p|\ openmesh,om5p-ac-v2|\ samsung,wam250|\ diff --git a/package/kernel/bcm63xx-cfe/Makefile b/package/kernel/bcm63xx-cfe/Makefile index bdc8b2cc76..3eada4bab2 100644 --- a/package/kernel/bcm63xx-cfe/Makefile +++ b/package/kernel/bcm63xx-cfe/Makefile @@ -17,9 +17,9 @@ include $(INCLUDE_DIR)/package.mk define Package/bcm63xx-cfe SECTION:=boot CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_bcm63xx + DEPENDS:=@(TARGET_bcm4908||TARGET_bcm63xx) TITLE:=bcm63xx-cfe - DEFAULT:=y if TARGET_bcm63xx + DEFAULT:=y endef define Package/bcm63xx-cfe/description diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index 6ce33d3f86..e931536339 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -8,20 +8,21 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb -PKG_VERSION:=1.0.22 -PKG_RELEASE:=2 +PKG_VERSION:=1.0.24 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=\ https://github.com/libusb/libusb/releases/download/v$(PKG_VERSION) \ @SF/$(PKG_NAME) -PKG_HASH:=75aeb9d59a4fdb800d329a545c2e6799f732362193b465ea198f2aa275518157 +PKG_HASH:=7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a + +PKG_MAINTAINER:= Felix Fietkau +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=0 -PKG_LICENSE:=LGPL-2.1 - -PKG_MAINTAINER := Felix Fietkau +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk @@ -45,12 +46,17 @@ CONFIGURE_ARGS += \ --disable-log define Build/InstallDev - $(CP) $(PKG_INSTALL_DIR)/* $(1)/ + $(INSTALL_DIR) $(1)/usr/include/libusb-1.0 + $(CP) $(PKG_INSTALL_DIR)/usr/include/libusb-1.0/libusb.h $(1)/usr/include/libusb-1.0/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb-1.0.pc $(1)/usr/lib/pkgconfig/ endef define Package/libusb-1.0/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libusb-1.0)) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index f7adb90208..4fcef3dd9c 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.16.8 +PKG_VERSION:=2.16.9 PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=fe9e3b15c3375943bdfebbbb20dd6b4f1147b3b5d926248bd835d73247407430 +PKG_HASH:=fc17ff7d8c11d08f23ae2800a18269408ad2c24ea6bb8b9363e41a01c2425697 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0-or-later diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index f34896b7ec..7061456b08 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2021-01-05 -PKG_SOURCE_VERSION:=0c8343968108f960b4eaafe4713453c5453bc6a0 -PKG_MIRROR_HASH:=613c432bbec93e067432646161ab1ba6a433ab7e4e8d3992cf3696128717ae36 +PKG_SOURCE_DATE:=2021-01-09 +PKG_SOURCE_VERSION:=c00c8335d6188daa326ecfe5a62da15a9b9987e1 +PKG_MIRROR_HASH:=c740e51e0cec13eec336ba1c7a643db3b64a9a2235f8c1b73a566cb89e841190 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index a52d3a3504..c9eaaedb19 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=16 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2020-12-26 -PKG_SOURCE_VERSION:=eac1961983b8e7a74c494feedcb878170b135072 -PKG_MIRROR_HASH:=3d026e66a57082d15a848357fdd94b8332d4916aa5a3251f72c3f83da3d6513e +PKG_SOURCE_DATE:=2021-01-09 +PKG_SOURCE_VERSION:=53f07e90b7f1da6977143a488dd5cb73a33b233b +PKG_MIRROR_HASH:=ad3665b611d19177996771b11df28d92f066b0125484ea3bdfc0b3185c14f90e PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index ba10ded333..7b5af1dd27 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq -PKG_UPSTREAM_VERSION:=2.82 +PKG_UPSTREAM_VERSION:=2.83 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=10 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq -PKG_HASH:=84523646f3116bb5e1151efb66e645030f6e6a8256f29aab444777a343ebc132 +PKG_HASH:=ffc1f7e8b05e22d910b9a71d09f1128197292766dc7c54cb7018a1b2c3af4aea PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch index aaa5a76909..bd11806ae0 100644 --- a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch +++ b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Kevin Darbyshire-Bryant --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -1112,7 +1112,7 @@ extern struct daemon { +@@ -1125,7 +1125,7 @@ extern struct daemon { int inotifyfd; #endif #if defined(HAVE_LINUX_NETWORK) @@ -36,7 +36,7 @@ Signed-off-by: Kevin Darbyshire-Bryant #elif defined(HAVE_BSD_NETWORK) int dhcp_raw_fd, dhcp_icmp_fd, routefd; #endif -@@ -1292,9 +1292,6 @@ int read_write(int fd, unsigned char *pa +@@ -1306,9 +1306,6 @@ int read_write(int fd, unsigned char *pa void close_fds(long max_fd, int spare1, int spare2, int spare3); int wildcard_match(const char* wildcard, const char* match); int wildcard_matchn(const char* wildcard, const char* match, int num); diff --git a/package/network/utils/owipcalc/Makefile b/package/network/utils/owipcalc/Makefile index 1f4c98bb48..dc68a0346b 100644 --- a/package/network/utils/owipcalc/Makefile +++ b/package/network/utils/owipcalc/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=owipcalc -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=Apache-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/owipcalc/src/owipcalc.c b/package/network/utils/owipcalc/src/owipcalc.c index c4df5c7450..5ed609f158 100644 --- a/package/network/utils/owipcalc/src/owipcalc.c +++ b/package/network/utils/owipcalc/src/owipcalc.c @@ -527,18 +527,17 @@ static bool cidr_network6(struct cidr *a) static bool cidr_contains6(struct cidr *a, struct cidr *b) { - struct cidr *n = cidr_clone(a); - struct in6_addr *x = &n->addr.v6; + struct in6_addr *x = &a->addr.v6; struct in6_addr *y = &b->addr.v6; - uint8_t i = (128 - n->prefix) / 8; - uint8_t m = ~((1 << ((128 - n->prefix) % 8)) - 1); + uint8_t i = (128 - a->prefix) / 8; + uint8_t m = ~((1 << ((128 - a->prefix) % 8)) - 1); uint8_t net1 = x->s6_addr[15-i] & m; uint8_t net2 = y->s6_addr[15-i] & m; if (printed) qprintf(" "); - if ((b->prefix >= n->prefix) && (net1 == net2) && + if ((b->prefix >= a->prefix) && (net1 == net2) && ((i == 15) || !memcmp(&x->s6_addr, &y->s6_addr, 15-i))) { qprintf("1"); diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600-v1.dts b/target/linux/ath79/dts/ar9344_openmesh_mr600-v1.dts new file mode 100644 index 0000000000..6c20f2715f --- /dev/null +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600-v1.dts @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_openmesh_mr600.dtsi" + +/ { + compatible = "openmesh,mr600-v1", "qca,ar9344"; + model = "OpenMesh MR600 v1"; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_orange; + led-upgrade = &led_power_orange; + }; + + leds { + compatible = "gpio-leds"; + + wifi5g_green { + label = "green:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps_blue { + label = "blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + leds-ath9k { + compatible = "gpio-leds"; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600-v2.dts b/target/linux/ath79/dts/ar9344_openmesh_mr600-v2.dts new file mode 100644 index 0000000000..988066798f --- /dev/null +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600-v2.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_openmesh_mr600.dtsi" + +/ { + compatible = "openmesh,mr600-v2", "qca,ar9344"; + model = "OpenMesh MR600 v2"; + + aliases { + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + }; + + leds { + compatible = "gpio-leds"; + + wifi5g_red { + label = "red:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + wps_blue { + label = "blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi2g_green { + label = "green:wifi2g"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi2g_yellow { + label = "yellow:wifi2g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + wifi2g_red { + label = "red:wifi2g"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + wifi5g_green { + label = "green:wifi5g"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi5g_yellow { + label = "yellow:wifi5g"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi new file mode 100644 index 0000000000..8517576787 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; + reg = <0x850000 0x7a0000>; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x02000000 0x00000101 0x00001313>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0030"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <8>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi new file mode 100644 index 0000000000..d51c587683 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi @@ -0,0 +1,169 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + led_wifi2g: wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + status_green { + label = "green:status"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + status_red { + label = "red:status"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_wifi5g: wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; + reg = <0x850000 0x7a0000>; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x20>; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x82000000 0x80000101 0x80001313>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy5>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr1750-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_mr1750-v1.dts new file mode 100644 index 0000000000..11eb6dfb55 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_mr1750-v1.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_openmesh_mr.dtsi" + +/ { + compatible = "openmesh,mr1750-v1", "qca,qca9558"; + model = "OpenMesh MR1750 v1"; +}; + +&led_wifi2g { + linux,default-trigger = "phy1tpt"; +}; + +&led_wifi5g { + linux,default-trigger = "phy0tpt"; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr1750-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_mr1750-v2.dts new file mode 100644 index 0000000000..0271db0802 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_mr1750-v2.dts @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_openmesh_mr.dtsi" + +/ { + compatible = "openmesh,mr1750-v2", "qca,qca9558"; + model = "OpenMesh MR1750 v2"; +}; + +&led_wifi2g { + linux,default-trigger = "phy1tpt"; +}; + +&led_wifi5g { + linux,default-trigger = "phy0tpt"; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts new file mode 100644 index 0000000000..f7889b00cc --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_openmesh_mr.dtsi" + +/ { + compatible = "openmesh,mr900-v1", "qca,qca9558"; + model = "OpenMesh MR900 v1"; +}; + +&led_wifi2g { + linux,default-trigger = "phy0tpt"; +}; + +&led_wifi5g { + linux,default-trigger = "phy1tpt"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <16>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts new file mode 100644 index 0000000000..1f54d2134a --- /dev/null +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_openmesh_mr.dtsi" + +/ { + compatible = "openmesh,mr900-v2", "qca,qca9558"; + model = "OpenMesh MR900 v2"; +}; + +&led_wifi2g { + linux,default-trigger = "phy0tpt"; +}; + +&led_wifi5g { + linux,default-trigger = "phy1tpt"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <16>; + }; +}; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 14532d3b7f..85f13c1473 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -79,7 +79,7 @@ }; partition@800000 { - label = "ubnt-airos"; + label = "kernel1"; reg = <0x800000 0x790000>; read-only; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index d23c64142d..9b85270913 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -157,7 +157,11 @@ telco,t1) ;; comfast,cf-wr752ac-v1|\ engenius,eap300-v2|\ -enterasys,ws-ap3705i) +enterasys,ws-ap3705i|\ +openmesh,mr900-v1|\ +openmesh,mr900-v2|\ +openmesh,mr1750-v1|\ +openmesh,mr1750-v2) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ;; compex,wpj344-16m|\ diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index ec9f0d0218..1a016a65ab 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -46,6 +46,12 @@ ath79_setup_interfaces() netgear,ex7300|\ ocedo,koala|\ ocedo,raccoon|\ + openmesh,mr600-v1|\ + openmesh,mr600-v2|\ + openmesh,mr900-v1|\ + openmesh,mr900-v2|\ + openmesh,mr1750-v1|\ + openmesh,mr1750-v2|\ pcs,cap324|\ pisen,ts-d084|\ pisen,wmb001n|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 95ad2a57ef..d50d8d9f82 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -120,6 +120,10 @@ case "$FIRMWARE" in ubnt,rocket-m) caldata_extract "art" 0x1000 0x1000 ;; + openmesh,mr600-v1|\ + openmesh,mr600-v2) + caldata_extract "ART" 0x5000 0x440 + ;; wd,mynet-n750) caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 67afafdaad..dbeaf81b79 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -96,6 +96,11 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0xc) ;; + openmesh,mr1750-v1|\ + openmesh,mr1750-v2) + caldata_extract "ART" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) + ;; openmesh,om5p-ac-v2) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration index 231afd9f57..ea5cafa66b 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration @@ -17,6 +17,18 @@ engenius,epg5000) glinet,gl-mifi) migrate_leds ":net=:3g4g" ;; +openmesh,mr600-v1) + migrate_leds ":wlan58=:wifi5g" + ;; +openmesh,mr600-v2) + migrate_leds ":wlan24=:wifi2g" ":wlan58=:wifi5g" + ;; +openmesh,mr900-v1|\ +openmesh,mr900-v2|\ +openmesh,mr1750-v1|\ +openmesh,mr1750-v2) + migrate_leds ":wlan24=:wifi2g" ":wlan58=:wifi5g" ":wan=:lan" + ;; pcs,cap324) migrate_leds "lan:amber=amber:lan" "lan:green=green:lan" ;; diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 79e023482b..575761d079 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -50,6 +50,12 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + openmesh,mr600-v1|\ + openmesh,mr600-v2|\ + openmesh,mr900-v1|\ + openmesh,mr900-v2|\ + openmesh,mr1750-v1|\ + openmesh,mr1750-v2|\ openmesh,om2p-v2|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 5d990f5f79..bb92e97db2 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -8,6 +8,7 @@ DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL +DEVICE_VARS += OPENMESH_CE_TYPE define Build/add-elecom-factory-initramfs $(eval edimax_model=$(word 1,$(1))) @@ -1552,94 +1553,166 @@ define Device/ocedo_ursus endef TARGET_DEVICES += ocedo_ursus -define Device/openmesh_om2p-common +define Device/openmesh_common_64k + DEVICE_VENDOR := OpenMesh + DEVICE_PACKAGES := uboot-envtools + IMAGE_SIZE := 7808k + BLOCKSIZE := 64k + OPENMESH_CE_TYPE := + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ + pad-to $$(BLOCKSIZE) + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ + openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata +endef + +define Device/openmesh_common_256k DEVICE_VENDOR := OpenMesh DEVICE_PACKAGES := uboot-envtools IMAGE_SIZE := 7168k BLOCKSIZE := 256k + OPENMESH_CE_TYPE := KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ pad-to $$(BLOCKSIZE) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ - openmesh-image ce_type=OM2P | append-metadata + openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata endef +define Device/openmesh_mr600-v1 + $(Device/openmesh_common_64k) + SOC := ar9344 + DEVICE_MODEL := MR600 + DEVICE_VARIANT := v1 + OPENMESH_CE_TYPE := MR600 + SUPPORTED_DEVICES += mr600 +endef +TARGET_DEVICES += openmesh_mr600-v1 + +define Device/openmesh_mr600-v2 + $(Device/openmesh_common_64k) + SOC := ar9344 + DEVICE_MODEL := MR600 + DEVICE_VARIANT := v2 + OPENMESH_CE_TYPE := MR600 + SUPPORTED_DEVICES += mr600v2 +endef +TARGET_DEVICES += openmesh_mr600-v2 + +define Device/openmesh_mr900-v1 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := MR900 + DEVICE_VARIANT := v1 + OPENMESH_CE_TYPE := MR900 + SUPPORTED_DEVICES += mr900 +endef +TARGET_DEVICES += openmesh_mr900-v1 + +define Device/openmesh_mr900-v2 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := MR900 + DEVICE_VARIANT := v2 + OPENMESH_CE_TYPE := MR900 + SUPPORTED_DEVICES += mr900v2 +endef +TARGET_DEVICES += openmesh_mr900-v2 + +define Device/openmesh_mr1750-v1 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := MR1750 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + OPENMESH_CE_TYPE := MR1750 + SUPPORTED_DEVICES += mr1750 +endef +TARGET_DEVICES += openmesh_mr1750-v1 + +define Device/openmesh_mr1750-v2 + $(Device/openmesh_common_64k) + SOC := qca9558 + DEVICE_MODEL := MR1750 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + OPENMESH_CE_TYPE := MR1750 + SUPPORTED_DEVICES += mr1750v2 +endef +TARGET_DEVICES += openmesh_mr1750-v2 + define Device/openmesh_om2p-v2 - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := ar9330 DEVICE_MODEL := OM2P DEVICE_VARIANT := v2 + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2pv2 endef TARGET_DEVICES += openmesh_om2p-v2 define Device/openmesh_om2p-v4 - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := qca9533 DEVICE_MODEL := OM2P DEVICE_VARIANT := v4 + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2pv4 endef TARGET_DEVICES += openmesh_om2p-v4 define Device/openmesh_om2p-hs-v1 - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := ar9341 DEVICE_MODEL := OM2P-HS DEVICE_VARIANT := v1 + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2p-hs endef TARGET_DEVICES += openmesh_om2p-hs-v1 define Device/openmesh_om2p-hs-v2 - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := ar9341 DEVICE_MODEL := OM2P-HS DEVICE_VARIANT := v2 + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2p-hsv2 endef TARGET_DEVICES += openmesh_om2p-hs-v2 define Device/openmesh_om2p-hs-v3 - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := ar9341 DEVICE_MODEL := OM2P-HS DEVICE_VARIANT := v3 + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2p-hsv3 endef TARGET_DEVICES += openmesh_om2p-hs-v3 define Device/openmesh_om2p-hs-v4 - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := qca9533 DEVICE_MODEL := OM2P-HS DEVICE_VARIANT := v4 + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2p-hsv4 endef TARGET_DEVICES += openmesh_om2p-hs-v4 define Device/openmesh_om2p-lc - $(Device/openmesh_om2p-common) + $(Device/openmesh_common_256k) SOC := ar9330 DEVICE_MODEL := OM2P-LC + OPENMESH_CE_TYPE := OM2P SUPPORTED_DEVICES += om2p-lc endef TARGET_DEVICES += openmesh_om2p-lc -define Device/openmesh_om5p-common - SOC := ar9344 - DEVICE_VENDOR := OpenMesh - DEVICE_PACKAGES := uboot-envtools - IMAGE_SIZE := 7808k - BLOCKSIZE := 64k - KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ - pad-to $$(BLOCKSIZE) - IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ - openmesh-image ce_type=OM5P | append-metadata -endef - define Device/openmesh_om5p - $(Device/openmesh_om5p-common) + $(Device/openmesh_common_64k) + SOC := ar9344 DEVICE_MODEL := OM5P + OPENMESH_CE_TYPE := OM5P SUPPORTED_DEVICES += om5p endef TARGET_DEVICES += openmesh_om5p diff --git a/target/linux/generic/hack-5.4/221-module_exports.patch b/target/linux/generic/hack-5.4/221-module_exports.patch index f651cd902e..4f805cf7e3 100644 --- a/target/linux/generic/hack-5.4/221-module_exports.patch +++ b/target/linux/generic/hack-5.4/221-module_exports.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau } \ \ /* __*init sections */ \ -@@ -885,6 +895,8 @@ +@@ -888,6 +898,8 @@ EXIT_TEXT \ EXIT_DATA \ EXIT_CALL \ diff --git a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch index 711ffcd838..2881337724 100644 --- a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch +++ b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau static bool enable_hooks __read_mostly; MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks"); module_param(enable_hooks, bool, 0000); -@@ -646,6 +649,7 @@ enum nf_ct_sysctl_index { +@@ -649,6 +652,7 @@ enum nf_ct_sysctl_index { NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM, #endif @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau __NF_SYSCTL_CT_LAST_SYSCTL, }; -@@ -972,6 +976,13 @@ static struct ctl_table nf_ct_sysctl_tab +@@ -975,6 +979,13 @@ static struct ctl_table nf_ct_sysctl_tab .proc_handler = proc_dointvec_jiffies, }, #endif diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 27cb814625..90f212d3a1 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -6,7 +6,7 @@ BOARDNAME:=Qualcomm Atheros IPQ40XX FEATURES:=squashfs fpu ramdisk nand CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 -SUBTARGETS:=generic +SUBTARGETS:=generic mikrotik KERNEL_PATCHVER:=5.4 KERNEL_TESTING_PATCHVER:=5.4 diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 079b0ec5dd..a764cb60af 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -1,10 +1,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID -DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION -DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE - define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) @@ -18,836 +14,6 @@ define Device/Default IMAGE/sysupgrade.bin/squashfs := endef -define Device/FitImage - KERNEL_SUFFIX := -fit-uImage.itb - KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitImageLzma - KERNEL_SUFFIX := -fit-uImage.itb - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_NAME := Image -endef - -define Device/FitzImage - KERNEL_SUFFIX := -fit-zImage.itb - KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_NAME := zImage -endef - -define Device/UbiFit - KERNEL_IN_UBI := 1 - IMAGES := nand-factory.ubi nand-sysupgrade.bin - IMAGE/nand-factory.ubi := append-ubi - IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata -endef - -define Device/DniImage - $(call Device/FitzImage) - NETGEAR_BOARD_ID := - NETGEAR_HW_ID := - IMAGES += factory.img - IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni - IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ - append-rootfs | pad-rootfs | append-metadata | check-size -endef - -define Build/append-rootfshdr - mkimage -A $(LINUX_KARCH) \ - -O linux -T filesystem \ - -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n root.squashfs -d $(IMAGE_ROOTFS) $@.new - dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL) -endef - -define Build/mkmylofw_32m - $(eval device_id=$(word 1,$(1))) - $(eval revision=$(word 2,$(1))) - - let \ - size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(BLOCKSIZE))" \ - pad="(pad - (size % pad)) % pad" \ - newsize='size + pad'; \ - $(STAGING_DIR_HOST)/bin/mkmylofw \ - -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \ - -s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \ - $@.new - @mv $@.new $@ -endef - -define Build/qsdk-ipq-factory-nand-askey - $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\ - askey_kernel $(IMAGE_KERNEL) \ - askey_fs $(IMAGE_ROOTFS) \ - ubifs $@ - PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new - @mv $@.new $@ -endef - -define Build/SenaoFW - -$(STAGING_DIR_HOST)/bin/mksenaofw \ - -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \ - -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \ - -e $@ \ - -o $@.new - @cp $@.new $@ -endef - -define Build/wrgg-image - mkwrggimg -i $@ \ - -o $@.new \ - -d "$(WRGG_DEVNAME)" \ - -s "$(WRGG_SIGNATURE)" \ - -v "" -m "" -B "" - mv $@.new $@ -endef - -define Device/8dev_habanero-dvk - $(call Device/FitImageLzma) - DEVICE_VENDOR := 8devices - DEVICE_MODEL := Habanero DVK - IMAGE_SIZE := 30976k - SOC := qcom-ipq4019 - DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk - IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size -endef -TARGET_DEVICES += 8dev_habanero-dvk - -define Device/8dev_jalapeno-common - $(call Device/FitImage) - $(call Device/UbiFit) - BLOCKSIZE := 128k - PAGESIZE := 2048 - SOC := qcom-ipq4018 -endef - -define Device/8dev_jalapeno - $(call Device/8dev_jalapeno-common) - DEVICE_VENDOR := 8devices - DEVICE_MODEL := Jalapeno -endef -TARGET_DEVICES += 8dev_jalapeno - -define Device/alfa-network_ap120c-ac - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := ALFA Network - DEVICE_MODEL := AP120C-AC - SOC := qcom-ipq4018 - DEVICE_PACKAGES := kmod-usb-acm \ - kmod-tpm-i2c-atmel uboot-envtools - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGE_SIZE := 65536k - IMAGES := nand-factory.bin nand-sysupgrade.bin - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand -endef -TARGET_DEVICES += alfa-network_ap120c-ac - -define Device/aruba_glenmorangie - $(call Device/FitImageLzma) - DEVICE_VENDOR := Aruba - SOC := qcom-ipq4029 - DEVICE_PACKAGES := ipq-wifi-aruba_ap-303 -endef - -define Device/aruba_ap-303 - $(call Device/aruba_glenmorangie) - DEVICE_MODEL := AP-303 - DEVICE_PACKAGES += uboot-envtools -endef -TARGET_DEVICES += aruba_ap-303 - -define Device/aruba_ap-303h - $(call Device/aruba_glenmorangie) - DEVICE_MODEL := AP-303H -endef -TARGET_DEVICES += aruba_ap-303h - -define Device/aruba_ap-365 - $(call Device/aruba_glenmorangie) - DEVICE_MODEL := AP-365 - DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools -endef -TARGET_DEVICES += aruba_ap-365 - -define Device/asus_map-ac2200 - $(call Device/FitImageLzma) - DEVICE_VENDOR := ASUS - DEVICE_MODEL := Lyra (MAP-AC2200) - SOC := qcom-ipq4019 - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k -endef -TARGET_DEVICES += asus_map-ac2200 - -define Device/asus_rt-ac58u - $(call Device/FitImageLzma) - DEVICE_VENDOR := ASUS - DEVICE_MODEL := RT-AC58U - SOC := qcom-ipq4018 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DTB_SIZE := 65536 - IMAGE_SIZE := 20439364 - FILESYSTEMS := squashfs -# Someone - in their infinite wisdom - decided to put the firmware -# version in front of the image name \03\00\00\04 => Version 3.0.0.4 -# Since u-boot works with strings we either need another fixup step -# to add a version... or we are very careful not to add '\0' into that -# string and call it a day.... Yeah, we do the latter! - UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U') - DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ - kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += asus_rt-ac58u - -define Device/avm_fritzbox-4040 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Box 4040 - SOC := qcom-ipq4018 - BOARD_NAME := fritz4040 - IMAGE_SIZE := 29056k - UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin - UBOOT_PARTITION_SIZE := 524288 - IMAGES += eva.bin - IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size - DEVICE_PACKAGES := fritz-tffs fritz-caldata -endef -TARGET_DEVICES += avm_fritzbox-4040 - -define Device/avm_fritzbox-7530 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Box 7530 - SOC := qcom-ipq4019 - DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand -endef -TARGET_DEVICES += avm_fritzbox-7530 - -define Device/avm_fritzrepeater-1200 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Repeater 1200 - SOC := qcom-ipq4019 - DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200 -endef -TARGET_DEVICES += avm_fritzrepeater-1200 - -define Device/avm_fritzrepeater-3000 - $(call Device/FitImageLzma) - DEVICE_VENDOR := AVM - DEVICE_MODEL := FRITZ!Repeater 3000 - SOC := qcom-ipq4019 - DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand -endef -TARGET_DEVICES += avm_fritzrepeater-3000 - -define Device/buffalo_wtr-m2133hp - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Buffalo - DEVICE_MODEL := WTR-M2133HP - SOC := qcom-ipq4019 - DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp - BLOCKSIZE := 128k - PAGESIZE := 2048 -endef -TARGET_DEVICES += buffalo_wtr-m2133hp - -define Device/cellc_rtl30vw - KERNEL_SUFFIX := -fit-uImage.itb - KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048 - KERNEL_NAME := Image - KERNEL_IN_UBI := - IMAGES := nand-factory.bin nand-sysupgrade.bin - IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey - IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata - DEVICE_VENDOR := Cell C - DEVICE_MODEL := RTL30VW - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@5 - KERNEL_INSTALL := 1 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 57344k - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi ipq-wifi-cellc_rtl30vw -endef -TARGET_DEVICES += cellc_rtl30vw - -define Device/cilab_meshpoint-one - $(call Device/8dev_jalapeno-common) - DEVICE_VENDOR := Crisis Innovation Lab - DEVICE_MODEL := MeshPoint.One - DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127 -endef -TARGET_DEVICES += cilab_meshpoint-one - -define Device/compex_wpj419 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Compex - DEVICE_MODEL := WPJ419 - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@12 - KERNEL_INSTALL := 1 - BLOCKSIZE := 128k - PAGESIZE := 2048 - FILESYSTEMS := squashfs -endef -TARGET_DEVICES += compex_wpj419 - -define Device/compex_wpj428 - $(call Device/FitImage) - DEVICE_VENDOR := Compex - DEVICE_MODEL := WPJ428 - SOC := qcom-ipq4028 - DEVICE_DTS_CONFIG := config@4 - BLOCKSIZE := 64k - IMAGE_SIZE := 31232k - KERNEL_SIZE := 4096k - IMAGES += cpximg-6a04.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3 - DEVICE_PACKAGES := kmod-gpio-beeper -endef -TARGET_DEVICES += compex_wpj428 - -define Device/devolo_magic-2-wifi-next - $(call Device/FitImage) - DEVICE_VENDOR := devolo - DEVICE_MODEL := Magic 2 WiFi next - SOC := qcom-ipq4018 - KERNEL_SIZE := 4096k - - # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image - # it will bootm it, just like we want for the initramfs. - KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\ - append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00' - - IMAGE_SIZE := 26624k - IMAGES := sysupgrade.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools -endef -TARGET_DEVICES += devolo_magic-2-wifi-next - -define Device/dlink_dap-2610 - $(call Device/FitImageLzma) - DEVICE_VENDOR := D-Link - DEVICE_MODEL := DAP-2610 - SOC := qcom-ipq4018 - DEVICE_DTS_CONFIG := config@ap.dk01.1-c1 - BLOCKSIZE := 64k - WRGG_DEVNAME := /dev/mtdblock/8 - WRGG_SIGNATURE := wapac30_dkbs_dap2610 - IMAGE_SIZE := 14080k - IMAGES += factory.bin - # Bootloader expects a special 160 byte header which is added by - # wrgg-image. - # Factory image size must be larger than 6MB, and size in wrgg header must - # match actual factory image size to be flashable from D-Link http server. - # Bootloader verifies checksum of wrgg image before booting, thus jffs2 - # cannot be part of the wrgg image. This is solved in the factory image by - # having the rootfs at the end of the image (without pad-rootfs). And in - # the sysupgrade image only the kernel is included in the wrgg checksum, - # but this is not flashable from the D-link http server. - # append-rootfs must start on an erase block boundary. - IMAGE/factory.bin := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size - IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata - DEVICE_PACKAGES := ipq-wifi-dlink_dap2610 -endef -TARGET_DEVICES += dlink_dap-2610 - -define Device/edgecore_ecw5211 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Edgecore - DEVICE_MODEL := ECW5211 - SOC := qcom-ipq4018 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools -endef -TARGET_DEVICES += edgecore_ecw5211 - -define Device/edgecore_oap100 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Edgecore - DEVICE_MODEL := OAP100 - SOC := qcom-ipq4019 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGES := nand-sysupgrade.bin - DEVICE_DTS_CONFIG := config@ap.dk07.1-c1 - DEVICE_PACKAGES := ipq-wifi-edgecore_oap100 kmod-usb-acm kmod-usb-net kmod-usb-net-cdc-qmi uqmi -endef -TARGET_DEVICES += edgecore_oap100 - -define Device/engenius_eap1300 - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EAP1300 - DEVICE_DTS_CONFIG := config@4 - BOARD_NAME := eap1300 - SOC := qcom-ipq4018 - KERNEL_SIZE := 5120k - IMAGE_SIZE := 25344k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += engenius_eap1300 - -define Device/engenius_eap2200 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EAP2200 - SOC := qcom-ipq4019 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-engenius_eap2200 -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers -endef -TARGET_DEVICES += engenius_eap2200 - -define Device/engenius_emd1 - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EMD1 - DEVICE_DTS_CONFIG := config@4 - SOC := qcom-ipq4018 - IMAGE_SIZE := 30720k - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size -endef -TARGET_DEVICES += engenius_emd1 - -define Device/engenius_emr3500 - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := EMR3500 - DEVICE_DTS_CONFIG := config@4 - SOC := qcom-ipq4018 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 30720k - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size -endef -TARGET_DEVICES += engenius_emr3500 - -define Device/engenius_ens620ext - $(call Device/FitImage) - DEVICE_VENDOR := EnGenius - DEVICE_MODEL := ENS620EXT - SOC := qcom-ipq4018 - DEVICE_DTS_CONFIG := config@4 - BLOCKSIZE := 64k - PAGESIZE := 256 - BOARD_NAME := ENS620EXT - VENDOR_ID := 0x0101 - PRODUCT_ID := 0x79 - PRODUCT_ID_NEW := 0xA4 - DATECODE := 190507 - FW_VER := 3.1.2 - FW_VER_NEW := 3.5.6 - CW_VER := 1.8.99 - IMAGE_SIZE := 21312k - KERNEL_SIZE := 5120k - FILESYSTEMS := squashfs - IMAGES += factory_30.bin factory_35.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata - IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER) - IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW) -endef -TARGET_DEVICES += engenius_ens620ext - -define Device/ezviz_cs-w3-wd1200g-eup - $(call Device/FitImage) - DEVICE_VENDOR := EZVIZ - DEVICE_MODEL := CS-W3-WD1200G - DEVICE_VARIANT := EUP - DEVICE_DTS_CONFIG := config@4 - IMAGE_SIZE := 14848k - SOC := qcom-ipq4018 - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ - append-metadata - DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ - ipq-wifi-ezviz_cs-w3-wd1200g-eup -endef -TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup - -define Device/glinet_gl-ap1300 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-AP1300 - SOC := qcom-ipq4018 - DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGE_SIZE := 131072k - KERNEL_INSTALL := 1 - DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 -endef -TARGET_DEVICES += glinet_gl-ap1300 - -define Device/glinet_gl-b1300 - $(call Device/FitImage) - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-B1300 - BOARD_NAME := gl-b1300 - SOC := qcom-ipq4029 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 26624k - IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += glinet_gl-b1300 - -define Device/glinet_gl-s1300 - $(call Device/FitImage) - DEVICE_VENDOR := GL.iNet - DEVICE_MODEL := GL-S1300 - SOC := qcom-ipq4029 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 26624k - IMAGES := sysupgrade.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := ipq-wifi-glinet_gl-s1300 kmod-fs-ext4 kmod-mmc kmod-spi-dev -endef -TARGET_DEVICES += glinet_gl-s1300 - -define Device/linksys_ea6350v3 - # The Linksys EA6350v3 has a uboot bootloader that does not - # support either booting lzma kernel images nor booting UBI - # partitions. This uboot, however, supports raw kernel images and - # gzipped images. - # - # As for the time of writing this, the device will boot the kernel - # from a fixed address with a fixed length of 3MiB. Also, the - # device has a hard-coded kernel command line that requieres the - # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively. - # Oh... and the kernel partition overlaps with the rootfs - # partition (the same for alt_kernel and alt_rootfs). - # - # If you are planing re-partitioning the device, you may want to - # keep those details in mind: - # 1. The kernel adresses you should honor are 0x00000000 and - # 0x02800000 respectively. - # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size. - # 3. You can use 'zImage', but not a raw 'Image' packed with lzma. - # 4. The kernel command line from uboot is harcoded to boot with - # rootfs either in mtd11 or mtd13. - $(call Device/FitzImage) - DEVICE_VENDOR := Linksys - DEVICE_MODEL := EA6350 - DEVICE_VARIANT := v3 - SOC := qcom-ipq4018 - BLOCKSIZE := 128k - PAGESIZE := 2048 - KERNEL_SIZE := 3072k - IMAGE_SIZE := 37888k - UBINIZE_OPTS := -E 5 - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 - DEVICE_PACKAGES := uboot-envtools -endef -TARGET_DEVICES += linksys_ea6350v3 - -define Device/linksys_ea8300 - $(call Device/FitzImage) - DEVICE_VENDOR := Linksys - DEVICE_MODEL := EA8300 - SOC := qcom-ipq4019 - KERNEL_SIZE := 3072k - IMAGE_SIZE := 87040k - BLOCKSIZE := 128k - PAGESIZE := 2048 - UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300 - DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += linksys_ea8300 - -define Device/linksys_mr8300 - $(call Device/FitzImage) - DEVICE_VENDOR := Linksys - DEVICE_MODEL := MR8300 - SOC := qcom-ipq4019 - KERNEL_SIZE := 3072k - IMAGE_SIZE := 87040k - BLOCKSIZE := 128k - PAGESIZE := 2048 - UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300 - DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += linksys_mr8300 - -define Device/luma_wrtq-329acn - $(call Device/FitImage) - DEVICE_VENDOR := Luma Home - DEVICE_MODEL := WRTQ-329ACN - SOC := qcom-ipq4018 - DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools - IMAGE_SIZE := 76632k - BLOCKSIZE := 128k - PAGESIZE := 2048 -endef -TARGET_DEVICES += luma_wrtq-329acn - -define Device/meraki_mr33 - $(call Device/FitImage) - DEVICE_VENDOR := Cisco Meraki - DEVICE_MODEL := MR33 - SOC := qcom-ipq4029 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct -endef -TARGET_DEVICES += meraki_mr33 - -define Device/mobipromo_cm520-79f - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := MobiPromo - DEVICE_MODEL := CM520-79F - SOC := qcom-ipq4019 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += mobipromo_cm520-79f - -define Device/netgear_ex61x0v2 - $(call Device/DniImage) - DEVICE_VENDOR := NETGEAR - DEVICE_DTS_CONFIG := config@4 - NETGEAR_BOARD_ID := EX6150v2series - NETGEAR_HW_ID := 29765285+16+0+128+2x2 - IMAGE_SIZE := 14400k - SOC := qcom-ipq4018 -endef - -define Device/netgear_ex6100v2 - $(call Device/netgear_ex61x0v2) - DEVICE_MODEL := EX6100 - DEVICE_VARIANT := v2 -endef -TARGET_DEVICES += netgear_ex6100v2 - -define Device/netgear_ex6150v2 - $(call Device/netgear_ex61x0v2) - DEVICE_MODEL := EX6150 - DEVICE_VARIANT := v2 -endef -TARGET_DEVICES += netgear_ex6150v2 - -define Device/openmesh_a42 - $(call Device/FitImageLzma) - DEVICE_VENDOR := OpenMesh - DEVICE_MODEL := A42 - SOC := qcom-ipq4018 - DEVICE_DTS_CONFIG := config@om.a42 - BLOCKSIZE := 64k - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) - IMAGE_SIZE := 15616k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := uboot-envtools -endef -TARGET_DEVICES += openmesh_a42 - -define Device/openmesh_a62 - $(call Device/FitImageLzma) - DEVICE_VENDOR := OpenMesh - DEVICE_MODEL := A62 - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@om.a62 - BLOCKSIZE := 64k - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) - IMAGE_SIZE := 15552k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools -endef -TARGET_DEVICES += openmesh_a62 - -define Device/p2w_r619ac - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := P&W - DEVICE_MODEL := R619AC - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@10 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGES += nand-factory.bin - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - DEVICE_PACKAGES := ipq-wifi-p2w_r619ac -endef -TARGET_DEVICES += p2w_r619ac - -define Device/p2w_r619ac-128m - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := P&W - DEVICE_MODEL := R619AC - DEVICE_VARIANT := 128M - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@10 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-p2w_r619ac -endef -TARGET_DEVICES += p2w_r619ac-128m - -define Device/plasmacloud_pa1200 - $(call Device/FitImageLzma) - DEVICE_VENDOR := Plasma Cloud - DEVICE_MODEL := PA1200 - SOC := qcom-ipq4018 - DEVICE_DTS_CONFIG := config@pc.pa1200 - BLOCKSIZE := 64k - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) - IMAGE_SIZE := 15616k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200 -endef -TARGET_DEVICES += plasmacloud_pa1200 - -define Device/plasmacloud_pa2200 - $(call Device/FitImageLzma) - DEVICE_VENDOR := Plasma Cloud - DEVICE_MODEL := PA2200 - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@pc.pa2200 - BLOCKSIZE := 64k - KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) - IMAGE_SIZE := 15552k - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools -endef -TARGET_DEVICES += plasmacloud_pa2200 - -define Device/qcom_ap-dk01.1-c1 - DEVICE_VENDOR := Qualcomm Atheros - DEVICE_MODEL := AP-DK01.1 - DEVICE_VARIANT := C1 - BOARD_NAME := ap-dk01.1-c1 - SOC := qcom-ipq4019 - DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1 - KERNEL_INSTALL := 1 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 26624k - $(call Device/FitImage) - IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += qcom_ap-dk01.1-c1 - -define Device/qcom_ap-dk04.1-c1 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Qualcomm Atheros - DEVICE_MODEL := AP-DK04.1 - DEVICE_VARIANT := C1 - SOC := qcom-ipq4019 - DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1 - KERNEL_INSTALL := 1 - KERNEL_SIZE := 4048k - BLOCKSIZE := 128k - PAGESIZE := 2048 - BOARD_NAME := ap-dk04.1-c1 -endef -TARGET_DEVICES += qcom_ap-dk04.1-c1 - -define Device/qxwlan_e2600ac-c1 - $(call Device/FitImage) - DEVICE_VENDOR := Qxwlan - DEVICE_MODEL := E2600AC - DEVICE_VARIANT := C1 - BOARD_NAME := e2600ac-c1 - SOC := qcom-ipq4019 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 31232k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac -endef -TARGET_DEVICES += qxwlan_e2600ac-c1 - -define Device/qxwlan_e2600ac-c2 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Qxwlan - DEVICE_MODEL := E2600AC - DEVICE_VARIANT := C2 - SOC := qcom-ipq4019 - KERNEL_INSTALL := 1 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac -endef -TARGET_DEVICES += qxwlan_e2600ac-c2 - -define Device/unielec_u4019-32m - $(call Device/FitImage) - DEVICE_VENDOR := Unielec - DEVICE_MODEL := U4019 - DEVICE_VARIANT := 32M - BOARD_NAME := u4019-32m - SOC := qcom-ipq4019 - KERNEL_SIZE := 4096k - IMAGE_SIZE := 31232k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata -endef -TARGET_DEVICES += unielec_u4019-32m - -define Device/zyxel_nbg6617 - $(call Device/FitImageLzma) - DEVICE_VENDOR := ZyXEL - DEVICE_MODEL := NBG6617 - SOC := qcom-ipq4018 - KERNEL_SIZE := 4096k - ROOTFS_SIZE := 24960k - RAS_BOARD := NBG6617 - RAS_ROOTFS_SIZE := 19840k - RAS_VERSION := "$(VERSION_DIST) $(REVISION)" - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata - IMAGES += factory.bin -# The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is -# at least as large as the one of the initial firmware image (not the current -# one on the device). This only applies to the Web-UI, the bootlaoder ignores -# this minimum-size. However, the larger image can be flashed both ways. - IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport -endef -TARGET_DEVICES += zyxel_nbg6617 - -define Device/zyxel_wre6606 - $(call Device/FitImage) - DEVICE_VENDOR := ZyXEL - DEVICE_MODEL := WRE6606 - DEVICE_DTS_CONFIG := config@4 - SOC := qcom-ipq4018 - IMAGE_SIZE := 13184k - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size - DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers -endef -TARGET_DEVICES += zyxel_wre6606 +include $(SUBTARGET).mk $(eval $(call BuildImage)) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk new file mode 100644 index 0000000000..d244d4f1a3 --- /dev/null +++ b/target/linux/ipq40xx/image/generic.mk @@ -0,0 +1,838 @@ + +DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID +DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION +DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE + +define Device/FitImage + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_NAME := Image +endef + +define Device/FitImageLzma + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_NAME := Image +endef + +define Device/FitzImage + KERNEL_SUFFIX := -fit-zImage.itb + KERNEL = kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_NAME := zImage +endef + +define Device/UbiFit + KERNEL_IN_UBI := 1 + IMAGES := nand-factory.ubi nand-sysupgrade.bin + IMAGE/nand-factory.ubi := append-ubi + IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/DniImage + $(call Device/FitzImage) + NETGEAR_BOARD_ID := + NETGEAR_HW_ID := + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | netgear-dni + IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ + append-rootfs | pad-rootfs | append-metadata | check-size +endef + +define Build/append-rootfshdr + mkimage -A $(LINUX_KARCH) \ + -O linux -T filesystem \ + -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n root.squashfs -d $(IMAGE_ROOTFS) $@.new + dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL) +endef + +define Build/mkmylofw_32m + $(eval device_id=$(word 1,$(1))) + $(eval revision=$(word 2,$(1))) + + let \ + size="$$(stat -c%s $@)" \ + pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="(pad - (size % pad)) % pad" \ + newsize='size + pad'; \ + $(STAGING_DIR_HOST)/bin/mkmylofw \ + -B WPE72 -i 0x11f6:$(device_id):0x11f6:$(device_id) -r $(revision) \ + -s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \ + $@.new + @mv $@.new $@ +endef + +define Build/qsdk-ipq-factory-nand-askey + $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\ + askey_kernel $(IMAGE_KERNEL) \ + askey_fs $(IMAGE_ROOTFS) \ + ubifs $@ + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new + @mv $@.new $@ +endef + +define Build/SenaoFW + -$(STAGING_DIR_HOST)/bin/mksenaofw \ + -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \ + -c $(DATECODE) -w $(2) -x $(CW_VER) -t 0 \ + -e $@ \ + -o $@.new + @cp $@.new $@ +endef + +define Build/wrgg-image + mkwrggimg -i $@ \ + -o $@.new \ + -d "$(WRGG_DEVNAME)" \ + -s "$(WRGG_SIGNATURE)" \ + -v "" -m "" -B "" + mv $@.new $@ +endef + +define Device/8dev_habanero-dvk + $(call Device/FitImageLzma) + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Habanero DVK + IMAGE_SIZE := 30976k + SOC := qcom-ipq4019 + DEVICE_PACKAGES := ipq-wifi-8dev_habanero-dvk + IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | append-metadata | check-size +endef +TARGET_DEVICES += 8dev_habanero-dvk + +define Device/8dev_jalapeno-common + $(call Device/FitImage) + $(call Device/UbiFit) + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := qcom-ipq4018 +endef + +define Device/8dev_jalapeno + $(call Device/8dev_jalapeno-common) + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Jalapeno +endef +TARGET_DEVICES += 8dev_jalapeno + +define Device/alfa-network_ap120c-ac + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := AP120C-AC + SOC := qcom-ipq4018 + DEVICE_PACKAGES := kmod-usb-acm \ + kmod-tpm-i2c-atmel uboot-envtools + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + IMAGES := nand-factory.bin nand-sysupgrade.bin + IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand +endef +TARGET_DEVICES += alfa-network_ap120c-ac + +define Device/aruba_glenmorangie + $(call Device/FitImageLzma) + DEVICE_VENDOR := Aruba + SOC := qcom-ipq4029 + DEVICE_PACKAGES := ipq-wifi-aruba_ap-303 +endef + +define Device/aruba_ap-303 + $(call Device/aruba_glenmorangie) + DEVICE_MODEL := AP-303 + DEVICE_PACKAGES += uboot-envtools +endef +TARGET_DEVICES += aruba_ap-303 + +define Device/aruba_ap-303h + $(call Device/aruba_glenmorangie) + DEVICE_MODEL := AP-303H +endef +TARGET_DEVICES += aruba_ap-303h + +define Device/aruba_ap-365 + $(call Device/aruba_glenmorangie) + DEVICE_MODEL := AP-365 + DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools +endef +TARGET_DEVICES += aruba_ap-365 + +define Device/asus_map-ac2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := Lyra (MAP-AC2200) + SOC := qcom-ipq4019 + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-ath3k +endef +TARGET_DEVICES += asus_map-ac2200 + +define Device/asus_rt-ac58u + $(call Device/FitImageLzma) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RT-AC58U + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DTB_SIZE := 65536 + IMAGE_SIZE := 20439364 + FILESYSTEMS := squashfs +# Someone - in their infinite wisdom - decided to put the firmware +# version in front of the image name \03\00\00\04 => Version 3.0.0.4 +# Since u-boot works with strings we either need another fixup step +# to add a version... or we are very careful not to add '\0' into that +# string and call it a day.... Yeah, we do the latter! + UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U') + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += asus_rt-ac58u + +define Device/avm_fritzbox-4040 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Box 4040 + SOC := qcom-ipq4018 + BOARD_NAME := fritz4040 + IMAGE_SIZE := 29056k + UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-fritz4040.bin + UBOOT_PARTITION_SIZE := 524288 + IMAGES += eva.bin + IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size + DEVICE_PACKAGES := fritz-tffs fritz-caldata +endef +TARGET_DEVICES += avm_fritzbox-4040 + +define Device/avm_fritzbox-7530 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Box 7530 + SOC := qcom-ipq4019 + DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand +endef +TARGET_DEVICES += avm_fritzbox-7530 + +define Device/avm_fritzrepeater-1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Repeater 1200 + SOC := qcom-ipq4019 + DEVICE_PACKAGES := fritz-caldata fritz-tffs-nand ipq-wifi-avm_fritzrepeater-1200 +endef +TARGET_DEVICES += avm_fritzrepeater-1200 + +define Device/avm_fritzrepeater-3000 + $(call Device/FitImageLzma) + DEVICE_VENDOR := AVM + DEVICE_MODEL := FRITZ!Repeater 3000 + SOC := qcom-ipq4019 + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct fritz-caldata fritz-tffs-nand +endef +TARGET_DEVICES += avm_fritzrepeater-3000 + +define Device/buffalo_wtr-m2133hp + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WTR-M2133HP + SOC := qcom-ipq4019 + DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef +TARGET_DEVICES += buffalo_wtr-m2133hp + +define Device/cellc_rtl30vw + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048 + KERNEL_NAME := Image + KERNEL_IN_UBI := + IMAGES := nand-factory.bin nand-sysupgrade.bin + IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey + IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata + DEVICE_VENDOR := Cell C + DEVICE_MODEL := RTL30VW + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@5 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 57344k + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi ipq-wifi-cellc_rtl30vw +endef +TARGET_DEVICES += cellc_rtl30vw + +define Device/cilab_meshpoint-one + $(call Device/8dev_jalapeno-common) + DEVICE_VENDOR := Crisis Innovation Lab + DEVICE_MODEL := MeshPoint.One + DEVICE_PACKAGES := kmod-i2c-gpio kmod-iio-bmp280-i2c kmod-hwmon-ina2xx kmod-rtc-pcf2127 +endef +TARGET_DEVICES += cilab_meshpoint-one + +define Device/compex_wpj419 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ419 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@12 + KERNEL_INSTALL := 1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + FILESYSTEMS := squashfs +endef +TARGET_DEVICES += compex_wpj419 + +define Device/compex_wpj428 + $(call Device/FitImage) + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ428 + SOC := qcom-ipq4028 + DEVICE_DTS_CONFIG := config@4 + BLOCKSIZE := 64k + IMAGE_SIZE := 31232k + KERNEL_SIZE := 4096k + IMAGES += cpximg-6a04.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGE/cpximg-6a04.bin := append-kernel | append-rootfs | pad-rootfs | mkmylofw_32m 0x8A2 3 + DEVICE_PACKAGES := kmod-gpio-beeper +endef +TARGET_DEVICES += compex_wpj428 + +define Device/devolo_magic-2-wifi-next + $(call Device/FitImage) + DEVICE_VENDOR := devolo + DEVICE_MODEL := Magic 2 WiFi next + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + + # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image + # it will bootm it, just like we want for the initramfs. + KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\ + append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00' + + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools +endef +TARGET_DEVICES += devolo_magic-2-wifi-next + +define Device/dlink_dap-2610 + $(call Device/FitImageLzma) + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-2610 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c1 + BLOCKSIZE := 64k + WRGG_DEVNAME := /dev/mtdblock/8 + WRGG_SIGNATURE := wapac30_dkbs_dap2610 + IMAGE_SIZE := 14080k + IMAGES += factory.bin + # Bootloader expects a special 160 byte header which is added by + # wrgg-image. + # Factory image size must be larger than 6MB, and size in wrgg header must + # match actual factory image size to be flashable from D-Link http server. + # Bootloader verifies checksum of wrgg image before booting, thus jffs2 + # cannot be part of the wrgg image. This is solved in the factory image by + # having the rootfs at the end of the image (without pad-rootfs). And in + # the sysupgrade image only the kernel is included in the wrgg checksum, + # but this is not flashable from the D-link http server. + # append-rootfs must start on an erase block boundary. + IMAGE/factory.bin := append-kernel | pad-offset 6144k 160 | append-rootfs | wrgg-image | check-size + IMAGE/sysupgrade.bin := append-kernel | wrgg-image | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | append-metadata + DEVICE_PACKAGES := ipq-wifi-dlink_dap2610 +endef +TARGET_DEVICES += dlink_dap-2610 + +define Device/edgecore_ecw5211 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := ECW5211 + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools +endef +TARGET_DEVICES += edgecore_ecw5211 + +define Device/edgecore_oap100 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := OAP100 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGES := nand-sysupgrade.bin + DEVICE_DTS_CONFIG := config@ap.dk07.1-c1 + DEVICE_PACKAGES := ipq-wifi-edgecore_oap100 kmod-usb-acm kmod-usb-net kmod-usb-net-cdc-qmi uqmi +endef +TARGET_DEVICES += edgecore_oap100 + +define Device/engenius_eap1300 + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EAP1300 + DEVICE_DTS_CONFIG := config@4 + BOARD_NAME := eap1300 + SOC := qcom-ipq4018 + KERNEL_SIZE := 5120k + IMAGE_SIZE := 25344k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += engenius_eap1300 + +define Device/engenius_eap2200 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EAP2200 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-engenius_eap2200 -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += engenius_eap2200 + +define Device/engenius_emd1 + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EMD1 + DEVICE_DTS_CONFIG := config@4 + SOC := qcom-ipq4018 + IMAGE_SIZE := 30720k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size +endef +TARGET_DEVICES += engenius_emd1 + +define Device/engenius_emr3500 + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := EMR3500 + DEVICE_DTS_CONFIG := config@4 + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 30720k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size +endef +TARGET_DEVICES += engenius_emr3500 + +define Device/engenius_ens620ext + $(call Device/FitImage) + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ENS620EXT + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@4 + BLOCKSIZE := 64k + PAGESIZE := 256 + BOARD_NAME := ENS620EXT + VENDOR_ID := 0x0101 + PRODUCT_ID := 0x79 + PRODUCT_ID_NEW := 0xA4 + DATECODE := 190507 + FW_VER := 3.1.2 + FW_VER_NEW := 3.5.6 + CW_VER := 1.8.99 + IMAGE_SIZE := 21312k + KERNEL_SIZE := 5120k + FILESYSTEMS := squashfs + IMAGES += factory_30.bin factory_35.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata + IMAGE/factory_30.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size | SenaoFW $$$$(PRODUCT_ID) $$$$(FW_VER) + IMAGE/factory_35.bin := qsdk-ipq-factory-nor | check-size | SenaoFW $$$$(PRODUCT_ID_NEW) $$$$(FW_VER_NEW) +endef +TARGET_DEVICES += engenius_ens620ext + +define Device/ezviz_cs-w3-wd1200g-eup + $(call Device/FitImage) + DEVICE_VENDOR := EZVIZ + DEVICE_MODEL := CS-W3-WD1200G + DEVICE_VARIANT := EUP + DEVICE_DTS_CONFIG := config@4 + IMAGE_SIZE := 14848k + SOC := qcom-ipq4018 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + append-metadata + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ + ipq-wifi-ezviz_cs-w3-wd1200g-eup +endef +TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup + +define Device/glinet_gl-ap1300 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AP1300 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 131072k + KERNEL_INSTALL := 1 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 +endef +TARGET_DEVICES += glinet_gl-ap1300 + +define Device/glinet_gl-b1300 + $(call Device/FitImage) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-B1300 + BOARD_NAME := gl-b1300 + SOC := qcom-ipq4029 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += glinet_gl-b1300 + +define Device/glinet_gl-s1300 + $(call Device/FitImage) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-S1300 + SOC := qcom-ipq4029 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-glinet_gl-s1300 kmod-fs-ext4 kmod-mmc kmod-spi-dev +endef +TARGET_DEVICES += glinet_gl-s1300 + +define Device/linksys_ea6350v3 + # The Linksys EA6350v3 has a uboot bootloader that does not + # support either booting lzma kernel images nor booting UBI + # partitions. This uboot, however, supports raw kernel images and + # gzipped images. + # + # As for the time of writing this, the device will boot the kernel + # from a fixed address with a fixed length of 3MiB. Also, the + # device has a hard-coded kernel command line that requieres the + # rootfs and alt_rootfs to be in mtd11 and mtd13 respectively. + # Oh... and the kernel partition overlaps with the rootfs + # partition (the same for alt_kernel and alt_rootfs). + # + # If you are planing re-partitioning the device, you may want to + # keep those details in mind: + # 1. The kernel adresses you should honor are 0x00000000 and + # 0x02800000 respectively. + # 2. The kernel size (plus the dtb) cannot exceed 3.00MiB in size. + # 3. You can use 'zImage', but not a raw 'Image' packed with lzma. + # 4. The kernel command line from uboot is harcoded to boot with + # rootfs either in mtd11 or mtd13. + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := EA6350 + DEVICE_VARIANT := v3 + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 37888k + UBINIZE_OPTS := -E 5 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += linksys_ea6350v3 + +define Device/linksys_ea8300 + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := EA8300 + SOC := qcom-ipq4019 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 87040k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300 + DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += linksys_ea8300 + +define Device/linksys_mr8300 + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := MR8300 + SOC := qcom-ipq4019 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 87040k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300 + DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += linksys_mr8300 + +define Device/luma_wrtq-329acn + $(call Device/FitImage) + DEVICE_VENDOR := Luma Home + DEVICE_MODEL := WRTQ-329ACN + SOC := qcom-ipq4018 + DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools + IMAGE_SIZE := 76632k + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef +TARGET_DEVICES += luma_wrtq-329acn + +define Device/meraki_mr33 + $(call Device/FitImage) + DEVICE_VENDOR := Cisco Meraki + DEVICE_MODEL := MR33 + SOC := qcom-ipq4029 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct +endef +TARGET_DEVICES += meraki_mr33 + +define Device/mobipromo_cm520-79f + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := MobiPromo + DEVICE_MODEL := CM520-79F + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += mobipromo_cm520-79f + +define Device/netgear_ex61x0v2 + $(call Device/DniImage) + DEVICE_VENDOR := NETGEAR + DEVICE_DTS_CONFIG := config@4 + NETGEAR_BOARD_ID := EX6150v2series + NETGEAR_HW_ID := 29765285+16+0+128+2x2 + IMAGE_SIZE := 14400k + SOC := qcom-ipq4018 +endef + +define Device/netgear_ex6100v2 + $(call Device/netgear_ex61x0v2) + DEVICE_MODEL := EX6100 + DEVICE_VARIANT := v2 +endef +TARGET_DEVICES += netgear_ex6100v2 + +define Device/netgear_ex6150v2 + $(call Device/netgear_ex61x0v2) + DEVICE_MODEL := EX6150 + DEVICE_VARIANT := v2 +endef +TARGET_DEVICES += netgear_ex6150v2 + +define Device/openmesh_a42 + $(call Device/FitImageLzma) + DEVICE_VENDOR := OpenMesh + DEVICE_MODEL := A42 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@om.a42 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += openmesh_a42 + +define Device/openmesh_a62 + $(call Device/FitImageLzma) + DEVICE_VENDOR := OpenMesh + DEVICE_MODEL := A62 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@om.a62 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools +endef +TARGET_DEVICES += openmesh_a62 + +define Device/plasmacloud_pa1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA1200 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@pc.pa1200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200 +endef +TARGET_DEVICES += plasmacloud_pa1200 + +define Device/plasmacloud_pa2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@pc.pa2200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools +endef +TARGET_DEVICES += plasmacloud_pa2200 + +define Device/p2w_r619ac + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := P&W + DEVICE_MODEL := R619AC + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@10 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGES += nand-factory.bin + IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand + DEVICE_PACKAGES := ipq-wifi-p2w_r619ac +endef +TARGET_DEVICES += p2w_r619ac + +define Device/p2w_r619ac-128m + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := P&W + DEVICE_MODEL := R619AC + DEVICE_VARIANT := 128M + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@10 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ipq-wifi-p2w_r619ac +endef +TARGET_DEVICES += p2w_r619ac-128m + +define Device/qcom_ap-dk01.1-c1 + DEVICE_VENDOR := Qualcomm Atheros + DEVICE_MODEL := AP-DK01.1 + DEVICE_VARIANT := C1 + BOARD_NAME := ap-dk01.1-c1 + SOC := qcom-ipq4019 + DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + $(call Device/FitImage) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += qcom_ap-dk01.1-c1 + +define Device/qcom_ap-dk04.1-c1 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Qualcomm Atheros + DEVICE_MODEL := AP-DK04.1 + DEVICE_VARIANT := C1 + SOC := qcom-ipq4019 + DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4048k + BLOCKSIZE := 128k + PAGESIZE := 2048 + BOARD_NAME := ap-dk04.1-c1 +endef +TARGET_DEVICES += qcom_ap-dk04.1-c1 + +define Device/qxwlan_e2600ac-c1 + $(call Device/FitImage) + DEVICE_VENDOR := Qxwlan + DEVICE_MODEL := E2600AC + DEVICE_VARIANT := C1 + BOARD_NAME := e2600ac-c1 + SOC := qcom-ipq4019 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 31232k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac +endef +TARGET_DEVICES += qxwlan_e2600ac-c1 + +define Device/qxwlan_e2600ac-c2 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Qxwlan + DEVICE_MODEL := E2600AC + DEVICE_VARIANT := C2 + SOC := qcom-ipq4019 + KERNEL_INSTALL := 1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ipq-wifi-qxwlan_e2600ac +endef +TARGET_DEVICES += qxwlan_e2600ac-c2 + +define Device/unielec_u4019-32m + $(call Device/FitImage) + DEVICE_VENDOR := Unielec + DEVICE_MODEL := U4019 + DEVICE_VARIANT := 32M + BOARD_NAME := u4019-32m + SOC := qcom-ipq4019 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 31232k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += unielec_u4019-32m + +define Device/zyxel_nbg6617 + $(call Device/FitImageLzma) + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NBG6617 + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + ROOTFS_SIZE := 24960k + RAS_BOARD := NBG6617 + RAS_ROOTFS_SIZE := 19840k + RAS_VERSION := "$(VERSION_DIST) $(REVISION)" + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + IMAGES += factory.bin +# The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is +# at least as large as the one of the initial firmware image (not the current +# one on the device). This only applies to the Web-UI, the bootlaoder ignores +# this minimum-size. However, the larger image can be flashed both ways. + IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += zyxel_nbg6617 + +define Device/zyxel_wre6606 + $(call Device/FitImage) + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := WRE6606 + DEVICE_DTS_CONFIG := config@4 + SOC := qcom-ipq4018 + IMAGE_SIZE := 13184k + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size + DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += zyxel_wre6606 + +$(eval $(call BuildImage)) diff --git a/target/linux/ipq40xx/image/mikrotik.mk b/target/linux/ipq40xx/image/mikrotik.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/target/linux/ipq40xx/mikrotik/config-default b/target/linux/ipq40xx/mikrotik/config-default new file mode 100644 index 0000000000..147217380c --- /dev/null +++ b/target/linux/ipq40xx/mikrotik/config-default @@ -0,0 +1,4 @@ +CONFIG_MIKROTIK=y +CONFIG_MIKROTIK_RB_SYSFS=y +CONFIG_MTD_ROUTERBOOT_PARTS=y +CONFIG_MTD_SPLIT_MINOR_FW=y diff --git a/target/linux/ipq40xx/mikrotik/target.mk b/target/linux/ipq40xx/mikrotik/target.mk new file mode 100644 index 0000000000..4530a90985 --- /dev/null +++ b/target/linux/ipq40xx/mikrotik/target.mk @@ -0,0 +1,4 @@ +BOARDNAME:=MikroTik +FEATURES += minor +KERNEL_IMAGES:=vmlinux +IMAGES_DIR:=compressed diff --git a/target/linux/ipq40xx/patches-5.4/301-arm-compressed-add-appended-DTB-section.patch b/target/linux/ipq40xx/patches-5.4/301-arm-compressed-add-appended-DTB-section.patch new file mode 100644 index 0000000000..7e6184fc73 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/301-arm-compressed-add-appended-DTB-section.patch @@ -0,0 +1,48 @@ +From 0843a61d6913bdac8889eb048ed89f7903059787 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 30 Oct 2020 13:36:31 +0100 +Subject: [PATCH] arm: compressed: add appended DTB section + +This adds a appended_dtb section to the ARM decompressor +linker script. + +This allows using the existing ARM zImage appended DTB support for +appending a DTB to the raw ELF kernel. + +Its size is set to 1MB max to match the zImage appended DTB size limit. + +To use it to pass the DTB to the kernel, objcopy is used: + +objcopy --set-section-flags=.appended_dtb=alloc,contents \ + --update-section=.appended_dtb=.dtb vmlinux + +This is based off the following patch: +https://github.com/openwrt/openwrt/commit/c063e27e02a9dcac0e7f5877fb154e58fa3e1a69 + +Signed-off-by: Robert Marko +--- + arch/arm/boot/compressed/vmlinux.lds.S | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/compressed/vmlinux.lds.S ++++ b/arch/arm/boot/compressed/vmlinux.lds.S +@@ -93,6 +93,13 @@ SECTIONS + + _edata = .; + ++ .appended_dtb : { ++ /* leave space for appended DTB */ ++ . += 0x100000; ++ } ++ ++ _edata_dtb = .; ++ + /* + * The image_end section appears after any additional loadable sections + * that the linker may decide to insert in the binary image. Having +@@ -132,4 +139,4 @@ SECTIONS + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + } +-ASSERT(_edata_real == _edata, "error: zImage file size is incorrect"); ++ASSERT(_edata_real == _edata_dtb, "error: zImage file size is incorrect"); diff --git a/target/linux/ipq40xx/patches-5.4/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch b/target/linux/ipq40xx/patches-5.4/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch new file mode 100644 index 0000000000..71618a40f2 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/302-arm-compressed-set-ipq40xx-watchdog-to-allow-boot.patch @@ -0,0 +1,66 @@ +From 11d6a6128a5a07c429941afc202b6e62a19771be Mon Sep 17 00:00:00 2001 +From: John Thomson +Date: Fri, 23 Oct 2020 19:42:36 +1000 +Subject: [PATCH 2/2] arm: compressed: set ipq40xx watchdog to allow boot + +For IPQ40XX systems where the SoC watchdog is activated before linux, +the watchdog timer may be too small for linux to finish uncompress, +boot, and watchdog management start. +If the watchdog is enabled, set the timeout for it to 30 seconds. +The functionality and offsets were copied from: +drivers/watchdog/qcom-wdt.c qcom_wdt_set_timeout & qcom_wdt_start +The watchdog memory address was taken from: +arch/arm/boot/dts/qcom-ipq4019.dtsi + +This was required on Mikrotik IPQ40XX consumer hardware using Mikrotik's +RouterBoot bootloader. + +Signed-off-by: John Thomson +--- + arch/arm/boot/compressed/head.S | 35 +++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +--- a/arch/arm/boot/compressed/head.S ++++ b/arch/arm/boot/compressed/head.S +@@ -599,6 +599,41 @@ not_relocated: mov r0, #0 + bic r4, r4, #1 + blne cache_on + ++/* Set the Qualcom IPQ40xx watchdog timeout to 30 seconds ++ * if it is enabled, so that there is time for kernel ++ * to decompress, boot, and take over the watchdog. ++ * data and functionality from drivers/watchdog/qcom-wdt.c ++ * address from arch/arm/boot/dts/qcom-ipq4019.dtsi ++ */ ++#ifdef CONFIG_ARCH_IPQ40XX ++watchdog_set: ++ /* offsets: ++ * 0x04 reset (=1 resets countdown) ++ * 0x08 enable (=0 disables) ++ * 0x0c status (=1 when SoC was reset by watchdog) ++ * 0x10 bark (=timeout warning in ticks) ++ * 0x14 bite (=timeout reset in ticks) ++ * clock rate is 1<<15 hertz ++ */ ++ .equ watchdog, 0x0b017000 @Store watchdog base address ++ movw r0, #:lower16:watchdog ++ movt r0, #:upper16:watchdog ++ ldr r1, [r0, #0x08] @Get enabled? ++ cmp r1, #1 @If not enabled, do not change ++ bne watchdog_finished ++ mov r1, #0 ++ str r1, [r0, #0x08] @Disable the watchdog ++ mov r1, #1 ++ str r1, [r0, #0x04] @Pet the watchdog ++ mov r1, #30 @30 seconds timeout ++ lsl r1, r1, #15 @converted to ticks ++ str r1, [r0, #0x10] @Set the bark timeout ++ str r1, [r0, #0x14] @Set the bite timeout ++ mov r1, #1 ++ str r1, [r0, #0x08] @Enable the watchdog ++watchdog_finished: ++#endif /* CONFIG_ARCH_IPQ40XX */ ++ + /* + * The C runtime environment should now be setup sufficiently. + * Set up some pointers, and start decompressing. diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch index 0c9ef86a3b..fc987e8e9d 100644 --- a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -95,7 +95,7 @@ Signed-off-by: David S. Miller } netif_tx_start_all_queues(port->dev); -@@ -5127,8 +5131,11 @@ static void mvpp2_mac_config(struct phyl +@@ -5139,8 +5143,11 @@ static void mvpp2_mac_config(struct phyl mvpp2_port_enable(port); } diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch index ef6f66e3fc..7a34dbad6e 100644 --- a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch +++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller struct ethtool_eee *p = &priv->dev->ports[port].eee; --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1507,7 +1507,9 @@ static void gswip_phylink_mac_link_down( +@@ -1508,7 +1508,9 @@ static void gswip_phylink_mac_link_down( static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index 75f43f2dc8..d8acaabe27 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -18,6 +18,13 @@ rockchip_setup_interfaces() esac } +nanopi_generate_mac() +{ + local sd_hash=$(sha256sum /sys/devices/platform/*.dwmmc/mmc_host/mmc0/mmc0:*/cid) + local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)") + echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")" +} + rockchip_setup_macs() { local board="$1" @@ -28,7 +35,7 @@ rockchip_setup_macs() case "$board" in friendlyarm,nanopi-r2s|\ friendlyarm,nanopi-r4s) - wan_mac=$(macaddr_random) + wan_mac=$(nanopi_generate_mac) lan_mac=$(macaddr_add "$wan_mac" +1) ;; esac diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index a8c6ab4f65..055082593b 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -27,6 +27,7 @@ define Host/Compile $(call cc,add_header) $(call cc,addpattern) $(call cc,asustrx) + $(call cc,bcm4908img,-Wall) $(call cc,bcm4908kernel,-Wall) $(call cc,buffalo-enc buffalo-lib,-Wall) $(call cc,buffalo-tag buffalo-lib,-Wall) diff --git a/tools/firmware-utils/src/bcm4908img.c b/tools/firmware-utils/src/bcm4908img.c new file mode 100644 index 0000000000..86a187b146 --- /dev/null +++ b/tools/firmware-utils/src/bcm4908img.c @@ -0,0 +1,379 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2021 Rafał Miłecki + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(__BYTE_ORDER) +#error "Unknown byte order" +#endif + +#if __BYTE_ORDER == __BIG_ENDIAN +#define cpu_to_le32(x) bswap_32(x) +#define le32_to_cpu(x) bswap_32(x) +#elif __BYTE_ORDER == __LITTLE_ENDIAN +#define cpu_to_le32(x) (x) +#define le32_to_cpu(x) (x) +#else +#error "Unsupported endianness" +#endif + +struct bcm4908img_tail { + uint32_t crc32; + uint32_t unk1; + uint32_t family; + uint32_t unk2; + uint32_t unk3; +}; + +char *pathname; +static size_t prefix_len; +static size_t suffix_len; + +static inline size_t bcm4908img_min(size_t x, size_t y) { + return x < y ? x : y; +} + +/************************************************** + * CRC32 + **************************************************/ + +static const uint32_t crc32_tbl[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +uint32_t bcm4908img_crc32(uint32_t crc, uint8_t *buf, size_t len) { + while (len) { + crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); + buf++; + len--; + } + + return crc; +} + +/************************************************** + * Check + **************************************************/ + +static void bcm4908img_check_parse_options(int argc, char **argv) { + int c; + + while ((c = getopt(argc, argv, "p:s:")) != -1) { + switch (c) { + case 'p': + prefix_len = atoi(optarg); + break; + case 's': + suffix_len = atoi(optarg); + break; + } + } +} + +static int bcm4908img_check(int argc, char **argv) { + struct bcm4908img_tail tail; + struct stat st; + uint8_t buf[1024]; + uint32_t crc32; + size_t length; + size_t bytes; + FILE *fp; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No BCM4908 image pathname passed\n"); + err = -EINVAL; + goto out; + } + pathname = argv[2]; + + optind = 3; + bcm4908img_check_parse_options(argc, argv); + + if (stat(pathname, &st)) { + fprintf(stderr, "Failed to stat %s\n", pathname); + err = -EIO; + goto out; + } + + fp = fopen(pathname, "r"); + if (!fp) { + fprintf(stderr, "Failed to open %s\n", pathname); + err = -EACCES; + goto out; + } + + fseek(fp, prefix_len, SEEK_SET); + + crc32 = 0xffffffff; + length = st.st_size - prefix_len - sizeof(tail) - suffix_len; + while (length && (bytes = fread(buf, 1, bcm4908img_min(sizeof(buf), length), fp)) > 0) { + crc32 = bcm4908img_crc32(crc32, buf, bytes); + length -= bytes; + } + + if (length) { + fprintf(stderr, "Failed to read last %zd B of data from %s\n", length, pathname); + err = -EIO; + goto err_close; + } + + if (fread(&tail, 1, sizeof(tail), fp) != sizeof(tail)) { + fprintf(stderr, "Failed to read BCM4908 image tail\n"); + err = -EIO; + goto err_close; + } + + if (crc32 != le32_to_cpu(tail.crc32)) { + fprintf(stderr, "Invalid data crc32: 0x%08x instead of 0x%08x\n", crc32, le32_to_cpu(tail.crc32)); + err = -EPROTO; + goto err_close; + } + + printf("Found a valid BCM4908 image (crc: 0x%08x)\n", crc32); + +err_close: + fclose(fp); +out: + return err; +} + +/************************************************** + * Create + **************************************************/ + +static ssize_t bcm4908img_create_append_file(FILE *trx, const char *in_path, uint32_t *crc32) { + FILE *in; + size_t bytes; + ssize_t length = 0; + uint8_t buf[1024]; + + in = fopen(in_path, "r"); + if (!in) { + fprintf(stderr, "Failed to open %s\n", in_path); + return -EACCES; + } + + while ((bytes = fread(buf, 1, sizeof(buf), in)) > 0) { + if (fwrite(buf, 1, bytes, trx) != bytes) { + fprintf(stderr, "Failed to write %zu B to %s\n", bytes, pathname); + length = -EIO; + break; + } + *crc32 = bcm4908img_crc32(*crc32, buf, bytes); + length += bytes; + } + + fclose(in); + + return length; +} + +static ssize_t bcm4908img_create_append_zeros(FILE *trx, size_t length) { + uint8_t *buf; + + buf = malloc(length); + if (!buf) + return -ENOMEM; + memset(buf, 0, length); + + if (fwrite(buf, 1, length, trx) != length) { + fprintf(stderr, "Failed to write %zu B to %s\n", length, pathname); + free(buf); + return -EIO; + } + + free(buf); + + return length; +} + +static ssize_t bcm4908img_create_align(FILE *trx, size_t cur_offset, size_t alignment) { + if (cur_offset & (alignment - 1)) { + size_t length = alignment - (cur_offset % alignment); + return bcm4908img_create_append_zeros(trx, length); + } + + return 0; +} + +static int bcm4908img_create(int argc, char **argv) { + struct bcm4908img_tail tail = { + .unk1 = cpu_to_le32(0x5732), + .family = cpu_to_le32(0x4908), + .unk2 = cpu_to_le32(0x03), + .unk3 = cpu_to_le32(0x02), + }; + uint32_t crc32 = 0xffffffff; + size_t cur_offset = 0; + ssize_t bytes; + FILE *fp; + int c; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No BCM4908 image pathname passed\n"); + err = -EINVAL; + goto out; + } + pathname = argv[2]; + + fp = fopen(pathname, "w+"); + if (!fp) { + fprintf(stderr, "Failed to open %s\n", pathname); + err = -EACCES; + goto out; + } + + optind = 3; + while ((c = getopt(argc, argv, "f:a:A:")) != -1) { + switch (c) { + case 'f': + bytes = bcm4908img_create_append_file(fp, optarg, &crc32); + if (bytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + cur_offset += bytes; + } + break; + case 'a': + bytes = bcm4908img_create_align(fp, cur_offset, strtol(optarg, NULL, 0)); + if (bytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + cur_offset += bytes; + break; + case 'A': + bytes = strtol(optarg, NULL, 0) - cur_offset; + if (bytes < 0) { + fprintf(stderr, "Current BCM4908 image length is 0x%zx, can't pad it with zeros to 0x%lx\n", cur_offset, strtol(optarg, NULL, 0)); + } else { + bytes = bcm4908img_create_append_zeros(fp, bytes); + if (bytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + cur_offset += bytes; + } + break; + } + if (err) + goto err_close; + } + + tail.crc32 = cpu_to_le32(crc32); + + bytes = fwrite(&tail, 1, sizeof(tail), fp); + if (bytes != sizeof(tail)) { + fprintf(stderr, "Failed to write BCM4908 image tail to %s\n", pathname); + return -EIO; + } + +err_close: + fclose(fp); +out: + return err; +} + +/************************************************** + * Start + **************************************************/ + +static void usage() { + printf("Usage:\n"); + printf("\n"); + printf("Checking a BCM4908 image:\n"); + printf("\tbcm4908img check [options]\tcheck if images is valid\n"); + printf("\t-p prefix\t\t\tlength of custom header to skip (default: 0)\n"); + printf("\t-s suffix\t\t\tlength of custom tail to skip (default: 0)\n"); + printf("\n"); + printf("Creating a new BCM4908 image:\n"); + printf("\tbcm4908img create [options]\n"); + printf("\t-f file\t\t\t\tadd data from specified file\n"); + printf("\t-a alignment\t\t\tpad image with zeros to specified alignment\n"); + printf("\t-A offset\t\t\t\tappend zeros until reaching specified offset\n"); +} + +int main(int argc, char **argv) { + if (argc > 1) { + if (!strcmp(argv[1], "check")) + return bcm4908img_check(argc, argv); + else if (!strcmp(argv[1], "create")) + return bcm4908img_create(argc, argv); + } + + usage(); + return 0; +}