Skip to content

Commit

Permalink
DM:Support ARCH for AArch64
Browse files Browse the repository at this point in the history
The first BSP is `qemu-virt64-aarch64`

Signed-off-by: GuEe-GUI <[email protected]>
  • Loading branch information
GuEe-GUI committed Jun 11, 2024
1 parent 65158cc commit 119aef9
Show file tree
Hide file tree
Showing 55 changed files with 1,806 additions and 4,515 deletions.
134 changes: 99 additions & 35 deletions bsp/qemu-virt64-aarch64/.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#
# RT-Thread Kernel
#
CONFIG_RT_NAME_MAX=16
CONFIG_RT_NAME_MAX=24
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_SMART is not set
CONFIG_RT_USING_SMART=y
CONFIG_RT_USING_SMP=y
CONFIG_RT_CPUS_NR=4
CONFIG_RT_ALIGN_SIZE=8
Expand Down Expand Up @@ -106,11 +106,12 @@ CONFIG_RT_USING_HW_ATOMIC=y
CONFIG_ARCH_MM_MMU=y
CONFIG_ARCH_ARM=y
CONFIG_ARCH_ARM_MMU=y
CONFIG_KERNEL_VADDR_START=0xffff000000000000
CONFIG_ARCH_ARMV8=y
CONFIG_ARCH_ARMV8_EXTENSIONS=0
CONFIG_ARCH_SUPPORT_FPU=y
CONFIG_ARCH_TEXT_OFFSET=0x80000
CONFIG_ARCH_TEXT_OFFSET=0x200000
CONFIG_ARCH_RAM_OFFSET=0x40000000
CONFIG_ARCH_ASPACE_SIZE=0xffffffff
CONFIG_ARCH_SECONDARY_CPU_STACK_SIZE=4096
CONFIG_ARCH_HAVE_EFFICIENT_UNALIGNED_ACCESS=y

Expand All @@ -127,7 +128,7 @@ CONFIG_RT_USING_FINSH=y
CONFIG_FINSH_USING_MSH=y
CONFIG_FINSH_THREAD_NAME="tshell"
CONFIG_FINSH_THREAD_PRIORITY=20
CONFIG_FINSH_THREAD_STACK_SIZE=4096
CONFIG_FINSH_THREAD_STACK_SIZE=8192
CONFIG_FINSH_USING_HISTORY=y
CONFIG_FINSH_HISTORY_LINES=10
CONFIG_FINSH_USING_SYMTAB=y
Expand Down Expand Up @@ -174,15 +175,38 @@ CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512
CONFIG_RT_DFS_ELM_REENTRANT=y
CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
CONFIG_RT_USING_DFS_DEVFS=y
CONFIG_RT_USING_DFS_DIRECTFS=y
CONFIG_RT_USING_DFS_ROMFS=y
# CONFIG_RT_USING_DFS_CROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set
# CONFIG_RT_USING_DFS_TMPFS is not set
# CONFIG_RT_USING_FAL is not set
CONFIG_RT_USING_LWP=y
CONFIG_RT_LWP_MAX_NR=30
CONFIG_LWP_TASK_STACK_SIZE=16384
CONFIG_RT_CH_MSG_MAX_NR=1024
CONFIG_LWP_CONSOLE_INPUT_BUFFER_SIZE=1024
CONFIG_LWP_TID_MAX_NR=64
CONFIG_RT_LWP_SHM_MAX_NR=64
# CONFIG_LWP_UNIX98_PTY is not set

#
# Device Drivers
#
CONFIG_RT_USING_TTY=y
# CONFIG_RT_TTY_DEBUG is not set
# CONFIG_RT_USING_CPUTIME is not set
# CONFIG_RT_USING_DAC is not set
CONFIG_RT_USING_NULL=y
CONFIG_RT_USING_ZERO=y
CONFIG_RT_USING_RANDOM=y
# CONFIG_RT_USING_PM is not set
# CONFIG_RT_USING_SENSOR is not set
# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
CONFIG_RT_USING_DEV_BUS=y
# CONFIG_RT_USING_WIFI is not set
CONFIG_RT_USING_DEVICE_IPC=y
CONFIG_RT_UNAMED_PIPE_NUMBER=64
CONFIG_RT_USING_SYSTEM_WORKQUEUE=y
Expand All @@ -194,16 +218,49 @@ CONFIG_RT_USING_SERIAL_V1=y
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=256
# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_USING_HWTIMER is not set
CONFIG_RT_USING_CLK=y
# CONFIG_RT_USING_CPUTIME is not set
CONFIG_RT_USING_FIRMWARE=y
CONFIG_RT_FIRMWARE_PSCI=y
CONFIG_RT_FIRMWARE_QEMU_FW_CFG=y
CONFIG_RT_USING_HWTIMER=y
CONFIG_RT_HWTIMER_ARM_ARCH=y
# CONFIG_RT_USING_I2C is not set
CONFIG_RT_USING_OFW=y
# CONFIG_RT_USING_BUILTIN_FDT is not set
CONFIG_RT_FDT_EARLYCON_MSG_SIZE=128
CONFIG_RT_USING_OFW_DIRECTFS=y
CONFIG_RT_USING_OFW_BUS_RANGES_NUMBER=8
CONFIG_RT_USING_PCI=y
CONFIG_RT_PCI_MSI=y
CONFIG_RT_PCI_ENDPOINT=y
CONFIG_RT_PCI_SYS_64BIT=y
CONFIG_RT_PCI_CACHE_LINE_SIZE=8
# CONFIG_RT_PCI_LOCKLESS is not set

#
# PCI Device Drivers
#
CONFIG_RT_PCI_ECAM=y
CONFIG_RT_PCI_HOST_COMMON=y
CONFIG_RT_PCI_HOST_GENERIC=y
# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIC=y
CONFIG_MAX_HANDLERS=512
CONFIG_RT_PIC_ARM_GIC=y
CONFIG_RT_PIC_ARM_GIC_V2M=y
CONFIG_RT_PIC_ARM_GIC_V3=y
CONFIG_RT_PIC_ARM_GIC_V3_ITS=y
CONFIG_RT_PIC_ARM_GIC_MAX_NR=1
# CONFIG_RT_USING_PINCTRL is not set
CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
CONFIG_RT_PIN_PL061=y
CONFIG_RT_USING_NULL=y
CONFIG_RT_USING_ZERO=y
CONFIG_RT_USING_RANDOM=y

#
# Power Management (PM) Domains device drivers
#
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
Expand All @@ -212,21 +269,41 @@ CONFIG_RT_USING_FDT=y
CONFIG_RT_USING_FDTLIB=y
# CONFIG_FDT_USING_DEBUG is not set
CONFIG_RT_USING_RTC=y
# CONFIG_RT_USING_ALARM is not set
CONFIG_RT_USING_ALARM=y
# CONFIG_RT_USING_SOFT_RTC is not set
# CONFIG_RT_USING_SDIO is not set
CONFIG_RT_RTC_PL031=y
# CONFIG_RT_RTC_RK_TIMER is not set
CONFIG_RT_USING_SERIAL=y
CONFIG_RT_USING_SERIAL_V1=y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA=y
CONFIG_RT_SERIAL_RB_BUFSZ=256

#
# Serial Device Drivers
#
CONFIG_RT_SERIAL_PL011=y
# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_LCD is not set
CONFIG_RT_USING_LCD=y
CONFIG_RT_USING_VIDEO=y
# CONFIG_RT_USING_HWCRYPTO is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
CONFIG_RT_VIDEO_FB=y
# CONFIG_RT_USING_INPUT_CAPTURE is not set
CONFIG_RT_USING_DEV_BUS=y
# CONFIG_RT_USING_WIFI is not set
CONFIG_RT_USING_VIRTIO=y
CONFIG_RT_VIDEO_LOGO=y
CONFIG_RT_VIDEO_LOGO_FBDEV="fb0"
CONFIG_RT_VIDEO_LOGO_RENDERING_STAGE_DRIVER_EARLY=y
# CONFIG_RT_VIDEO_LOGO_RENDERING_STAGE_DRIVER is not set
# CONFIG_RT_VIDEO_LOGO_RENDERING_STAGE_DRIVER_LATER is not set
# CONFIG_RT_VIDEO_LOGO_RENDERING_STAGE_COMPONENT is not set
# CONFIG_RT_VIDEO_LOGO_RENDERING_STAGE_ENV is not set
# CONFIG_RT_VIDEO_LOGO_RENDERING_STAGE_APP is not set
CONFIG_RT_VIDEO_LOGO_RT_THREAD_CLUT224=y
# CONFIG_RT_VIDEO_LOGO_RT_THREAD_WHITE_CLUT224 is not set
# CONFIG_RT_USING_VIRTIO is not set
CONFIG_RT_USING_VIRTIO10=y
CONFIG_RT_USING_VIRTIO_MMIO_ALIGN=y
CONFIG_RT_USING_VIRTIO_BLK=y
Expand Down Expand Up @@ -262,7 +339,7 @@ CONFIG_RT_USING_POSIX_TERMIOS=y
# CONFIG_RT_USING_POSIX_MMAN is not set
CONFIG_RT_USING_POSIX_DELAY=y
CONFIG_RT_USING_POSIX_CLOCK=y
# CONFIG_RT_USING_POSIX_TIMER is not set
CONFIG_RT_USING_POSIX_TIMER=y
# CONFIG_RT_USING_PTHREADS is not set
# CONFIG_RT_USING_MODULE is not set

Expand Down Expand Up @@ -294,7 +371,12 @@ CONFIG_RT_USING_POSIX_PIPE_SIZE=512
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
# CONFIG_RT_USING_VAR_EXPORT is not set
CONFIG_RT_USING_CRASH_CORE=y
CONFIG_RT_USING_ADT=y
CONFIG_RT_USING_ADT_AVL=y
CONFIG_RT_USING_ADT_BITMAP=y
CONFIG_RT_USING_ADT_HASHMAP=y
CONFIG_RT_USING_ADT_REF=y
# CONFIG_RT_USING_RT_LINK is not set
# CONFIG_RT_USING_VBUS is not set

Expand Down Expand Up @@ -1053,21 +1135,3 @@ CONFIG_RT_USING_ADT=y
# Uncategorized
#
CONFIG_SOC_VIRT64_AARCH64=y

#
# AARCH64 qemu virt64 configs
#
CONFIG_BSP_SUPPORT_FPU=y
CONFIG_BSP_USING_UART=y
CONFIG_RT_USING_UART0=y
CONFIG_BSP_USING_RTC=y
# CONFIG_BSP_USING_ALARM is not set
CONFIG_BSP_USING_PIN=y
CONFIG_BSP_USING_VIRTIO_BLK=y
# CONFIG_BSP_USING_VIRTIO_NET is not set
CONFIG_BSP_USING_VIRTIO_CONSOLE=y
CONFIG_BSP_USING_VIRTIO_GPU=y
CONFIG_BSP_USING_VIRTIO_INPUT=y
CONFIG_BSP_USING_GIC=y
CONFIG_BSP_USING_GICV2=y
# CONFIG_BSP_USING_GICV3 is not set
1 change: 1 addition & 0 deletions bsp/qemu-virt64-aarch64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.qcow2
5 changes: 0 additions & 5 deletions bsp/qemu-virt64-aarch64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,4 @@ config SOC_VIRT64_AARCH64
select RT_USING_CACHE
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
select RT_USING_GIC
select BSP_USING_GIC
select ARCH_MM_MMU
default y

source "$BSP_DIR/drivers/Kconfig"
32 changes: 5 additions & 27 deletions bsp/qemu-virt64-aarch64/applications/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,6 @@
#include <console.h>
#endif

#include <virtio_console.h>

static int console_init()
{
rt_err_t status = RT_EOK;
rt_device_t device = rt_device_find("virtio-console0");

if (device != RT_NULL && rt_device_open(device, 0) == RT_EOK)
{
/* Create vport0p1 */
// status = rt_device_control(device, VIRTIO_DEVICE_CTRL_CONSOLE_PORT_CREATE, RT_NULL);
}

if (device != RT_NULL)
{
rt_device_close(device);
}

return status;
}
INIT_ENV_EXPORT(console_init);

#ifdef FINSH_USING_MSH

static int console(int argc, char **argv)
Expand All @@ -55,11 +33,11 @@ static int console(int argc, char **argv)

if (dev != RT_NULL)
{
#ifdef RT_USING_SMART
console_set_iodev(dev);
#else
rt_kprintf("TODO not supported\n");
#endif
#ifdef RT_USING_SMART
console_set_iodev(dev);
#else
rt_kprintf("TODO not supported\n");
#endif
}
}
#else
Expand Down
38 changes: 12 additions & 26 deletions bsp/qemu-virt64-aarch64/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,24 @@
* 2020/10/7 bernard the first version
*/

#include <stdio.h>
#include <rthw.h>
#include <rtthread.h>
#include "drivers/core/bus.h"

#ifdef RT_USING_FDT
#include "dtb_node.h"
#endif

struct rt_device timer_device = {
.name = "timer_virt64",
};

// static void timer_init(void)
// {
// rt_device_attach(&timer_device);
// }

int main(void)
int main(int argc, char** argv)
{
/* example: init timer device statically */
// timer_init();
const char *oem;

#ifdef RT_USING_SMART
oem = "Smart";
#else
oem = "Thread";
#endif

rt_uint8_t times = 0;
rt_ubase_t level = rt_hw_interrupt_disable();

printf("hello rt-thread\n");
rt_kprintf("Hi, this is RT-%s!!\n", oem);

/*test timer*/
while (times++ < 2)
{
rt_thread_mdelay(500);
printf("hello rt-thread\n");
}
rt_hw_interrupt_enable(level);

return 0;
}
30 changes: 0 additions & 30 deletions bsp/qemu-virt64-aarch64/applications/mnt.c

This file was deleted.

33 changes: 0 additions & 33 deletions bsp/qemu-virt64-aarch64/applications/pin.c

This file was deleted.

Loading

0 comments on commit 119aef9

Please sign in to comment.