summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinclude/wifi.mk28
-rwxr-xr-xtarget/linux/ramips/mt7620/config-3.10309
-rwxr-xr-xtarget/linux/ramips/mt7620/profiles/00-default.mk25
-rwxr-xr-xtarget/linux/ramips/mt7620/target.mk17
-rwxr-xr-xtarget/linux/ramips/mt7628/config-3.10431
-rwxr-xr-xtarget/linux/ramips/mt7628/profiles/00-default.mk24
-rwxr-xr-xtarget/linux/ramips/mt7628/target.mk17
-rwxr-xr-xtarget/linux/wifi/mt7615-patch/0604-mt7615-buildin.patch395
-rwxr-xr-xtarget/linux/wifi/mt76x2-patch/0612-mt76x2-build.patch75
9 files changed, 1321 insertions, 0 deletions
diff --git a/include/wifi.mk b/include/wifi.mk
new file mode 100755
index 0000000..7f489d2
--- /dev/null
+++ b/include/wifi.mk
@@ -0,0 +1,28 @@
+WIFI_SOURCE_7615:=MT7615_LinuxAP_V4.4.1.2_20170514.tar.bz2
+WIFI_SOURCE_76x2:=MT76x2e_MT7620_LinuxAP_V3.0.4.0_DPA_20150618.tar.bz2
+WIFI_SOURCE_7610:=mt7610e-p4rev-118062.tar.bz2
+WIFI_SOURCE_7603:=MT7603e_LinuxAP_V4.0.1.0rev1_DPA_20150629.tar.bz2
+WIFI_SOURCE_7620:=mt7620-p4rev-120998.tar.bz2
+WIFI_SOURCE_7628:=mt7628-p4rev-120935.tar.bz2
+FILE_7615_EXIT = $(shell if [ -a $(DL_DIR)/$(WIFI_SOURCE_7615) ];then echo "exist";else echo "notexit";fi;)
+
+FILE_76x2_EXIT = $(shell if [ -a $(DL_DIR)/$(WIFI_SOURCE_76x2) ];then echo "exist";else echo "notexit";fi;)
+define wifi-prepare
+
+ifeq ($(FILE_76x2_EXIT),exist)
+ @echo =======76x2 exist=======;
+ @echo "Extract 76x2 wifi driver";
+ rm -rf $(LINUX_DIR)/drivers/net/wireless/rlt_wifi*;
+ $(TAR) -jxvf $(DL_DIR)/$(WIFI_SOURCE_76x2) -C $(LINUX_DIR)/drivers/net/wireless/;
+ $(call PatchDir,$(PKG_BUILD_DIR),$(MT76x2_PATCH_DIR),mt76x2/)
+endif
+
+ifeq ($(FILE_7615_EXIT),exist)
+ @echo =======7615 exist=======
+ @echo "Extract 7615 wifi driver";
+ rm -rf $(LINUX_DIR)/drivers/net/wireless/mt_wifi*;
+ $(TAR) -jxvf $(DL_DIR)/$(WIFI_SOURCE_7615) -C $(LINUX_DIR)/drivers/net/wireless/;
+ $(call PatchDir,$(PKG_BUILD_DIR),$(MT7615_PATCH_DIR),mt7615/)
+endif
+
+endef
diff --git a/target/linux/ramips/mt7620/config-3.10 b/target/linux/ramips/mt7620/config-3.10
new file mode 100755
index 0000000..cb294cb
--- /dev/null
+++ b/target/linux/ramips/mt7620/config-3.10
@@ -0,0 +1,309 @@
+# CONFIG_32B_DESC is not set
+# CONFIG_AIO is not set
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+# CONFIG_ARPD is not set
+CONFIG_AT803X_PHY=y
+CONFIG_ATA=m
+# CONFIG_AUFS_FS is not set
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BRIDGE_IGMP_SNOOPING is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootfstype=squashfs,jffs2 print-fatal-signals=1"
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+CONFIG_COMPAT_BRK=y
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CPU_SUPPORTS_HR_SCHED_CLOCK=y
+CONFIG_CRC32_SLICEBY8=y
+CONFIG_CSRC_R4K=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DMA_NONCOHERENT=y
+# CONFIG_DUAL_IMAGE is not set
+CONFIG_ESW_DOUBLE_VLAN_TAG=y
+# CONFIG_ETH_SKB_ALLOC_SELECT is not set
+# CONFIG_ETH_WIFI_OOM_DEBUG is not set
+CONFIG_FAT_FS=m
+# CONFIG_GDMA_DEBUG is not set
+CONFIG_GDMA_EVERYBODY=y
+# CONFIG_GDMA_PCM_I2S_OTHERS is not set
+# CONFIG_GDMA_PCM_ONLY is not set
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GPIO_DEVRES=y
+# CONFIG_HAMRADIO is not set
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_KVM=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HNAT_V2=y
+CONFIG_HW_HAS_PCI=y
+CONFIG_HW_RANDOM=m
+CONFIG_HZ=250
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+CONFIG_HZ_PERIODIC=y
+# CONFIG_IMQ is not set
+CONFIG_INET_LRO=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IPV6=y
+# CONFIG_IPV6_GRE is not set
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MULTIPLE_TABLES=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_SUBTREES=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_KERNEL_NVRAM=y
+CONFIG_L2TP=m
+# CONFIG_L2TP_DEBUGFS is not set
+CONFIG_LAN_WAN_SUPPORT=y
+# CONFIG_MII is not set
+CONFIG_MIPS=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MIPS_MT_DISABLED=y
+CONFIG_MMC=m
+CONFIG_MMC_BLOCK=m
+# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MT7620_ASIC=y
+# CONFIG_MT7620_FPGA is not set
+CONFIG_MTD_ANY_RALINK=y
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_KERNEL_PART_SIZ=0xD0000
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_RALINK is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_BUSWIDTH=2
+CONFIG_MTD_PHYSMAP_LEN=0x1000000
+CONFIG_MTD_PHYSMAP_START=0x1C000000
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_SPI_RALINK is not set
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_UIMAGE_SPLIT=y
+# CONFIG_MTK_AEE_KDUMP is not set
+CONFIG_MTK_MMC=m
+# CONFIG_MTK_MMC_CD_POLL is not set
+# CONFIG_NAT_FCONE is not set
+# CONFIG_NAT_LINUX is not set
+CONFIG_NAT_RCONE=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NETFILTER=y
+CONFIG_NETFILTER_ADVANCED=y
+# CONFIG_NETFILTER_RALINK_SWQOS_SUPPORT is not set
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+# CONFIG_NET_SCHED is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+# CONFIG_NF_CONNTRACK_PROCFS is not set
+CONFIG_NF_DEFRAG_IPV4=m
+# CONFIG_NF_DEFRAG_IPV6 is not set
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_NEEDED=y
+# CONFIG_NF_SHORTCUT_HOOK is not set
+CONFIG_NLS=m
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_NTFS_FS=m
+CONFIG_NTFS_RW=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PDMA_NEW=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PHYLIB=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_PRINTK_TIME=y
+CONFIG_RAETH=y
+CONFIG_RAETH_CHECKSUM_OFFLOAD=y
+# CONFIG_RAETH_HAS_PORT4 is not set
+# CONFIG_RAETH_HAS_PORT5 is not set
+CONFIG_RAETH_HW_VLAN_TX=y
+CONFIG_RAETH_LRO=y
+# CONFIG_RAETH_NAPI is not set
+CONFIG_RAETH_RW_PDMAPTR_FROM_VAR=y
+CONFIG_RAETH_SCATTER_GATHER_RX_DMA=y
+CONFIG_RAETH_SKB_RECYCLE_2K=y
+# CONFIG_RAETH_SPECIAL_TAG is not set
+CONFIG_RAETH_TSO=y
+CONFIG_RAETH_TSOV6=y
+# CONFIG_RAETH_TSO_DBG is not set
+CONFIG_RALINK_CPUSLEEP=y
+CONFIG_RALINK_GDMA=y
+CONFIG_RALINK_GPIO=y
+CONFIG_RALINK_GPIO_LED=y
+CONFIG_RALINK_I2C=m
+# CONFIG_RALINK_I2S is not set
+CONFIG_RALINK_MT7620=y
+# CONFIG_RALINK_MT7621 is not set
+# CONFIG_RALINK_MT7628 is not set
+# CONFIG_RALINK_PCM is not set
+CONFIG_RALINK_RAM_SIZE=64
+CONFIG_RALINK_RDM=y
+# CONFIG_RALINK_RT5350 is not set
+# CONFIG_RALINK_SLIC_CONNECT_SPI_CS1 is not set
+CONFIG_RALINK_SPI=y
+# CONFIG_RALINK_SPI_CS0_HIGH_ACTIVE is not set
+# CONFIG_RALINK_SPI_CS1_HIGH_ACTIVE is not set
+CONFIG_RALINK_SYSTICK=y
+# CONFIG_RALINK_TIMER is not set
+# CONFIG_RALINK_TIMER_WDG_RESET_OUTPUT is not set
+# CONFIG_RALINK_VITESSE_SWITCH_CONNECT_SPI_CS1 is not set
+CONFIG_RALINK_WATCHDOG=y
+CONFIG_RA_HW_NAT=m
+# CONFIG_RA_HW_NAT_ACCNT_MAINTAINER is not set
+CONFIG_RA_HW_NAT_BINDING_THRESHOLD=30
+CONFIG_RA_HW_NAT_FIN_DLTA=5
+# CONFIG_RA_HW_NAT_HASH0 is not set
+CONFIG_RA_HW_NAT_HASH1=y
+# CONFIG_RA_HW_NAT_HASH2 is not set
+# CONFIG_RA_HW_NAT_HASH3 is not set
+# CONFIG_RA_HW_NAT_IPV6 is not set
+CONFIG_RA_HW_NAT_LAN_VLANID=1
+# CONFIG_RA_HW_NAT_NIC_USB is not set
+CONFIG_RA_HW_NAT_NTU_DLTA=5
+CONFIG_RA_HW_NAT_NTU_KA=1
+# CONFIG_RA_HW_NAT_TBL_16K is not set
+# CONFIG_RA_HW_NAT_TBL_1K is not set
+# CONFIG_RA_HW_NAT_TBL_2K is not set
+CONFIG_RA_HW_NAT_TBL_4K=y
+# CONFIG_RA_HW_NAT_TBL_8K is not set
+CONFIG_RA_HW_NAT_TCP_DLTA=5
+CONFIG_RA_HW_NAT_TCP_KA=1
+CONFIG_RA_HW_NAT_UDP_DLTA=5
+CONFIG_RA_HW_NAT_UDP_KA=1
+CONFIG_RA_HW_NAT_UNB_DLTA=3
+CONFIG_RA_HW_NAT_UNB_MNP=1000
+CONFIG_RA_HW_NAT_WAN_VLANID=2
+# CONFIG_RA_HW_NAT_WIFI is not set
+CONFIG_RA_NAT_HW=y
+# CONFIG_RA_NAT_NONE is not set
+CONFIG_RA_NETWORK_TASKLET_BH=y
+# CONFIG_RA_NETWORK_WORKQUEUE_BH is not set
+# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_RD_LZMA=y
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_ROOTFS_IN_FLASH_NO_PADDING is not set
+# CONFIG_RT2880_DRAM_128M is not set
+# CONFIG_RT2880_DRAM_16M is not set
+# CONFIG_RT2880_DRAM_256M is not set
+# CONFIG_RT2880_DRAM_32M is not set
+CONFIG_RT2880_DRAM_64M=y
+# CONFIG_RT2880_DRAM_8M is not set
+CONFIG_RT2880_ROOTFS_IN_FLASH=y
+# CONFIG_RT2880_ROOTFS_IN_RAM is not set
+CONFIG_RT_3052_ESW=y
+# CONFIG_SAMSUNG_USB2PHY is not set
+# CONFIG_SAMSUNG_USB3PHY is not set
+# CONFIG_SAMSUNG_USBPHY is not set
+CONFIG_SCSI=m
+CONFIG_SCSI_MOD=m
+CONFIG_SECCOMP=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RT288X=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+# CONFIG_SPLICE_NET_SUPPORT is not set
+# CONFIG_STAGING is not set
+CONFIG_SWAP_IO_SPACE=y
+# CONFIG_SYN_COOKIES is not set
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_TIGON3_V3133D is not set
+CONFIG_UIDGID_CONVERTED=y
+# CONFIG_UNION_FS is not set
+CONFIG_USB=m
+CONFIG_USB_ARCH_HAS_XHCI=y
+CONFIG_USB_COMMON=m
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_HCD_PLATFORM is not set
+CONFIG_USB_EHCI_PCI=m
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_PHY=y
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_UHCI_HCD is not set
+CONFIG_VFAT_FS=m
+# CONFIG_WAN_AT_P0 is not set
+CONFIG_WAN_AT_P4=y
+# CONFIG_WIFI_DRIVER is not set
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ramips/mt7620/profiles/00-default.mk b/target/linux/ramips/mt7620/profiles/00-default.mk
new file mode 100755
index 0000000..93b7cec
--- /dev/null
+++ b/target/linux/ramips/mt7620/profiles/00-default.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MT7620
+ NAME:=Default Profile
+ PACKAGES:=\
+ -swconfig -rt2x00 \
+ ated hwnat reg gpio btnd switch ethstt uci2dat mii_mgr watchdog 8021xd \
+ wireless-tools block-mount fstools kmod-scsi-generic \
+ kmod-usb-core kmod-ohci kmod-usb2 kmod-usb-storage \
+ kmod-fs-vfat kmod-fs-ntfs kmod-nls-base kmod-nls-utf8 kmod-nls-cp936 \
+ kmod-nls-cp437 kmod-nls-cp850 kmod-nls-iso8859-1 kmod-nls-iso8859-15 kmod-nls-cp950
+endef
+
+
+define Profile/Default/Description
+ Basic MT7620 SoC support
+endef
+$(eval $(call Profile,MT7620))
+
+
diff --git a/target/linux/ramips/mt7620/target.mk b/target/linux/ramips/mt7620/target.mk
new file mode 100755
index 0000000..ed4159f
--- /dev/null
+++ b/target/linux/ramips/mt7620/target.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+
+SUBTARGET:=mt7620
+BOARDNAME:=MT7620 based boards
+ARCH_PACKAGES:=ramips_24kec
+FEATURES+=usb
+CPU_TYPE:=24kec
+CPU_SUBTYPE:=dsp
+
+DEFAULT_PACKAGES +=
+
+define Target/Description
+ Build firmware images for Ralink MT7620 based boards.
+endef
+
diff --git a/target/linux/ramips/mt7628/config-3.10 b/target/linux/ramips/mt7628/config-3.10
new file mode 100755
index 0000000..c5779b3
--- /dev/null
+++ b/target/linux/ramips/mt7628/config-3.10
@@ -0,0 +1,431 @@
+# CONFIG_AIO is not set
+# CONFIG_APCLI_CERT_SUPPORT is not set
+CONFIG_APCLI_SUPPORT=y
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ATE_SUPPORT=y
+# CONFIG_ATH_CARDS is not set
+# CONFIG_AUFS_FS is not set
+CONFIG_AVERAGE=y
+CONFIG_BACKGROUND_SCAN_SUPPORT=y
+# CONFIG_BAND_STEERING is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
+# CONFIG_CFG80211_DEBUGFS is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_REG_DEBUG=y
+# CONFIG_CFG80211_SUPPORT is not set
+CONFIG_CFG80211_WEXT=y
+CONFIG_CHIP_MT7615E=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootfstype=squashfs,jffs2 print-fatal-signals=1"
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+# CONFIG_CON_WPS_SUPPORT is not set
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CPU_SUPPORTS_HR_SCHED_CLOCK=y
+CONFIG_CRC32_SLICEBY8=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_CSRC_R4K=y
+CONFIG_DBDC_MODE=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DEFAULT_HOSTNAME="MT7628"
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
+CONFIG_DMA_NONCOHERENT=y
+# CONFIG_DOT11K_RRM_SUPPORT is not set
+# CONFIG_DOT11R_FT_SUPPORT is not set
+CONFIG_DOT11W_PMF_SUPPORT=y
+CONFIG_DOT11_N_SUPPORT=y
+CONFIG_DOT11_VHT_AC=y
+# CONFIG_DUAL_IMAGE is not set
+CONFIG_ESW_DOUBLE_VLAN_TAG=y
+# CONFIG_ETH_MEMORY_OPTIMIZATION is not set
+# CONFIG_ETH_ONE_PORT_ONLY is not set
+# CONFIG_ETH_SKB_ALLOC_SELECT is not set
+# CONFIG_ETH_WIFI_OOM_DEBUG is not set
+CONFIG_FIRST_IF_EEPROM_FLASH=y
+CONFIG_FIRST_IF_EPAELNA=y
+# CONFIG_FIRST_IF_IPAELNA is not set
+# CONFIG_FIRST_IF_IPAILNA is not set
+CONFIG_FIRST_IF_MT7615E=y
+# CONFIG_FIRST_IF_MT7620 is not set
+# CONFIG_FIRST_IF_MT7628 is not set
+# CONFIG_FIRST_IF_NONE is not set
+# CONFIG_FIRST_IF_RT2860 is not set
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_GREENAP_SUPPORT=y
+CONFIG_G_BAND_256QAM_SUPPORT=y
+# CONFIG_HAMRADIO is not set
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_KVM=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HDR_TRANS_RX_SUPPORT=y
+CONFIG_HDR_TRANS_TX_SUPPORT=y
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_HW_HAS_PCI=y
+CONFIG_HZ=250
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_ICAP_SUPPORT=y
+CONFIG_IGMP_SNOOP_SUPPORT=y
+# CONFIG_IMQ is not set
+CONFIG_INET_LRO=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IPC_NS=y
+CONFIG_IPV6=y
+# CONFIG_IPV6_GRE is not set
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MULTIPLE_TABLES=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IP_NF_IPTABLES=m
+# CONFIG_IP_ROUTE_VERBOSE is not set
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+# CONFIG_ISDN is not set
+# CONFIG_IWL4965 is not set
+CONFIG_KERNEL_NVRAM=y
+CONFIG_L2TP=m
+# CONFIG_L2TP_DEBUGFS is not set
+CONFIG_LAN_WAN_SUPPORT=y
+# CONFIG_LBDAF is not set
+CONFIG_LED_CONTROL_SUPPORT=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=16
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_MAC80211_HAS_RC=y
+# CONFIG_MAC80211_HWSIM is not set
+CONFIG_MAC80211_MESH=y
+# CONFIG_MAC80211_MESSAGE_TRACING is not set
+CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+# CONFIG_MAC80211_RC_PID is not set
+CONFIG_MAC_REPEATER_SUPPORT=y
+CONFIG_MBSS_SUPPORT=y
+CONFIG_MCAST_RATE_SPECIFIC=y
+# CONFIG_MII is not set
+CONFIG_MIPS=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MIPS_MT_DISABLED=y
+CONFIG_MMC=y
+# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MT7628_ASIC=y
+# CONFIG_MT7628_FPGA is not set
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_KERNEL_PART_SIZ=0xD0000
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_BUSWIDTH=2
+CONFIG_MTD_PHYSMAP_LEN=0x1000000
+CONFIG_MTD_PHYSMAP_START=0x1C000000
+CONFIG_MTD_SPI_RALINK=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_UIMAGE_SPLIT=y
+# CONFIG_MTK_AEE_KDUMP is not set
+CONFIG_MTK_MMC=m
+# CONFIG_MTK_MMC_CD_POLL is not set
+# CONFIG_MTK_MMC_EMMC_8BIT is not set
+CONFIG_MT_AP_SUPPORT=y
+CONFIG_MT_DFS_SUPPORT=y
+CONFIG_MT_MAC=y
+CONFIG_MT_WIFI=y
+CONFIG_MT_WIFI_PATH="mt_wifi"
+CONFIG_MUMIMO_SUPPORT=y
+CONFIG_MU_RA_SUPPORT=y
+# CONFIG_MWIFIEX is not set
+CONFIG_NAMESPACES=y
+# CONFIG_NAT_FCONE is not set
+CONFIG_NAT_LINUX=y
+# CONFIG_NAT_RCONE is not set
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_RALINK_SWQOS_SUPPORT is not set
+CONFIG_NETFILTER_XTABLES=y
+# CONFIG_NET_CADENCE is not set
+CONFIG_NET_IPGRE_DEMUX=y
+CONFIG_NET_NS=y
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_ADAPTEC is not set
+# CONFIG_NET_VENDOR_ALTEON is not set
+# CONFIG_NET_VENDOR_AMD is not set
+# CONFIG_NET_VENDOR_ATHEROS is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_BROCADE is not set
+# CONFIG_NET_VENDOR_CHELSIO is not set
+# CONFIG_NET_VENDOR_CISCO is not set
+# CONFIG_NET_VENDOR_DEC is not set
+# CONFIG_NET_VENDOR_DLINK is not set
+# CONFIG_NET_VENDOR_EMULEX is not set
+# CONFIG_NET_VENDOR_EXAR is not set
+# CONFIG_NET_VENDOR_HP is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MELLANOX is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_MYRI is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NVIDIA is not set
+# CONFIG_NET_VENDOR_OKI is not set
+# CONFIG_NET_VENDOR_QLOGIC is not set
+# CONFIG_NET_VENDOR_RDC is not set
+# CONFIG_NET_VENDOR_REALTEK is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SILAN is not set
+# CONFIG_NET_VENDOR_SIS is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SUN is not set
+# CONFIG_NET_VENDOR_TEHUTI is not set
+# CONFIG_NET_VENDOR_TI is not set
+# CONFIG_NET_VENDOR_TOSHIBA is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_IPV4=m
+# CONFIG_NF_CONNTRACK_PROCFS is not set
+CONFIG_NF_DEFRAG_IPV4=m
+# CONFIG_NF_DEFRAG_IPV6 is not set
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+# CONFIG_NF_SHORTCUT_HOOK is not set
+CONFIG_NL80211_TESTMODE=y
+CONFIG_NLS=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_OPROFILE=m
+CONFIG_PAGEFLAGS_EXTENDED=y
+# CONFIG_PARTITION_ADVANCED is not set
+# CONFIG_PASSPOINT_R2 is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PID_NS=y
+CONFIG_PPP=m
+CONFIG_PPPOE=m
+CONFIG_PPPOL2TP=m
+CONFIG_PPPOPPTP=m
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_MPPE=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_PRINTK_TIME=y
+CONFIG_PROFILING=y
+# CONFIG_RADIUS_ACCOUNTING_SUPPORT is not set
+CONFIG_RAETH=y
+# CONFIG_RAETH_CHECKSUM_OFFLOAD is not set
+# CONFIG_RAETH_HW_LRO is not set
+# CONFIG_RAETH_NAPI is not set
+CONFIG_RAETH_SKB_RECYCLE_2K=y
+# CONFIG_RAETH_SPECIAL_TAG is not set
+# CONFIG_RALINK_CPUSLEEP is not set
+# CONFIG_RALINK_GDMA is not set
+CONFIG_RALINK_GPIO=y
+CONFIG_RALINK_GPIO_LED=y
+CONFIG_RALINK_I2C=m
+# CONFIG_RALINK_I2C_CODEC is not set
+# CONFIG_RALINK_I2S is not set
+# CONFIG_RALINK_MT7620 is not set
+# CONFIG_RALINK_MT7621 is not set
+CONFIG_RALINK_MT7628=y
+# CONFIG_RALINK_PCM is not set
+CONFIG_RALINK_RAM_SIZE=64
+CONFIG_RALINK_RDM=m
+# CONFIG_RALINK_RT5350 is not set
+# CONFIG_RALINK_SPI is not set
+# CONFIG_RALINK_SYSTICK is not set
+# CONFIG_RALINK_TIMER is not set
+# CONFIG_RALINK_WATCHDOG is not set
+CONFIG_RATE_ADAPTION=y
+CONFIG_RATE_ADAPT_AGBS_SUPPORT=y
+CONFIG_RA_NAT_NONE=y
+CONFIG_RA_NETWORK_TASKLET_BH=y
+# CONFIG_RA_NETWORK_WORKQUEUE_BH is not set
+# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_RD_LZMA=y
+CONFIG_RED_SUPPORT=y
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RF_LOCKDOWN_SUPPORT=y
+CONFIG_RING_BUFFER=y
+CONFIG_RING_BUFFER_ALLOW_SWAP=y
+# CONFIG_RIRST_IF_EEPROM_EFUSE is not set
+CONFIG_RLM_CAL_CACHE_SUPPORT=y
+# CONFIG_RLT_MAC is not set
+# CONFIG_ROOTFS_IN_FLASH_NO_PADDING is not set
+# CONFIG_RT2880_DRAM_128M is not set
+# CONFIG_RT2880_DRAM_16M is not set
+# CONFIG_RT2880_DRAM_256M is not set
+# CONFIG_RT2880_DRAM_32M is not set
+CONFIG_RT2880_DRAM_64M=y
+# CONFIG_RT2880_DRAM_8M is not set
+CONFIG_RT2880_ROOTFS_IN_FLASH=y
+# CONFIG_RT2880_ROOTFS_IN_RAM is not set
+# CONFIG_RTLWIFI is not set
+CONFIG_RTMP_FLASH_SUPPORT=y
+# CONFIG_RTMP_MAC is not set
+CONFIG_RT_3052_ESW=y
+CONFIG_RT_FIRST_CARD="7615e"
+CONFIG_RT_FIRST_CARD_EEPROM="flash"
+CONFIG_RT_FIRST_IF_RF_OFFSET=0x0
+# CONFIG_SAMSUNG_USB2PHY is not set
+# CONFIG_SAMSUNG_USB3PHY is not set
+# CONFIG_SAMSUNG_USBPHY is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SECOND_IF_MT7602E is not set
+# CONFIG_SECOND_IF_MT7603E is not set
+# CONFIG_SECOND_IF_MT7610E is not set
+# CONFIG_SECOND_IF_MT7610U is not set
+# CONFIG_SECOND_IF_MT7612E is not set
+# CONFIG_SECOND_IF_MT7612U is not set
+# CONFIG_SECOND_IF_MT7615E is not set
+# CONFIG_SECOND_IF_MT7637E is not set
+CONFIG_SECOND_IF_NONE=y
+# CONFIG_SECOND_IF_RT3092 is not set
+# CONFIG_SECOND_IF_RT3572 is not set
+# CONFIG_SECOND_IF_RT3593 is not set
+# CONFIG_SECOND_IF_RT5392 is not set
+# CONFIG_SECOND_IF_RT5572 is not set
+# CONFIG_SECOND_IF_RT5592 is not set
+# CONFIG_SECOND_IF_RT8592 is not set
+CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RT288X=y
+CONFIG_SLHC=m
+CONFIG_SMART_CARRIER_SENSE_SUPPORT=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+# CONFIG_SPLICE_NET_SUPPORT is not set
+# CONFIG_STAGING is not set
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_TASKSTATS=y
+# CONFIG_TASK_DELAY_ACCT is not set
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_TASK_XACCT=y
+# CONFIG_THIRD_IF_MT7615E is not set
+CONFIG_THIRD_IF_NONE=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TPC_SUPPORT=y
+CONFIG_TRACE_CLOCK=y
+CONFIG_TXBF_SUPPORT=y
+CONFIG_UAPSD=y
+CONFIG_UIDGID_CONVERTED=y
+# CONFIG_UNION_FS is not set
+CONFIG_USB=y
+CONFIG_USB_ARCH_HAS_XHCI=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_EHCI_PCI=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_PHY=y
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_UHCI_HCD is not set
+CONFIG_USER_NS=y
+CONFIG_UTS_NS=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_VOW_SUPPORT=y
+# CONFIG_WAN_AT_P0 is not set
+CONFIG_WAN_AT_P4=y
+CONFIG_WATCHDOG_CORE=y
+# CONFIG_WDS_SUPPORT is not set
+CONFIG_WIFI_BASIC_FUNC=y
+CONFIG_WIFI_DRIVER=y
+CONFIG_WIFI_MODE_AP=y
+# CONFIG_WIFI_MODE_BOTH is not set
+# CONFIG_WIFI_MODE_STA is not set
+# CONFIG_WIFI_PKT_FWD is not set
+# CONFIG_WIFI_PKT_FWD_V1 is not set
+# CONFIG_WIFI_SKB_ALLOC_SELECT is not set
+CONFIG_WSC_INCLUDED=y
+CONFIG_WSC_V2_SUPPORT=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ramips/mt7628/profiles/00-default.mk b/target/linux/ramips/mt7628/profiles/00-default.mk
new file mode 100755
index 0000000..455696c
--- /dev/null
+++ b/target/linux/ramips/mt7628/profiles/00-default.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/MT7628
+ NAME:=MT7628 Default
+ PACKAGES:= -swconfig -rt2x00 \
+ ated reg gpio btnd switch ethstt uci2dat mii_mgr watchdog 8021xd \
+ wireless-tools xl2tpd block-mount fstools kmod-scsi-generic \
+ kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-storage \
+ kmod-fs-vfat kmod-fs-ntfs kmod-nls-base kmod-nls-utf8 kmod-nls-cp936 \
+ kmod-nls-cp437 kmod-nls-cp850 kmod-nls-iso8859-1 kmod-nls-iso8859-15 kmod-nls-cp950
+endef
+
+define Profile/MT7628/Description
+ Basic MT7628 SoC support
+endef
+$(eval $(call Profile,MT7628))
+
+
+
diff --git a/target/linux/ramips/mt7628/target.mk b/target/linux/ramips/mt7628/target.mk
new file mode 100755
index 0000000..80beb6b
--- /dev/null
+++ b/target/linux/ramips/mt7628/target.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+
+SUBTARGET:=mt7628
+BOARDNAME:=MT7628 based boards
+ARCH_PACKAGES:=ramips_24kec
+FEATURES+=usb
+CPU_TYPE:=24kec
+CPU_SUBTYPE:=dsp
+
+DEFAULT_PACKAGES +=
+
+define Target/Description
+ Build firmware images for Ralink MT7628 based boards.
+endef
+
diff --git a/target/linux/wifi/mt7615-patch/0604-mt7615-buildin.patch b/target/linux/wifi/mt7615-patch/0604-mt7615-buildin.patch
new file mode 100755
index 0000000..d735270
--- /dev/null
+++ b/target/linux/wifi/mt7615-patch/0604-mt7615-buildin.patch
@@ -0,0 +1,395 @@
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/chips/mt7615.c
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/chips/mt7615.c
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/chips/mt7615.c
+@@ -43,9 +43,9 @@
+
+ #ifdef CONFIG_AP_SUPPORT
+ #ifdef INTELP6_SUPPORT
+-#define DEFAULT_BIN_FILE "/nvram/MT7615_EEPROM_2G.bin"
++#define DEFAULT_BIN_FILE "/etc/wlan/MT7615_EEPROM_2G.bin"
+ #else
+-#define DEFAULT_BIN_FILE "/etc_ro/wlan/MT7615E_EEPROM1.bin"
++#define DEFAULT_BIN_FILE "/etc/wlan/MT7615E_EEPROM1.bin"
+ #endif
+ #else
+ #define DEFAULT_BIN_FILE "/etc/MT7615E_EEPROM1.bin"
+@@ -53,13 +53,13 @@
+
+ #ifdef MT_SECOND_CARD
+ #ifdef INTELP6_SUPPORT
+-#define SECOND_BIN_FILE "/nvram/MT7615_EEPROM_5G.bin"
++#define SECOND_BIN_FILE "/etc/wlan/MT7615_EEPROM_5G.bin"
+ #else
+-#define SECOND_BIN_FILE "/etc_ro/wlan/MT7615E_EEPROM2.bin"
++#define SECOND_BIN_FILE "/etc/wlan/MT7615E_EEPROM2.bin"
+ #endif
+ #endif /* MT_SECOND_CARD */
+ #ifdef MT_THIRD_CARD
+-#define THIRD_BIN_FILE "/etc_ro/wlan/MT7615E_EEPROM3.bin"
++#define THIRD_BIN_FILE "/etc/wlan/MT7615E_EEPROM3.bin"
+ #endif /* MT_THIRD_CARD */
+
+ extern UCHAR g_BFBackOffMode; // BF Backoff Mode: 2/3/4: apply 2T/3T/4T value in BF backoff table
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/common/cmm_profile.c
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/embedded/common/cmm_profile.c
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/common/cmm_profile.c
+@@ -5348,7 +5348,7 @@ BOOLEAN RTMP_CardInfoRead(
+ } else {
+ MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR,
+ ("Dat path not found/too big -- Using Defaults!\n"));
+- snprintf(default_buf, sizeof(default_buf), "/etc/Wireless/RT2860AP/RT2860AP%01d.dat", card_match_id +1);
++ snprintf(default_buf, sizeof(default_buf), "/etc/wireless/RT2860AP/RT2860AP%01d.dat", card_match_id +1);
+ NdisMoveMemory(pAd->MC_FileName, default_buf, strlen(default_buf));
+ pAd->MC_FileName[strlen(default_buf)] = '\0';
+ }
+@@ -5359,7 +5359,7 @@ BOOLEAN RTMP_CardInfoRead(
+ } else {
+ MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR,
+ ("BIN path not found/too big -- Using Defaults!\n"));
+- snprintf(default_buf, sizeof(default_buf), "/etc/Wireless/RT2860AP/Eeprom%01d.bin", card_match_id +1);
++ snprintf(default_buf, sizeof(default_buf), "/etc/wireless/RT2860AP/Eeprom%01d.bin", card_match_id +1);
+ NdisMoveMemory(pAd->MC_BinFileName, default_buf, strlen(default_buf));
+ pAd->MC_BinFileName[strlen(default_buf)] = '\0';
+ }
+@@ -5370,7 +5370,7 @@ BOOLEAN RTMP_CardInfoRead(
+ } else {
+ MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR,
+ ("CAL BIN path not found/too big -- Using Defaults!\n"));
+- snprintf(default_buf, sizeof(default_buf), "/etc/Wireless/RT2860AP/Caldata%01d.bin", card_match_id +1);
++ snprintf(default_buf, sizeof(default_buf), "/etc/wireless/RT2860AP/Caldata%01d.bin", card_match_id +1);
+ NdisMoveMemory(pAd->MC_CalBinFileName, default_buf, strlen(default_buf));
+ pAd->MC_CalBinFileName[strlen(default_buf)] = '\0';
+ }
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/common/eeprom.c
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/embedded/common/eeprom.c
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/common/eeprom.c
+@@ -31,38 +31,38 @@
+
+
+ #ifdef MT_FIRST_CARD
+-#define FIRST_EEPROM_FILE_PATH "/etc_ro/Wireless/RT2860/MT7615_EEPROM_1.bin"
++#define FIRST_EEPROM_FILE_PATH "/etc/wireless/RT2860/MT7615_EEPROM_1.bin"
+ #endif /* MT_FIRST_CARD */
+
+ #ifdef MT_SECOND_CARD
+-#define SECOND_EEPROM_FILE_PATH "/etc_ro/Wireless/iNIC/MT7615_EEPROM_2.bin"
++#define SECOND_EEPROM_FILE_PATH "/etc/wireless/iNIC/MT7615_EEPROM_2.bin"
+ #endif /* MT_SECOND_CARD */
+
+ #if defined(PRE_CAL_TRX_SET1_SUPPORT) || defined(PRE_CAL_TRX_SET2_SUPPORT) || defined(RLM_CAL_CACHE_SUPPORT)
+ #ifdef MT_FIRST_CARD
+ #ifdef INTELP6_SUPPORT
+-#define FIRST_CAL_FILE_PATH "/nvram/MT7615_CALDATA1.bin"
++#define FIRST_CAL_FILE_PATH "/etc/wireless/MT7615_CALDATA1.bin"
+ #else
+-#define FIRST_CAL_FILE_PATH "/etc_ro/Wireless/RT2860/CALDATA1.bin"
++#define FIRST_CAL_FILE_PATH "/etc/wireless/RT2860/CALDATA1.bin"
+ #endif
+ #endif /* MT_FIRST_CARD */
+
+ #ifdef MT_SECOND_CARD
+ #ifdef INTELP6_SUPPORT
+-#define SECOND_CAL_FILE_PATH "/nvram/MT7615_CALDATA2.bin"
++#define SECOND_CAL_FILE_PATH "/etc/wireless/MT7615_CALDATA2.bin"
+ #else
+-#define SECOND_CAL_FILE_PATH "/etc_ro/Wireless/iNIC/CALDATA2.bin"
++#define SECOND_CAL_FILE_PATH "/etc/wireless/iNIC/CALDATA2.bin"
+ #endif
+ #endif /* MT_SECOND_CARD */
+ #endif /* PRE_CAL_TRX_SET1_SUPPORT */
+
+ #ifdef PA_TRIM_SUPPORT
+ #ifdef MT_FIRST_CARD
+-#define FIRST_CAL_BIN_FILE_PATH "/etc_ro/Wireless/RT2860AP/CALIBRATION_DATA_1.bin"
++#define FIRST_CAL_BIN_FILE_PATH "/etc/wireless/RT2860AP/CALIBRATION_DATA_1.bin"
+ #endif /* MT_FIRST_CARD */
+
+ #ifdef MT_SECOND_CARD
+-#define SECOND_CAL_BIN_FILE_PATH "/etc_ro/Wireless/iNIC/CALIBRATION_DATA_2.bin"
++#define SECOND_CAL_BIN_FILE_PATH "/etc/wireless/iNIC/CALIBRATION_DATA_2.bin"
+ #endif /* MT_SECOND_CARD */
+ #endif /* PA_TRIM_SUPPORT */
+
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/common/multi_profile.c
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/embedded/common/multi_profile.c
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/common/multi_profile.c
+@@ -19,25 +19,25 @@
+ #include "rt_config.h"
+
+ /*Local definition*/
+-#define FIRST_AP_2G_PROFILE_PATH "/etc/Wireless/RT2860/RT2860_2G.dat"
+-#define FIRST_AP_5G_PROFILE_PATH "/etc/Wireless/RT2860/RT2860_5G.dat"
+-#define FIRST_AP_MERGE_PROFILE_PATH "/etc/Wireless/RT2860/RT2860_dbdc.dat"
++#define FIRST_AP_2G_PROFILE_PATH "/etc/wireless/mt7615e/mt7615e.1.2G.dat"
++#define FIRST_AP_5G_PROFILE_PATH "/etc/wireless/mt7615e/mt7615e.1.5G.dat"
++#define FIRST_AP_MERGE_PROFILE_PATH "/etc/wireless/mt7615e/.mt7615e.1.dbdc.dat"
+ #ifdef RT_CFG80211_SUPPORT
+ #define FIRST_AP_5G_DEVNAME "wlanx"
+ #else
+ #define FIRST_AP_5G_DEVNAME "rax"
+ #endif
+-#define SECOND_AP_2G_PROFILE_PATH "/etc/Wireless/iNIC/iNIC_ap_2G.dat"
+-#define SECOND_AP_5G_PROFILE_PATH "/etc/Wireless/iNIC/iNIC_ap_5G.dat"
+-#define SECOND_AP_MERGE_PROFILE_PATH "/etc/Wireless/RT2860/iNIC_ap_dbdc.dat"
++#define SECOND_AP_2G_PROFILE_PATH "/etc/wireless/mt7615e/mt7615e.2.2G.dat"
++#define SECOND_AP_5G_PROFILE_PATH "/etc/wireless/mt7615e/mt7615e.2.5G.dat"
++#define SECOND_AP_MERGE_PROFILE_PATH "/etc/wireless/mt7615e/.mt7615e.2.dbdc.dat"
+ #ifdef RT_CFG80211_SUPPORT
+ #define SECOND_AP_5G_DEVNAME "wlany"
+ #else
+ #define SECOND_AP_5G_DEVNAME "ray"
+ #endif
+-#define THIRD_AP_2G_PROFILE_PATH "/etc/Wireless/WIFI3/RT2870AP_2G.dat"
+-#define THIRD_AP_5G_PROFILE_PATH "/etc/Wireless/WIFI3/RT2870AP_5G.dat"
+-#define THIRD_AP_MERGE_PROFILE_PATH "/etc/Wireless/WIFI3/RT2870AP_dbdc.dat"
++#define THIRD_AP_2G_PROFILE_PATH "/etc/wireless/mt7615e/mt7615e.3.2G.dat"
++#define THIRD_AP_5G_PROFILE_PATH "/etc/wireless/mt7615e/mt7615e.3.5G.dat"
++#define THIRD_AP_MERGE_PROFILE_PATH "/etc/wireless/mt7615e/.mt7615e.3.dbdc.dat"
+ #ifdef RT_CFG80211_SUPPORT
+ #define THIRD_AP_5G_DEVNAME "wlanz"
+ #else
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/include/eeprom.h
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/embedded/include/eeprom.h
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/embedded/include/eeprom.h
+@@ -92,17 +92,17 @@
+ #endif /* WCX_SUPPORT */
+ #endif /* BB_SOC */
+
+-#define EEPROM_DFT_FILE_DIR "/etc_ro/wlan/"
+-#define EEPROM_1ST_FILE_DIR "/etc_ro/Wireless/RT2860/"
+-#define EEPROM_2ND_FILE_DIR "/etc_ro/Wireless/iNIC/"
++#define EEPROM_DFT_FILE_DIR "/etc/wlan/"
++#define EEPROM_1ST_FILE_DIR "/etc/wireless/RT2860/"
++#define EEPROM_2ND_FILE_DIR "/etc/wireless/iNIC/"
+
+ #ifndef EEPROM_DEFAULT_FILE_PATH
+ /* RFIC 2820 */
+-#define EEPROM_DEFAULT_FILE_PATH "/etc_ro/wlan/RT2880_RT2820_AP_2T3R_V1_6.bin"
++#define EEPROM_DEFAULT_FILE_PATH "/etc/wlan/RT2880_RT2820_AP_2T3R_V1_6.bin"
+
+ #ifdef MT7615
+ #undef EEPROM_DEFAULT_FILE_PATH
+-#define EEPROM_DEFAULT_FILE_PATH "/etc_ro/wlan/MT7615_EEPROM.bin"
++#define EEPROM_DEFAULT_FILE_PATH "/etc/wlan/MT7615_EEPROM.bin"
+ #endif /* MT7615 */
+
+
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/include/os/rt_linux.h
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/include/os/rt_linux.h
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/include/os/rt_linux.h
+@@ -129,36 +129,36 @@ typedef struct usb_ctrlrequest devctrlre
+ #ifdef CONFIG_AP_SUPPORT
+ #ifdef RTMP_MAC_PCI
+ #if CONFIG_RTPCI_AP_RF_OFFSET == 0x48000
+-#define AP_PROFILE_PATH "/etc/Wireless/iNIC/iNIC_ap.dat"
+-#define AP_RTMP_FIRMWARE_FILE_NAME "/etc_ro/Wireless/iNIC/RT2860AP.bin"
++#define AP_PROFILE_PATH "/etc/wireless/iNIC/iNIC_ap.dat"
++#define AP_RTMP_FIRMWARE_FILE_NAME "/etc/wireless/iNIC/RT2860AP.bin"
+ #else
+-#define AP_PROFILE_PATH "/etc/Wireless/RT2860AP/RT2860AP.dat"
+-#define AP_RTMP_FIRMWARE_FILE_NAME "/etc/Wireless/RT2860AP/RT2860AP.bin"
++#define AP_PROFILE_PATH "/etc/wireless/RT2860AP/RT2860AP.dat"
++#define AP_RTMP_FIRMWARE_FILE_NAME "/etc/wireless/RT2860AP/RT2860AP.bin"
+ #endif
+
+
+ #define AP_DRIVER_VERSION "4.4.1.2"
+ #ifdef MULTIPLE_CARD_SUPPORT
+-#define CARD_INFO_PATH "/etc/Wireless/RT2860AP/RT2860APCard.dat"
++#define CARD_INFO_PATH "/etc/wireless/RT2860AP/RT2860APCard.dat"
+ #endif /* MULTIPLE_CARD_SUPPORT */
+ #endif /* RTMP_MAC_PCI */
+
+
+ #ifdef RTMP_MAC_SDIO
+-#define AP_PROFILE_PATH "/etc/Wireless/RT2870AP/RT2870AP.dat"
++#define AP_PROFILE_PATH "/etc/wireless/RT2870AP/RT2870AP.dat"
+ #define AP_DRIVER_VERSION "4.0.0.3"
+ #endif /* RTMP_MAC_SDIO */
+
+
+ #ifdef SINGLE_SKU_V2
+ #ifdef VENDOR_FEATURE6_SUPPORT
+-#define SINGLE_SKU_TABLE_FILE_NAME "/tmp/.mt7615_SingleSKU.dat"
+-#define BF_GAIN_TABLE_FILE_NAME "/tmp/.mt7615_SingleSKU_BF_Gain.dat"
+-#define BF_SKU_TABLE_FILE_NAME "/tmp/.mt7615_SingleSKU_BF.dat"
+-#else
+-#define SINGLE_SKU_TABLE_FILE_NAME "/etc_ro/Wireless/RT2860AP/7615_SingleSKU.dat"
+-#define BF_GAIN_TABLE_FILE_NAME "/etc_ro/Wireless/RT2860AP/7615_BF_Gain_Table.dat"
+-#define BF_SKU_TABLE_FILE_NAME "/etc_ro/Wireless/RT2860AP/7615_SingleSKU_BF.dat"
++#define SINGLE_SKU_TABLE_FILE_NAME "/tmp/.mt7615e-sku.dat"
++#define BF_GAIN_TABLE_FILE_NAME "/tmp/.mt7615e-bf-gain.dat"
++#define BF_SKU_TABLE_FILE_NAME "/tmp/.mt7615e/mt7615e-sku-bf.dat"
++#else
++#define SINGLE_SKU_TABLE_FILE_NAME "/etc/wireless/mt7615e/mt7615e-sku.dat"
++#define BF_GAIN_TABLE_FILE_NAME "/etc/wireless/mt7615e/mt7615e-bf-gain.dat"
++#define BF_SKU_TABLE_FILE_NAME "/etc/wireless/mt7615e/mt7615e-sku-bf.dat"
+ #endif
+ #endif /* SINGLE_SKU_V2 */
+
+@@ -1812,14 +1812,14 @@ extern int rausb_control_msg(VOID *dev,
+ #define ate_print printk
+ #ifdef RTMP_MAC_PCI
+ #ifdef CONFIG_AP_SUPPORT
+-#define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860AP/e2p.bin"
++#define EEPROM_BIN_FILE_NAME "/etc/wireless/RT2860AP/e2p.bin"
+ #endif /* CONFIG_AP_SUPPORT */
+ #endif /* RTMP_MAC_PCI */
+
+
+ #ifdef RTMP_MAC_SDIO
+ #ifdef CONFIG_AP_SUPPORT
+-#define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2870AP/e2p.bin"
++#define EEPROM_BIN_FILE_NAME "/etc/wireless/RT2870AP/e2p.bin"
+ #endif /* CONFIG_AP_SUPPORT */
+ #endif /* RTMP_MAC_SDIO */
+
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi/os/linux/rt_profile.c
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi/os/linux/rt_profile.c
++++ linux-3.10.14/drivers/net/wireless/mt_wifi/os/linux/rt_profile.c
+@@ -93,47 +93,47 @@ struct dev_type_name_map{
+ #define def_to_str(s) #s
+
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)) && defined (CONFIG_ANDROID)
+-#define FIRST_EEPROM_FILE_PATH "/data/router/etc_ro/Wireless/RT2860/"
+-#define FIRST_AP_PROFILE_PATH "/data/router/etc/Wireless/RT2860/RT2860.dat"
+-#define FIRST_STA_PROFILE_PATH "/data/router/etc/Wireless/RT2860/RT2860.dat"
++#define FIRST_EEPROM_FILE_PATH "/data/router/etc/wireless/RT2860/"
++#define FIRST_AP_PROFILE_PATH "/data/router/etc/wireless/RT2860/RT2860.dat"
++#define FIRST_STA_PROFILE_PATH "/data/router/etc/wireless/RT2860/RT2860.dat"
+ #define FIRST_CHIP_ID xdef_to_str(MT_FIRST_CARD)
+
+
+-#define SECOND_EEPROM_FILE_PATH "/data/router/etc_ro/Wireless/iNIC/"
+-#define SECOND_AP_PROFILE_PATH "/data/router/etc/Wireless/iNIC/iNIC_ap.dat"
+-#define SECOND_STA_PROFILE_PATH "/data/router/etc/Wireless/iNIC/iNIC_sta.dat"
++#define SECOND_EEPROM_FILE_PATH "/data/router/etc/wireless/iNIC/"
++#define SECOND_AP_PROFILE_PATH "/data/router/etc/wireless/iNIC/iNIC_ap.dat"
++#define SECOND_STA_PROFILE_PATH "/data/router/etc/wireless/iNIC/iNIC_sta.dat"
+
+ #define SECOND_CHIP_ID xdef_to_str(MT_SECOND_CARD)
+
+-#define THIRD_EEPROM_FILE_PATH "/data/router/etc_ro/Wireless/WIFI3/"
+-#define THIRD_AP_PROFILE_PATH "/data/router/etc/Wireless/WIFI3/RT2870AP.dat"
+-#define THIRD_STA_PROFILE_PATH "/data/router/etc/Wireless/WIFI3/RT2870AP.dat"
++#define THIRD_EEPROM_FILE_PATH "/data/router/etc/wireless/WIFI3/"
++#define THIRD_AP_PROFILE_PATH "/data/router/etc/wireless/WIFI3/RT2870AP.dat"
++#define THIRD_STA_PROFILE_PATH "/data/router/etc/wireless/WIFI3/RT2870AP.dat"
+
+ #define THIRD_CHIP_ID xdef_to_str(MT_THIRD_CARD)
+
+ #else
+-#define FIRST_EEPROM_FILE_PATH "/etc_ro/Wireless/RT2860/"
++#define FIRST_EEPROM_FILE_PATH "/etc/wireless/RT2860/"
+ #ifdef INTELP6_SUPPORT
+ #define FIRST_AP_PROFILE_PATH "/tmp/mt76xx_24.dat"
+ #else
+-#define FIRST_AP_PROFILE_PATH "/etc/Wireless/RT2860/RT2860.dat"
++#define FIRST_AP_PROFILE_PATH "/etc/wireless/RT2860/RT2860.dat"
+ #endif
+-#define FIRST_STA_PROFILE_PATH "/etc/Wireless/RT2860/RT2860.dat"
++#define FIRST_STA_PROFILE_PATH "/etc/wireless/RT2860/RT2860.dat"
+ #define FIRST_CHIP_ID xdef_to_str(MT_FIRST_CARD)
+
+-#define SECOND_EEPROM_FILE_PATH "/etc_ro/Wireless/iNIC/"
++#define SECOND_EEPROM_FILE_PATH "/etc/wireless/iNIC/"
+ #ifdef INTELP6_SUPPORT
+ #define SECOND_AP_PROFILE_PATH "/tmp/mt76xx_5.dat"
+ #else
+-#define SECOND_AP_PROFILE_PATH "/etc/Wireless/iNIC/iNIC_ap.dat"
++#define SECOND_AP_PROFILE_PATH "/etc/wireless/iNIC/iNIC_ap.dat"
+ #endif
+-#define SECOND_STA_PROFILE_PATH "/etc/Wireless/iNIC/iNIC_sta.dat"
++#define SECOND_STA_PROFILE_PATH "/etc/wireless/iNIC/iNIC_sta.dat"
+
+ #define SECOND_CHIP_ID xdef_to_str(MT_SECOND_CARD)
+
+-#define THIRD_EEPROM_FILE_PATH "/etc_ro/Wireless/WIFI3/"
+-#define THIRD_AP_PROFILE_PATH "/etc/Wireless/WIFI3/RT2870AP.dat"
+-#define THIRD_STA_PROFILE_PATH "/etc/Wireless/WIFI3/RT2870AP.dat"
++#define THIRD_EEPROM_FILE_PATH "/etc/wireless/WIFI3/"
++#define THIRD_AP_PROFILE_PATH "/etc/wireless/WIFI3/RT2870AP.dat"
++#define THIRD_STA_PROFILE_PATH "/etc/wireless/WIFI3/RT2870AP.dat"
+
+ #define THIRD_CHIP_ID xdef_to_str(MT_THIRD_CARD)
+ #endif /* CONFIG_ANDROID */
+@@ -715,6 +715,13 @@ int GetBrLanNetMask(
+ }
+ in_dev = (struct in_device *)pNetDev->ip_ptr;
+ // get in_ifaddr
++
++ if (!in_dev)
++ {
++ MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_OFF, (" in_dev is NULL!\n"));
++ return 0;
++ }
++
+ if_info = in_dev->ifa_list;
+ if( if_info )
+ {
+Index: linux-3.10.14/drivers/net/wireless/mt_wifi_ap/Makefile
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/mt_wifi_ap/Makefile
++++ linux-3.10.14/drivers/net/wireless/mt_wifi_ap/Makefile
+@@ -2,14 +2,38 @@ EXTRA_CFLAGS = -Idrivers/net/wireless/mt
+ -Idrivers/net/wireless/mt_wifi/embedded/include \
+ -Idrivers/net/wireless/mt_wifi/ate/include
+
+-ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
+-EXTRA_CFLAGS = -I$(src)/../src/include \
+- -I$(src)/../src/embedded/include \
+- -I$(src)/../src/ate/include
+-DRV_NAME = mt7628
+-SRC_DIR = ../src/embedded
+-obj-m += $(DRV_NAME).o
+-else
++################################################################################
++ifeq ($(CONFIG_FIRST_IF_EEPROM_PROM),y)
++EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"prom\""
++endif
++ifeq ($(CONFIG_FIRST_IF_EEPROM_EFUSE),y)
++EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"efuse\""
++endif
++ifeq ($(CONFIG_FIRST_IF_EEPROM_FLASH),y)
++EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"flash\""
++endif
++
++ifeq ($(CONFIG_SECOND_IF_EEPROM_PROM),y)
++EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"prom\""
++endif
++ifeq ($(CONFIG_SECOND_IF_EEPROM_EFUSE),y)
++EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"efuse\""
++endif
++ifeq ($(CONFIG_SECOND_IF_EEPROM_FLASH),y)
++EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"flash\""
++endif
++
++ifeq ($(CONFIG_THIRD_IF_EEPROM_PROM),y)
++EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD_EEPROM="\"prom\""
++endif
++ifeq ($(CONFIG_THIRD_IF_EEPROM_EFUSE),y)
++EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD_EEPROM="\"efuse\""
++endif
++ifeq ($(CONFIG_THIRD_IF_EEPROM_FLASH),y)
++EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD_EEPROM="\"flash\""
++endif
++
++################################################################################
+ EXTRA_CFLAGS = -Idrivers/net/wireless/mt_wifi/include \
+ -Idrivers/net/wireless/mt_wifi/embedded/include \
+ -Idrivers/net/wireless/mt_wifi/ate/include
+@@ -17,7 +41,6 @@ DRV_NAME = mt_wifi
+ SRC_DIR = ../mt_wifi
+ SRC_EMBEDDED_DIR = ../mt_wifi/embedded
+ obj-$(CONFIG_MT_AP_SUPPORT) += $(DRV_NAME).o
+-endif
+
+ ########################################################
+ # Common files
diff --git a/target/linux/wifi/mt76x2-patch/0612-mt76x2-build.patch b/target/linux/wifi/mt76x2-patch/0612-mt76x2-build.patch
new file mode 100755
index 0000000..f53e09a
--- /dev/null
+++ b/target/linux/wifi/mt76x2-patch/0612-mt76x2-build.patch
@@ -0,0 +1,75 @@
+Index: linux-3.10.14/drivers/net/wireless/rlt_wifi_ap/Kconfig
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/rlt_wifi_ap/Kconfig
++++ linux-3.10.14/drivers/net/wireless/rlt_wifi_ap/Kconfig
+@@ -4,6 +4,7 @@ config RLT_AP_SUPPORT
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
++ default m
+
+ config WDS_SUPPORT
+ bool "WDS"
+Index: linux-3.10.14/drivers/net/wireless/rlt_wifi_ap/Makefile
+===================================================================
+--- linux-3.10.14.orig/drivers/net/wireless/rlt_wifi_ap/Makefile
++++ linux-3.10.14/drivers/net/wireless/rlt_wifi_ap/Makefile
+@@ -1,12 +1,6 @@
+-ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
+-EXTRA_CFLAGS = -I$(src)/../src/include -I$(src)/../src/ate/include
+-DRV_NAME = mt76x2e
+-RT_WIFI_DIR = ../src
+-else
+ EXTRA_CFLAGS = -Idrivers/net/wireless/rlt_wifi/include -Idrivers/net/wireless/rlt_wifi/ate/include
+ DRV_NAME = rlt_wifi
+ RT_WIFI_DIR = ../rlt_wifi
+-endif
+
+ ########################################################
+ # Common files
+@@ -649,11 +643,7 @@ endif
+ #
+ # Root
+ #
+-ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
+-obj-m += $(DRV_NAME).o
+-else
+ obj-$(CONFIG_RLT_AP_SUPPORT) += $(DRV_NAME).o
+-endif
+
+ $(DRV_NAME)-objs += $(cmm_objs) $(asic_objs) $(chip_objs) $(rate_objs)\
+ $(spec_objs) $(func_objs) $(ap_objs) $(os_objs)
+@@ -752,25 +742,6 @@ EXTRA_CFLAGS += -DTHERMAL_PROTECT_SUPPOR
+ endif
+ endif
+
+-# For OpenWrt compatibility
+-ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
+-EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD=$(CONFIG_RT_FIRST_CARD)
+-EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD=$(CONFIG_RT_SECOND_CARD)
+-
+-EXTRA_CFLAGS += -DCONFIG_RT_FIRST_IF_RF_OFFSET=$(CONFIG_RT_FIRST_IF_RF_OFFSET)
+-EXTRA_CFLAGS += -DCONFIG_RT_SECOND_IF_RF_OFFSET=$(CONFIG_RT_SECOND_IF_RF_OFFSET)
+-
+-ifeq ($(CONFIG_FIRST_IF_EEPROM_PROM),y)
+-EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"prom\""
+-else
+-ifeq ($(CONFIG_FIRST_IF_EEPROM_EFUSE),y)
+-EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"efuse\""
+-else
+-ifeq ($(CONFIG_FIRST_IF_EEPROM_FLASH),y)
+-EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"flash\""
+-endif
+-endif
+-endif
+
+ ifeq ($(CONFIG_SECOND_IF_EEPROM_PROM),y)
+ EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"prom\""
+@@ -784,7 +755,6 @@ endif
+ endif
+ endif
+
+-endif
+
+ ifeq ($(CONFIG_DISABLE_EDCCA),y)
+ EXTRA_CFLAGS += -DCONFIG_DISABLE_EDCCA