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

This patch needed more review than it got.

This reverts commit a6526cd90c.
This commit is contained in:
Andrew Kaster 2023-02-17 10:35:13 -07:00 committed by Andrew Kaster
parent aac122ab17
commit 3a01573350
Notes: sideshowbarker 2024-07-17 00:16:10 +09:00
2 changed files with 3 additions and 23 deletions

View File

@ -272,26 +272,6 @@ AK_MAKE_ARBITRARY_SIZED_ENUM(CPUFeature, u256,
__End = CPUFeature(1u) << 255u); // SENTINEL VALUE
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();
StringView cpu_feature_to_name(CPUFeature::Type const&);
StringView cpu_feature_to_description(CPUFeature::Type const&);

View File

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