Kernel: Add a MMIO class for aarch64

It doesn't do anything yet except figure out the peripheral base
address.

Very likely belongs in Kernel, not Prekernel, eventually.
This commit is contained in:
Nico Weber 2021-09-17 11:00:46 -04:00 committed by Linus Groh
commit d0b9c7a20b
Notes: sideshowbarker 2024-07-18 03:40:29 +09:00
4 changed files with 54 additions and 3 deletions

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Prekernel/Arch/aarch64/MMIO.h>
#include <Kernel/Prekernel/Arch/aarch64/MainIdRegister.h>
namespace Prekernel {
MMIO::MMIO()
: m_base_address(0xFE00'0000)
{
MainIdRegister id;
if (id.part_num() <= MainIdRegister::RaspberryPi3)
m_base_address = 0x3F00'0000;
}
MMIO& MMIO::the()
{
static MMIO instance;
return instance;
}
}