2016-11-07 18:00:24 +01:00
|
|
|
/*
|
|
|
|
* \brief Platform implementations specific for RISC-V
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \author Sebastian Sumpf
|
|
|
|
* \date 2016-11-23
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
2016-11-07 18:00:24 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2016-11-07 18:00:24 +01:00
|
|
|
*/
|
|
|
|
#include <platform.h>
|
|
|
|
|
2017-05-26 16:27:39 +02:00
|
|
|
using namespace Board;
|
|
|
|
|
2017-02-21 13:46:59 +01:00
|
|
|
Bootstrap::Platform::Board::Board()
|
2017-05-26 16:27:39 +02:00
|
|
|
: early_ram_regions(Memory_region { RAM_0_BASE, RAM_0_SIZE } ) {}
|
2016-11-07 18:00:24 +01:00
|
|
|
|
|
|
|
|
2017-02-21 13:46:59 +01:00
|
|
|
void Bootstrap::Platform::enable_mmu()
|
2016-11-07 18:00:24 +01:00
|
|
|
{
|
2017-05-26 16:27:39 +02:00
|
|
|
asm volatile ("csrw sptbr, %0\n" /* set asid | page table */
|
2016-11-07 18:00:24 +01:00
|
|
|
:
|
2017-05-26 16:27:39 +02:00
|
|
|
: "r" ((addr_t)core_pd->table_base >> 12)
|
2017-05-12 10:35:33 +02:00
|
|
|
: "memory");
|
2016-11-07 18:00:24 +01:00
|
|
|
}
|