-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiple registers and update fields #27
Merged
Merged
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b4ef409
Apply `cargo fmt`
bitboom e27e9b6
Add CNTPOFF_EL2 register
bitboom 33057e5
Add CPTR_EL2 register
bitboom d119808
Add ICC_SRE_EL2 register
bitboom 00baf43
Add more field to HCR_EL2
bitboom 9c28fbe
Add EOS field to SCTLR_EL2
bitboom f2f7ce8
Fix ESL_EL1 to write with field
bitboom b3a6517
Add HPFAR_EL2 register
bitboom ae98a00
Add ID_AA64ISAR1_EL1 register
bitboom c7c26e4
Add ID_AA64AFR0_EL1, ID_AA64AFR1_EL1 registers
bitboom 840e9c4
Add ID_AA64DFR0_EL1, ID_AA64DFR1_EL1 registers
bitboom 0cbc13a
Add ID_AA64PFR0_EL1, ID_AA64PFR1_EL1 registers
bitboom a1393c2
Add ICH_AP0Rn_EL2, ICH_AP1Rn_EL2 registers
bitboom 6057193
Add ICH_LR<n>_EL2 registers
bitboom a4569ab
Add ICH_HCR_EL2 register
bitboom 1e33b06
Add ICH_VTR_EL2 register
bitboom 51a94fa
Add ICC_CTLR_EL1 register
bitboom 55610ab
Add ICH_VMCR_EL2 register
bitboom 196a69d
Add ICH_MISR_EL2 register
bitboom 93a638e
Update ICH_LR0_EL2 fields
bitboom 193cdda
Add fields to VTCR_EL2
bitboom 39369e6
Add RES1 field to MPIDR_EL1
bitboom 9107714
Update HPFAR_EL2 and ID_AA64DFR0_EL1 fields
bitboom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Counter-timer Physical Offset register - EL2 | ||
//! | ||
//! Holds the 64-bit physical offset. | ||
//! This is the offset for the AArch64 physical timers and counters | ||
//! when Enhanced Counter Virtualization is enabled. | ||
|
||
use tock_registers::interfaces::{Readable, Writeable}; | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = (); | ||
|
||
sys_coproc_read_raw!(u64, "CNTPOFF_EL2", "x"); | ||
} | ||
|
||
impl Writeable for Reg { | ||
type T = u64; | ||
type R = (); | ||
|
||
sys_coproc_write_raw!(u64, "CNTPOFF_EL2", "x"); | ||
} | ||
|
||
pub const CNTPOFF_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Architectural Feature Trap Register - EL2 | ||
//! | ||
//! Controls trapping to EL2 of accesses to CPACR, CPACR_EL1, trace, Activity Monitor, SME, | ||
//! Streaming SVE, SVE, and Advanced SIMD and floating-point functionality. | ||
|
||
use tock_registers::{ | ||
interfaces::{Readable, Writeable}, | ||
register_bitfields, | ||
}; | ||
|
||
register_bitfields! {u64, | ||
pub CPTR_EL2 [ | ||
/// Trap Activity Monitor access. Traps EL1 and EL0 accesses to all Activity Monitor | ||
/// registers to EL2. | ||
/// | ||
/// 0 Accesses from EL1 and EL0 to Activity Monitor registers are not trapped. | ||
/// | ||
/// 1 Accesses from EL1 and EL0 to Activity Monitor registers are trapped to EL2, | ||
/// when EL2 is enabled in the current Security state. | ||
TAM OFFSET(30) NUMBITS(1) [], | ||
] | ||
} | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = CPTR_EL2::Register; | ||
|
||
sys_coproc_read_raw!(u64, "CPTR_EL2", "x"); | ||
} | ||
|
||
impl Writeable for Reg { | ||
type T = u64; | ||
type R = CPTR_EL2::Register; | ||
|
||
sys_coproc_write_raw!(u64, "CPTR_EL2", "x"); | ||
} | ||
|
||
pub const CPTR_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Hypervisor IPA Fault Address Register - EL2 | ||
//! | ||
//! Holds the faulting IPA for some aborts on a stage 2 translation taken to EL2. | ||
|
||
use tock_registers::{interfaces::Readable, register_bitfields}; | ||
|
||
register_bitfields! {u64, | ||
pub HPFAR_EL2 [ | ||
/// Faulting IPA address space. | ||
NS OFFSET(63) NUMBITS(1) [], | ||
|
||
/// Faulting Intermediate Physical Address. | ||
FIPA OFFSET(4) NUMBITS(40) [] | ||
] | ||
} | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = HPFAR_EL2::Register; | ||
|
||
sys_coproc_read_raw!(u64, "HPFAR_EL2", "x"); | ||
} | ||
|
||
pub const HPFAR_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Interrupt Controller System Register Enable Register - EL2 | ||
//! | ||
//! Controls whether the System register interface or the memory-mapped interface | ||
//! to the GIC CPU interface is used for EL2. | ||
|
||
use tock_registers::{ | ||
interfaces::{Readable, Writeable}, | ||
register_bitfields, | ||
}; | ||
|
||
register_bitfields! {u64, | ||
pub ICC_SRE_EL2 [ | ||
/// Enables lower Exception level access to ICC_SRE_EL1. | ||
/// | ||
/// 0 When EL2 is implemented and enabled in the current Security state, | ||
/// EL1 accesses to ICC_SRE_EL1 trap to EL2. | ||
/// | ||
/// 1 EL1 accesses to ICC_SRE_EL1 do not trap to EL2. | ||
ENABLE OFFSET(3) NUMBITS(1) [], | ||
|
||
/// Disable IRQ bypass. | ||
/// | ||
/// 0 IRQ bypass enabled. | ||
/// | ||
/// 1 IRQ bypass disabled. | ||
DIB OFFSET(2) NUMBITS(1) [], | ||
|
||
/// Disable FIQ bypass. | ||
/// | ||
/// 0 FIQ bypass enabled. | ||
/// | ||
/// 1 FIQ bypass disabled. | ||
DFB OFFSET(1) NUMBITS(1) [], | ||
|
||
/// System Register Enable. | ||
/// | ||
/// 0 The memory-mapped interface must be used. Access at EL2 to any ICH_* or | ||
/// ICC_* register other than ICC_SRE_EL1 or ICC_SRE_EL2, is trapped to EL2. | ||
/// | ||
/// 1 The System register interface to the ICH_* registers and the EL1 and EL2 | ||
/// ICC_* registers is enabled for EL2. | ||
SRE OFFSET(0) NUMBITS(1) [], | ||
] | ||
} | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = ICC_SRE_EL2::Register; | ||
|
||
sys_coproc_read_raw!(u64, "ICC_SRE_EL2", "x"); | ||
} | ||
|
||
impl Writeable for Reg { | ||
type T = u64; | ||
type R = ICC_SRE_EL2::Register; | ||
|
||
sys_coproc_write_raw!(u64, "ICC_SRE_EL2", "x"); | ||
} | ||
|
||
pub const ICC_SRE_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! AArch64 Auxiliary Feature Register 0 - EL1 | ||
//! | ||
//! Provides information about the IMPLEMENTATION DEFINED features of the PE in AArch64 state. | ||
|
||
use tock_registers::interfaces::Readable; | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = (); | ||
|
||
sys_coproc_read_raw!(u64, "ID_AA64AFR0_EL1", "x"); | ||
} | ||
|
||
pub const ID_AA64AFR0_EL1: Reg = Reg {}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at possible encodings it is probably safe to encode FIPA as
OFFSET(0) NUMBITS(48)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After taking a closer look, FIPA could be
OFFSET(4) NUMBIT(48)
. It's a bit confusing when viewed on the web due to the indentation, but it's clearer in the PDF version.This conditions below refer to an offset within the 44 bits of FIPA[47:4].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, alright, yeah that makes sense, it was a bit unclear in the web version.