提交 c1f47af9 编写于 作者: B Bernard Xiong

[BSP] remove RT_USING_VMM in default and let it run in QEMU.

上级 86358d08
...@@ -31,8 +31,12 @@ if GetDepend('RT_USING_VMM'): ...@@ -31,8 +31,12 @@ if GetDepend('RT_USING_VMM'):
ldfile = rtconfig.LINK_SCRIPT)) != 0: ldfile = rtconfig.LINK_SCRIPT)) != 0:
print 'failed to generate linker script %s' % rtconfig.LINK_SCRIPT print 'failed to generate linker script %s' % rtconfig.LINK_SCRIPT
sys.exit(255) sys.exit(255)
# if the linker script changed, relink the target # if the linker script changed, relink the target
Depends(TARGET, rtconfig.LINK_SCRIPT) 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 # make a building
DoBuilding(TARGET, objs) DoBuilding(TARGET, objs)
...@@ -15,32 +15,18 @@ ...@@ -15,32 +15,18 @@
#include <rtthread.h> #include <rtthread.h>
#include <components.h> #include <components.h>
#include <pthread.h> void init_thread(void* parameter)
void *test_task(void *parameter)
{ {
int count = 0; rt_components_init();
while (1)
{
rt_thread_delay(RT_TICK_PER_SECOND);
rt_kprintf("count = %d\n", count ++);
}
return RT_NULL;
} }
int rt_application_init() int rt_application_init()
{ {
// pthread_t tid; rt_thread_t tid;
/* do component initialization */
rt_components_init();
#ifdef RT_USING_NEWLIB
libc_system_init(RT_CONSOLE_DEVICE_NAME);
#endif
// pthread_create(&tid, RT_NULL, test_task, RT_NULL); 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; return 0;
} }
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
#define SYS_CTRL __REG32(REALVIEW_SCTL_BASE) #define SYS_CTRL __REG32(REALVIEW_SCTL_BASE)
#ifdef RT_USING_VMM #ifdef RT_USING_VMM
#include <vmm.h> #include <vmm.h>
static rt_uint32_t timer_hw_base = 0; static rt_uint32_t timer_hw_base = 0;
#define TIMER_HW_BASE (timer_hw_base) #define TIMER_HW_BASE (timer_hw_base)
#else #else
#define TIMER_HW_BASE REALVIEW_TIMER2_3_BASE #define TIMER_HW_BASE REALVIEW_TIMER2_3_BASE
#endif #endif
void rt_hw_timer_ack(void) void rt_hw_timer_ack(void)
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "serial.h" #include "serial.h"
#ifdef RT_USING_VMM #ifdef RT_USING_VMM
#include <vmm.h> #include <vmm.h>
#endif #endif
struct hw_uart_device struct hw_uart_device
...@@ -165,8 +165,8 @@ int rt_hw_uart_init(void) ...@@ -165,8 +165,8 @@ int rt_hw_uart_init(void)
config.parity = PARITY_NONE; config.parity = PARITY_NONE;
config.stop_bits = STOP_BITS_1; config.stop_bits = STOP_BITS_1;
config.invert = NRZ_NORMAL; config.invert = NRZ_NORMAL;
config.bufsz = RT_SERIAL_RB_BUFSZ; config.bufsz = RT_SERIAL_RB_BUFSZ;
#ifdef RT_USING_UART0 #ifdef RT_USING_UART0
uart = &_uart0_device; uart = &_uart0_device;
#ifdef RT_USING_VMM #ifdef RT_USING_VMM
...@@ -194,7 +194,7 @@ int rt_hw_uart_init(void) ...@@ -194,7 +194,7 @@ int rt_hw_uart_init(void)
/* register UART1 device */ /* register UART1 device */
rt_hw_serial_register(&_serial1, "uart1", rt_hw_serial_register(&_serial1, "uart1",
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX, uart); RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX, uart);
/* enable Rx and Tx of UART */ /* enable Rx and Tx of UART */
UART_CR(uart->hw_base) = (1 << 0) | (1 << 8) | (1 << 9); UART_CR(uart->hw_base) = (1 << 0) | (1 << 8) | (1 << 9);
#endif #endif
......
...@@ -107,8 +107,8 @@ ...@@ -107,8 +107,8 @@
// </section> // </section>
// <section name="LIBC" description="C Runtime library setting" default="always" > // <section name="LIBC" description="C Runtime library setting" default="always" >
// <bool name="RT_USING_NEWLIB" description="Using newlib library, only available under GNU GCC" default="true" /> // <bool name="RT_USING_LIBC" description="Using libc library" default="true" />
#define RT_USING_NEWLIB #define RT_USING_LIBC
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" /> // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
#define RT_USING_PTHREADS #define RT_USING_PTHREADS
// </section> // </section>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
#define RT_USING_LOGTRACE #define RT_USING_LOGTRACE
// <section name="RT_USING_VMM" description="Enable RT-Thread hypervisor" default="true" > // <section name="RT_USING_VMM" description="Enable RT-Thread hypervisor" default="true" >
#define RT_USING_VMM // #define RT_USING_VMM
// </section> // </section>
#endif #endif
...@@ -21,8 +21,6 @@ if os.getenv('RTT_EXEC_PATH'): ...@@ -21,8 +21,6 @@ if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH') EXEC_PATH = os.getenv('RTT_EXEC_PATH')
BUILD = 'debug' BUILD = 'debug'
VMM = True
#VMM = False
if PLATFORM == 'gcc': if PLATFORM == 'gcc':
# toolchains # toolchains
...@@ -40,10 +38,7 @@ if PLATFORM == 'gcc': ...@@ -40,10 +38,7 @@ if PLATFORM == 'gcc':
DEVICE = ' -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3-d16 -ftree-vectorize -ffast-math -mfloat-abi=softfp' DEVICE = ' -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3-d16 -ftree-vectorize -ffast-math -mfloat-abi=softfp'
CFLAGS = DEVICE + ' -Wall' CFLAGS = DEVICE + ' -Wall'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__'
if VMM: LINK_SCRIPT = 'realview_vmm.lds'
LINK_SCRIPT = 'realview_vmm.lds'
else:
LINK_SCRIPT = 'realview.lds'
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=realview.map,-cref,-u,system_vectors'+\ LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=realview.map,-cref,-u,system_vectors'+\
' -T %s' % LINK_SCRIPT ' -T %s' % LINK_SCRIPT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册