diff options
| author | Simon Glass <[email protected]> | 2025-01-10 17:00:04 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-22 15:58:03 -0600 |
| commit | 8b89d901465bd00358c761f0b64e05efed8a333a (patch) | |
| tree | 31eedd9263f965e459077ed0f4dae36621533133 /include/cpu.h | |
| parent | 7ba7c1dd86cf212c7d489dbf0a07301d1a3b4d2c (diff) | |
cpu: Provide a way to get the physical-address size
This concept exists on x86. Declare it as a generic function so that the
value can be accessed by UPL.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/cpu.h')
| -rw-r--r-- | include/cpu.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/cpu.h b/include/cpu.h index 0018910d61f..d0cd104c05a 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -179,4 +179,18 @@ struct udevice *cpu_get_current_dev(void); * @return 0 if OK, -ve on error */ int cpu_release_core(const struct udevice *dev, phys_addr_t addr); + +/** + * cpu_phys_address_size() - Get the physical-address size for the CPU + * + * x86 CPUs have a setting which indicates how many bits of address space are + * available on the CPU. This is 32 for older CPUs but newer ones may support 36 + * or more. + * + * For non-x86 CPUs the result may simply be 32 for 32-bit CPUS or 64 for 64-bit + * + * Return: address size (typically 32 or 36) + */ +int cpu_phys_address_size(void); + #endif |
