mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
Kernel: Migrate ‘main id registerʼ access in Aarch64 MMIO
This commit is contained in:
parent
d6c620dc4f
commit
a6526cd90c
2 changed files with 23 additions and 3 deletions
|
@ -272,6 +272,26 @@ AK_MAKE_ARBITRARY_SIZED_ENUM(CPUFeature, u256,
|
||||||
|
|
||||||
__End = CPUFeature(1u) << 255u); // XXX — SENTINEL VALUE — XXX
|
__End = CPUFeature(1u) << 255u); // XXX — SENTINEL VALUE — XXX
|
||||||
|
|
||||||
|
enum class ArmLimited { // 0x41
|
||||||
|
Cortex_A34 = 0xd02,
|
||||||
|
Cortex_A53 = 0xd03, // Raspberry Pi 2 v1.2 / Raspberry Pi 3
|
||||||
|
Cortex_A35 = 0xd04,
|
||||||
|
Cortex_A55 = 0xd05,
|
||||||
|
Cortex_A65 = 0xd06,
|
||||||
|
Cortex_A57 = 0xd07,
|
||||||
|
Cortex_A72 = 0xd08, // Raspberry Pi 4
|
||||||
|
Cortex_A73 = 0xd09,
|
||||||
|
Cortex_A75 = 0xd0a,
|
||||||
|
Cortex_A76 = 0xd0b,
|
||||||
|
Neoverse_N1 = 0xd0c,
|
||||||
|
Cortex_A77 = 0xd0d,
|
||||||
|
Cortex_A78 = 0xd41,
|
||||||
|
Cortex_A65AE = 0xd43,
|
||||||
|
Cortex_X1 = 0xd44,
|
||||||
|
Cortex_A78C = 0xd4b,
|
||||||
|
Cortex_X1C = 0xd4c,
|
||||||
|
};
|
||||||
|
|
||||||
CPUFeature::Type detect_cpu_features();
|
CPUFeature::Type detect_cpu_features();
|
||||||
StringView cpu_feature_to_name(CPUFeature::Type const&);
|
StringView cpu_feature_to_name(CPUFeature::Type const&);
|
||||||
StringView cpu_feature_to_description(CPUFeature::Type const&);
|
StringView cpu_feature_to_description(CPUFeature::Type const&);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* 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>
|
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
|
||||||
|
|
||||||
namespace Kernel::RPi {
|
namespace Kernel::RPi {
|
||||||
|
@ -12,8 +12,8 @@ namespace Kernel::RPi {
|
||||||
MMIO::MMIO()
|
MMIO::MMIO()
|
||||||
: m_base_address(0xFE00'0000)
|
: m_base_address(0xFE00'0000)
|
||||||
{
|
{
|
||||||
MainIdRegister id;
|
auto main_id_register = Aarch64::MIDR_EL1::read();
|
||||||
if (id.part_num() <= MainIdRegister::RaspberryPi3)
|
if (static_cast<ArmLimited>(main_id_register.PartNum) <= ArmLimited::Cortex_A53) // Raspberry Pi 3
|
||||||
m_base_address = PhysicalAddress(0x3F00'0000);
|
m_base_address = PhysicalAddress(0x3F00'0000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue