]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap_custom/server/src/platform/omap.cc
fiasco: bootstrap: copy bootstrap into bootstrap_custom for to port this into Jailhouse.
[l4.git] / l4 / pkg / bootstrap_custom / server / src / platform / omap.cc
1 /*!
2  * \file   support_beagleboard.cc
3  * \brief  Support for the Beagleboard
4  *
5  * \date   2009-08
6  * \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
7  *
8  */
9 /*
10  * (c) 2009 Author(s)
11  *     economic rights: Technische Universität Dresden (Germany)
12  *
13  * This file is part of TUD:OS and distributed under the terms of the
14  * GNU General Public License 2.
15  * Please see the COPYING-GPL-2 file for details.
16  */
17
18 #include "support.h"
19 #include <l4/drivers/uart_omap35x.h>
20
21 namespace {
22 class Platform_arm_omap : public Platform_single_region_ram
23 {
24   bool probe() { return true; }
25
26   void init()
27   {
28     static L4::Uart_omap35x _uart;
29 #ifdef PLATFORM_TYPE_beagleboard
30     static L4::Io_register_block_mmio r(0x49020000);
31 #elif defined(PLATFORM_TYPE_omap3evm)
32     static L4::Io_register_block_mmio r(0x4806a000);
33 #elif defined(PLATFORM_TYPE_omap3_am33xx)
34     static L4::Io_register_block_mmio r(0x44e09000);
35 #elif defined(PLATFORM_TYPE_pandaboard) || defined(PLATFORM_TYPE_omap5)
36     static L4::Io_register_block_mmio r(0x48020000);
37 #else
38 #error Unknown platform
39 #endif
40     _uart.startup(&r);
41     set_stdio_uart(&_uart);
42   }
43
44   void arm_switch_to_hyp()
45   {
46     register l4_umword_t f asm("r12") = 0x102;
47     asm volatile("push {fp}                 \n"
48                  "mcr p15, 0, sp, c13, c0, 2\n"
49                  "mov r0, pc                \n"
50                  ".inst 0xe1600071          \n"
51                  "mrc p15, 0, sp, c13, c0, 2\n"
52                  "pop {fp}                  \n"
53                  :
54                  : "r" (f)
55                  : "r0", "r1", "r2", "r3", "r4",
56                    "r5", "r6", "r7", "r8", "r9",
57                    "r10", "memory");
58   }
59 };
60 }
61
62 REGISTER_PLATFORM(Platform_arm_omap);