]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap/server/src/platform/rv_vexpress.cc
update
[l4.git] / l4 / pkg / bootstrap / server / src / platform / rv_vexpress.cc
1 /*!
2  * \file
3  * \brief  Support for the rv platform
4  *
5  * \date   2011
6  * \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
7  *
8  */
9 /*
10  * (c) 2008-2011 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
20 #include <l4/drivers/uart_pl011.h>
21
22 namespace {
23
24 class Platform_arm_rv_vexpress : public Platform_single_region_ram
25 {
26   bool probe() { return true; }
27   void init()
28   {
29     unsigned long m;
30     unsigned long uart_base = 0x10009000;
31
32     asm volatile("mrc p15, 0, %0, c0, c0, 0" : "=r" (m));
33     if ((m & 0x00000070) == 0x70)
34       uart_base = 0x1c090000;
35
36     static L4::Io_register_block_mmio r(uart_base);
37     static L4::Uart_pl011 _uart(24019200);
38     _uart.startup(&r);
39     set_stdio_uart(&_uart);
40   }
41 };
42
43 }
44
45 REGISTER_PLATFORM(Platform_arm_rv_vexpress);