2012-05-30 20:13:09 +02:00
|
|
|
/*
|
|
|
|
* \brief Platform implementations specific for base-hw and Panda A2
|
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2012-04-27
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2013-01-10 21:44:47 +01:00
|
|
|
* Copyright (C) 2012-2013 Genode Labs GmbH
|
2012-05-30 20:13:09 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* core includes */
|
|
|
|
#include <platform.h>
|
2012-12-10 13:55:19 +01:00
|
|
|
#include <board.h>
|
2014-07-15 14:51:27 +02:00
|
|
|
#include <cpu.h>
|
2013-01-25 16:56:39 +01:00
|
|
|
#include <pic.h>
|
2014-06-04 15:35:54 +02:00
|
|
|
#include <unmanaged_singleton.h>
|
2012-05-30 20:13:09 +02:00
|
|
|
|
|
|
|
using namespace Genode;
|
|
|
|
|
2013-10-30 13:56:57 +01:00
|
|
|
Native_region * Platform::_ram_regions(unsigned const i)
|
2012-05-30 20:13:09 +02:00
|
|
|
{
|
|
|
|
static Native_region _regions[] =
|
|
|
|
{
|
2013-10-30 13:56:57 +01:00
|
|
|
{ Board::RAM_0_BASE, Board::RAM_0_SIZE }
|
2012-05-30 20:13:09 +02:00
|
|
|
};
|
|
|
|
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-28 14:56:00 +02:00
|
|
|
Native_region * mmio_regions(unsigned const i)
|
2012-05-30 20:13:09 +02:00
|
|
|
{
|
|
|
|
static Native_region _regions[] =
|
|
|
|
{
|
2012-12-10 13:55:19 +01:00
|
|
|
{ Board::MMIO_0_BASE, Board::MMIO_0_SIZE },
|
|
|
|
{ Board::MMIO_1_BASE, Board::MMIO_1_SIZE },
|
|
|
|
{ Board::DSS_MMIO_BASE, Board::DSS_MMIO_SIZE },
|
|
|
|
{ Board::DISPC_MMIO_BASE, Board::DISPC_MMIO_SIZE },
|
|
|
|
{ Board::HDMI_MMIO_BASE, Board::HDMI_MMIO_SIZE }
|
2012-05-30 20:13:09 +02:00
|
|
|
};
|
|
|
|
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Native_region * Platform::_core_only_mmio_regions(unsigned const i)
|
|
|
|
{
|
|
|
|
static Native_region _regions[] =
|
|
|
|
{
|
|
|
|
/* core timer and PIC */
|
2012-12-10 13:55:19 +01:00
|
|
|
{ Board::CORTEX_A9_PRIVATE_MEM_BASE,
|
|
|
|
Board::CORTEX_A9_PRIVATE_MEM_SIZE },
|
2012-05-30 20:13:09 +02:00
|
|
|
|
|
|
|
/* core UART */
|
2014-06-04 15:35:54 +02:00
|
|
|
{ Board::TL16C750_3_MMIO_BASE, Board::TL16C750_MMIO_SIZE },
|
|
|
|
|
|
|
|
/* l2 cache controller */
|
|
|
|
{ Board::PL310_MMIO_BASE, Board::PL310_MMIO_SIZE }
|
2012-05-30 20:13:09 +02:00
|
|
|
};
|
|
|
|
return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
|
|
|
|
}
|
2013-11-05 11:08:05 +01:00
|
|
|
|
|
|
|
|
2015-12-07 10:48:29 +01:00
|
|
|
static Genode::L2_cache * l2_cache() {
|
|
|
|
return unmanaged_singleton<Genode::L2_cache>(); }
|
2014-06-04 15:35:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
void Board::outer_cache_invalidate() { l2_cache()->invalidate(); }
|
|
|
|
void Board::outer_cache_flush() { l2_cache()->flush(); }
|
|
|
|
void Board::prepare_kernel() { l2_cache()->invalidate(); }
|
2015-02-19 14:50:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
Cpu::User_context::User_context() { cpsr = Psr::init_user(); }
|