1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 20:17:46 +00:00

Kernel: Migrate ‘main id registerʼ access in Aarch64 MMIO

This commit is contained in:
konrad 2023-01-24 22:03:28 +01:00 committed by Andrew Kaster
parent d6c620dc4f
commit a6526cd90c
2 changed files with 23 additions and 3 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/aarch64/MainIdRegister.h>
#include <Kernel/Arch/aarch64/CPUID.h>
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
namespace Kernel::RPi {
@ -12,8 +12,8 @@ namespace Kernel::RPi {
MMIO::MMIO()
: m_base_address(0xFE00'0000)
{
MainIdRegister id;
if (id.part_num() <= MainIdRegister::RaspberryPi3)
auto main_id_register = Aarch64::MIDR_EL1::read();
if (static_cast<ArmLimited>(main_id_register.PartNum) <= ArmLimited::Cortex_A53) // Raspberry Pi 3
m_base_address = PhysicalAddress(0x3F00'0000);
}