Skip to content
Open
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/hvisor.S
/hvisor-elf.txt
/images/*
/platform/*/*/image/kernel/*
/platform/*/*/image/virtdisk/*
/platform/*/*/image/kernel
/platform/*/*/image/virtdisk
/tools/hvisor
/tmp
*.mod.[co]
Expand Down
2 changes: 1 addition & 1 deletion platform/aarch64/imx8mp/configs/zone1-ruxos.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
},
"num_pci_devs": 0,
"alloc_pci_devs": [],
"pci_config": {}
"pci_config": []
}
36 changes: 22 additions & 14 deletions platform/aarch64/qemu-gicv2/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use crate::{
config::*,
};

use crate::pci_dev;

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

pub const BOARD_NCPUS: usize = 4;
Expand Down Expand Up @@ -90,20 +92,26 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
};


pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
io_base: 0x3eff0000,
io_size: 0x10000,
pci_io_base: 0x0,
mem32_base: 0x10000000,
mem32_size: 0x2eff0000,
pci_mem32_base: 0x10000000,
mem64_base: 0x8000000000,
mem64_size: 0x8000000000,
pci_mem64_base: 0x8000000000,
};
pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [
HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
io_base: 0x3eff0000,
io_size: 0x10000,
pci_io_base: 0x0,
mem32_base: 0x10000000,
mem32_size: 0x2eff0000,
pci_mem32_base: 0x10000000,
mem64_base: 0x8000000000,
mem64_size: 0x8000000000,
pci_mem64_base: 0x8000000000,
}
];

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

pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
pub const ROOT_PCI_DEVS: [HvPciDevConfig; 3] = [
pci_dev!(0x0, 0x0, 0x0),
pci_dev!(0x0, 0x1, 0x0),
pci_dev!(0x0, 0x2, 0x0),
];
18 changes: 18 additions & 0 deletions platform/aarch64/qemu-gicv2/image/dts/zone0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@
compatible = "arm,armv8-timer\0arm,armv7-timer";
};

pcie@10000000 {
interrupt-map-mask = <0x1800 0x00 0x00 0x07>;
interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x03 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x04 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x05 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x06 0x04 0x800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x04 0x04 0x800 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x05 0x04 0x800 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x06 0x04 0x800 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x03 0x04 0x1000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x05 0x04 0x1000 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x06 0x04 0x1000 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x03 0x04 0x1000 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x04 0x04 0x1800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x06 0x04 0x1800 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x03 0x04 0x1800 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x04 0x04 0x1800 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x05 0x04>;
#interrupt-cells = <0x01>;
ranges = <0x1000000 0x00 0x00 0x00 0x3eff0000 0x00 0x10000
0x2000000 0x00 0x10000000 0x00 0x10000000 0x00 0x2eff0000
0x3000000 0x80 0x00 0x80 0x00 0x80 0x00>;
reg = <0x40 0x10000000 0x00 0x10000000>;
msi-map = <0x00 0x8006 0x00 0x10000>;
dma-coherent;
bus-range = <0x00 0xff>;
linux,pci-domain = <0x00>;
#size-cells = <0x02>;
#address-cells = <0x03>;
device_type = "pci";
compatible = "pci-host-ecam-generic";
};

virtio_mmio@a003a00 {
dma-coherent;
interrupt-parent = <0x01>;
Expand Down
14 changes: 11 additions & 3 deletions platform/aarch64/qemu-gicv3/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ use crate::{
},
config::*,
};

use crate::pci_dev;

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

pub const BOARD_NCPUS: usize = 4;
Expand Down Expand Up @@ -88,7 +91,7 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
}),
};

pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
io_base: 0x3eff0000,
Expand All @@ -100,8 +103,13 @@ pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
mem64_base: 0x8000000000,
mem64_size: 0x8000000000,
pci_mem64_base: 0x8000000000,
};
}];

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

pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
pub const ROOT_PCI_DEVS: [HvPciDevConfig; 3] = [
pci_dev!(0x0, 0x0, 0x0),
pci_dev!(0x0, 0x1, 0x0),
pci_dev!(0x0, 0x2, 0x0),
// pci_dev!(0x0, 0x3, 0x0),
];
36 changes: 19 additions & 17 deletions platform/aarch64/qemu-gicv3/configs/zone1-linux.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"arch": "arm64",
"name": "linux2",
"zone_id": 1,
"cpus": [2, 3],
Expand All @@ -12,22 +11,15 @@
},
{
"type": "virtio",
"physical_start": "0xa003800",
"virtual_start": "0xa003800",
"size": "0x200"
},
{
"type": "virtio",
"physical_start": "0xa003c00",
"virtual_start": "0xa003c00",
"size": "0x200"
"physical_start": "0xa000000",
"virtual_start": "0xa000000",
"size": "0x4000"
}
],
"interrupts": [76, 78],
"ivc_configs": [],
"kernel_filepath": "Image",
"kernel_args": "",
"dtb_filepath": "zone1-linux.dtb",
"kernel_filepath": "./Image",
"dtb_filepath": "./linux2.dtb",
"kernel_load_paddr": "0x50400000",
"dtb_load_paddr": "0x50000000",
"entry_point": "0x50400000",
Expand All @@ -38,9 +30,10 @@
"gicr_base": "0x80a0000",
"gicr_size": "0xf60000",
"gits_base": "0x8080000",
"gits_size": "0x20000"
"gits_size": "0x20000",
"is_aarch32": false
},
"pci_config": {
"pci_config": [{
"ecam_base": "0x4010000000",
"ecam_size": "0x10000000",
"io_base": "0x3eff0000",
Expand All @@ -52,7 +45,16 @@
"mem64_base": "0x8000000000",
"mem64_size": "0x8000000000",
"pci_mem64_base": "0x8000000000"
},
}],
"num_pci_devs": 2,
"alloc_pci_devs": [0, 16]
"alloc_pci_devs": [
{
"bdf": "0x0",
"vbdf": "0x0"
},
{
"bdf": "0x18",
"vbdf": "0x18"
}
]
}
88 changes: 45 additions & 43 deletions platform/loongarch64/ls3a5000/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// Yulong Han <[email protected]>
//
use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::pci_dev;

pub const BOARD_NAME: &str = "ls3a5000";

Expand Down Expand Up @@ -154,19 +155,21 @@ pub const ROOT_ZONE_IRQS: [u32; 0] = [];
pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig { dummy: 0 };
pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];

pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
ecam_base: 0xfe00000000,
ecam_size: 0x20000000,
io_base: 0x18408000,
io_size: 0x8000,
pci_io_base: 0x00008000,
mem32_base: 0x0,
mem32_size: 0x0,
pci_mem32_base: 0x0,
mem64_base: 0x60000000,
mem64_size: 0x20000000,
pci_mem64_base: 0x60000000,
};
pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [
HvPciConfig {
ecam_base: 0xfe00000000,
ecam_size: 0x20000000,
io_base: 0x18408000,
io_size: 0x8000,
pci_io_base: 0x00008000,
mem32_base: 0x0,
mem32_size: 0x0,
pci_mem32_base: 0x0,
mem64_base: 0x60000000,
mem64_size: 0x20000000,
pci_mem64_base: 0x60000000,
}
];

/* 00:00.0, 00:00.1, 00:00.2, 00:00.3, 00:04.0, 00:04.1*/
/* 00:05.0, 00:05.1, 00:06.0, 00:06.1, 00:06.2 */
Expand All @@ -177,38 +180,37 @@ pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
/* 08:00.0, 08:00.1, 08:00.2, 08:00.3 net */
/* BUS 6 on X4 slot */
/* 06:00.0, 06:00.1, 06:00.2, 06:00.3 net */
pub const ROOT_PCI_DEVS: [u64; 26] = [
0,
1,
2,
3,
4 << 3,
(4 << 3) + 1,
5 << 3,
(5 << 3) + 1,
// 00:06.xx is VGA and Graphics card
(6 << 3),
(6 << 3) + 1,
(6 << 3) + 2,
7 << 3,
8 << 3, // bus 0 device 8: AHCI
9 << 3,
0xa << 3,
0xb << 3,
0xc << 3,
0xd << 3,
0xf << 3,
0x10 << 3,
0x13 << 3,
0x16 << 3,
0x19 << 3,
2 << 8,
5 << 8,
// bus 6 (x4 slot) is PCIe network card
// (8 << 8), // bus 8 net
(6 << 8), // bus 6 net
pub const ROOT_PCI_DEVS: [HvPciDevConfig; 26] = [
pci_dev!(0x0, 0x0, 0x0), // 00:00.0
pci_dev!(0x0, 0x0, 0x1), // 00:00.1
pci_dev!(0x0, 0x0, 0x2), // 00:00.2
pci_dev!(0x0, 0x0, 0x3), // 00:00.3
pci_dev!(0x0, 0x4, 0x0), // 00:04.0
pci_dev!(0x0, 0x4, 0x1), // 00:04.1
pci_dev!(0x0, 0x5, 0x0), // 00:05.0
pci_dev!(0x0, 0x5, 0x1), // 00:05.1
pci_dev!(0x0, 0x6, 0x0), // 00:06.0
pci_dev!(0x0, 0x6, 0x1), // 00:06.1
pci_dev!(0x0, 0x6, 0x2), // 00:06.2
pci_dev!(0x0, 0x7, 0x0), // 00:07.0
pci_dev!(0x0, 0x8, 0x0), // 00:08.0
pci_dev!(0x0, 0x9, 0x0), // 00:09.0
pci_dev!(0x0, 0xa, 0x0), // 00:0a.0
pci_dev!(0x0, 0xb, 0x0), // 00:0b.0
pci_dev!(0x0, 0xc, 0x0), // 00:0c.0
pci_dev!(0x0, 0xd, 0x0), // 00:0d.0
pci_dev!(0x0, 0xf, 0x0), // 00:0f.0
pci_dev!(0x0, 0x10, 0x0), // 00:10.0
pci_dev!(0x0, 0x13, 0x0), // 00:13.0
pci_dev!(0x0, 0x16, 0x0), // 00:16.0
pci_dev!(0x0, 0x19, 0x0), // 00:19.0
pci_dev!(0x2, 0x0, 0x0), // 02:00.0
pci_dev!(0x5, 0x0, 0x0), // 05:00.0
pci_dev!(0x6, 0x0, 0x0), // 06:00.0
];



// bus << 8 | dev << 5 | func << 3

// pub const ROOT_PCI_DEVS: [u64; 0] = [];
Expand Down
9 changes: 6 additions & 3 deletions platform/loongarch64/ls3a5000/configs/zone1-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"arch_config": {
"dummy": "0x1234"
},
"pci_config": {
"pci_config": [{
"ecam_base": "0xfe00000000",
"ecam_size": "0x20000000",
"io_base": "0x18408000",
Expand All @@ -123,7 +123,10 @@
"mem64_base": "0x60000000",
"mem64_size": "0x20000000",
"pci_mem64_base": "0x60000000"
},
}],
"num_pci_devs": 1,
"alloc_pci_devs": [1537]
"alloc_pci_devs": [{
"bdf": "0x601",
"vbdf": "0x601"
}]
}
9 changes: 6 additions & 3 deletions platform/loongarch64/ls3a5000/configs/zone2-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"arch_config": {
"dummy": "0x1234"
},
"pci_config": {
"pci_config": [{
"ecam_base": "0xfe00000000",
"ecam_size": "0x20000000",
"io_base": "0x18408000",
Expand All @@ -111,7 +111,10 @@
"mem64_base": "0x60000000",
"mem64_size": "0x20000000",
"pci_mem64_base": "0x60000000"
},
}],
"num_pci_devs": 1,
"alloc_pci_devs": [1538]
"alloc_pci_devs": [{
"bdf": "0x602",
"vbdf": "0x602"
}]
}
9 changes: 6 additions & 3 deletions platform/loongarch64/ls3a5000/configs/zone3-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"arch_config": {
"dummy": "0x1234"
},
"pci_config": {
"pci_config": [{
"ecam_base": "0xfe00000000",
"ecam_size": "0x20000000",
"io_base": "0x18408000",
Expand All @@ -111,7 +111,10 @@
"mem64_base": "0x60000000",
"mem64_size": "0x20000000",
"pci_mem64_base": "0x60000000"
},
}],
"num_pci_devs": 1,
"alloc_pci_devs": [1539]
"alloc_pci_devs": [{
"bdf": "0x603",
"vbdf": "0x603"
}]
}
Loading
Loading