Error build firmware Nexx WT3020 (16 mb patch)

Forum not accept archives
all files upload to http://rgho.st/private/7JfnshjjZ/bf65ba25c94163a597a4974b1fb15e2f

use source for v17.01.2

.config (default config for WT3020-8M and add git_2.11.0-1_mips_mips32.ipk & depends)

Lede_WT3020-16M.17-01-2.patch - i use this patch

build.log - build log file
command for build:
ionice -c 3 nice -n 20 make -j 1 V=s CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 | tee ../build.log

packages selected in 6 mb without errors
if select packages over 6-7 mb, build with error

What else needs to be changed to build the firmware with 8-10 MB packages?

Your .config is loaded with trash such as :
CONFIG_IWL100_FW=y
CONFIG_IWL1000_FW=y
CONFIG_IWL105_FW=y
CONFIG_IWL135_FW=y
CONFIG_IWL2000_FW=y
CONFIG_IWL2030_FW=y
CONFIG_IWL3160_FW=y
CONFIG_IWL5000_FW=y
CONFIG_IWL5150_FW=y
CONFIG_IWL6000_FW=y
CONFIG_IWL6005_FW=y
CONFIG_IWL6030_FW=y
CONFIG_IWL6050_FW=y
CONFIG_IWL7260_FW=y
CONFIG_IWL7265_FW=y
CONFIG_IWL8000_FW=y

This options enabled in default config:
vech@agro-data:~/lede/source$ ./scripts/diffconfig.sh
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7620=y
CONFIG_TARGET_ramips_mt7620_DEVICE_wt3020-16M=y
CONFIG_ALL_NONSHARED=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_IB=y
CONFIG_IMAGEOPT=y
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_LIBCURL_COOKIES=y
CONFIG_LIBCURL_FILE=y
CONFIG_LIBCURL_FTP=y
CONFIG_LIBCURL_HTTP=y
CONFIG_LIBCURL_MBEDTLS=y
CONFIG_LIBCURL_NO_SMB="!"
CONFIG_LIBCURL_PROXY=y
CONFIG_OPENSSL_WITH_DEPRECATED=y
CONFIG_OPENSSL_WITH_EC=y
CONFIG_OPENSSL_WITH_NPN=y
CONFIG_OPENSSL_WITH_PSK=y
CONFIG_OPENSSL_WITH_SRP=y
CONFIG_PACKAGE_adb=m
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_git=y
CONFIG_PACKAGE_git-http=y
CONFIG_PACKAGE_libcurl=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_libmbedtls=y
CONFIG_PACKAGE_libopenssl=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_zlib=y
# CONFIG_PER_FEED_REPO_ADD_COMMENTED is not set
CONFIG_SDK=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_BUG_URL=""
CONFIG_VERSION_CODE=""
CONFIG_VERSION_DIST="LEDE"
CONFIG_VERSION_FILENAMES=y
CONFIG_VERSION_HWREV=""
CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_MANUFACTURER_URL=""
CONFIG_VERSION_NICK=""
CONFIG_VERSION_NUMBER=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_REPO="http://downloads.lede-project.org/releases/17.01.2"
CONFIG_VERSION_SUPPORT_URL=""
# CONFIG_IB_STANDALONE is not set

The problem still remains unresolved

Author: L. D. Pinney ldpinney@gmail.com
Date: Sat Aug 5 13:48:09 2017 +0800

ramips: Add support for Nexx WT-3020 16M SPI Flash Hardware hack.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>

diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 17ada64893..901152c84e 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -604,6 +604,9 @@ ramips_board_detect() {
 	*"WT3020 (8M)")
 		name="wt3020-8M"
 		;;
+	*"WT3020 (16M)")
+		name="wt3020-16M"
+		;;
 	*"WZR-AGL300NH")
 		name="wzr-agl300nh"
 		;;
diff --git a/target/linux/ramips/dts/WT3020-16M.dts b/target/linux/ramips/dts/WT3020-16M.dts
new file mode 100644
index 0000000000..a55bfa684a
--- /dev/null
+++ b/target/linux/ramips/dts/WT3020-16M.dts
@@ -0,0 +1,102 @@
+/dts-v1/;
+
+#include "mt7620n.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "wt3020", "ralink,mt7620n-soc";
+	model = "Nexx WT3020 (16M)";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power {
+			label = "wt3020:blue:power";
+			gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&gpio3 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	m25p80@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+
+		partition@0 {
+			label = "u-boot";
+			reg = <0x0 0x30000>;
+			read-only;
+		};
+
+		partition@30000 {
+			label = "u-boot-env";
+			reg = <0x30000 0x10000>;
+			read-only;
+		};
+
+		factory: partition@40000 {
+			label = "factory";
+			reg = <0x40000 0x10000>;
+			read-only;
+		};
+
+		partition@50000 {
+			label = "firmware";
+			reg = <0x50000 0xfb0000>;
+		};
+	};
+};
+
+&ehci {
+	status = "okay";
+};
+
+&ohci {
+	status = "okay";
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x4>;
+	mediatek,portmap = "wllll";
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+	state_default: pinctrl0 {
+		default {
+			ralink,group = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
+			ralink,function = "gpio";
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index e27c405b3c..7157527cc8 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -110,6 +110,16 @@ define Device/wt3020-8M
 endef
 TARGET_DEVICES += wt3020-8M
 
+define Device/wt3020-16M
+  DTS := WT3020-16M
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  IMAGES += factory.bin
+  IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
+	poray-header -B WT3020 -F 16M
+  DEVICE_TITLE := Nexx WT3020 (16MB)
+endef
+TARGET_DEVICES += wt3020-16M
+
 define Device/wrh-300cr
   DTS := WRH-300CR
   IMAGE_SIZE := $(ralink_default_fw_size_16M)
diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c
index 6ec4f320d9..6bf5bf01a7 100644
--- a/tools/firmware-utils/src/mkporayfw.c
+++ b/tools/firmware-utils/src/mkporayfw.c
@@ -136,17 +136,20 @@ static struct flash_layout layouts[] = {
 		.id		= "8M",
 		.fw_max_len	= 0x7c0000,
 	}, {
+		.id 	= "16M",
+		.fw_max_len	= 0xfc0000,
+	}, {
 		/* terminating entry */
 	}
 };
 
 static struct board_info boards[] = {
 	{
-		.id             = "A5-V11",
-		.hw_id          = HWID_A5_V11,
-		.layout_id      = "4M",
-		.key            = KEY_A5_V11,
-        }, {
+		.id 	= "A5-V11",
+		.hw_id		= HWID_A5_V11,
+		.layout_id	= "4M",
+		.key		= KEY_A5_V11,
+	}, {
 		.id		= "MPR-A1",
 		.hw_id		= HWID_HAME_MPR_A1_L8,
 		.layout_id	= "4M",
@@ -221,20 +224,22 @@ static struct board_info boards[] = {
 		.hw_id		= HWID_NEXX_WT1520,
 		.layout_id	= "8M",
 		.key		= KEY_NEXX_1,
-        }, {
-                .id             = "WT3020",
-                .hw_id          = HWID_NEXX_WT3020,
-                .layout_id      = "4M",
-                .key            = KEY_NEXX_2,
-        }, {
-                .id             = "WT3020",
-                .hw_id          = HWID_NEXX_WT3020,
-                .layout_id      = "8M",
-                .key            = KEY_NEXX_2,
-        }, {
-
-
-
+	}, {
+		.id		= "WT3020",
+		.hw_id		= HWID_NEXX_WT3020,
+		.layout_id	= "4M",
+		.key		= KEY_NEXX_2,
+	}, {
+		.id		= "WT3020",
+		.hw_id		= HWID_NEXX_WT3020,
+		.layout_id	= "8M",
+		.key		= KEY_NEXX_2,
+	}, {
+		.id		= "WT3020",
+		.hw_id		= HWID_NEXX_WT3020,
+		.layout_id	= "16M",
+		.key		= KEY_NEXX_2,
+	}, {
 
 		/* terminating entry */
 	}

I did not have this line in file linux/ramips/image/mt7620.mk:

  • IMAGE_SIZE := $(ralink_default_fw_size_16M)
    Now I started the firmware assembly again

I'm thinking about upgrading WT3020 I have in my collection. Is there a similar patch for the current OpenWrt version? Sorry, this is slightly outside of my area of expertise.