Index: kernel/arch/mips64/Makefile.inc
===================================================================
--- kernel/arch/mips64/Makefile.inc	(revision d8db519fc389e77afc616e76c57b7406a9b9fad0)
+++ kernel/arch/mips64/Makefile.inc	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
@@ -55,4 +55,5 @@
 	arch/$(KARCH)/src/debug/stacktrace.c \
 	arch/$(KARCH)/src/debug/stacktrace_asm.S \
+	arch/$(KARCH)/src/mm/km.c \
 	arch/$(KARCH)/src/mm/frame.c \
 	arch/$(KARCH)/src/mm/page.c \
Index: kernel/arch/mips64/include/mm/frame.h
===================================================================
--- kernel/arch/mips64/include/mm/frame.h	(revision d8db519fc389e77afc616e76c57b7406a9b9fad0)
+++ kernel/arch/mips64/include/mm/frame.h	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
@@ -41,5 +41,6 @@
 #ifndef __ASM__
 
-extern void frame_arch_init(void);
+extern void frame_low_arch_init(void);
+extern void frame_high_arch_init(void);
 extern void physmem_print(void);
 
Index: kernel/arch/mips64/include/mm/km.h
===================================================================
--- kernel/arch/mips64/include/mm/km.h	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
+++ kernel/arch/mips64/include/mm/km.h	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup mips64mm
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_mips64_KM_H_
+#define KERN_mips64_KM_H_
+
+#include <typedefs.h>
+
+extern void km_identity_arch_init(void);
+extern void km_non_identity_arch_init(void);
+extern bool km_is_non_identity_arch(uintptr_t);
+
+#endif
+
+/** @}
+ */
Index: kernel/arch/mips64/src/mm/frame.c
===================================================================
--- kernel/arch/mips64/src/mm/frame.c	(revision d8db519fc389e77afc616e76c57b7406a9b9fad0)
+++ kernel/arch/mips64/src/mm/frame.c	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
@@ -123,25 +123,38 @@
 }
 
-static void frame_add_region(pfn_t start_frame, pfn_t end_frame)
-{
-	if (end_frame > start_frame) {
-		/* Convert 1M frames to 16K frames */
-		pfn_t first = ADDR2PFN(start_frame << ZERO_PAGE_WIDTH);
-		pfn_t count = ADDR2PFN((end_frame - start_frame) << ZERO_PAGE_WIDTH);
-		
+static void frame_add_region(pfn_t start_frame, pfn_t end_frame, bool low)
+{
+	if (end_frame <= start_frame)
+		return;
+
+	uintptr_t base = start_frame << ZERO_PAGE_WIDTH;
+	size_t size = (end_frame - start_frame) << ZERO_PAGE_WIDTH;
+
+	if (!frame_adjust_zone_bounds(low, &base, &size))
+		return; 
+
+	pfn_t first = ADDR2PFN(base);
+	size_t count = SIZE2FRAMES(size);
+	pfn_t conf_frame;
+
+	if (low) {
 		/* Interrupt vector frame is blacklisted */
-		pfn_t conf_frame;
 		if (first == 0)
 			conf_frame = 1;
 		else
 			conf_frame = first;
+		zone_create(first, count, conf_frame,
+		    ZONE_AVAILABLE | ZONE_LOWMEM);
+	} else {
+		conf_frame = zone_external_conf_alloc(count);
+		zone_create(first, count, conf_frame,
+		    ZONE_AVAILABLE | ZONE_HIGHMEM);
+	}
 		
-		zone_create(first, count, conf_frame, 0);
 		
-		if (phys_regions_count < MAX_REGIONS) {
-			phys_regions[phys_regions_count].start = first;
-			phys_regions[phys_regions_count].count = count;
-			phys_regions_count++;
-		}
+	if (phys_regions_count < MAX_REGIONS) {
+		phys_regions[phys_regions_count].start = first;
+		phys_regions[phys_regions_count].count = count;
+		phys_regions_count++;
 	}
 }
@@ -156,5 +169,5 @@
  *
  */
-void frame_arch_init(void)
+void frame_low_arch_init(void)
 {
 	ipl_t ipl = interrupts_disable();
@@ -207,5 +220,5 @@
 		
 		if (!avail) {
-			frame_add_region(start_frame, frame);
+			frame_add_region(start_frame, frame, true);
 			start_frame = frame + 1;
 			avail = true;
@@ -213,5 +226,5 @@
 	}
 	
-	frame_add_region(start_frame, frame);
+	frame_add_region(start_frame, frame, true);
 	
 	/* Blacklist interrupt vector frame */
@@ -229,4 +242,8 @@
 }
 
+void frame_high_arch_init(void)
+{
+}
+
 void physmem_print(void)
 {
Index: kernel/arch/mips64/src/mm/km.c
===================================================================
--- kernel/arch/mips64/src/mm/km.c	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
+++ kernel/arch/mips64/src/mm/km.c	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup mips64mm
+ * @{
+ */
+
+#include <arch/mm/km.h>
+#include <typedefs.h>
+
+void km_identity_arch_init(void)
+{
+}
+
+void km_non_identity_arch_init(void)
+{
+}
+
+bool km_is_non_identity_arch(uintptr_t addr)
+{
+	return false;
+}
+
+/** @}
+ */
Index: kernel/arch/mips64/src/mm/page.c
===================================================================
--- kernel/arch/mips64/src/mm/page.c	(revision d8db519fc389e77afc616e76c57b7406a9b9fad0)
+++ kernel/arch/mips64/src/mm/page.c	(revision efb48ebf4be82c1df6d4bef51b7a15c85de1af3f)
@@ -43,13 +43,4 @@
 }
 
-/** Map device into kernel space
- * - on mips, all devices are already mapped into kernel space,
- *   translate the physical address to uncached area
- */
-uintptr_t hw_map(uintptr_t physaddr, size_t size)
-{
-	return physaddr + 0xffffffffa0000000;
-}
-
 /** @}
  */
