Index: boot/Makefile
===================================================================
--- boot/Makefile	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/Makefile	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -61,4 +61,6 @@
 	mkdir "$(DIST_PATH)/inc/c/"
 	cp -r -L "$(USPACE_PATH)/lib/c/include/." "$(DIST_PATH)/inc/c/"
+	cp -r -L "$(ROOT_PATH)/abi/include/." "$(DIST_PATH)/inc/c/"
+	cp -r -L "$(USPACE_PATH)/lib/c/arch/$(UARCH)/include/." "$(DIST_PATH)/inc/c/"
 	cat "$(USPACE_PATH)/lib/c/arch/$(UARCH)/_link.ld" | sed 's/^STARTUP(.*)$$//g' > "$(DIST_PATH)/inc/_link.ld"
 endif
Index: boot/arch/arm32/Makefile.inc
===================================================================
--- boot/arch/arm32/Makefile.inc	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/arch/arm32/Makefile.inc	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -35,5 +35,5 @@
 endif
 
-ifeq ($(MACHINE), beagleboardxm)
+ifeq ($(MACHINE), $(filter $(MACHINE),beagleboardxm beaglebone))
 	BOOT_OUTPUT = image.boot
 	POST_OUTPUT = $(ROOT_PATH)/uImage.bin
Index: boot/arch/arm32/include/arch.h
===================================================================
--- boot/arch/arm32/include/arch.h	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/arch/arm32/include/arch.h	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -44,4 +44,6 @@
 #elif defined MACHINE_beagleboardxm
 #define BOOT_BASE	0x80000000
+#elif defined MACHINE_beaglebone
+#define BOOT_BASE       0x80000000
 #else
 #define BOOT_BASE	0x00000000
@@ -51,4 +53,6 @@
 
 #ifdef MACHINE_beagleboardxm
+	#define PA_OFFSET 0
+#elif defined MACHINE_beaglebone
 	#define PA_OFFSET 0
 #else
Index: boot/arch/arm32/include/main.h
===================================================================
--- boot/arch/arm32/include/main.h	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/arch/arm32/include/main.h	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -51,4 +51,13 @@
 #define BBXM_THR_FULL           0x00000001
 
+/** Beaglebone UART register addresses
+ *
+ * This is UART0 of AM335x CPU
+ */
+#define BBONE_SCONS_THR         0x44E09000
+#define BBONE_SCONS_SSR         0x44E09044
+
+/** Check this bit before writing (tx fifo full) */
+#define BBONE_TXFIFO_FULL       0x00000001
 
 /** GTA02 serial console UART register addresses.
Index: boot/arch/arm32/include/mm.h
===================================================================
--- boot/arch/arm32/include/mm.h	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/arch/arm32/include/mm.h	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -63,4 +63,9 @@
 #define BBXM_RAM_END   0xc0000000
 
+/** Start of ram memory on AM335x */
+#define AM335x_RAM_START   0x80000000
+/** End of ram memory on AM335x */
+#define AM335x_RAM_END     0xC0000000
+
 
 /* Page table level 0 entry - "section" format is used
@@ -76,5 +81,6 @@
 	unsigned int access_permission_0 : 2;
 	unsigned int tex : 3;
-	unsigned int access_permission_1 : 2;
+	unsigned int access_permission_1 : 1;
+	unsigned int shareable : 1;
 	unsigned int non_global : 1;
 	unsigned int should_be_zero_2 : 1;
Index: boot/arch/arm32/src/mm.c
===================================================================
--- boot/arch/arm32/src/mm.c	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/arch/arm32/src/mm.c	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -38,4 +38,15 @@
 #include <arch/mm.h>
 
+/** Disable the MMU */
+static void disable_paging(void)
+{
+	asm volatile (
+		"mrc p15, 0, r0, c1, c0, 0\n"
+		"bic r0, r0, #1\n"
+		"mcr p15, 0, r0, c1, c0, 0\n"
+		::: "r0"
+	);
+}
+
 /** Check if caching can be enabled for a given memory section.
  *
@@ -59,4 +70,8 @@
 	const unsigned long address = section << PTE_SECTION_SHIFT;
 	if (address >= BBXM_RAM_START && address < BBXM_RAM_END)
+		return 1;
+#elif defined MACHINE_beaglebone
+	const unsigned long address = section << PTE_SECTION_SHIFT;
+	if (address >= AM335x_RAM_START && address < AM335x_RAM_END)
 		return 1;
 #endif
@@ -88,4 +103,5 @@
 	pte->tex = 0;
 	pte->access_permission_1 = 0;
+	pte->shareable = 0;
 	pte->non_global = 0;
 	pte->should_be_zero_2 = 0;
@@ -102,18 +118,4 @@
 	for (page = 0; page < split_page; page++)
 		init_ptl0_section(&boot_pt[page], page);
-	
-	/*
-	 * Create 1:1 virtual-physical mapping in kernel space
-	 * (upper 2 GB), physical addresses start from 0.
-	 */
-	/* BeagleBoard-xM (DM37x) memory starts at 2GB border,
-	 * thus mapping only lower 2GB is not not enough.
-	 * Map entire AS 1:1 instead and hope it works. */
-	for (page = split_page; page < PTL0_ENTRIES; page++)
-#ifndef MACHINE_beagleboardxm
-		init_ptl0_section(&boot_pt[page], page - split_page);
-#else
-		init_ptl0_section(&boot_pt[page], page);
-#endif
 	
 	asm volatile (
@@ -132,5 +134,5 @@
 		"ldr r0, =0x55555555\n"
 		"mcr p15, 0, r0, c3, c0, 0\n"
-		
+
 		/* Current settings */
 		"mrc p15, 0, r0, c1, c0, 0\n"
@@ -143,6 +145,11 @@
 		
 		"orr r0, r0, r1\n"
+
+		/* Invalidate the TLB content before turning on the MMU.
+		 * ARMv7-A Reference manual, B3.10.3
+		 */
+		"mcr p15, 0, r0, c8, c7, 0\n"
 		
-		/* Store settings */
+		/* Store settings, enable the MMU */
 		"mcr p15, 0, r0, c1, c0, 0\n"
 		::: "r0", "r1"
@@ -152,4 +159,5 @@
 /** Start the MMU - initialize page table and enable paging. */
 void mmu_start() {
+	disable_paging();
 	init_boot_pt();
 	enable_paging();
Index: boot/arch/arm32/src/putchar.c
===================================================================
--- boot/arch/arm32/src/putchar.c	(revision faf83cf9ad0f66d170fa21d6bd2f1a5ba5abe52d)
+++ boot/arch/arm32/src/putchar.c	(revision 5c1b3cdf711ad251494bf421532d7e53ecd912ee)
@@ -40,4 +40,26 @@
 #include <putchar.h>
 #include <str.h>
+
+#ifdef MACHINE_beaglebone
+
+/** Send a byte to the am335x serial console.
+ *
+ * @param byte		Byte to send.
+ */
+static void scons_sendb_bbone(uint8_t byte)
+{
+	volatile uint32_t *thr =
+		(volatile uint32_t *) BBONE_SCONS_THR;
+	volatile uint32_t *ssr =
+		(volatile uint32_t *) BBONE_SCONS_SSR;
+
+	/* Wait until transmitter is empty */
+	while (*ssr & BBONE_TXFIFO_FULL);
+
+	/* Transmit byte */
+	*thr = (uint32_t) byte;
+}
+
+#endif
 
 #ifdef MACHINE_beagleboardxm
@@ -106,4 +128,7 @@
 static void scons_sendb(uint8_t byte)
 {
+#ifdef MACHINE_beaglebone
+	scons_sendb_bbone(byte);
+#endif
 #ifdef MACHINE_beagleboardxm
 	scons_sendb_bbxm(byte);
