diff --git a/include/kernel.mk b/include/kernel.mk
index 8b98369b4bf02c469d2142082639c97a521195ba..20377af3cf80fd2851d76a04390013db548caadd 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -53,7 +53,7 @@ ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
 else
   ifeq (,$(LINUX_KARCH))
-    LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst mipsel,mips,$(subst sh2,sh,$(subst sh3,sh,$(subst sh4,sh,$(ARCH))))))))
+    LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst mipsel,mips,$(subst mips64,mips,$(subst mips64el,mips,$(subst sh2,sh,$(subst sh3,sh,$(subst sh4,sh,$(ARCH))))))))))
   endif
 endif
 
diff --git a/include/site/mips64-linux b/include/site/mips64-linux
new file mode 100644
index 0000000000000000000000000000000000000000..1541a89d153fbb45535f610f9b056bb8832a9a20
--- /dev/null
+++ b/include/site/mips64-linux
@@ -0,0 +1,28 @@
+ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
+
+ac_cv_sizeof___int64=8
+ac_cv_sizeof_char=1
+ac_cv_sizeof_int=4
+ac_cv_sizeof_int16_t=2
+ac_cv_sizeof_int32_t=4
+ac_cv_sizeof_int64_t=8
+ac_cv_sizeof_long_int=8
+ac_cv_sizeof_long_long=8
+ac_cv_sizeof_long=8
+ac_cv_sizeof_off_t=8
+ac_cv_sizeof_short_int=2
+ac_cv_sizeof_short=2
+ac_cv_sizeof_size_t=8
+ac_cv_sizeof_ssize_t=8
+ac_cv_sizeof_u_int16_t=2
+ac_cv_sizeof_u_int32_t=4
+ac_cv_sizeof_u_int64_t=8
+ac_cv_sizeof_uint16_t=2
+ac_cv_sizeof_uint32_t=4
+ac_cv_sizeof_uint64_t=8
+ac_cv_sizeof_unsigned_int=4
+ac_cv_sizeof_unsigned_long=8
+ac_cv_sizeof_unsigned_long_long=8
+ac_cv_sizeof_unsigned_short=2
+ac_cv_sizeof_void_p=8
diff --git a/include/site/mips64-openwrt-linux-gnu b/include/site/mips64-openwrt-linux-gnu
new file mode 100644
index 0000000000000000000000000000000000000000..b7474d527a95a18ed660f388a18f0e3e79aa5ba0
--- /dev/null
+++ b/include/site/mips64-openwrt-linux-gnu
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. $TOPDIR/include/site/mips64-linux
+. $TOPDIR/include/site/linux-gnu
+
diff --git a/include/site/mips64-openwrt-linux-uclibc b/include/site/mips64-openwrt-linux-uclibc
new file mode 100644
index 0000000000000000000000000000000000000000..1b1347ce94ab7474c6ffd3db6851f91ecbad806c
--- /dev/null
+++ b/include/site/mips64-openwrt-linux-uclibc
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. $TOPDIR/include/site/mips64-linux
+. $TOPDIR/include/site/linux-uclibc
+
diff --git a/include/site/mips64el-linux b/include/site/mips64el-linux
new file mode 100644
index 0000000000000000000000000000000000000000..41dfc01df5c60725718f440ff148671811276d86
--- /dev/null
+++ b/include/site/mips64el-linux
@@ -0,0 +1,28 @@
+ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
+
+ac_cv_sizeof___int64=8
+ac_cv_sizeof_char=1
+ac_cv_sizeof_int=4
+ac_cv_sizeof_int16_t=2
+ac_cv_sizeof_int32_t=4
+ac_cv_sizeof_int64_t=8
+ac_cv_sizeof_long_int=8
+ac_cv_sizeof_long_long=8
+ac_cv_sizeof_long=8
+ac_cv_sizeof_off_t=8
+ac_cv_sizeof_short_int=2
+ac_cv_sizeof_short=2
+ac_cv_sizeof_size_t=8
+ac_cv_sizeof_ssize_t=8
+ac_cv_sizeof_u_int16_t=2
+ac_cv_sizeof_u_int32_t=4
+ac_cv_sizeof_u_int64_t=8
+ac_cv_sizeof_uint16_t=2
+ac_cv_sizeof_uint32_t=4
+ac_cv_sizeof_uint64_t=8
+ac_cv_sizeof_unsigned_int=4
+ac_cv_sizeof_unsigned_long=8
+ac_cv_sizeof_unsigned_long_long=8
+ac_cv_sizeof_unsigned_short=2
+ac_cv_sizeof_void_p=8
diff --git a/include/site/mips64el-openwrt-linux-gnu b/include/site/mips64el-openwrt-linux-gnu
new file mode 100644
index 0000000000000000000000000000000000000000..b7474d527a95a18ed660f388a18f0e3e79aa5ba0
--- /dev/null
+++ b/include/site/mips64el-openwrt-linux-gnu
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. $TOPDIR/include/site/mips64-linux
+. $TOPDIR/include/site/linux-gnu
+
diff --git a/include/site/mips64el-openwrt-linux-uclibc b/include/site/mips64el-openwrt-linux-uclibc
new file mode 100644
index 0000000000000000000000000000000000000000..1b1347ce94ab7474c6ffd3db6851f91ecbad806c
--- /dev/null
+++ b/include/site/mips64el-openwrt-linux-uclibc
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. $TOPDIR/include/site/mips64-linux
+. $TOPDIR/include/site/linux-uclibc
+
diff --git a/include/target.mk b/include/target.mk
index 2f62c2a8cd72faa2a1b5bf045e8c9d994c44a239..5484592def5a214607f1e586dbcabcaa4ee006b5 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -155,6 +155,8 @@ ifeq ($(DUMP),1)
   DEFAULT_CFLAGS_x86_64=-O2 -pipe -march=athlon64 -funit-at-a-time
   DEFAULT_CFLAGS_mips=-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time
   DEFAULT_CFLAGS_mipsel=$(DEFAULT_CFLAGS_mips)
+  DEFAULT_CFLAGS_mips64=-Os -pipe -mips64 -mtune=mips64 -mabi=64 -funit-at-a-time
+  DEFAULT_CFLAGS_mips64el=$(DEFAULT_CFLAGS_mips64)
   DEFAULT_CFLAGS_arm=-Os -pipe -march=armv5te -mtune=xscale -funit-at-a-time
   DEFAULT_CFLAGS_armeb=$(DEFAULT_CFLAGS_arm)
   DEFAULT_CFLAGS=$(if $(DEFAULT_CFLAGS_$(ARCH)),$(DEFAULT_CFLAGS_$(ARCH)),-Os -pipe -funit-at-a-time)
diff --git a/target/Config.in b/target/Config.in
index 6506312b37a2a8c4ad8999b681a7c9b397f923aa..405e1690c4fa8372a1979316de3e533196884c6f 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -65,6 +65,13 @@ config mips
 config mipsel
 	bool
 
+config mips64
+	select BIG_ENDIAN
+	bool
+
+config mips64el
+	bool
+
 config arm
 	bool
 
@@ -118,6 +125,8 @@ config ARCH
 	default "m68k"    if m68k
 	default "mips"    if mips
 	default "mipsel"  if mipsel
+	default "mips64"  if mips64
+	default "mips64el" if mips64el
 	default "powerpc" if powerpc
 	default "sh3"     if sh3
 	default "sh3eb"   if sh3eb
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 6f2b626f38bcf0655bd11aa6cf920959c4c35598..d7170ea8ec9467744725463b65833a4ea23ab5b8 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -73,6 +73,7 @@ GCC_CONFIGURE:= \
 		--disable-nls \
 		$(SOFT_FLOAT_CONFIG_OPTION) \
 		$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
+		$(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 --with-abi=64) \
 
 ifneq ($(CONFIG_GCC_VERSION_4_3),)
   GCC_BUILD_TARGET_LIBGCC:=y
@@ -189,6 +190,7 @@ define Stage2/Configure
 	ln -sf ../include $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include
 	rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
 	ln -sf ../lib $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
+	$(if $(CONFIG_mips64)$(CONFIG_mips64el),ln -sf ../lib64 $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib64)
 	(cd $(HOST_BUILD_DIR2); rm -f config.cache; \
 		$(GCC_CONFIGURE_STAGE2) \
 	);
diff --git a/toolchain/glibc/Config.version b/toolchain/glibc/Config.version
index d68eeea8a9932f7d63b6f957c8211bb5816aabc6..1debf0c040d81189cebecead0909329978a39624 100644
--- a/toolchain/glibc/Config.version
+++ b/toolchain/glibc/Config.version
@@ -9,7 +9,7 @@ config GLIBC_VERSION
 config GLIBC_PORTS
 	bool
 	depends on USE_GLIBC
-	default y  if GLIBC_VERSION_2_3_6 && (arm || armeb || mips || mipsel)
-	default y  if GLIBC_VERSION_2_6_1 && (arm || armeb || mips || mipsel || powerpc)
-	default y  if GLIBC_VERSION_2_7 && (arm || armeb || mips || mipsel || powerpc)
+	default y  if GLIBC_VERSION_2_3_6 && (arm || armeb || mips || mipsel || mips64 || mips64el)
+	default y  if GLIBC_VERSION_2_6_1 && (arm || armeb || mips || mipsel || mips64 || mips64el || powerpc)
+	default y  if GLIBC_VERSION_2_7 && (arm || armeb || mips || mipsel || mips64 || mips64el || powerpc)
 	default n
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
index d014cacdedaf4e5dffa900d22c6300e85c9e886f..054d891303d263efa2c072410b5e1346fe272c4d 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -57,6 +57,7 @@ GLIBC_CONFIGURE:= \
 		--build=$(GNU_HOST_NAME) \
 		--host=$(REAL_GNU_TARGET_NAME) \
 		--with-headers="$(TOOLCHAIN_DIR)/usr/include" \
+		$(if $(CONFIG_mips64)$(CONFIG_mips64el), --enable-kernel="2.6.0") \
 		--disable-debug \
 		--disable-profile \
 		--enable-add-ons="$(GLIBC_ADD_ONS)" \
diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 70834770f267710fdc4f46470e47e8b9afe56fe6..523120a454dff74860864c782b0ac5fbcb15ffd0 100644
--- a/toolchain/uClibc/Config.in
+++ b/toolchain/uClibc/Config.in
@@ -13,6 +13,7 @@ choice
 
 	config UCLIBC_VERSION_0_9_28
 		bool "uClibc 0.9.28"
+		depends !(mips64 || mips64el)
 
 	config UCLIBC_VERSION_0_9_29
 		bool "uClibc 0.9.29"
diff --git a/toolchain/uClibc/config-0.9.29/mips64 b/toolchain/uClibc/config-0.9.29/mips64
new file mode 100644
index 0000000000000000000000000000000000000000..5ec91eea20b2a33927e0d19b5db814ad6a318550
--- /dev/null
+++ b/toolchain/uClibc/config-0.9.29/mips64
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+# ARCH_LITTLE_ENDIAN is not set
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+DL_FINI_CRT_COMPAT=y
+KERNEL_HEADERS="."
+KERNEL_SOURCE="."
+TARGET_ARCH="mips"
+TARGET_mips=y
diff --git a/toolchain/uClibc/config-0.9.29/mips64el b/toolchain/uClibc/config-0.9.29/mips64el
new file mode 100644
index 0000000000000000000000000000000000000000..0b6f5b4e1fa6e2f0f7f74168fc6fa1daa6b79b15
--- /dev/null
+++ b/toolchain/uClibc/config-0.9.29/mips64el
@@ -0,0 +1,19 @@
+ARCH_ANY_ENDIAN=y
+# ARCH_BIG_ENDIAN is not set
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+DL_FINI_CRT_COMPAT=y
+KERNEL_HEADERS="."
+KERNEL_SOURCE="."
+TARGET_ARCH="mips"
+TARGET_mips=y
diff --git a/toolchain/uClibc/config-0.9.30/mips64 b/toolchain/uClibc/config-0.9.30/mips64
new file mode 100644
index 0000000000000000000000000000000000000000..fa5bee3aa5088b3afe0be29b528a360292431cf7
--- /dev/null
+++ b/toolchain/uClibc/config-0.9.30/mips64
@@ -0,0 +1,17 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-0.9.30/mips64el b/toolchain/uClibc/config-0.9.30/mips64el
new file mode 100644
index 0000000000000000000000000000000000000000..1ca764f6e29ca7c4abbc1b3283eb2a059b760ae1
--- /dev/null
+++ b/toolchain/uClibc/config-0.9.30/mips64el
@@ -0,0 +1,17 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-nptl/mips64 b/toolchain/uClibc/config-nptl/mips64
new file mode 100644
index 0000000000000000000000000000000000000000..fa5bee3aa5088b3afe0be29b528a360292431cf7
--- /dev/null
+++ b/toolchain/uClibc/config-nptl/mips64
@@ -0,0 +1,17 @@
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_WANTS_BIG_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y
diff --git a/toolchain/uClibc/config-nptl/mips64el b/toolchain/uClibc/config-nptl/mips64el
new file mode 100644
index 0000000000000000000000000000000000000000..1ca764f6e29ca7c4abbc1b3283eb2a059b760ae1
--- /dev/null
+++ b/toolchain/uClibc/config-nptl/mips64el
@@ -0,0 +1,17 @@
+ARCH_ANY_ENDIAN=y
+ARCH_CFLAGS="-mno-split-addresses"
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+# CONFIG_MIPS_ISA_MIPS32 is not set
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+CONFIG_MIPS_ISA_MIPS64=y
+# CONFIG_MIPS_N32_ABI is not set
+CONFIG_MIPS_N64_ABI=y
+# CONFIG_MIPS_O32_ABI is not set
+TARGET_ARCH="mips"
+TARGET_mips=y
+UCLIBC_HAS_FPU=y