Remove duplicated BcmHost
This commit is contained in:
parent
abafec12c6
commit
a04f2e4f17
|
@ -193,23 +193,3 @@ pub fn write_translation_table_base(base: PhysicalAddress) {
|
||||||
// },
|
// },
|
||||||
// ];
|
// ];
|
||||||
// }
|
// }
|
||||||
|
|
||||||
pub struct BcmHost;
|
|
||||||
|
|
||||||
impl BcmHost {
|
|
||||||
// As per https://www.raspberrypi.org/documentation/hardware/raspberrypi/peripheral_addresses.md
|
|
||||||
/// This returns the ARM-side physical address where peripherals are mapped.
|
|
||||||
pub const fn get_peripheral_address() -> u32 {
|
|
||||||
0x3f00_0000
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This returns the size of the peripheral's space.
|
|
||||||
pub fn get_peripheral_size() -> usize {
|
|
||||||
0x0100_0000
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This returns the bus address of the SDRAM.
|
|
||||||
pub fn get_sdram_address() -> PhysicalAddress {
|
|
||||||
0xC000_0000 // uncached
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -19,22 +19,22 @@ pub fn bus2phys(address: u32) -> u32 {
|
||||||
// @todo use BcmHost::get_peripheral_address() instead
|
// @todo use BcmHost::get_peripheral_address() instead
|
||||||
pub const PERIPHERAL_BASE: u32 = phys2virt(0x3F00_0000); // Base address for all peripherals
|
pub const PERIPHERAL_BASE: u32 = phys2virt(0x3F00_0000); // Base address for all peripherals
|
||||||
|
|
||||||
pub struct BcmHost; // One dupe of this is in arch::aarch64 mod NOW!
|
pub struct BcmHost;
|
||||||
|
|
||||||
impl BcmHost {
|
impl BcmHost {
|
||||||
// As per https://www.raspberrypi.org/documentation/hardware/raspberrypi/peripheral_addresses.md
|
// As per https://www.raspberrypi.org/documentation/hardware/raspberrypi/peripheral_addresses.md
|
||||||
/// This returns the ARM-side physical address where peripherals are mapped.
|
/// This returns the ARM-side physical address where peripherals are mapped.
|
||||||
pub fn get_peripheral_address() -> u32 {
|
pub const fn get_peripheral_address() -> u32 {
|
||||||
0x3f00_0000
|
0x3f00_0000
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This returns the size of the peripherals' space.
|
/// This returns the size of the peripherals' space.
|
||||||
pub fn get_peripheral_size() -> usize {
|
pub const fn get_peripheral_size() -> usize {
|
||||||
0x0100_0000
|
0x0100_0000
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This returns the bus address of the SDRAM.
|
/// This returns the bus address of the SDRAM.
|
||||||
pub fn get_sdram_address() -> usize {
|
pub const fn get_sdram_address() -> usize {
|
||||||
0xC000_0000 // uncached
|
0xC000_0000 // uncached
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue