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
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ pipeline {
name 'BID'
values(
'aarch64/imx8mp',
'aarch64/jeston-orin',
'aarch64/ok6254-c',
'aarch64/phytium-pi',
'aarch64/qemu-gicv2',
Expand Down
14 changes: 14 additions & 0 deletions kconfig/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ config ARCH_X86_64
endchoice
endmenu

menu "AArch64 options"
depends on ARCH_AARCH64

config AARCH64_UEFI_SUPPORT
bool "UEFI memory map virtualization"
default n

endmenu

menu "Interrupt controller"
depends on ARCH_AARCH64 || ARCH_RISCV64 || ARCH_LOONGARCH64

Expand Down Expand Up @@ -168,6 +177,11 @@ config LOONGSON_UART
bool "Loongson UART"
depends on ARCH_LOONGARCH64
default n

config SEQUENTIAL_OUTPUT
bool "Wait for UART before writing console output"
depends on ARCH_AARCH64 && (PL011 || UART_16550)
default n
endmenu

menu "PCIe"
Expand Down
2 changes: 2 additions & 0 deletions kconfig/cfg_map.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
[symbols]
CONFIG_IRQ_GICV2 = "irq_gicv2"
CONFIG_IRQ_GICV3 = "irq_gicv3"
CONFIG_AARCH64_UEFI_SUPPORT = "aarch64_uefi_support"
CONFIG_PL011 = "pl011"
CONFIG_IMX_UART = "imx_uart"
CONFIG_XUARTPS = "xuartps"
CONFIG_UART_16550 = "uart_16550"
CONFIG_UART16550A = "uart16550a"
CONFIG_LOONGSON_UART = "loongson_uart"
CONFIG_SEQUENTIAL_OUTPUT = "sequential_output"
CONFIG_PCI = "pci"
CONFIG_PCIE_ECAM = "ecam_pcie"
CONFIG_PCIE_DWC = "dwc_pcie"
Expand Down
9 changes: 6 additions & 3 deletions platform/aarch64/dayu200/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use crate::{
arch::{
mmu::MemoryType,
zone::{GicConfig, Gicv3Config, HvArchZoneConfig},
zone::{GicConfig, Gicv3Config, HvArchZoneConfig, UefiConfig},
},
config::*,
};
Expand All @@ -36,6 +36,9 @@ pub static BOARD_MPIDR_MAPPINGS: [u64; BOARD_NCPUS] = [
0x300, // cpu3
];

/// Early boot cache invalidate mask (per CPU): bit0->L1(D), bit1->L2, bit2->L3.
pub static BOARD_EARLY_CACHE_INVALIDATE_MASKS: [u64; BOARD_NCPUS] = [0b011; BOARD_NCPUS];

/// The physical memory layout of the board.
/// Each address should align to 2M (0x200000).
/// Addresses must be in ascending order.
Expand Down Expand Up @@ -104,8 +107,7 @@ pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 8] = [
];

pub const ROOT_ZONE_IRQS_BITMAP: &[BitmapWord] = &get_irqs_bitmap(&[
0x33, 0x38, 0x3b, 0x3d, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x4e, 0x85, 0x8b, 0x8d,
0x96,
0x33, 0x38, 0x3b, 0x3d, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x4e, 0x85, 0x8b, 0x8d, 0x96,
]);

pub const IRQ_WAKEUP_VIRTIO_DEVICE: usize = 32 + 0x6b;
Expand All @@ -120,6 +122,7 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gits_base: 0,
gits_size: 0,
}),
uefi_config: UefiConfig::NoUefi,
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
Expand Down
6 changes: 5 additions & 1 deletion platform/aarch64/imx8mp/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use crate::{
arch::{
mmu::MemoryType,
zone::{GicConfig, Gicv3Config, HvArchZoneConfig},
zone::{GicConfig, Gicv3Config, HvArchZoneConfig, UefiConfig},
},
config::*,
};
Expand All @@ -37,6 +37,9 @@ pub static BOARD_MPIDR_MAPPINGS: [u64; BOARD_NCPUS] = [
0x3, // cpu3
];

/// Early boot cache invalidate mask (per CPU): bit0->L1(D), bit1->L2, bit2->L3.
pub static BOARD_EARLY_CACHE_INVALIDATE_MASKS: [u64; BOARD_NCPUS] = [0b011; BOARD_NCPUS];

/// The physical memory layout of the board.
/// Each address should align to 2M (0x200000).
/// Addresses must be in ascending order.
Expand Down Expand Up @@ -137,6 +140,7 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gits_base: 0,
gits_size: 0,
}),
uefi_config: UefiConfig::NoUefi
};

pub const ROOT_PCI_CONFIG: &[HvPciConfig] = &[HvPciConfig {
Expand Down
138 changes: 138 additions & 0 deletions platform/aarch64/jeston-orin/board.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// Copyright (c) 2025 Syswonder
// hvisor is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
// FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
//
// Syswonder Website:
// https://www.syswonder.org
//
// Authors:
//
use crate::{
arch::{
mmu::MemoryType,
zone::{GicConfig, Gicv3Config, HvArchZoneConfig, Uefi, UefiConfig},
},
config::*,
};

pub const BOARD_NAME: &str = "jeston-orin";
pub const BOARD_NCPUS: usize = 6;
pub const BOARD_UART_BASE: u64 = 0xc280000;
pub static BOARD_EARLY_CACHE_INVALIDATE_MASKS: [u64; BOARD_NCPUS] = [0b111; BOARD_NCPUS];
#[rustfmt::skip]
pub static BOARD_MPIDR_MAPPINGS: [u64; BOARD_NCPUS] = [
0x0, // cpu0
0x100, // cpu1
0x200, // cpu2
0x300, // cpu3
0x10200, // cpu4
0x10300, // cpu5
];

/// The physical memory layout of the board.
/// Each address should align to 2M (0x200000).
/// Addresses must be in ascending order.
#[rustfmt::skip]
pub const BOARD_PHYSMEM_LIST: &[(u64, u64, MemoryType)] = &[
// ( start, end, type)
( 0x00000000, 0x080000000, MemoryType::Device),
( 0x80000000, 0x280000000, MemoryType::Normal),
(0x2000000000, 0x2500000000, MemoryType::Device),
(0x3000000000, 0x4000000000, MemoryType::Device)
];

pub const ROOT_ZONE_DTB_ADDR: u64 = 0xA0000000;
pub const ROOT_ZONE_KERNEL_ADDR: u64 = 0xA0400000;
pub const ROOT_ZONE_ENTRY: u64 = 0xA0400000;
pub const ROOT_ZONE_CPUS: u64 = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3);

pub const ROOT_ZONE_NAME: &str = "root-linux";

pub const ROOT_ZONE_MEMORY_REGIONS: &[HvConfigMemoryRegion] = &[
HvConfigMemoryRegion {
mem_type: MEM_TYPE_RAM,
physical_start: 0x90000000,
virtual_start: 0x90000000,
size: 0x2E000000, // 1G
}, // ram
HvConfigMemoryRegion {
mem_type: MEM_TYPE_RAM,
physical_start: 0xC2000000,
virtual_start: 0xC2000000,
size: 0x3E000000, // 1G
}, // ram
HvConfigMemoryRegion {
mem_type: MEM_TYPE_RAM,
physical_start: 0x100000000,
virtual_start: 0x100000000,
size: 0x100000000, // 1G
}, // ram
HvConfigMemoryRegion {
mem_type: MEM_TYPE_RAM,
physical_start: 0x260000000,
virtual_start: 0x260000000,
size: 0x10000000,
}, // ram - UEFI
HvConfigMemoryRegion {
mem_type: MEM_TYPE_IO,
physical_start: 0x00000000,
virtual_start: 0x00000000,
size: 0x0f400000,
}, // general
HvConfigMemoryRegion {
mem_type: MEM_TYPE_IO,
physical_start: 0x10000000,
virtual_start: 0x10000000,
size: 0x70000000,
}, // general
HvConfigMemoryRegion {
mem_type: MEM_TYPE_IO,
physical_start: 0x2000000000,
virtual_start: 0x2000000000,
size: 0x500000000,
}, // pcie
HvConfigMemoryRegion {
mem_type: MEM_TYPE_IO,
physical_start: 0x3000000000,
virtual_start: 0x3000000000,
size: 0x1000000000,
}, // pcie
];

pub const IRQ_WAKEUP_VIRTIO_DEVICE: usize = 32 + 0x20;

// serial-c - phy - pcie - phy - hsp - timer - hsp - phy - phy - memory-controller - external-memory-controller
// pcie - phy - phy
// bpmp-fabric
// gpu
// host1x
pub const ROOT_ZONE_IRQS_BITMAP: &[BitmapWord] = &get_irqs_bitmap(&[
146, 372, 83, 84, 373, 165, 166, 167, 168, 208, 152, 153, 154, 155, 156, 157, 158, 159, 374,
375, 255, 256, 64, 388, 389, 253, 254, 206, 99, 100, 102, 103, 480, 481, 482, 483, 484, 485,
486, 487,
]);

pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
is_aarch32: 0,
gic_config: GicConfig::Gicv3(Gicv3Config {
gicd_base: 0xf400000,
gicd_size: 0x10000,
gicr_base: 0xf440000,
gicr_size: 0x200000,
gits_base: 0x0,
gits_size: 0x0,
}),
uefi_config: UefiConfig::Uefi(Uefi {
memory_map_addr: 0xB0000000,
memory_map_size: 0x990,
sys_map_addr: 0xB1000000,
}),
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
7 changes: 7 additions & 0 deletions platform/aarch64/jeston-orin/cargo/config.template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[target.aarch64-unknown-none]
runner = "platform/__ARCH__/__BOARD__/test/runner.sh"
rustflags = [
"-Clink-arg=-Tplatform/__ARCH__/__BOARD__/linker.ld",
"-Ctarget-feature=+a72,+v8a,+strict-align,-neon,-fp-armv8",
"-Cforce-frame-pointers=yes",
]
8 changes: 8 additions & 0 deletions platform/aarch64/jeston-orin/image/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DTS_FILES := $(wildcard *.dts)
DTB_FILES := $(DTS_FILES:.dts=.dtb)

all: $(DTB_FILES)
%.dtb: %.dts
dtc -I dts -O dtb $< -o $@
clean:
rm -f $(DTB_FILES)
Loading
Loading