diff --git a/recipes-devtools/mii-mgr/files/COPYING b/recipes-devtools/mii-mgr/files/COPYING
new file mode 100644
index 0000000..7975bdb
--- /dev/null
+++ b/recipes-devtools/mii-mgr/files/COPYING
@@ -0,0 +1 @@
+Copyright (c) Mediatek 2020
diff --git a/recipes-devtools/mii-mgr/files/mii_mgr.c b/recipes-devtools/mii-mgr/files/mii_mgr.c
new file mode 100644
index 0000000..f968807
--- /dev/null
+++ b/recipes-devtools/mii-mgr/files/mii_mgr.c
@@ -0,0 +1,180 @@
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <linux/ethtool.h>
+#include <linux/mdio.h>
+#include <linux/sockios.h>
+
+#include "mii_mgr.h"
+
+void show_usage(void)
+{
+	printf("mii_mgr -g -i [ifname] -p [phy number] -r [register number]\n");
+	printf("  Get: mii_mgr -g -p 3 -r 4\n\n");
+	printf("mii_mgr -s -p [phy number] -r [register number] -v [0xvalue]\n");
+	printf("  Set: mii_mgr -s -p 4 -r 1 -v 0xff11\n");
+	printf("#NOTE: Without -i , eth0 is default ifname!\n");
+	printf("----------------------------------------------------------------------------------------\n");
+	printf("Get: mii_mgr_cl45 -g -p [port number] -d [dev number] -r [register number]\n");
+	printf("Example: mii_mgr_cl45 -g -p 3 -d 0x5 -r 0x4\n\n");
+	printf("Set: mii_mgr_cl45 -s -p [port number] -d [dev number] -r [register number] -v [value]\n");
+	printf("Example: mii_mgr_cl45 -s -p 4 -d 0x6 -r 0x1 -v 0xff11\n\n");
+}
+
+static void fill_mii_ioctl(struct mii_ioctl_data *mii, uint16_t phy_id,
+			   uint16_t reg_num, uint16_t *val)
+{
+	mii->phy_id  = phy_id;
+	mii->reg_num = reg_num;
+	mii->val_in  = *val;
+	mii->val_out = 0;
+}
+
+
+static void fill_mtk_mii_ioctl(struct mtk_mii_ioctl_data *mtk_mii, uint16_t phy_id,
+			      uint16_t reg_num, unsigned int *val)
+{
+	mtk_mii->phy_id  = phy_id;
+	mtk_mii->reg_num = reg_num;
+	mtk_mii->val_in  = *val;
+	mtk_mii->val_out = 0;
+}
+
+static int __phy_op(char *ifname, uint16_t phy_id, uint16_t reg_num, unsigned int *val, uint16_t cmd, int is_priv)
+{
+        static int sd = -1;
+
+        struct ifreq ifr;
+        struct mii_ioctl_data mii;
+	struct mtk_mii_ioctl_data mtk_mii;
+        int err;
+
+        if (sd < 0)
+                sd = socket(AF_INET, SOCK_DGRAM, 0);
+
+        if (sd < 0)
+                return sd;
+
+	strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
+	ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+	if (is_priv) {
+		fill_mtk_mii_ioctl(&mtk_mii, phy_id, reg_num, val);
+		ifr.ifr_data = (char *)&mtk_mii;
+	} else {
+		fill_mii_ioctl(&mii, phy_id, reg_num, (uint16_t *)val);
+		ifr.ifr_data = (char *)&mii;
+	}
+
+        err = ioctl(sd, cmd, &ifr);
+        if (err)
+                return -errno;
+
+	if ((cmd == MTKETH_MII_WRITE) || (cmd == MTKETH_MII_WRITE_CL45) ||
+	    (cmd == SIOCSMIIREG))
+		*val = (is_priv) ? mtk_mii.val_in : mii.val_in;
+	else
+		*val = (is_priv) ? mtk_mii.val_out : mii.val_out;
+
+        return 0;
+}
+
+int main(int argc, char *argv[])
+{
+	int opt;
+	char options[] = "gsui:p:d:r:v:?t";
+	int is_write = 0,is_cl45 = 0;
+	int is_priv = 1;
+	unsigned int port=0, dev=0,reg_num=0,val=0;
+	char ifname[IFNAMSIZ]="eth0";	
+	uint16_t phy_id=0;
+	uint16_t cmd;
+
+
+	if (argc < 6) {
+		show_usage();
+		return 0;
+	}
+
+	while ((opt = getopt(argc, argv, options)) != -1) {
+		switch (opt) {
+			case 'g':
+				is_write=0;
+				break;
+			case 's':
+				is_write=1;
+				break;
+			case 'u':
+				is_priv = 0;
+				break;
+			case 'i':
+				strncpy(ifname, optarg, IFNAMSIZ);
+				ifname[IFNAMSIZ - 1] = '\0';
+				break;	
+			case 'p':
+				port = strtoul(optarg, NULL, 16);
+				break;
+			case 'd':
+				dev = strtoul(optarg, NULL, 16);
+				is_cl45 = 1;
+				break;
+			case 'r':
+				reg_num = strtoul(optarg, NULL, 16);
+				break;
+
+			case 'v':
+				val = strtoul(optarg, NULL, 16);
+				break;
+			case '?':
+				show_usage();
+				break;
+		}
+	}
+
+	if(is_cl45)
+		phy_id = mdio_phy_id_c45(port, dev);
+	else
+		phy_id = port;
+
+	if(is_write) { 
+		if (is_priv)
+			cmd = (is_cl45) ? MTKETH_MII_WRITE_CL45 :
+					  MTKETH_MII_WRITE;
+		else
+			cmd = SIOCSMIIREG;
+
+		__phy_op(ifname,phy_id,reg_num, &val, cmd, is_priv);
+
+		if(is_cl45)
+			printf("Set: port%x dev%Xh_reg%Xh = 0x%04X\n",port, dev, reg_num, val);
+		else
+			printf("Set: phy[%x].reg[%x] = %04x\n",port, reg_num, val);
+	}	
+	else {
+		if (is_priv)
+			cmd = (is_cl45) ? MTKETH_MII_READ_CL45 :
+					  MTKETH_MII_READ;
+		else
+			cmd = SIOCGMIIREG;
+
+		__phy_op(ifname,phy_id,reg_num, &val, cmd, is_priv);
+
+		if(is_cl45)
+			printf("Get: port%x dev%Xh_reg%Xh = 0x%04X\n",port, dev, reg_num, val);
+		else
+			printf("Get: phy[%x].reg[%x] = %04x\n",port, reg_num, val);
+	
+	}
+
+	return 0;	
+}
diff --git a/recipes-devtools/mii-mgr/files/mii_mgr.h b/recipes-devtools/mii-mgr/files/mii_mgr.h
new file mode 100644
index 0000000..66f7a61
--- /dev/null
+++ b/recipes-devtools/mii-mgr/files/mii_mgr.h
@@ -0,0 +1,20 @@
+/*
+ * switch_ioctl.h: switch(ioctl) set API
+ */
+
+#ifndef MII_MGR_H
+#define MII_MGR_H
+
+#define MTKETH_MII_READ		0x89F3
+#define MTKETH_MII_WRITE	0x89F4
+#define MTKETH_MII_READ_CL45	0x89FC
+#define MTKETH_MII_WRITE_CL45	0x89FD
+
+struct mtk_mii_ioctl_data {
+        __u16 phy_id;
+        __u16 reg_num;
+        __u32 val_in;
+        __u32 val_out;
+};
+
+#endif /* MII_MGR_H */
diff --git a/recipes-devtools/mii-mgr/mii-mgr_1.0.bb b/recipes-devtools/mii-mgr/mii-mgr_1.0.bb
new file mode 100644
index 0000000..9a16340
--- /dev/null
+++ b/recipes-devtools/mii-mgr/mii-mgr_1.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "An program to read/write from/to phy from userspace"
+SECTION = "applications"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c188eeeb69c0a05d0545816f1458a0c9"
+
+S = "${WORKDIR}"
+
+SRC_URI = " \
+    file://COPYING \
+    file://mii_mgr.c \
+    file://mii_mgr.h \
+    "
+
+do_compile() {
+    ${CC} ${LDFLAGS} mii_mgr.c -o mii_mgr
+}
+
+do_install() {
+    install -d ${D}${sbindir}
+    install -m 0755 ${WORKDIR}/mii_mgr ${D}${sbindir}
+    install -m 0755 ${WORKDIR}/mii_mgr ${D}${sbindir}/mii_mgr_cl45
+}
diff --git a/recipes-devtools/regs/files/COPYING b/recipes-devtools/regs/files/COPYING
new file mode 100644
index 0000000..7975bdb
--- /dev/null
+++ b/recipes-devtools/regs/files/COPYING
@@ -0,0 +1 @@
+Copyright (c) Mediatek 2020
diff --git a/recipes-devtools/regs/files/regs.c b/recipes-devtools/regs/files/regs.c
new file mode 100644
index 0000000..93a3532
--- /dev/null
+++ b/recipes-devtools/regs/files/regs.c
@@ -0,0 +1,155 @@
+/*
+ * pcimem.c: Simple program to read/write from/to a pci device from userspace.
+ *
+ *  Copyright (C) 2010, Bill Farrow (bfarrow@beyondelectronics.us)
+ *
+ *  Based on the devmem2.c code
+ *  Copyright (C) 2000, Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <termios.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+
+#define PRINT_ERROR \
+	do { \
+		fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
+		__LINE__, __FILE__, errno, strerror(errno)); exit(1); \
+	} while(0)
+
+#define MAP_SIZE 4096UL
+#define MAP_MASK (MAP_SIZE - 1)
+
+void dump_page(uint32_t *vaddr, uint32_t *vbase, uint32_t *pbase){
+	
+	int i =0;
+	uint32_t *end = vaddr + (MAP_SIZE >> 6);
+	uint32_t *start = vaddr;
+
+	while(start  < end) {
+		printf("%p:%08x %08x %08x %08x\n",
+			start - vbase + pbase, start[0], start[1] , start[2], start[3]);
+		start+=4;
+	}
+}
+
+void reg_mod_bits(uint32_t *virt_addr, int data, int  start_bit, int data_len)
+{
+    int mask=0;
+    int value;
+    int i;
+
+    for (i = 0; i < data_len; i++) {
+        mask |= 1 << (start_bit + i);
+    }
+
+    value = *((volatile uint32_t *) virt_addr);
+    value &= ~mask;
+    value |= (data << start_bit) & mask;;
+
+    *((uint32_t *) virt_addr) = value;
+}
+
+void usage(void)
+{
+		fprintf(stderr, "\nUsage:\tregs [Type] [ Offset:Hex ] [ Data:Hex ] [StartBit:Dec] [DataLen:Dec]\n"
+			"\tType    : access operation type : [m]odify, [w]wite, [d]ump\n"
+			"\tOffset  : offset into memory region to act upon\n"
+			"\tData    : data to be written\n"
+			"\tStartbit: Startbit of Addr that want to be modified\n"
+			"\tDataLen : Data length of Data\n\n"
+			"Example:\tRead/Write/Modify register \n"
+			"\tRead    : regs d 0x1b100000           //dump 0x1b100000~0x1b1000f0 \n"
+			"\tWrite   : regs w 0x1b100000 0x1234    //write 0x1b100000=0x1234\n"
+			"\tModify  : regs m 0x1b100000 0x0 29 3  //modify 0x1b100000[29:31]=0\n");
+}
+
+int main(int argc, char **argv) {
+	int fd;
+	void *map_base = NULL;
+        void *virt_addr = NULL;
+	uint32_t read_result =0;
+        uint32_t writeval = 0;
+	uint32_t startbit = 0;
+       	uint32_t datalen = 0;
+	char *filename = NULL;
+	off_t offset = 0;
+	int access_type = 0;
+
+	if(argc < 2) {
+		usage();
+		exit(1);
+	}
+
+	access_type = tolower(argv[1][0]);
+	if((access_type == 'd' && argc < 3) || (access_type == 'w' && argc < 4) || (access_type == 'm' && argc < 6)) {
+		usage();
+		exit(1);
+	}
+
+	filename = "/dev/mem";
+	if((fd = open(filename, O_RDWR | O_SYNC)) == -1) 
+		PRINT_ERROR;
+
+	/* Map one page */
+	offset = strtoul(argv[2], NULL, 16);
+	map_base = mmap(0, 2*MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset & ~MAP_MASK);
+	if(map_base == (void *) -1) 
+		PRINT_ERROR;
+
+	virt_addr = map_base + (offset & MAP_MASK);
+	read_result = *((volatile uint32_t *) virt_addr);
+	printf("Value at 0x%X (%p): 0x%X\n", offset, virt_addr, read_result);
+
+	switch(access_type) {
+		case 'm':
+			writeval = strtoul(argv[3], 0, 16);
+			startbit = strtoul(argv[4], 0, 10);
+			datalen  = strtoul(argv[5], 0, 10);
+			reg_mod_bits((uint32_t *)virt_addr, writeval, startbit, datalen);
+			break;
+		case 'w':
+			writeval = strtoul(argv[3], 0, 16);
+			*((uint32_t *) virt_addr) = writeval;
+			break;
+		case 'd':
+			dump_page(virt_addr, map_base, (uint32_t *)(offset & ~MAP_MASK));
+			return;
+		default:
+			fprintf(stderr, "Illegal data type '%c'.\n", access_type);
+			exit(2);
+	}
+
+	read_result = *((volatile uint32_t *) virt_addr);
+	printf("Written 0x%X; Readback 0x%X\n", writeval, read_result);
+
+	if(munmap(map_base, MAP_SIZE) == -1) 
+		PRINT_ERROR;
+
+	close(fd);
+	return 0;
+}
diff --git a/recipes-devtools/regs/regs_1.0.bb b/recipes-devtools/regs/regs_1.0.bb
new file mode 100644
index 0000000..80666fa
--- /dev/null
+++ b/recipes-devtools/regs/regs_1.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "An program to read/write from/to a pci device from userspace"
+SECTION = "applications"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c188eeeb69c0a05d0545816f1458a0c9"
+
+S = "${WORKDIR}"
+
+SRC_URI = " \
+    file://COPYING \
+    file://regs.c \
+    "
+
+do_compile() {
+    ${CC} ${CFLAGS} ${LDFLAGS} regs.c -o regs
+}
+
+do_install() {
+    install -d ${D}${base_bindir}
+    install -m 0755 ${WORKDIR}/regs ${D}${base_bindir}
+}
