Index: kernel/arch/arm32/Makefile.inc
===================================================================
--- kernel/arch/arm32/Makefile.inc	(revision c124dce396901c501e16c20ef82e82a814244b30)
+++ kernel/arch/arm32/Makefile.inc	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -85,4 +85,8 @@
 endif
 
+ifeq ($(MACHINE),beaglebone)
+        ARCH_SOURCES += arch/$(KARCH)/src/mach/beaglebone/beaglebone.c
+endif
+
 ifeq ($(CONFIG_PL050),y)
 	ARCH_SOURCES += genarch/src/drivers/pl050/pl050.c
Index: kernel/arch/arm32/include/mach/beaglebone/beaglebone.h
===================================================================
--- kernel/arch/arm32/include/mach/beaglebone/beaglebone.h	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
+++ kernel/arch/arm32/include/mach/beaglebone/beaglebone.h	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2012 Matteo Facchinetti
+ * 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 arm32beaglebone beaglebone
+ *  @brief BeagleBone platform.
+ *  @ingroup arm32
+ * @{
+ */
+/** @file
+ *  @brief BeagleBone platform driver.
+ */
+
+#ifndef KERN_arm32_beaglebone_H_
+#define KERN_arm32_beaglebone_H_
+
+#include <arch/machine_func.h>
+
+extern struct arm_machine_ops bbone_machine_ops;
+
+#endif
+
+/** @}
+ */
+
Index: kernel/arch/arm32/include/mm/frame.h
===================================================================
--- kernel/arch/arm32/include/mm/frame.h	(revision c124dce396901c501e16c20ef82e82a814244b30)
+++ kernel/arch/arm32/include/mm/frame.h	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -56,4 +56,9 @@
 #define BOOT_PAGE_TABLE_ADDRESS  0x80008000
 
+#elif defined MACHINE_beaglebone
+
+#define PHYSMEM_START_ADDR       0x80000000
+#define BOOT_PAGE_TABLE_ADDRESS  0x80008000
+
 #else
 
@@ -65,5 +70,4 @@
 #define BOOT_PAGE_TABLE_START_FRAME     (BOOT_PAGE_TABLE_ADDRESS >> FRAME_WIDTH)
 #define BOOT_PAGE_TABLE_SIZE_IN_FRAMES  (BOOT_PAGE_TABLE_SIZE >> FRAME_WIDTH)
-
 
 extern void frame_low_arch_init(void);
Index: kernel/arch/arm32/include/mm/page.h
===================================================================
--- kernel/arch/arm32/include/mm/page.h	(revision c124dce396901c501e16c20ef82e82a814244b30)
+++ kernel/arch/arm32/include/mm/page.h	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -46,5 +46,5 @@
 #define PAGE_SIZE	FRAME_SIZE
 
-#ifdef MACHINE_beagleboardxm
+#if (defined MACHINE_beagleboardxm) || (defined MACHINE_beaglebone)
 #ifndef __ASM__
 #	define KA2PA(x)	((uintptr_t) (x))
Index: kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c
===================================================================
--- kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c	(revision c124dce396901c501e16c20ef82e82a814244b30)
+++ kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -35,7 +35,7 @@
 #include <arch/exception.h>
 #include <arch/mach/beagleboardxm/beagleboardxm.h>
-#include <genarch/drivers/amdm37x_irc/amdm37x_irc.h>
-#include <genarch/drivers/amdm37x_uart/amdm37x_uart.h>
-#include <genarch/drivers/amdm37x_gpt/amdm37x_gpt.h>
+#include <genarch/drivers/amdm37x/uart.h>
+#include <genarch/drivers/amdm37x/irc.h>
+#include <genarch/drivers/amdm37x/gpt.h>
 #include <genarch/fb/fb.h>
 #include <genarch/srln/srln.h>
Index: kernel/arch/arm32/src/mach/beaglebone/beaglebone.c
===================================================================
--- kernel/arch/arm32/src/mach/beaglebone/beaglebone.c	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
+++ kernel/arch/arm32/src/mach/beaglebone/beaglebone.c	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2012 Matteo Facchinetti
+ * 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 arm32beaglebone
+ * @{
+ */
+/** @file
+ *  @brief BeagleBone platform driver.
+ */
+
+#include <arch/exception.h>
+#include <arch/mach/beaglebone/beaglebone.h>
+#include <genarch/drivers/am335x/irc.h>
+#include <genarch/drivers/am335x/uart.h>
+#include <genarch/drivers/am335x/timer.h>
+#include <genarch/srln/srln.h>
+#include <interrupt.h>
+#include <ddi/ddi.h>
+#include <ddi/device.h>
+#include <mm/km.h>
+
+#define BBONE_MEMORY_START       0x80000000      /* physical */
+#define BBONE_MEMORY_SIZE        0x10000000      /* 256 MB */
+
+static void bbone_init(void);
+static void bbone_timer_irq_start(void);
+static void bbone_cpu_halt(void);
+static void bbone_get_memory_extents(uintptr_t *start, size_t *size);
+static void bbone_irq_exception(unsigned int exc_no, istate_t *istate);
+static void bbone_frame_init(void);
+static void bbone_output_init(void);
+static void bbone_input_init(void);
+static size_t bbone_get_irq_count(void);
+static const char *bbone_get_platform_name(void);
+
+static struct beaglebone {
+	am335x_irc_regs_t *irc_addr;
+	am335x_timer_t timer;
+	am335x_uart_t uart;
+} bbone;
+
+struct arm_machine_ops bbone_machine_ops = {
+	.machine_init = bbone_init,
+	.machine_timer_irq_start = bbone_timer_irq_start,
+	.machine_cpu_halt = bbone_cpu_halt,
+	.machine_get_memory_extents = bbone_get_memory_extents,
+	.machine_irq_exception = bbone_irq_exception,
+	.machine_frame_init = bbone_frame_init,
+	.machine_output_init = bbone_output_init,
+	.machine_input_init = bbone_input_init,
+	.machine_get_irq_count = bbone_get_irq_count,
+	.machine_get_platform_name = bbone_get_platform_name,
+};
+
+static void bbone_init(void)
+{
+	/* Initialize the interrupt controller */
+	bbone.irc_addr = (void *) km_map(AM335x_IRC_BASE_ADDRESS,
+	    AM335x_IRC_SIZE, PAGE_NOT_CACHEABLE);
+
+	am335x_irc_init(bbone.irc_addr);
+
+	/* Initialize the DMTIMER0 */
+	am335x_timer_init(&bbone.timer, DMTIMER0, HZ);
+}
+
+static irq_ownership_t bbone_timer_irq_claim(irq_t *irq)
+{
+	return IRQ_ACCEPT;
+}
+
+static void bbone_timer_irq_handler(irq_t *irq)
+{
+	am335x_timer_intr_ack(&bbone.timer);
+	spinlock_unlock(&irq->lock);
+	clock();
+	spinlock_lock(&irq->lock);
+}
+
+static void bbone_timer_irq_start(void)
+{
+	/* Initialize the IRQ */
+	static irq_t timer_irq;
+	irq_initialize(&timer_irq);
+	timer_irq.devno = device_assign_devno();
+	timer_irq.inr = AM335x_DMTIMER0_IRQ;
+	timer_irq.claim = bbone_timer_irq_claim;
+	timer_irq.handler = bbone_timer_irq_handler;
+	irq_register(&timer_irq);
+
+	/* Initialize the DMTIMER0 */
+	am335x_timer_init(&bbone.timer, DMTIMER0, HZ);
+	/* Enable the interrupt */
+	am335x_irc_enable(bbone.irc_addr, AM335x_DMTIMER0_IRQ);
+	/* Start the timer */
+	am335x_timer_start(&bbone.timer);
+}
+
+static void bbone_cpu_halt(void)
+{
+	while (1);
+}
+
+/** Get extents of available memory.
+ *
+ * @param start		Place to store memory start address (physical).
+ * @param size		Place to store memory size.
+ */
+static void bbone_get_memory_extents(uintptr_t *start, size_t *size)
+{
+	*start = BBONE_MEMORY_START;
+	*size  = BBONE_MEMORY_SIZE;
+}
+
+static void bbone_irq_exception(unsigned int exc_no, istate_t *istate)
+{
+	const unsigned inum = am335x_irc_inum_get(bbone.irc_addr);
+	am335x_irc_irq_ack(bbone.irc_addr);
+
+	irq_t *irq = irq_dispatch_and_lock(inum);
+	if (irq) {
+		/* The IRQ handler was found. */
+		irq->handler(irq);
+		spinlock_unlock(&irq->lock);
+	} else {
+		printf("Spurious interrupt\n");
+	}
+}
+
+static void bbone_frame_init(void)
+{
+}
+
+static void bbone_output_init(void)
+{
+	const bool ok = am335x_uart_init(&bbone.uart,
+	    AM335x_UART0_IRQ, AM335x_UART0_BASE_ADDRESS,
+	    AM335x_UART0_SIZE);
+
+	if (ok) {
+		stdout_wire(&bbone.uart.outdev);
+		printf("UART Ok\n");
+	}
+}
+
+static void bbone_input_init(void)
+{
+	srln_instance_t *srln_instance = srln_init();
+	if (srln_instance) {
+		indev_t *sink = stdin_wire();
+		indev_t *srln = srln_wire(srln_instance, sink);
+		am335x_uart_input_wire(&bbone.uart, srln);
+		am335x_irc_enable(bbone.irc_addr, AM335x_UART0_IRQ);
+	}
+}
+
+size_t bbone_get_irq_count(void)
+{
+	return AM335x_IRC_IRQ_COUNT;
+}
+
+const char *bbone_get_platform_name(void)
+{
+	return "beaglebone";
+}
+
+/**
+ * @}
+ */
+
Index: kernel/arch/arm32/src/machine_func.c
===================================================================
--- kernel/arch/arm32/src/machine_func.c	(revision c124dce396901c501e16c20ef82e82a814244b30)
+++ kernel/arch/arm32/src/machine_func.c	(revision 077b91722ee4b0aab9a5b3194eaa1107252a19c8)
@@ -42,4 +42,5 @@
 #include <arch/mach/integratorcp/integratorcp.h>
 #include <arch/mach/beagleboardxm/beagleboardxm.h>
+#include <arch/mach/beaglebone/beaglebone.h>
 
 /** Pointer to machine_ops structure being used. */
@@ -55,4 +56,6 @@
 #elif defined(MACHINE_beagleboardxm)
 	machine_ops = &bbxm_machine_ops;
+#elif defined(MACHINE_beaglebone)
+	machine_ops = &bbone_machine_ops;
 #else
 #error Machine type not defined.
