]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap/server/src/platform/exynos.cc
update
[l4.git] / l4 / pkg / bootstrap / server / src / platform / exynos.cc
1 /*!
2  * \file
3  * \brief  Support for Exynos platforms
4  *
5  * \author Adam Lackorzynski <adam@os.inf.tu-dresden.de>
6  *
7  */
8 /*
9  * (c) 2013 Author(s)
10  *     economic rights: Technische Universität Dresden (Germany)
11  *
12  * This file is part of TUD:OS and distributed under the terms of the
13  * GNU General Public License 2.
14  * Please see the COPYING-GPL-2 file for details.
15  */
16
17 #include "support.h"
18 #include <l4/drivers/uart_s3c2410.h>
19
20 #include <cstdio>
21
22 namespace {
23 class Platform_arm_exynos : public Platform_single_region_ram
24 {
25 public:
26   bool probe() { return true; }
27
28   void init()
29   {
30     static L4::Uart_s5pv210 _uart;
31     const unsigned long uart_offset = 0x10000;
32     unsigned long uart_base;
33     unsigned uart_nr = 2;
34
35 #ifdef PLATFORM_TYPE_exynos4
36     uart_base = 0x13800000;
37 #else
38     uart_base = 0x12c00000;
39 #endif
40
41     static L4::Io_register_block_mmio r(uart_base + uart_nr * uart_offset);
42     _uart.startup(&r);
43     set_stdio_uart(&_uart);
44   }
45
46   void reboot()
47   {
48 #ifdef PLATFORM_TYPE_exynos4
49     *(unsigned *)0x10020400 = 1;
50 #else
51     *(unsigned *)0x10040400 = 1;
52 #endif
53   }
54
55 };
56 }
57
58 REGISTER_PLATFORM(Platform_arm_exynos);