From 5ea61fca5ad8f90ce6059a6400b5eb13bb019997 Mon Sep 17 00:00:00 2001 From: yangjie Date: Mon, 26 Apr 2021 14:59:31 +0800 Subject: [PATCH] [bsp][realview-a8] delete realview-a8 bsp --- bsp/realview-a8/.gitignore | 26 -- bsp/realview-a8/README.md | 11 - bsp/realview-a8/SConscript | 14 - bsp/realview-a8/SConstruct | 44 --- bsp/realview-a8/applications/SConscript | 11 - bsp/realview-a8/applications/application.c | 28 -- bsp/realview-a8/applications/startup.c | 68 ----- bsp/realview-a8/boot.sh | 3 - bsp/realview-a8/drivers/SConscript | 13 - bsp/realview-a8/drivers/board.c | 99 ------- bsp/realview-a8/drivers/board.h | 28 -- bsp/realview-a8/drivers/realview.h | 324 --------------------- bsp/realview-a8/drivers/serial.c | 185 ------------ bsp/realview-a8/drivers/serial.h | 20 -- bsp/realview-a8/linux_vmm/.gitignore | 10 - bsp/realview-a8/linux_vmm/Makefile | 6 - bsp/realview-a8/linux_vmm/build.sh | 22 -- bsp/realview-a8/linux_vmm/vmm_linux.c | 257 ---------------- bsp/realview-a8/linux_vmm/vmm_linux.h | 8 - bsp/realview-a8/mk.sh | 19 -- bsp/realview-a8/qemu.sh | 1 - bsp/realview-a8/realview.lds | 91 ------ bsp/realview-a8/realview_vmm.lds.S | 140 --------- bsp/realview-a8/rtconfig.h | 153 ---------- bsp/realview-a8/rtconfig.py | 55 ---- bsp/realview-a8/rtt_api.h | 164 ----------- 26 files changed, 1800 deletions(-) delete mode 100644 bsp/realview-a8/.gitignore delete mode 100644 bsp/realview-a8/README.md delete mode 100644 bsp/realview-a8/SConscript delete mode 100644 bsp/realview-a8/SConstruct delete mode 100644 bsp/realview-a8/applications/SConscript delete mode 100644 bsp/realview-a8/applications/application.c delete mode 100644 bsp/realview-a8/applications/startup.c delete mode 100644 bsp/realview-a8/boot.sh delete mode 100644 bsp/realview-a8/drivers/SConscript delete mode 100644 bsp/realview-a8/drivers/board.c delete mode 100644 bsp/realview-a8/drivers/board.h delete mode 100644 bsp/realview-a8/drivers/realview.h delete mode 100644 bsp/realview-a8/drivers/serial.c delete mode 100644 bsp/realview-a8/drivers/serial.h delete mode 100644 bsp/realview-a8/linux_vmm/.gitignore delete mode 100644 bsp/realview-a8/linux_vmm/Makefile delete mode 100644 bsp/realview-a8/linux_vmm/build.sh delete mode 100644 bsp/realview-a8/linux_vmm/vmm_linux.c delete mode 100644 bsp/realview-a8/linux_vmm/vmm_linux.h delete mode 100644 bsp/realview-a8/mk.sh delete mode 100644 bsp/realview-a8/qemu.sh delete mode 100644 bsp/realview-a8/realview.lds delete mode 100644 bsp/realview-a8/realview_vmm.lds.S delete mode 100644 bsp/realview-a8/rtconfig.h delete mode 100644 bsp/realview-a8/rtconfig.py delete mode 100644 bsp/realview-a8/rtt_api.h diff --git a/bsp/realview-a8/.gitignore b/bsp/realview-a8/.gitignore deleted file mode 100644 index f0bbbc4965..0000000000 --- a/bsp/realview-a8/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# Object files -*.o -*.bin -*.pyc -*.map -*.elf - -# Libraries -*.lib -*.a - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app - -.scons* - -# directory -build/* diff --git a/bsp/realview-a8/README.md b/bsp/realview-a8/README.md deleted file mode 100644 index b9ee2d06d3..0000000000 --- a/bsp/realview-a8/README.md +++ /dev/null @@ -1,11 +0,0 @@ -VMM BSP on realview-pb-a8 - -This is a demo program that run RT-Thread VMM(Virtual Machine Module) on -the single core RealView-PB-A8. - -To compile it, you need buildroot and a linux 3.8.x source tree. You should -build the patched Linux kernel and builroot before building the VMM. This -directory has a "mk.sh" helper script to build both the RT-Thread, Linux kernel -module and the ramdisk. - -Linux console is serial0 and RT-Thread console is serial1. diff --git a/bsp/realview-a8/SConscript b/bsp/realview-a8/SConscript deleted file mode 100644 index fe0ae941ae..0000000000 --- a/bsp/realview-a8/SConscript +++ /dev/null @@ -1,14 +0,0 @@ -# for module compiling -import os -Import('RTT_ROOT') - -cwd = str(Dir('#')) -objs = [] -list = os.listdir(cwd) - -for d in list: - path = os.path.join(cwd, d) - if os.path.isfile(os.path.join(path, 'SConscript')): - objs = objs + SConscript(os.path.join(d, 'SConscript')) - -Return('objs') diff --git a/bsp/realview-a8/SConstruct b/bsp/realview-a8/SConstruct deleted file mode 100644 index 2ba0e9f457..0000000000 --- a/bsp/realview-a8/SConstruct +++ /dev/null @@ -1,44 +0,0 @@ -import os -import sys -import rtconfig - -if os.getenv('RTT_ROOT'): - RTT_ROOT = os.getenv('RTT_ROOT') -else: - RTT_ROOT = os.path.normpath(os.getcwd() + '/../..') - -sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')] -from building import * - -TARGET = 'rtthread-realview.' + rtconfig.TARGET_EXT - -DefaultEnvironment(tools=[]) -env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) -env.PrependENVPath('PATH', rtconfig.EXEC_PATH) -env['ASCOM'] = env['ASPPCOM'] - -Export('RTT_ROOT') -Export('rtconfig') - -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT) - -if GetDepend('RT_USING_VMM'): - if os.system('{cppcmd} -P -C -E -I. -D__ASSEMBLY__ {ldfile}.S -o {ldfile}'.format( - cppcmd = os.path.join(rtconfig.EXEC_PATH, 'arm-none-eabi-gcc'), - ldfile = rtconfig.LINK_SCRIPT)) != 0: - print('failed to generate linker script %s' % rtconfig.LINK_SCRIPT) - sys.exit(255) - # if the linker script changed, relink the target - Depends(TARGET, rtconfig.LINK_SCRIPT) -else: - # we should use none-vmm link script - link_flags = str(env['LINKFLAGS']) - env['LINKFLAGS'] = link_flags.replace('_vmm.lds', '.lds') - -# make a building -DoBuilding(TARGET, objs) diff --git a/bsp/realview-a8/applications/SConscript b/bsp/realview-a8/applications/SConscript deleted file mode 100644 index 01eb940dfb..0000000000 --- a/bsp/realview-a8/applications/SConscript +++ /dev/null @@ -1,11 +0,0 @@ -Import('RTT_ROOT') -Import('rtconfig') -from building import * - -cwd = os.path.join(str(Dir('#')), 'applications') -src = Glob('*.c') -CPPPATH = [cwd, str(Dir('#'))] - -group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/realview-a8/applications/application.c b/bsp/realview-a8/applications/application.c deleted file mode 100644 index 0b8f14b1db..0000000000 --- a/bsp/realview-a8/applications/application.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-11-20 Bernard the first version - */ - -#include - -void init_thread(void* parameter) -{ - rt_components_init(); -} - -int rt_application_init() -{ - rt_thread_t tid; - - tid = rt_thread_create("init", init_thread, RT_NULL, - 1024, RT_THREAD_PRIORITY_MAX/3, 10); - if (tid != RT_NULL) rt_thread_startup(tid); - - return 0; -} - diff --git a/bsp/realview-a8/applications/startup.c b/bsp/realview-a8/applications/startup.c deleted file mode 100644 index 2c37bb4726..0000000000 --- a/bsp/realview-a8/applications/startup.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-12-05 Bernard the first version - */ - -#include -#include - -#include - -extern int rt_application_init(void); -extern void rt_hw_board_init(void); - -/** - * This function will startup RT-Thread RTOS. - */ -void rtthread_startup(void) -{ - /* initialzie hardware interrupt */ - rt_hw_interrupt_init(); - - /* initialize board */ - rt_hw_board_init(); - - /* show RT-Thread version */ - rt_show_version(); - - /* initialize memory system */ -#ifdef RT_USING_HEAP - rt_system_heap_init(HEAP_BEGIN, HEAP_END); -#endif - - /* initialize scheduler system */ - rt_system_scheduler_init(); - - /* initialize timer and soft timer thread */ - rt_system_timer_init(); - rt_system_timer_thread_init(); - - /* initialize application */ - rt_application_init(); - - /* initialize idle thread */ - rt_thread_idle_init(); - - /* start scheduler */ - rt_system_scheduler_start(); - - /* never reach here */ - return ; -} - -int main(void) -{ - /* disable interrupt first */ - rt_hw_interrupt_disable(); - - /* invoke rtthread_startup */ - rtthread_startup(); - - return 0; -} - diff --git a/bsp/realview-a8/boot.sh b/bsp/realview-a8/boot.sh deleted file mode 100644 index eaafa6524c..0000000000 --- a/bsp/realview-a8/boot.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -e -scons -j12 -qemu-system-arm -M realview-pb-a8 -kernel rtthread-realview.elf -serial vc -serial stdio diff --git a/bsp/realview-a8/drivers/SConscript b/bsp/realview-a8/drivers/SConscript deleted file mode 100644 index 9987f53e4b..0000000000 --- a/bsp/realview-a8/drivers/SConscript +++ /dev/null @@ -1,13 +0,0 @@ -import copy -Import('RTT_ROOT') -Import('rtconfig') -from building import * - -cwd = GetCurrentDir() -src = Glob('*.c') - -CPPPATH = [cwd] - -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/realview-a8/drivers/board.c b/bsp/realview-a8/drivers/board.c deleted file mode 100644 index 013603b684..0000000000 --- a/bsp/realview-a8/drivers/board.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-11-20 Bernard the first version - */ - -#include -#include - -#include "board.h" - -#define TIMER_LOAD(hw_base) __REG32(hw_base + 0x00) -#define TIMER_VALUE(hw_base) __REG32(hw_base + 0x04) -#define TIMER_CTRL(hw_base) __REG32(hw_base + 0x08) -#define TIMER_CTRL_ONESHOT (1 << 0) -#define TIMER_CTRL_32BIT (1 << 1) -#define TIMER_CTRL_DIV1 (0 << 2) -#define TIMER_CTRL_DIV16 (1 << 2) -#define TIMER_CTRL_DIV256 (2 << 2) -#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable (versatile only) */ -#define TIMER_CTRL_PERIODIC (1 << 6) -#define TIMER_CTRL_ENABLE (1 << 7) - -#define TIMER_INTCLR(hw_base) __REG32(hw_base + 0x0c) -#define TIMER_RIS(hw_base) __REG32(hw_base + 0x10) -#define TIMER_MIS(hw_base) __REG32(hw_base + 0x14) -#define TIMER_BGLOAD(hw_base) __REG32(hw_base + 0x18) - -#define SYS_CTRL __REG32(REALVIEW_SCTL_BASE) - -#ifdef RT_USING_VMM -#include -static rt_uint32_t timer_hw_base = 0; -#define TIMER_HW_BASE (timer_hw_base) -#else -#define TIMER_HW_BASE REALVIEW_TIMER2_3_BASE -#endif - -void rt_hw_timer_ack(void) -{ - /* clear interrupt */ - TIMER_INTCLR(TIMER_HW_BASE) = 0x01; -} - -static void rt_hw_timer_isr(int vector, void *param) -{ - rt_tick_increase(); - - rt_hw_timer_ack(); -} - -int rt_hw_timer_init(void) -{ - rt_uint32_t val; - -#ifdef RT_USING_VMM - { - rt_uint32_t sys_ctrl; - sys_ctrl = vmm_find_iomap("SYS_CTRL"); - __REG32(sys_ctrl) |= REALVIEW_REFCLK; - } - - timer_hw_base = vmm_find_iomap("TIMER"); -#else - SYS_CTRL |= REALVIEW_REFCLK; -#endif - - /* Setup Timer0 for generating irq */ - val = TIMER_CTRL(TIMER_HW_BASE); - val &= ~TIMER_CTRL_ENABLE; - val |= (TIMER_CTRL_32BIT | TIMER_CTRL_PERIODIC | TIMER_CTRL_IE); - TIMER_CTRL(TIMER_HW_BASE) = val; - - TIMER_LOAD(TIMER_HW_BASE) = 1000; - - /* enable timer */ - TIMER_CTRL(TIMER_HW_BASE) |= TIMER_CTRL_ENABLE; - - rt_hw_interrupt_install(IRQ_PBA8_TIMER2_3, rt_hw_timer_isr, RT_NULL, "tick"); - rt_hw_interrupt_umask(IRQ_PBA8_TIMER2_3); - - return 0; -} -INIT_BOARD_EXPORT(rt_hw_timer_init); - -/** - * This function will initialize beaglebone board - */ -void rt_hw_board_init(void) -{ - rt_components_board_init(); - rt_console_set_device(RT_CONSOLE_DEVICE_NAME); -} - -/*@}*/ diff --git a/bsp/realview-a8/drivers/board.h b/bsp/realview-a8/drivers/board.h deleted file mode 100644 index f1d30314ba..0000000000 --- a/bsp/realview-a8/drivers/board.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2013-07-06 Bernard the first version - */ - -#ifndef __BOARD_H__ -#define __BOARD_H__ - -#include - -#if defined(__CC_ARM) -extern int Image$$RW_IRAM1$$ZI$$Limit; -#define HEAP_BEGIN ((void*)&Image$$RW_IRAM1$$ZI$$Limit) -#elif defined(__GNUC__) -extern int __bss_end; -#define HEAP_BEGIN ((void*)&__bss_end) -#endif - -#define HEAP_END (void*)(0x70000000 + 8 * 1024 * 1024) - -void rt_hw_board_init(void); - -#endif diff --git a/bsp/realview-a8/drivers/realview.h b/bsp/realview-a8/drivers/realview.h deleted file mode 100644 index 159f2244ea..0000000000 --- a/bsp/realview-a8/drivers/realview.h +++ /dev/null @@ -1,324 +0,0 @@ -#ifndef __AM33XX_H__ -#define __AM33XX_H__ - -#define __REG32(x) (*((volatile unsigned int *)(x))) -#define __REG16(x) (*((volatile unsigned short *)(x))) - -/* - * Peripheral addresses - */ -#define REALVIEW_UART0_BASE 0x10009000 /* UART 0 */ -#define REALVIEW_UART1_BASE 0x1000A000 /* UART 1 */ -#define REALVIEW_UART2_BASE 0x1000B000 /* UART 2 */ -#define REALVIEW_UART3_BASE 0x1000C000 /* UART 3 */ -#define REALVIEW_SSP_BASE 0x1000D000 /* Synchronous Serial Port */ -#define REALVIEW_WATCHDOG0_BASE 0x1000F000 /* Watchdog 0 */ -#define REALVIEW_WATCHDOG_BASE 0x10010000 /* watchdog interface */ -#define REALVIEW_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */ -#define REALVIEW_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */ -#define REALVIEW_GPIO0_BASE 0x10013000 /* GPIO port 0 */ -#define REALVIEW_RTC_BASE 0x10017000 /* Real Time Clock */ -#define REALVIEW_TIMER4_5_BASE 0x10018000 /* Timer 4/5 */ -#define REALVIEW_TIMER6_7_BASE 0x10019000 /* Timer 6/7 */ -#define REALVIEW_SCTL_BASE 0x1001A000 /* System Controller */ -#define REALVIEW_CLCD_BASE 0x10020000 /* CLCD */ -#define REALVIEW_ONB_SRAM_BASE 0x10060000 /* On-board SRAM */ -#define REALVIEW_DMC_BASE 0x100E0000 /* DMC configuration */ -#define REALVIEW_SMC_BASE 0x100E1000 /* SMC configuration */ -#define REALVIEW_CAN_BASE 0x100E2000 /* CAN bus */ -#define REALVIEW_GIC_CPU_BASE 0x1E000000 /* Generic interrupt controller CPU interface */ -#define REALVIEW_FLASH0_BASE 0x40000000 -#define REALVIEW_FLASH0_SIZE SZ_64M -#define REALVIEW_FLASH1_BASE 0x44000000 -#define REALVIEW_FLASH1_SIZE SZ_64M -#define REALVIEW_ETH_BASE 0x4E000000 /* Ethernet */ -#define REALVIEW_USB_BASE 0x4F000000 /* USB */ -#define REALVIEW_GIC_DIST_BASE 0x1E001000 /* Generic interrupt controller distributor */ -#define REALVIEW_LT_BASE 0xC0000000 /* Logic Tile expansion */ -#define REALVIEW_SDRAM6_BASE 0x70000000 /* SDRAM bank 6 256MB */ -#define REALVIEW_SDRAM7_BASE 0x80000000 /* SDRAM bank 7 256MB */ - -#define REALVIEW_SYS_PLD_CTRL1 0x74 - -/* - * PCI regions - */ -#define REALVIEW_PCI_BASE 0x90040000 /* PCI-X Unit base */ -#define REALVIEW_PCI_IO_BASE 0x90050000 /* IO Region on AHB */ -#define REALVIEW_PCI_MEM_BASE 0xA0000000 /* MEM Region on AHB */ - -#define REALVIEW_PCI_BASE_SIZE 0x10000 /* 16 Kb */ -#define REALVIEW_PCI_IO_SIZE 0x1000 /* 4 Kb */ -#define REALVIEW_PCI_MEM_SIZE 0x20000000 /* 512 MB */ - -/* - * Memory definitions - */ -#define REALVIEW_BOOT_ROM_LO 0x30000000 /* DoC Base (64Mb)... */ -#define REALVIEW_BOOT_ROM_HI 0x30000000 -#define REALVIEW_BOOT_ROM_BASE REALVIEW_BOOT_ROM_HI /* Normal position */ -#define REALVIEW_BOOT_ROM_SIZE SZ_64M - -#define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */ -#define REALVIEW_SSRAM_SIZE SZ_2M - -/* - * SDRAM - */ -#define REALVIEW_SDRAM_BASE 0x00000000 - -/* - * Logic expansion modules - * - */ -#define IRQ_PBA8_GIC_START 32 - -/* - * PB-A8 on-board gic irq sources - */ -#define IRQ_PBA8_WATCHDOG (IRQ_PBA8_GIC_START + 0) /* Watchdog timer */ -#define IRQ_PBA8_SOFT (IRQ_PBA8_GIC_START + 1) /* Software interrupt */ -#define IRQ_PBA8_COMMRx (IRQ_PBA8_GIC_START + 2) /* Debug Comm Rx interrupt */ -#define IRQ_PBA8_COMMTx (IRQ_PBA8_GIC_START + 3) /* Debug Comm Tx interrupt */ -#define IRQ_PBA8_TIMER0_1 (IRQ_PBA8_GIC_START + 4) /* Timer 0/1 (default timer) */ -#define IRQ_PBA8_TIMER2_3 (IRQ_PBA8_GIC_START + 5) /* Timer 2/3 */ -#define IRQ_PBA8_GPIO0 (IRQ_PBA8_GIC_START + 6) /* GPIO 0 */ -#define IRQ_PBA8_GPIO1 (IRQ_PBA8_GIC_START + 7) /* GPIO 1 */ -#define IRQ_PBA8_GPIO2 (IRQ_PBA8_GIC_START + 8) /* GPIO 2 */ -/* 9 reserved */ -#define IRQ_PBA8_RTC (IRQ_PBA8_GIC_START + 10) /* Real Time Clock */ -#define IRQ_PBA8_SSP (IRQ_PBA8_GIC_START + 11) /* Synchronous Serial Port */ -#define IRQ_PBA8_UART0 (IRQ_PBA8_GIC_START + 12) /* UART 0 on development chip */ -#define IRQ_PBA8_UART1 (IRQ_PBA8_GIC_START + 13) /* UART 1 on development chip */ -#define IRQ_PBA8_UART2 (IRQ_PBA8_GIC_START + 14) /* UART 2 on development chip */ -#define IRQ_PBA8_UART3 (IRQ_PBA8_GIC_START + 15) /* UART 3 on development chip */ -#define IRQ_PBA8_SCI (IRQ_PBA8_GIC_START + 16) /* Smart Card Interface */ -#define IRQ_PBA8_MMCI0A (IRQ_PBA8_GIC_START + 17) /* Multimedia Card 0A */ -#define IRQ_PBA8_MMCI0B (IRQ_PBA8_GIC_START + 18) /* Multimedia Card 0B */ -#define IRQ_PBA8_AACI (IRQ_PBA8_GIC_START + 19) /* Audio Codec */ -#define IRQ_PBA8_KMI0 (IRQ_PBA8_GIC_START + 20) /* Keyboard/Mouse port 0 */ -#define IRQ_PBA8_KMI1 (IRQ_PBA8_GIC_START + 21) /* Keyboard/Mouse port 1 */ -#define IRQ_PBA8_CHARLCD (IRQ_PBA8_GIC_START + 22) /* Character LCD */ -#define IRQ_PBA8_CLCD (IRQ_PBA8_GIC_START + 23) /* CLCD controller */ -#define IRQ_PBA8_DMAC (IRQ_PBA8_GIC_START + 24) /* DMA controller */ -#define IRQ_PBA8_PWRFAIL (IRQ_PBA8_GIC_START + 25) /* Power failure */ -#define IRQ_PBA8_PISMO (IRQ_PBA8_GIC_START + 26) /* PISMO interface */ -#define IRQ_PBA8_DoC (IRQ_PBA8_GIC_START + 27) /* Disk on Chip memory controller */ -#define IRQ_PBA8_ETH (IRQ_PBA8_GIC_START + 28) /* Ethernet controller */ -#define IRQ_PBA8_USB (IRQ_PBA8_GIC_START + 29) /* USB controller */ -#define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */ -#define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */ - -#define IRQ_PBA8_PMU (IRQ_PBA8_GIC_START + 47) /* Cortex-A8 PMU */ - -/* ... */ -#define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50) -#define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51) -#define IRQ_PBA8_PCI2 (IRQ_PBA8_GIC_START + 52) -#define IRQ_PBA8_PCI3 (IRQ_PBA8_GIC_START + 53) - -#define IRQ_PBA8_SMC -1 -#define IRQ_PBA8_SCTL -1 - -#define NR_GIC_PBA8 1 - -/* - * Only define NR_IRQS if less than NR_IRQS_PBA8 - */ -#define NR_IRQS_PBA8 (IRQ_PBA8_GIC_START + 64) - -/* ------------------------------------------------------------------------ - * RealView Registers - * ------------------------------------------------------------------------ - * - */ -#define REALVIEW_SYS_ID_OFFSET 0x00 -#define REALVIEW_SYS_SW_OFFSET 0x04 -#define REALVIEW_SYS_LED_OFFSET 0x08 -#define REALVIEW_SYS_OSC0_OFFSET 0x0C - -#define REALVIEW_SYS_OSC1_OFFSET 0x10 -#define REALVIEW_SYS_OSC2_OFFSET 0x14 -#define REALVIEW_SYS_OSC3_OFFSET 0x18 -#define REALVIEW_SYS_OSC4_OFFSET 0x1C /* OSC1 for RealView/AB */ - -#define REALVIEW_SYS_LOCK_OFFSET 0x20 -#define REALVIEW_SYS_100HZ_OFFSET 0x24 -#define REALVIEW_SYS_CFGDATA1_OFFSET 0x28 -#define REALVIEW_SYS_CFGDATA2_OFFSET 0x2C -#define REALVIEW_SYS_FLAGS_OFFSET 0x30 -#define REALVIEW_SYS_FLAGSSET_OFFSET 0x30 -#define REALVIEW_SYS_FLAGSCLR_OFFSET 0x34 -#define REALVIEW_SYS_NVFLAGS_OFFSET 0x38 -#define REALVIEW_SYS_NVFLAGSSET_OFFSET 0x38 -#define REALVIEW_SYS_NVFLAGSCLR_OFFSET 0x3C -#define REALVIEW_SYS_RESETCTL_OFFSET 0x40 -#define REALVIEW_SYS_PCICTL_OFFSET 0x44 -#define REALVIEW_SYS_MCI_OFFSET 0x48 -#define REALVIEW_SYS_FLASH_OFFSET 0x4C -#define REALVIEW_SYS_CLCD_OFFSET 0x50 -#define REALVIEW_SYS_CLCDSER_OFFSET 0x54 -#define REALVIEW_SYS_BOOTCS_OFFSET 0x58 -#define REALVIEW_SYS_24MHz_OFFSET 0x5C -#define REALVIEW_SYS_MISC_OFFSET 0x60 -#define REALVIEW_SYS_IOSEL_OFFSET 0x70 -#define REALVIEW_SYS_PROCID_OFFSET 0x84 -#define REALVIEW_SYS_TEST_OSC0_OFFSET 0xC0 -#define REALVIEW_SYS_TEST_OSC1_OFFSET 0xC4 -#define REALVIEW_SYS_TEST_OSC2_OFFSET 0xC8 -#define REALVIEW_SYS_TEST_OSC3_OFFSET 0xCC -#define REALVIEW_SYS_TEST_OSC4_OFFSET 0xD0 - -#define REALVIEW_SYS_BASE 0x10000000 -#define REALVIEW_SYS_ID (REALVIEW_SYS_BASE + REALVIEW_SYS_ID_OFFSET) -#define REALVIEW_SYS_SW (REALVIEW_SYS_BASE + REALVIEW_SYS_SW_OFFSET) -#define REALVIEW_SYS_LED (REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET) -#define REALVIEW_SYS_OSC0 (REALVIEW_SYS_BASE + REALVIEW_SYS_OSC0_OFFSET) -#define REALVIEW_SYS_OSC1 (REALVIEW_SYS_BASE + REALVIEW_SYS_OSC1_OFFSET) - -#define REALVIEW_SYS_LOCK (REALVIEW_SYS_BASE + REALVIEW_SYS_LOCK_OFFSET) -#define REALVIEW_SYS_100HZ (REALVIEW_SYS_BASE + REALVIEW_SYS_100HZ_OFFSET) -#define REALVIEW_SYS_CFGDATA1 (REALVIEW_SYS_BASE + REALVIEW_SYS_CFGDATA1_OFFSET) -#define REALVIEW_SYS_CFGDATA2 (REALVIEW_SYS_BASE + REALVIEW_SYS_CFGDATA2_OFFSET) -#define REALVIEW_SYS_FLAGS (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGS_OFFSET) -#define REALVIEW_SYS_FLAGSSET (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGSSET_OFFSET) -#define REALVIEW_SYS_FLAGSCLR (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGSCLR_OFFSET) -#define REALVIEW_SYS_NVFLAGS (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGS_OFFSET) -#define REALVIEW_SYS_NVFLAGSSET (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGSSET_OFFSET) -#define REALVIEW_SYS_NVFLAGSCLR (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGSCLR_OFFSET) -#define REALVIEW_SYS_RESETCTL (REALVIEW_SYS_BASE + REALVIEW_SYS_RESETCTL_OFFSET) -#define REALVIEW_SYS_PCICTL (REALVIEW_SYS_BASE + REALVIEW_SYS_PCICTL_OFFSET) -#define REALVIEW_SYS_MCI (REALVIEW_SYS_BASE + REALVIEW_SYS_MCI_OFFSET) -#define REALVIEW_SYS_FLASH (REALVIEW_SYS_BASE + REALVIEW_SYS_FLASH_OFFSET) -#define REALVIEW_SYS_CLCD (REALVIEW_SYS_BASE + REALVIEW_SYS_CLCD_OFFSET) -#define REALVIEW_SYS_CLCDSER (REALVIEW_SYS_BASE + REALVIEW_SYS_CLCDSER_OFFSET) -#define REALVIEW_SYS_BOOTCS (REALVIEW_SYS_BASE + REALVIEW_SYS_BOOTCS_OFFSET) -#define REALVIEW_SYS_24MHz (REALVIEW_SYS_BASE + REALVIEW_SYS_24MHz_OFFSET) -#define REALVIEW_SYS_MISC (REALVIEW_SYS_BASE + REALVIEW_SYS_MISC_OFFSET) -#define REALVIEW_SYS_IOSEL (REALVIEW_SYS_BASE + REALVIEW_SYS_IOSEL_OFFSET) -#define REALVIEW_SYS_PROCID (REALVIEW_SYS_BASE + REALVIEW_SYS_PROCID_OFFSET) -#define REALVIEW_SYS_TEST_OSC0 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC0_OFFSET) -#define REALVIEW_SYS_TEST_OSC1 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC1_OFFSET) -#define REALVIEW_SYS_TEST_OSC2 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC2_OFFSET) -#define REALVIEW_SYS_TEST_OSC3 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC3_OFFSET) -#define REALVIEW_SYS_TEST_OSC4 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC4_OFFSET) - -#define REALVIEW_SYS_CTRL_LED (1 << 0) - -/* ------------------------------------------------------------------------ - * RealView control registers - * ------------------------------------------------------------------------ - */ - -/* - * REALVIEW_IDFIELD - * - * 31:24 = manufacturer (0x41 = ARM) - * 23:16 = architecture (0x08 = AHB system bus, ASB processor bus) - * 15:12 = FPGA (0x3 = XVC600 or XVC600E) - * 11:4 = build value - * 3:0 = revision number (0x1 = rev B (AHB)) - */ - -/* - * REALVIEW_SYS_LOCK - * control access to SYS_OSCx, SYS_CFGDATAx, SYS_RESETCTL, - * SYS_CLD, SYS_BOOTCS - */ -#define REALVIEW_SYS_LOCK_LOCKED (1 << 16) -#define REALVIEW_SYS_LOCKVAL 0xA05F -#define REALVIEW_SYS_LOCKVAL_MASK 0xFFFF /* write 0xA05F to enable write access */ - -/* - * REALVIEW_SYS_FLASH - */ -#define REALVIEW_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */ - -/* - * REALVIEW_INTREG - * - used to acknowledge and control MMCI and UART interrupts - */ -#define REALVIEW_INTREG_WPROT 0x00 /* MMC protection status (no interrupt generated) */ -#define REALVIEW_INTREG_RI0 0x01 /* Ring indicator UART0 is asserted, */ -#define REALVIEW_INTREG_CARDIN 0x08 /* MMCI card in detect */ -/* write 1 to acknowledge and clear */ -#define REALVIEW_INTREG_RI1 0x02 /* Ring indicator UART1 is asserted, */ -#define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */ - -/* - * LED settings, bits [7:0] - */ -#define REALVIEW_SYS_LED0 (1 << 0) -#define REALVIEW_SYS_LED1 (1 << 1) -#define REALVIEW_SYS_LED2 (1 << 2) -#define REALVIEW_SYS_LED3 (1 << 3) -#define REALVIEW_SYS_LED4 (1 << 4) -#define REALVIEW_SYS_LED5 (1 << 5) -#define REALVIEW_SYS_LED6 (1 << 6) -#define REALVIEW_SYS_LED7 (1 << 7) - -#define ALL_LEDS 0xFF - -#define LED_BANK REALVIEW_SYS_LED - -/* - * Control registers - */ -#define REALVIEW_IDFIELD_OFFSET 0x0 /* RealView build information */ -#define REALVIEW_FLASHPROG_OFFSET 0x4 /* Flash devices */ -#define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ -#define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ - -/* - * Clean base - dummy - * - */ -#define CLEAN_BASE REALVIEW_BOOT_ROM_HI - -/* - * System controller bit assignment - */ -#define REALVIEW_REFCLK 0 -#define REALVIEW_TIMCLK 1 - -#define REALVIEW_TIMER1_EnSel 15 -#define REALVIEW_TIMER2_EnSel 17 -#define REALVIEW_TIMER3_EnSel 19 -#define REALVIEW_TIMER4_EnSel 21 - -/* - *struct rt_hw_register - *{ - * unsigned long r0; - * unsigned long r1; - * unsigned long r2; - * unsigned long r3; - * unsigned long r4; - * unsigned long r5; - * unsigned long r6; - * unsigned long r7; - * unsigned long r8; - * unsigned long r9; - * unsigned long r10; - * unsigned long fp; - * unsigned long ip; - * unsigned long sp; - * unsigned long lr; - * unsigned long pc; - * unsigned long cpsr; - * unsigned long ORIG_r0; - *}; - */ - -#include - -/* Interrupt Control Interface */ -#define ARM_GIC_CPU_BASE 0x1E000000 - -/* number of interrupts on board */ -#define ARM_GIC_NR_IRQS 96 -/* only one GIC available */ -#define ARM_GIC_MAX_NR 1 - -#endif - diff --git a/bsp/realview-a8/drivers/serial.c b/bsp/realview-a8/drivers/serial.c deleted file mode 100644 index 75fca59401..0000000000 --- a/bsp/realview-a8/drivers/serial.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2013-03-30 Bernard the first verion - */ - -#include -#include - -#include "serial.h" -#ifdef RT_USING_VMM -#include -#endif - -struct hw_uart_device -{ - rt_uint32_t hw_base; - rt_uint32_t irqno; -}; - -#define UART_DR(base) __REG32(base + 0x00) -#define UART_FR(base) __REG32(base + 0x18) -#define UART_CR(base) __REG32(base + 0x30) -#define UART_IMSC(base) __REG32(base + 0x38) -#define UART_ICR(base) __REG32(base + 0x44) - -#define UARTFR_RXFE 0x10 -#define UARTFR_TXFF 0x20 -#define UARTIMSC_RXIM 0x10 -#define UARTIMSC_TXIM 0x20 -#define UARTICR_RXIC 0x10 -#define UARTICR_TXIC 0x20 - -static void rt_hw_uart_isr(int irqno, void *param) -{ - struct rt_serial_device *serial = (struct rt_serial_device *)param; - - rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); -} - -static rt_err_t uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg) -{ - return RT_EOK; -} - -static rt_err_t uart_control(struct rt_serial_device *serial, int cmd, void *arg) -{ - struct hw_uart_device *uart; - - RT_ASSERT(serial != RT_NULL); - uart = (struct hw_uart_device *)serial->parent.user_data; - - switch (cmd) - { - case RT_DEVICE_CTRL_CLR_INT: - /* disable rx irq */ - UART_IMSC(uart->hw_base) &= ~UARTIMSC_RXIM; - break; - - case RT_DEVICE_CTRL_SET_INT: - /* enable rx irq */ - UART_IMSC(uart->hw_base) |= UARTIMSC_RXIM; - rt_hw_interrupt_install(uart->irqno, rt_hw_uart_isr, serial, "uart"); - rt_hw_interrupt_umask(uart->irqno); - break; - } - - return RT_EOK; -} - -static int uart_putc(struct rt_serial_device *serial, char c) -{ - struct hw_uart_device *uart; - - RT_ASSERT(serial != RT_NULL); - uart = (struct hw_uart_device *)serial->parent.user_data; - - while (UART_FR(uart->hw_base) & UARTFR_TXFF); - UART_DR(uart->hw_base) = c; - - return 1; -} - -static int uart_getc(struct rt_serial_device *serial) -{ - int ch; - struct hw_uart_device *uart; - - RT_ASSERT(serial != RT_NULL); - uart = (struct hw_uart_device *)serial->parent.user_data; - - ch = -1; - if (!(UART_FR(uart->hw_base) & UARTFR_RXFE)) - { - ch = UART_DR(uart->hw_base) & 0xff; - } - - return ch; -} - -static const struct rt_uart_ops _uart_ops = -{ - uart_configure, - uart_control, - uart_putc, - uart_getc, -}; - -#ifdef RT_USING_UART0 -/* UART device driver structure */ -static struct hw_uart_device _uart0_device = -{ - REALVIEW_UART0_BASE, - IRQ_PBA8_UART0, -}; -static struct rt_serial_device _serial0; -#endif - -#ifdef RT_USING_UART1 -/* UART1 device driver structure */ -static struct hw_uart_device _uart1_device = -{ - REALVIEW_UART1_BASE, - IRQ_PBA8_UART1, -}; -static struct rt_serial_device _serial1; -#endif - -int uart_isr_test(void) -{ - return uart_getc(&_serial1); -} - -int rt_hw_uart_init(void) -{ - struct hw_uart_device *uart; - struct serial_configure config; - - config.baud_rate = BAUD_RATE_115200; - config.bit_order = BIT_ORDER_LSB; - config.data_bits = DATA_BITS_8; - config.parity = PARITY_NONE; - config.stop_bits = STOP_BITS_1; - config.invert = NRZ_NORMAL; - config.bufsz = RT_SERIAL_RB_BUFSZ; - -#ifdef RT_USING_UART0 - uart = &_uart0_device; -#ifdef RT_USING_VMM - uart->hw_base = vmm_find_iomap("UART0"); -#endif - - _serial0.ops = &_uart_ops; - _serial0.config = config; - - /* register UART1 device */ - rt_hw_serial_register(&_serial0, "uart0", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX, - uart); - /* enable Rx and Tx of UART */ - UART_CR(uart->hw_base) = (1 << 0) | (1 << 8) | (1 << 9); -#endif - -#ifdef RT_USING_UART1 - uart = &_uart1_device; -#ifdef RT_USING_VMM - uart->hw_base = vmm_find_iomap("UART1"); -#endif - _serial1.ops = &_uart_ops; - _serial1.config = config; - - /* register UART1 device */ - rt_hw_serial_register(&_serial1, "uart1", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX, uart); - /* enable Rx and Tx of UART */ - UART_CR(uart->hw_base) = (1 << 0) | (1 << 8) | (1 << 9); -#endif - - return 0; -} -INIT_BOARD_EXPORT(rt_hw_uart_init); diff --git a/bsp/realview-a8/drivers/serial.h b/bsp/realview-a8/drivers/serial.h deleted file mode 100644 index dceea68d1f..0000000000 --- a/bsp/realview-a8/drivers/serial.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2013-03-30 Bernard the first verion - */ - -#ifndef __UART_H__ -#define __UART_H__ - -#include - -int rt_hw_uart_init(void); - -#endif - - diff --git a/bsp/realview-a8/linux_vmm/.gitignore b/bsp/realview-a8/linux_vmm/.gitignore deleted file mode 100644 index f508c5d65e..0000000000 --- a/bsp/realview-a8/linux_vmm/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -*.o -*.o.cmd -*.ko -*.ko.cmd -*.mod.c - -Module.symvers -modules.order - -.tmp_versions/ diff --git a/bsp/realview-a8/linux_vmm/Makefile b/bsp/realview-a8/linux_vmm/Makefile deleted file mode 100644 index 9520dce92f..0000000000 --- a/bsp/realview-a8/linux_vmm/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -ccflags-y := -I$(VMM_HDR_DIR) - -obj-m += rtvmm.o - -rtvmm-objs := vmm_linux.o - diff --git a/bsp/realview-a8/linux_vmm/build.sh b/bsp/realview-a8/linux_vmm/build.sh deleted file mode 100644 index f385a17f11..0000000000 --- a/bsp/realview-a8/linux_vmm/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -e - -# local variable -TISDK_DIR=/home/grissiom/ti-sdk-am335x-evm-06.00.00.00/ - -# external variable {{{ -ROOTFS_DIR=${ROOTFS_DIR:-~/remotedir/buildroot-rootfs/} -KDIR=${KDIR:-$PWD/../../bfm-kernel/} - -TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-${TISDK_DIR}/linux-devkit/sysroots/i686-arago-linux/usr/bin} -TOOLCHAIN_PREFIX=${TOOLCHAIN_PREFIX:-"arm-linux-gnueabihf-"} -# }}} - -export PATH="${TOOLCHAIN_DIR}:$PATH" - -make -C $KDIR M=$PWD ARCH=arm CROSS_COMPILE="${TOOLCHAIN_PREFIX}" V=0 - -#sudo PATH="${TOOLCHAIN_DIR}:$PATH" \ - #make -C $KDIR M=$PWD ARCH=arm CROSS_COMPILE=${TOOLCHAIN_PREFIX} \ - #INSTALL_MOD_PATH=${ROOTFS_DIR} modules_install diff --git a/bsp/realview-a8/linux_vmm/vmm_linux.c b/bsp/realview-a8/linux_vmm/vmm_linux.c deleted file mode 100644 index 110a4f40fa..0000000000 --- a/bsp/realview-a8/linux_vmm/vmm_linux.c +++ /dev/null @@ -1,257 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "vmm_linux.h" - -#define IOMAP_NUM 3 -#define BUFF_SZ (4 * 1024) - -struct vmm_iomap *_linux_iomap = NULL; - -const char *uart_name = "uart"; - -/* some exported Linux Kernel patch */ -extern void vmm_set_status(int status); -extern void vmm_context_init(void *context_addr); -extern unsigned long vmm_save_irq(void); -extern void vmm_restore_irq(unsigned long flags); - -static struct vmm_domain domain = -{ - .kernel = DOMAIN_KERNEL, - .user = DOMAIN_USER, - .io = DOMAIN_IO, - .vmm = DOMAIN_RTVMM, - .vmm_share = DOMAIN_RTVMM_SHR, -}; - -static struct vmm_iomap iomap[RT_VMM_IOMAP_MAXNR] = -{ - {.name = "UART1", .pa = 0x1000A000, .size = 4096}, - {.name = "TIMER", .pa = 0x10012000, .size = 4096}, - {.name = "GIC_CPU", .pa = 0x1E000000, .size = 4096}, - {.name = "GIC_DIST", .pa = 0x1E001000, .size = 4096}, - {.name = "SYS_CTRL", .pa = 0x1001A000, .size = 4096}, - {.pa = 0}, -}; - -void vmm_iomap_init(void) -{ - int index; - - _linux_iomap = &iomap[0]; - - BUILD_BUG_ON(ARRAY_SIZE(iomap) > RT_VMM_IOMAP_MAXNR); - - for (index = 0; index < ARRAY_SIZE(iomap); index++) { - if (_linux_iomap[index].pa == 0) - break; - - if (_linux_iomap[index].size != 0) - _linux_iomap[index].va = - ioremap_nocache(_linux_iomap[index].pa, - _linux_iomap[index].size); - - printk("%s: 0x%08lx --> 0x%p, size %u\n", - _linux_iomap[index].name, - _linux_iomap[index].pa, - _linux_iomap[index].va, - _linux_iomap[index].size); - } - - printk("vmm: init iomap done!\n"); -} - -#if 0 -void trap_set_vector(unsigned long start, unsigned int length) -{ - int sctrl; - - /* C12-C0 is only active when SCTLR.V = 0 */ - asm volatile ("mrc p15, #0, %0, c1, c0, #0" - :"=r" (sctrl)); - sctrl &= ~(1 << 13); - asm volatile ("mcr p15, #0, %0, c1, c0, #0" - : - :"r" (sctrl)); - - asm volatile ("mcr p15, #0, %0, c12, c0, #0" - : - :"r" (start)); - rmb(); -} -#else -extern void trap_set_vector(unsigned long start, unsigned int length); -#endif - -static void vmm_open_domain(void) -{ - unsigned long dval; - asm volatile ("mrc p15, 0, %0, c3, c0\n" - : "=r" (dval)); - dval |= (0x1 << (DOMAIN_RTVMM * 2)) | - (0x1 << (DOMAIN_RTVMM_SHR * 2)); - asm volatile ("mcr p15, 0, %0, c3, c0\n" - : : "r" (dval)); -} - -static void vmm_close_domain(void) -{ - unsigned long dval; - asm volatile ("mrc p15, 0, %0, c3, c0\n" - : "=r" (dval)); - /* we still need access tp DOMAIN_RTVMM_SHR because the IRQ stack is - * there. */ - dval &= ~(0x3 << (DOMAIN_RTVMM * 2)); - asm volatile ("mcr p15, 0, %0, c3, c0\n" - : : "r" (dval)); -} - -static DEFINE_SPINLOCK(init_lock); -void vmm_entry(void) -{ - vmm_entry_t entry; - unsigned long flags; - struct vmm_entry_param eparam = { - .iomap = &iomap[0], - .domain = &domain, - }; - - printk("Entry VMM:0x%08x with iomap 0x%p\n", VMM_BEGIN, _linux_iomap); - - spin_lock_irqsave(&init_lock, flags); - - memcpy((void*)(LINUX_VECTOR_POS), (void*)0xFFFF0000, - LINUX_VECTOR_PGSZ); - flush_icache_range(LINUX_VECTOR_POS, - LINUX_VECTOR_POS + LINUX_VECTOR_PGSZ); - - /*dump_vector(0xFFFF0000);*/ - /* set the interrupt vector to RTT */ - trap_set_vector(VMM_BEGIN, 16 * 4); - /*dump_vector(VMM_END-LINUX_VECTOR_PGSZ);*/ - - entry = (vmm_entry_t)VMM_BEGIN; - - vmm_context_init(&RT_VMM_SHARE->ctx); - vmm_set_status(0x01); - - pr_info("Linux domain: kernel: %d, user: %d, io: %d\n", - DOMAIN_KERNEL, DOMAIN_USER, DOMAIN_IO); - - /* switch to RTT and Good Luck */ - entry(&eparam); - - spin_unlock_irqrestore(&init_lock, flags); - - /* we now switched to virtual IRQ but the hardware IRQ is disabled - * before entering RT-Thread. So we have to enabled it by hand. */ - { - asm volatile ("cpsie i":::"memory", "cc"); - } - - printk("come back to Linux.\n"); - -} - -int vmm_load_fw(const char* filename) -{ - mm_segment_t oldfs = {0}; - unsigned long len; - unsigned long file_sz; - loff_t pos = 0; - struct file *flp = NULL; - char *buf_ptr = (char*)VMM_BEGIN; - - printk("loading RT-Thread:%s ....", filename); - /* FIXME: we should not need this actually. But currently Linux would - * hang without this. Let's just proceed and I will go back to handle - * this in the future. */ - memset((void*)VMM_BEGIN, 0, VMM_SIZE); - - flp = filp_open(filename, O_RDONLY, S_IRWXU); - if (IS_ERR(flp)) - { - printk("vmm loader: open file failed. " - "Return 0x%p\n", flp); - return -1; - } - - /* get file size */ - file_sz = vfs_llseek(flp, 0, SEEK_END); - vfs_llseek(flp, 0, SEEK_SET); - - oldfs = get_fs(); - set_fs(get_ds()); - while (file_sz > 0) - { - // len = vfs_read(flp, (void __user __force *)buff, BUFF_SZ, &pos); - len = vfs_read(flp, (void __user __force*)buf_ptr, BUFF_SZ, &pos); - file_sz -= len; - buf_ptr += len; - } - set_fs(oldfs); - - filp_close(flp, NULL); - - printk("done!\n"); - - /* flush RT-Thread memory */ - flush_cache_vmap(VMM_BEGIN, VMM_END); - - return 0; -} - -static int __init vmm_init(void) -{ - printk("VMM started.\n"); - - vmm_iomap_init(); - /* Open the domain permission so we could write firmware to it */ - vmm_open_domain(); - if (vmm_load_fw("/vmm/rtthread.bin") == 0) - vmm_entry(); - - return 0; -} - -static void __exit vmm_exit(void) -{ - int i; - unsigned long flags; - - spin_lock_irqsave(&init_lock, flags); - vmm_set_status(0x00); - trap_set_vector(LINUX_VECTOR_POS, 16 * 4); - spin_unlock_irqrestore(&init_lock, flags); - - for (i = 0; i < ARRAY_SIZE(iomap); i++) - { - if (iomap[i].pa == 0) - break; - - printk("iounmap %s(0x%p)\n", - iomap[i].name, - iomap[i].va); - iounmap(iomap[i].va); - } - - vmm_close_domain(); - - printk("vmm exit\n"); -} - -module_init(vmm_init); -module_exit(vmm_exit); - -MODULE_AUTHOR("bernard.xiong "); -MODULE_DESCRIPTION("RT-VMM"); -MODULE_LICENSE("GPL"); diff --git a/bsp/realview-a8/linux_vmm/vmm_linux.h b/bsp/realview-a8/linux_vmm/vmm_linux.h deleted file mode 100644 index 395a807751..0000000000 --- a/bsp/realview-a8/linux_vmm/vmm_linux.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __VMM_H__ -#define __VMM_H__ - -#include - -#define RT_VMM_ON_AM335X - -#endif diff --git a/bsp/realview-a8/mk.sh b/bsp/realview-a8/mk.sh deleted file mode 100644 index 964009c271..0000000000 --- a/bsp/realview-a8/mk.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -set -e - -KDIR=~/linux-git -BUILD_ROOT_DIR=/temp-build/buildroot-2014.02/ - -scons -j20 -mkdir -p $BUILD_ROOT_DIR/output/target/vmm -cp rtthread.bin $BUILD_ROOT_DIR/output/target/vmm - -( -cd ./linux_vmm/ -export PATH=/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/:"$PATH" -make -C $KDIR M=$PWD VMM_HDR_DIR=$PWD/../ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -cp rtvmm.ko $BUILD_ROOT_DIR/output/target/root/ -) - -make -C $BUILD_ROOT_DIR diff --git a/bsp/realview-a8/qemu.sh b/bsp/realview-a8/qemu.sh deleted file mode 100644 index 539a608c60..0000000000 --- a/bsp/realview-a8/qemu.sh +++ /dev/null @@ -1 +0,0 @@ -qemu-system-arm -M realview-pb-a8 -kernel rtthread-realview.elf -serial vc -serial vc diff --git a/bsp/realview-a8/realview.lds b/bsp/realview-a8/realview.lds deleted file mode 100644 index f586228840..0000000000 --- a/bsp/realview-a8/realview.lds +++ /dev/null @@ -1,91 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -SECTIONS -{ - . = 0x70000000; - - __text_start = .; - .text : - { - *(.vectors) - *(.text) - *(.text.*) - - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - . = ALIGN(4); - - /* section information for modules */ - . = ALIGN(4); - __rtmsymtab_start = .; - KEEP(*(RTMSymTab)) - __rtmsymtab_end = .; - - /* section information for initialization */ - . = ALIGN(4); - __rt_init_start = .; - KEEP(*(SORT(.rti_fn*))) - __rt_init_end = .; - } =0 - __text_end = .; - - __rodata_start = .; - .rodata : { *(.rodata) *(.rodata.*) } - __rodata_end = .; - - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } - - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } - - . = ALIGN(8); - __data_start = .; - .data : - { - *(.data) - *(.data.*) - } - __data_end = .; - - . = ALIGN(8); - __bss_start = .; - .bss : - { - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - } - . = ALIGN(4); - __bss_end = .; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - _end = .; -} diff --git a/bsp/realview-a8/realview_vmm.lds.S b/bsp/realview-a8/realview_vmm.lds.S deleted file mode 100644 index 09cb9a302c..0000000000 --- a/bsp/realview-a8/realview_vmm.lds.S +++ /dev/null @@ -1,140 +0,0 @@ -#include - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) - -SECTIONS -{ - . = VMM_BEGIN; - - __text_start = .; - .text.share : - { - KEEP(*(.vectors)) - *(.text.isr) - *(.vmm_glue) - } - ASSERT(SIZEOF(.text.share) <= VMM_SHARE_TEXT_PGSZ, ".text.share too big") - - . = VMM_BEGIN + VMM_SHARE_TEXT_PGSZ; - /* the vectore page is saved here - * { - * } - */ - - . = VMM_SHARE_DATA_POS; - .data.share : - { - __data_share_start = .; - *(.data.share*) - __data_share_end = .; - } - ASSERT(SIZEOF(.data.share) <= (VMM_SHARE_DATA_PGSZ), ".data.share is too big") - - . = VMM_SHARE_BSS_POS; - .bss.share : - { - __bss_share_start = .; - *(.bss.share*) - __bss_share_end = .; - } - ASSERT(SIZEOF(.bss.share) <= (VMM_SHARE_BSS_PGSZ), ".bss.share is too big") - - . = VMM_SHARE_CTX_POS; - .vmm.share : - { - /* the vmm context goes here */ - __vmm_share_start = .; - *(.vmm.share*) - __vmm_share_end = .; - } - ASSERT(SIZEOF(.vmm.share) <= (VMM_SHARE_CTX_PGSZ), "vmm share context is too big") - - . = VMM_BEGIN + VMM_SHARE_PGSZ; - .text : - { - *(.vmm_init) - *(.text) - *(.text.*) - - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - . = ALIGN(4); - - /* section information for modules */ - . = ALIGN(4); - __rtmsymtab_start = .; - KEEP(*(RTMSymTab)) - __rtmsymtab_end = .; - - /* section information for initialization */ - . = ALIGN(4); - __rt_init_start = .; - KEEP(*(SORT(.rti_fn*))) - __rt_init_end = .; - } - __text_end = .; - - __rodata_start = .; - .rodata : { *(.rodata) *(.rodata.*) } - __rodata_end = .; - - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - KEEP(*(SORT(.ctors.*))) - KEEP(*(.ctors)) - PROVIDE(__ctors_end__ = .); - } - - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.dtors.*))) - KEEP(*(.dtors)) - PROVIDE(__dtors_end__ = .); - } - - __data_start = .; - . = ALIGN(8); - .data : - { - *(.data) - *(.data.*) - } - __data_end = .; - - . = ALIGN(8); - __bss_start = __data_end; - .bss : - { - vmm_stack_start = .; - . = vmm_stack_start + RT_VMM_STACK_SIZE; - vmm_stack_end = .; - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - } - . = ALIGN(4); - __bss_end = .; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - _end = .; -} diff --git a/bsp/realview-a8/rtconfig.h b/bsp/realview-a8/rtconfig.h deleted file mode 100644 index a83c9e020d..0000000000 --- a/bsp/realview-a8/rtconfig.h +++ /dev/null @@ -1,153 +0,0 @@ -/* RT-Thread config file */ -#ifndef __RTTHREAD_CFG_H__ -#define __RTTHREAD_CFG_H__ - -// - -// -#define RT_NAME_MAX 6 -// -#define RT_ALIGN_SIZE 4 -// -// 8 -// 32 -// 256 -// -#define RT_THREAD_PRIORITY_MAX 32 -// -#define RT_TICK_PER_SECOND 1000 -// -#define IDLE_THREAD_STACK_SIZE 512 -//
-#define RT_DEBUG -#define RT_DEBUG_COLOR -// -// #define RT_THREAD_DEBUG -// -// #define RT_USING_OVERFLOW_CHECK -//
- -// -#define RT_USING_HOOK -//
-// #define RT_USING_TIMER_SOFT -// -#define RT_TIMER_THREAD_PRIO 4 -// -#define RT_TIMER_THREAD_STACK_SIZE 512 -// -#define RT_TIMER_TICK_PER_SECOND 10 -//
- -//
-// -#define RT_USING_SEMAPHORE -// -#define RT_USING_MUTEX -// -#define RT_USING_EVENT -// -#define RT_USING_MAILBOX -// -#define RT_USING_MESSAGEQUEUE -//
- -//
-// -#define RT_USING_MEMPOOL -// -// #define RT_USING_MEMHEAP -// -#define RT_USING_HEAP -// -// #define RT_USING_MEMHEAP_AS_HEAP -// -#define RT_USING_SMALL_MEM -// -// #define RT_USING_SLAB -//
- -//
-#define RT_USING_DEVICE -// -#define RT_USING_DEVICE_IPC -// -#define RT_USING_SERIAL -#define RT_SERIAL_USING_DMA -// -#define RT_UART_RX_BUFFER_SIZE 64 -// -#define RT_USING_INTERRUPT_INFO -// -// #define RT_USING_UART0 -// -#define RT_USING_UART1 -//
- -//
-#define RT_USING_CONSOLE -// -#define RT_CONSOLEBUF_SIZE 128 -// -#define RT_CONSOLE_DEVICE_NAME "uart1" -//
- -// -#define RT_USING_COMPONENTS_INIT -//
-#define RT_USING_FINSH -// -#define FINSH_USING_MSH -// -#define FINSH_USING_MSH_DEFAULT -// -#define FINSH_USING_SYMTAB -// -#define FINSH_USING_DESCRIPTION -// -#define FINSH_THREAD_STACK_SIZE 4096 -//
- -//
-// -#define RT_USING_LIBC -// -#define RT_USING_PTHREADS -//
- -//
-// #define RT_USING_DFS -// -// #define DFS_USING_WORKDIR -// -#define DFS_FILESYSTEMS_MAX 2 -// -#define DFS_FD_MAX 4 -// -#define RT_USING_DFS_ELMFAT -// -// 1 -// 2 -// -#define RT_DFS_ELM_USE_LFN 1 -// -#define RT_DFS_ELM_MAX_LFN 64 -// -// #define RT_USING_DFS_YAFFS2 -// -// #define RT_USING_DFS_UFFS -// -// #define RT_USING_DFS_DEVFS -// -// #define RT_USING_DFS_NFS -// -#define RT_NFS_HOST_EXPORT "192.168.1.5:/" -//
- -//
- -//
-// #define RT_USING_VMM -//
- -#endif diff --git a/bsp/realview-a8/rtconfig.py b/bsp/realview-a8/rtconfig.py deleted file mode 100644 index 21aeec8787..0000000000 --- a/bsp/realview-a8/rtconfig.py +++ /dev/null @@ -1,55 +0,0 @@ -import os - -# toolchains options -ARCH='arm' -CPU='realview-a8-vmm' -CROSS_TOOL='gcc' - -if os.getenv('RTT_CC'): - CROSS_TOOL = os.getenv('RTT_CC') - -PLATFORM = 'gcc' -# EXEC_PATH = r'/opt/arm-2012.09/bin' -EXEC_PATH = r'C:\Program Files (x86)\CodeSourcery\Sourcery_CodeBench_Lite_for_ARM_EABI\bin' -EXEC_PATH = '/opt/gcc-arm-none-eabi-4_8-2014q1_gri/bin' - -if os.getenv('RTT_EXEC_PATH'): - EXEC_PATH = os.getenv('RTT_EXEC_PATH') - -BUILD = 'debug' - -if PLATFORM == 'gcc': - # toolchains - PREFIX = 'arm-none-eabi-' - CC = PREFIX + 'gcc' - CXX = PREFIX + 'g++' - AS = PREFIX + 'gcc' - AR = PREFIX + 'ar' - LINK = PREFIX + 'gcc' - TARGET_EXT = 'elf' - SIZE = PREFIX + 'size' - OBJDUMP = PREFIX + 'objdump' - OBJCPY = PREFIX + 'objcopy' - - DEVICE = ' -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3-d16 -ftree-vectorize -ffast-math -mfloat-abi=softfp' - CFLAGS = DEVICE + ' -Wall' - AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__' - LINK_SCRIPT = 'realview_vmm.lds' - LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=realview.map,-cref,-u,system_vectors'+\ - ' -T %s' % LINK_SCRIPT - - CPATH = '' - LPATH = '' - - # generate debug info in all cases - AFLAGS += ' -gdwarf-2' - CFLAGS += ' -g -gdwarf-2' - - if BUILD == 'debug': - CFLAGS += ' -O0' - else: - CFLAGS += ' -O2' - - POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' +\ - SIZE + ' $TARGET \n' +\ - OBJDUMP + ' -S $TARGET > rtt.S\n' diff --git a/bsp/realview-a8/rtt_api.h b/bsp/realview-a8/rtt_api.h deleted file mode 100644 index cf8e8ddb1a..0000000000 --- a/bsp/realview-a8/rtt_api.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2014-04-07 Grissiom first version - */ - -#ifndef __RTT_API_H__ -#define __RTT_API_H__ - -/* 4MB in size */ -#define VMM_SIZE 0x400000 -#define VMM_END 0xc8000000 -#define VMM_BEGIN (VMM_END - VMM_SIZE) - -/* VMM Memory Map: - * - * --- VMM_BEGIN --- +------+ - * .vectors | 4KB | - * .text.share | | - * ----------------- + | - * guest vector page | 4KB | - * ----------------- + | - * .data.share | 4KB | - * ----------------- + | - * .bss.share | 4KB | - * -- SHARE_BASE -- + | 1MB - * shared context | shared region - * ----------------- | - * blabla... | - * ----------------- +------+ - * vmm text | - * rodata | - * blabla... | - * ----------------- | private region - * vmm data | - * ----------------- | - * vmm bss | - * ---- VMM_END ---- +------+ - * - */ - -/* 1MB is one level one page table entry, if we want to page table to be - * simple(avoid TLB miss), we could allocate 1MB for shared memory. */ -#define VMM_SHARE_PGSZ (1024*1024) - -/* the size and position of shared code text */ -#define VMM_SHARE_TEXT_PGSZ 4096 - -/* the size and position of vector's page size in Linux */ -#define LINUX_VECTOR_PGSZ 4096 -#define LINUX_VECTOR_POS (VMM_BEGIN + VMM_SHARE_TEXT_PGSZ) - -/* the size and position of shared code data */ -#define VMM_SHARE_DATA_PGSZ 4096 -#define VMM_SHARE_DATA_POS (LINUX_VECTOR_POS + LINUX_VECTOR_PGSZ) - -/* the size and position of shared code bss */ -#define VMM_SHARE_BSS_PGSZ 4096 -#define VMM_SHARE_BSS_POS (VMM_SHARE_DATA_POS + VMM_SHARE_DATA_PGSZ) - -/* the size and position of shared code bss */ -#define VMM_SHARE_CTX_PGSZ (VMM_SHARE_PGSZ - \ - LINUX_VECTOR_PGSZ - \ - VMM_SHARE_TEXT_PGSZ - \ - VMM_SHARE_DATA_PGSZ - \ - VMM_SHARE_BSS_PGSZ) -#if VMM_SHARE_CTX_PGSZ <= 0 -#error -#endif - -#define VMM_SHARE_CTX_POS (VMM_SHARE_BSS_POS + VMM_SHARE_BSS_PGSZ) - -/* the size of FIQ stack page size in RT-Thread */ -#define RT_FIQ_STACK_PGSZ 0 - -/* the size of IRQ stack page size in RT-Thread */ -#define RT_IRQ_STACK_PGSZ 4096 - -#ifdef HEAP_END -#undef HEAP_END -#endif -#define HEAP_END (VMM_END) - -#define RT_VMM_VIRQ_TRIGGER 10 - -#define RT_VMM_STACK_SIZE 1024 - -/* the max number of iomap entries */ -#define RT_VMM_IOMAP_MAXNR 16 - -#ifndef __iomem -#define __iomem -#endif - -#define IRQS_NR_32 ((96 + 31)/32) - -/*#define RT_VMM_USING_DOMAIN*/ - -#ifndef __ASSEMBLY__ - -/* keep consistent with linux/arch/arm/include/vmm/vmm.h */ -struct vmm_context -{ - /* the status of vGuest irq, read only for RT-Thread */ - volatile unsigned long virq_status; - - /* has interrupt pended on vGuest OS IRQ */ - volatile unsigned long virq_pended; - - /* pending interrupt for vGuest OS */ - volatile unsigned long virq_pending[IRQS_NR_32]; -}; - -struct vmm_domain -{ - /* the number of kernel domain */ - char kernel; - /* the number of user domain */ - char user; - /* the number of io domain */ - char io; - /* the number of vmm domain */ - char vmm; - /* the number of vmm_share domain */ - char vmm_share; -}; - -struct vmm_iomap -{ - const char name[16]; /* iomap name */ - - unsigned long pa; /* physical address */ - volatile void __iomem * va; /* virtual address */ - size_t size; /* memory size */ -}; - -struct vmm_entry_param -{ - struct vmm_iomap *iomap; - struct vmm_domain *domain; -}; - -typedef void (*vmm_entry_t)(struct vmm_entry_param* param); - -struct rt_vmm_share_layout -{ - struct vmm_context ctx; -}; - -#ifndef __KERNEL__ -/* not in Linux, use better type check */ -extern struct rt_vmm_share_layout rt_vmm_share; -#define RT_VMM_SHARE (&rt_vmm_share) -#else -#define RT_VMM_SHARE ((struct rt_vmm_share_layout*)VMM_SHARE_CTX_POS) -#endif - -#endif - -#endif /* end of include guard: __RTT_API_H__ */