Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions platform/aarch64/imx8mp/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
// Authors:
//
use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{arch::zone::{HvArchZoneConfig,GicConfig,Gicv3Config}, config::*};

pub const BOARD_NAME: &str = "imx8mp";

Expand Down Expand Up @@ -75,13 +75,13 @@ pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 8] = [
virtual_start: 0x32c00000,
size: 0x400000,
}, // hdmi
// bus@30800000
// HvConfigMemoryRegion {
// mem_type: MEM_TYPE_IO,
// physical_start: 0x30890000,
// virtual_start: 0x30890000,
// size: 0x1000,
// }, // serial
// bus@30800000
// HvConfigMemoryRegion {
// mem_type: MEM_TYPE_IO,
// physical_start: 0x30890000,
// virtual_start: 0x30890000,
// size: 0x1000,
// }, // serial
];

pub const ROOT_ZONE_IRQS: [u32; 28] = [
Expand All @@ -90,19 +90,15 @@ pub const ROOT_ZONE_IRQS: [u32; 28] = [
];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0x38800000,
gicd_size: 0x10000,
gicr_base: 0x38880000,
gicr_size: 0xc0000,
gicc_base: 0,
gicc_size: 0,
gicc_offset: 0x0,
gich_base: 0,
gich_size: 0,
gicv_base: 0,
gicv_size: 0,
gits_base: 0,
gits_size: 0,
gic_version: 3,
gic_config: GicConfig::Gicv3(Gicv3Config {
gicd_base: 0x38800000,
gicd_size: 0x10000,
gicr_base: 0x38880000,
gicr_size: 0xc0000,
gits_base: 0x0,
gits_size: 0x0,
}),
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
26 changes: 11 additions & 15 deletions platform/aarch64/ok6254-c/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Authors:
//

use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{arch::zone::{HvArchZoneConfig,GicConfig,Gicv3Config}, config::*};

pub const BOARD_NAME: &str = "ok6254";
pub const BOARD_NCPUS: usize = 4;
Expand Down Expand Up @@ -106,19 +106,15 @@ pub const ROOT_ZONE_IRQS: [u32; 13] = [
];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0x1800000,
gicd_size: 0x10000,
gicr_base: 0x1880000,
gicr_size: 0xc0000,
gicc_base: 0x0,
gicc_size: 0x0,
gicc_offset: 0x0,
gich_base: 0x0,
gich_size: 0x0,
gicv_base: 0x0,
gicv_size: 0x00000,
gits_base: 0x1820000,
gits_size: 0x10000,
gic_version: 3,
gic_config: GicConfig::Gicv3(Gicv3Config {
gicd_base: 0x1800000,
gicd_size: 0x10000,
gicr_base: 0x1880000,
gicr_size: 0xc0000,
gits_base: 0x1820000,
gits_size: 0x10000,
}),
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
32 changes: 16 additions & 16 deletions platform/aarch64/qemu-gicv2/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// https://www.syswonder.org
//
// Authors:
//
use crate::{arch::zone::HvArchZoneConfig, config::*};
// Hangqi Ren <[email protected]>
use crate::{arch::zone::{HvArchZoneConfig,GicConfig,Gicv2Config}, config::*};

pub const BOARD_NAME: &str = "qemu-gicv2";

Expand Down Expand Up @@ -52,21 +52,21 @@ pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 3] = [
pub const ROOT_ZONE_IRQS: [u32; 9] = [33, 64, 77, 79, 35, 36, 37, 38, 65];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0x8000000,
gicd_size: 0x10000,
gicr_base: 0x80a0000,
gicr_size: 0xf60000,
gicc_base: 0x8010000,
gicc_size: 0x10000,
gicc_offset: 0x0,
gich_base: 0x8030000,
gich_size: 0x10000,
gicv_base: 0x8040000,
gicv_size: 0x10000,
gits_base: 0x8080000,
gits_size: 0x20000,
gic_version: 2,
gic_config: GicConfig::Gicv2(Gicv2Config {
gicd_base: 0x8000000,
gicd_size: 0x10000,
gicc_base: 0x8010000,
gicc_size: 0x10000,
gicc_offset: 0x0,
gich_base: 0x8030000,
gich_size: 0x10000,
gicv_base: 0x8040000,
gicv_size: 0x10000,
}),
};


pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
Expand All @@ -83,4 +83,4 @@ pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];

pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
27 changes: 13 additions & 14 deletions platform/aarch64/qemu-gicv3/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
//
// Authors:
//
use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{
arch::zone::{GicConfig, Gicv3Config, HvArchZoneConfig},
config::*,
};

pub const BOARD_NAME: &str = "qemu-gicv3";

Expand Down Expand Up @@ -52,19 +55,15 @@ pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 3] = [
pub const ROOT_ZONE_IRQS: [u32; 9] = [33, 64, 77, 79, 35, 36, 37, 38, 65];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0x8000000,
gicd_size: 0x10000,
gicr_base: 0x80a0000,
gicr_size: 0xf60000,
gicc_base: 0x8010000,
gicc_size: 0x10000,
gicc_offset: 0x0,
gich_base: 0x8030000,
gich_size: 0x10000,
gicv_base: 0x8040000,
gicv_size: 0x10000,
gits_base: 0x8080000,
gits_size: 0x20000,
gic_version: 3,
gic_config: GicConfig::Gicv3(Gicv3Config {
gicd_base: 0x8000000,
gicd_size: 0x10000,
gicr_base: 0x80a0000,
gicr_size: 0xf60000,
gits_base: 0x8080000,
gits_size: 0x20000,
}),
};

pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
Expand Down
29 changes: 13 additions & 16 deletions platform/aarch64/rk3568/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Authors:
//

use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{arch::zone::{HvArchZoneConfig,GicConfig,Gicv3Config}, config::*};

pub const BOARD_NAME: &str = "rk3568";

Expand Down Expand Up @@ -163,23 +163,20 @@ pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 19] = [
];

pub const ROOT_ZONE_IRQS: [u32; 20] = [
0x84, 0x98, 0x40, 0x104, 0x105, 0x106, 0x107, 0x2d, 0x2e, 0x2b, 0x2a, 0x29, 0x33, 0x96, 0x11c, 0x44, 0x43, 0x42, 0x41, 0x8d];
0x84, 0x98, 0x40, 0x104, 0x105, 0x106, 0x107, 0x2d, 0x2e, 0x2b, 0x2a, 0x29, 0x33, 0x96, 0x11c, 0x44, 0x43, 0x42, 0x41, 0x8d];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0xfd400000,
gicd_size: 0x10000,
gicr_base: 0xfd460000,
gicr_size: 0xc0000,
gicc_base: 0,
gicc_size: 0,
gicc_offset: 0x0,
gich_base: 0,
gich_size: 0,
gicv_base: 0,
gicv_size: 0,
gits_base: 0,
gits_size: 0,
gic_version: 3,
gic_config: GicConfig::Gicv3(Gicv3Config {
gicd_base: 0xfd400000,
gicd_size: 0x10000,
gicr_base: 0xfd460000,
gicr_size: 0xc0000,
gits_base: 0x0,
gits_size: 0x0,
}),
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];

pub const ROOT_PCI_DEVS: [u64; 0] = [];
pub const ROOT_PCI_DEVS: [u64; 0] = [];
26 changes: 11 additions & 15 deletions platform/aarch64/rk3588/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
// Authors:
//
use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{arch::zone::{HvArchZoneConfig,GicConfig,Gicv3Config}, config::*};

// [ 17.796762] node 0: [mem 0x0000000000200000-0x000000000047ffff]
// [ 17.797335] node 0: [mem 0x0000000000480000-0x000000000087ffff]
Expand Down Expand Up @@ -146,19 +146,15 @@ pub const ROOT_ZONE_IRQS: [u32; 29] = [
];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0xfe600000,
gicd_size: 0x10000,
gicr_base: 0xfe680000,
gicr_size: 0x100000,
gicc_base: 0x8010000,
gicc_size: 0x10000,
gicc_offset: 0x0,
gich_base: 0x8030000,
gich_size: 0x10000,
gicv_base: 0x8040000,
gicv_size: 0x10000,
gits_base: 0x8080000,
gits_size: 0x20000,
gic_version: 3,
gic_config: GicConfig::Gicv3(Gicv3Config {
gicd_base: 0xfe600000,
gicd_size: 0x10000,
gicr_base: 0xfe680000,
gicr_size: 0x100000,
gits_base: 0x8080000,
gits_size: 0x20000,
}),
};

pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
Expand All @@ -177,4 +173,4 @@ pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];

pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
31 changes: 15 additions & 16 deletions platform/aarch64/zcu102/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// https://www.syswonder.org
//
// Authors:
//
// Hangqi Ren <[email protected]>
use crate::config::HvConfigMemoryRegion;
use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{arch::zone::{HvArchZoneConfig,GicConfig,Gicv2Config}, config::*};

pub const BOARD_NAME: &str = "zcu102";

Expand Down Expand Up @@ -69,19 +69,18 @@ pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 5] = [
pub const ROOT_ZONE_IRQS: [u32; 8] = [53, 81, 67, 175, 176, 177, 178, 64];

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicd_base: 0xf9010000,
gicd_size: 0x10000,
gicr_base: 0x80a0000,
gicr_size: 0xf60000,
gits_base: 0x20000,
gits_size: 0x20000,
gicc_base: 0xf9020000,
gicc_size: 0x20000,
gicc_offset: 0xf000,
gich_base: 0xf9040000,
gich_size: 0x20000,
gicv_base: 0xf9060000,
gicv_size: 0x20000,
gic_version: 2,
gic_config: GicConfig::Gicv2(Gicv2Config {
gicd_base: 0xf9010000,
gicd_size: 0x10000,
gicc_base: 0xf9020000,
gicc_size: 0x20000,
gicc_offset: 0xf000,
gich_base: 0xf9040000,
gich_size: 0x20000,
gicv_base: 0xf9060000,
gicv_size: 0x20000,
}),
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
31 changes: 26 additions & 5 deletions src/arch/aarch64/zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,38 @@ impl Zone {
#[repr(C)]
#[derive(Debug, Clone)]
pub struct HvArchZoneConfig {
pub gic_version: usize,
pub gic_config: GicConfig,
}

#[repr(C, usize)]
#[derive(Debug, Clone)]
pub enum GicConfig {
Gicv2(Gicv2Config),
Gicv3(Gicv3Config),
}

#[repr(C)]
#[derive(Debug, Clone)]
pub struct Gicv2Config {
pub gicd_base: usize,
pub gicd_size: usize,
pub gicr_base: usize,
pub gicr_size: usize,
pub gits_base: usize,
pub gits_size: usize,
pub gicc_base: usize,
pub gicc_offset: usize,
pub gicc_size: usize,
pub gicc_offset: usize,
pub gich_base: usize,
pub gich_size: usize,
pub gicv_base: usize,
pub gicv_size: usize,
}

#[repr(C)]
#[derive(Debug, Clone)]
pub struct Gicv3Config {
pub gicd_base: usize,
pub gicd_size: usize,
pub gicr_base: usize,
pub gicr_size: usize,
pub gits_base: usize,
pub gits_size: usize,
}
Loading
Loading