summaryrefslogtreecommitdiff
path: root/bsp/qemu-vexpress-a9
diff options
context:
space:
mode:
authorqz721 <[email protected]>2019-03-25 20:03:49 +0800
committerqz721 <[email protected]>2019-03-25 20:03:49 +0800
commit2eb1bef773e099ac93ec74dba7ec216bdf61597c (patch)
treeacee7a3f45b163e18f29475c6a009795c6d3a146 /bsp/qemu-vexpress-a9
parentefd8b404a3fc6ee8c98b6a735fceaf29fd42c76c (diff)
Make 'qemu-vexpress-a9' and 'imx6ul' use the same libcpu code.
Diffstat (limited to 'bsp/qemu-vexpress-a9')
-rw-r--r--bsp/qemu-vexpress-a9/.config1
-rw-r--r--bsp/qemu-vexpress-a9/SConstruct4
-rw-r--r--bsp/qemu-vexpress-a9/cpu/SConscript17
-rw-r--r--bsp/qemu-vexpress-a9/cpu/armv7.h64
-rw-r--r--bsp/qemu-vexpress-a9/cpu/context_gcc.S198
-rw-r--r--bsp/qemu-vexpress-a9/cpu/cp15.h12
-rw-r--r--bsp/qemu-vexpress-a9/cpu/cp15_gcc.S140
-rw-r--r--bsp/qemu-vexpress-a9/cpu/cpuport.c83
-rw-r--r--bsp/qemu-vexpress-a9/cpu/gic.c299
-rw-r--r--bsp/qemu-vexpress-a9/cpu/gic.h33
-rw-r--r--bsp/qemu-vexpress-a9/cpu/interrupt.c108
-rw-r--r--bsp/qemu-vexpress-a9/cpu/interrupt.h25
-rw-r--r--bsp/qemu-vexpress-a9/cpu/mmu.c207
-rw-r--r--bsp/qemu-vexpress-a9/cpu/pmu.c12
-rw-r--r--bsp/qemu-vexpress-a9/cpu/pmu.h151
-rw-r--r--bsp/qemu-vexpress-a9/cpu/stack.c71
-rw-r--r--bsp/qemu-vexpress-a9/cpu/start_gcc.S447
-rw-r--r--bsp/qemu-vexpress-a9/cpu/trap.c190
-rw-r--r--bsp/qemu-vexpress-a9/cpu/vector_gcc.S65
-rw-r--r--bsp/qemu-vexpress-a9/drivers/board.c9
-rw-r--r--bsp/qemu-vexpress-a9/platform/SConscript13
-rw-r--r--bsp/qemu-vexpress-a9/platform/cpu/platform.h37
-rw-r--r--bsp/qemu-vexpress-a9/rtconfig.h149
-rw-r--r--bsp/qemu-vexpress-a9/rtconfig.py5
24 files changed, 214 insertions, 2126 deletions
diff --git a/bsp/qemu-vexpress-a9/.config b/bsp/qemu-vexpress-a9/.config
index c8814d366a..6fde000858 100644
--- a/bsp/qemu-vexpress-a9/.config
+++ b/bsp/qemu-vexpress-a9/.config
@@ -322,6 +322,7 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_WEBTERMINAL is not set
# CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_JSMN is not set
+# CONFIG_PKG_USING_LIBMODBUS is not set
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set
diff --git a/bsp/qemu-vexpress-a9/SConstruct b/bsp/qemu-vexpress-a9/SConstruct
index 638311d697..d618790dec 100644
--- a/bsp/qemu-vexpress-a9/SConstruct
+++ b/bsp/qemu-vexpress-a9/SConstruct
@@ -5,7 +5,7 @@ import rtconfig
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
else:
- RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
+ RTT_ROOT = os.path.join(os.getcwd(), '..', '..')
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
from building import *
@@ -25,7 +25,7 @@ Export('RTT_ROOT')
Export('rtconfig')
# prepare building environment
-objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=True)
+objs = PrepareBuilding(env, RTT_ROOT)
# make a building
DoBuilding(TARGET, objs)
diff --git a/bsp/qemu-vexpress-a9/cpu/SConscript b/bsp/qemu-vexpress-a9/cpu/SConscript
deleted file mode 100644
index b45f95cc1a..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/SConscript
+++ /dev/null
@@ -1,17 +0,0 @@
-Import('rtconfig')
-from building import *
-
-cwd = GetCurrentDir()
-src = Glob('*.c')
-CPPPATH = [cwd]
-
-if rtconfig.PLATFORM == 'iar':
- src += Glob('*_iar.S')
-elif rtconfig.PLATFORM == 'gcc':
- src += Glob('*_gcc.S')
-elif rtconfig.PLATFORM == 'armcc':
- src += Glob('*_rvds.S')
-
-group = DefineGroup('CPU', src, depend = [''], CPPPATH = CPPPATH)
-
-Return('group')
diff --git a/bsp/qemu-vexpress-a9/cpu/armv7.h b/bsp/qemu-vexpress-a9/cpu/armv7.h
deleted file mode 100644
index 69c556eb3c..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/armv7.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef __ARMV7_H__
-#define __ARMV7_H__
-
-/* the exception stack without VFP registers */
-struct rt_hw_exp_stack
-{
- 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;
-};
-
-struct rt_hw_stack
-{
- unsigned long cpsr;
- 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 lr;
- unsigned long pc;
-};
-
-#define USERMODE 0x10
-#define FIQMODE 0x11
-#define IRQMODE 0x12
-#define SVCMODE 0x13
-#define MONITORMODE 0x16
-#define ABORTMODE 0x17
-#define HYPMODE 0x1b
-#define UNDEFMODE 0x1b
-#define MODEMASK 0x1f
-#define NOINT 0xc0
-
-#define T_Bit (1<<5)
-#define F_Bit (1<<6)
-#define I_Bit (1<<7)
-#define A_Bit (1<<8)
-#define E_Bit (1<<9)
-#define J_Bit (1<<24)
-
-#endif
diff --git a/bsp/qemu-vexpress-a9/cpu/context_gcc.S b/bsp/qemu-vexpress-a9/cpu/context_gcc.S
deleted file mode 100644
index 0aad0200d5..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/context_gcc.S
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * File : context.S
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013, RT-Thread Development Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-05 Bernard the first version
- * 2018-11-22 Jesven in the smp version, using macro to
- * define rt_hw_interrupt_enable and rt_hw_interrupt_disable
- * rt_hw_context_switch_interrupt switches to the new thread directly
- */
-
-#include "rtconfig.h"
-.section .text, "ax"
-
-#ifdef RT_USING_SMP
-#define rt_hw_interrupt_disable rt_hw_local_irq_disable
-#define rt_hw_interrupt_enable rt_hw_local_irq_enable
-#endif
-
-/*
- * rt_base_t rt_hw_interrupt_disable();
- */
-.globl rt_hw_interrupt_disable
-rt_hw_interrupt_disable:
- mrs r0, cpsr
- cpsid i
- bx lr
-
-/*
- * void rt_hw_interrupt_enable(rt_base_t level);
- */
-.globl rt_hw_interrupt_enable
-rt_hw_interrupt_enable:
- msr cpsr, r0
- bx lr
-
-/*
- * void rt_hw_context_switch_to(rt_uint32 to);
- * r0 --> to
- */
-.globl rt_hw_context_switch_to
-rt_hw_context_switch_to:
- ldr sp, [r0] @ get new task stack pointer
-
-#ifdef RT_USING_SMP
- mov r0, r1
- bl rt_cpus_lock_status_restore
-#endif /*RT_USING_SMP*/
-
-#ifdef RT_USING_LWP
- ldmfd sp, {r13, r14}^ @ pop usr_sp usr_lr
- add sp, #8
-#endif
-
- ldmfd sp!, {r4} @ pop new task spsr
- msr spsr_cxsf, r4
-
- ldmfd sp!, {r0-r12, lr, pc}^ @ pop new task r0-r12, lr & pc
-
-.section .bss.share.isr
-_guest_switch_lvl:
- .word 0
-
-.section .text.isr, "ax"
-/*
- * void rt_hw_context_switch(rt_uint32 from, rt_uint32 to);
- * r0 --> from
- * r1 --> to
- */
-.globl rt_hw_context_switch
-rt_hw_context_switch:
- stmfd sp!, {lr} @ push pc (lr should be pushed in place of PC)
- stmfd sp!, {r0-r12, lr} @ push lr & register file
-
- mrs r4, cpsr
- tst lr, #0x01
- orrne r4, r4, #0x20 @ it's thumb code
-
- stmfd sp!, {r4} @ push cpsr
-
-#ifdef RT_USING_LWP
- stmfd sp, {r13, r14}^ @ push usr_sp usr_lr
- sub sp, #8
-#endif
-
- str sp, [r0] @ store sp in preempted tasks TCB
- ldr sp, [r1] @ get new task stack pointer
-
-#ifdef RT_USING_SMP
- mov r0, r2
- bl rt_cpus_lock_status_restore
-#endif /*RT_USING_SMP*/
-
-#ifdef RT_USING_LWP
- ldmfd sp, {r13, r14}^ @ pop usr_sp usr_lr
- add sp, #8
-#endif
-
- ldmfd sp!, {r4} @ pop new task cpsr to spsr
- msr spsr_cxsf, r4
- ldmfd sp!, {r0-r12, lr, pc}^ @ pop new task r0-r12, lr & pc, copy spsr to cpsr
-
-/*
- * void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to);
- */
-.equ Mode_USR, 0x10
-.equ Mode_FIQ, 0x11
-.equ Mode_IRQ, 0x12
-.equ Mode_SVC, 0x13
-.equ Mode_ABT, 0x17
-.equ Mode_UND, 0x1B
-.equ Mode_SYS, 0x1F
-
-.equ I_Bit, 0x80 @ when I bit is set, IRQ is disabled
-.equ F_Bit, 0x40 @ when F bit is set, FIQ is disabled
-
-.globl rt_thread_switch_interrupt_flag
-.globl rt_interrupt_from_thread
-.globl rt_interrupt_to_thread
-.globl rt_hw_context_switch_interrupt
-rt_hw_context_switch_interrupt:
-#ifdef RT_USING_SMP
- /* r0 :irq_mod context
- * r1 :addr of from_thread's sp
- * r2 :addr of to_thread's sp
- * r3 :to_thread's tcb
- */
-
- @ r0 point to {r0-r3} in stack
- push {r1 - r3}
- mov r1, r0
- add r0, r0, #4*4
- ldmfd r0!, {r4-r12,lr}@ reload saved registers
- mrs r3, spsr @ get cpsr of interrupt thread
- sub r2, lr, #4 @ save old task's pc to r2
- msr cpsr_c, #I_Bit|F_Bit|Mode_SVC
-
- stmfd sp!, {r2} @ push old task's pc
- stmfd sp!, {r4-r12,lr}@ push old task's lr,r12-r4
- ldmfd r1, {r4-r7} @ restore r0-r3 of the interrupt thread
- stmfd sp!, {r4-r7} @ push old task's r0-r3
- stmfd sp!, {r3} @ push old task's cpsr
-
-#ifdef RT_USING_LWP
- stmfd sp, {r13,r14}^ @push usr_sp usr_lr
- sub sp, #8
-#endif
-
- msr cpsr_c, #I_Bit|F_Bit|Mode_IRQ
- pop {r1 - r3}
- mov sp, r0
- msr cpsr_c, #I_Bit|F_Bit|Mode_SVC
- str sp, [r1]
-
- ldr sp, [r2]
- mov r0, r3
- bl rt_cpus_lock_status_restore
-
-#ifdef RT_USING_LWP
- ldmfd sp, {r13,r14}^ @pop usr_sp usr_lr
- add sp, #8
-#endif
-
- ldmfd sp!, {r4} @ pop new task's cpsr to spsr
- msr spsr_cxsf, r4
-
- ldmfd sp!, {r0-r12,lr,pc}^ @ pop new task's r0-r12,lr & pc, copy spsr to cpsr
-
-#else /*RT_USING_SMP*/
- ldr r2, =rt_thread_switch_interrupt_flag
- ldr r3, [r2]
- cmp r3, #1
- beq _reswitch
- ldr ip, =rt_interrupt_from_thread @ set rt_interrupt_from_thread
- mov r3, #1 @ set rt_thread_switch_interrupt_flag to 1
- str r0, [ip]
- str r3, [r2]
-_reswitch:
- ldr r2, =rt_interrupt_to_thread @ set rt_interrupt_to_thread
- str r1, [r2]
- bx lr
-#endif /*RT_USING_SMP*/
diff --git a/bsp/qemu-vexpress-a9/cpu/cp15.h b/bsp/qemu-vexpress-a9/cpu/cp15.h
deleted file mode 100644
index ebea3f0fe3..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/cp15.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __CP15_H__
-#define __CP15_H__
-
-unsigned long rt_cpu_get_smp_id(void);
-
-void rt_cpu_mmu_disable(void);
-void rt_cpu_mmu_enable(void);
-void rt_cpu_tlb_set(volatile unsigned long*);
-
-void rt_cpu_vector_set_base(unsigned int addr);
-
-#endif
diff --git a/bsp/qemu-vexpress-a9/cpu/cp15_gcc.S b/bsp/qemu-vexpress-a9/cpu/cp15_gcc.S
deleted file mode 100644
index f1ed6492aa..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/cp15_gcc.S
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * File : cp15_gcc.S
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013, RT-Thread Development Team
- * http://www.rt-thread.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-05 Bernard the first version
- */
-
-.globl rt_cpu_get_smp_id
-rt_cpu_get_smp_id:
- mrc p15, #0, r0, c0, c0, #5
- bx lr
-
-.globl rt_cpu_vector_set_base
-rt_cpu_vector_set_base:
- mcr p15, #0, r0, c12, c0, #0
- dsb
- bx lr
-
-.globl rt_hw_cpu_dcache_enable
-rt_hw_cpu_dcache_enable:
- mrc p15, #0, r0, c1, c0, #0
- orr r0, r0, #0x00000004
- mcr p15, #0, r0, c1, c0, #0
- bx lr
-
-.globl rt_hw_cpu_icache_enable
-rt_hw_cpu_icache_enable:
- mrc p15, #0, r0, c1, c0, #0
- orr r0, r0, #0x00001000
- mcr p15, #0, r0, c1, c0, #0
- bx lr
-
-_FLD_MAX_WAY:
- .word 0x3ff
-_FLD_MAX_IDX:
- .word 0x7ff
-
-.globl rt_cpu_dcache_clean_flush
-rt_cpu_dcache_clean_flush:
- push {r4-r11}
- dmb
- mrc p15, #1, r0, c0, c0, #1 @ read clid register
- ands r3, r0, #0x7000000 @ get level of coherency
- mov r3, r3, lsr #23
- beq finished
- mov r10, #0
-loop1:
- add r2, r10, r10, lsr #1
- mov r1, r0, lsr r2
- and r1, r1, #7
- cmp r1, #2
- blt skip
- mcr p15, #2, r10, c0, c0, #0
- isb
- mrc p15, #1, r1, c0, c0, #0
- and r2, r1, #7
- add r2, r2, #4
- ldr r4, _FLD_MAX_WAY
- ands r4, r4, r1, lsr #3
- clz r5, r4
- ldr r7, _FLD_MAX_IDX
- ands r7, r7, r1, lsr #13
-loop2:
- mov r9, r4
-loop3:
- orr r11, r10, r9, lsl r5
- orr r11, r11, r7, lsl r2
- mcr p15, #0, r11, c7, c14, #2
- subs r9, r9, #1
- bge loop3
- subs r7, r7, #1
- bge loop2
-skip:
- add r10, r10, #2
- cmp r3, r10
- bgt loop1
-
-finished:
- dsb
- isb
- pop {r4-r11}
- bx lr
-
-.globl rt_hw_cpu_dcache_disable
-rt_hw_cpu_dcache_disable:
- push {r4-r11, lr}
- bl rt_cpu_dcache_clean_flush
- mrc p15, #0, r0, c1, c0, #0
- bic r0, r0, #0x00000004
- mcr p15, #0, r0, c1, c0, #0
- pop {r4-r11, lr}
- bx lr
-
-.globl rt_hw_cpu_icache_disable
-rt_hw_cpu_icache_disable:
- mrc p15, #0, r0, c1, c0, #0
- bic r0, r0, #0x00001000
- mcr p15, #0, r0, c1, c0, #0
- bx lr
-
-.globl rt_cpu_mmu_disable
-rt_cpu_mmu_disable:
- mcr p15, #0, r0, c8, c7, #0 @ invalidate tlb
- mrc p15, #0, r0, c1, c0, #0
- bic r0, r0, #1
- mcr p15, #0, r0, c1, c0, #0 @ clear mmu bit
- dsb
- bx lr
-
-.globl rt_cpu_mmu_enable
-rt_cpu_mmu_enable:
- mrc p15, #0, r0, c1, c0, #0
- orr r0, r0, #0x001
- mcr p15, #0, r0, c1, c0, #0 @ set mmu enable bit
- dsb
- bx lr
-
-.globl rt_cpu_tlb_set
-rt_cpu_tlb_set:
- mcr p15, #0, r0, c2, c0, #0
- dmb
- bx lr
diff --git a/bsp/qemu-vexpress-a9/cpu/cpuport.c b/bsp/qemu-vexpress-a9/cpu/cpuport.c
deleted file mode 100644
index 6b129f89ee..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/cpuport.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2011-09-15 Bernard first version
- * 2018-11-22 Jesven add rt_hw_cpu_id()
- */
-
-#include <rthw.h>
-#include <rtthread.h>
-#include <board.h>
-
-#ifdef RT_USING_SMP
-int rt_hw_cpu_id(void)
-{
- int cpu_id;
- __asm__ volatile (
- "mrc p15, 0, %0, c0, c0, 5"
- :"=r"(cpu_id)
- );
- cpu_id &= 0xf;
- return cpu_id;
-};
-
-void rt_hw_spin_lock(rt_hw_spinlock_t *lock)
-{
- unsigned long tmp;
- unsigned long newval;
- rt_hw_spinlock_t lockval;
-
- __asm__ __volatile__(
- "pld [%0]"
- ::"r"(&lock->slock)
- );
-
- __asm__ __volatile__(
- "1: ldrex %0, [%3]\n"
- " add %1, %0, %4\n"
- " strex %2, %1, [%3]\n"
- " teq %2, #0\n"
- " bne 1b"
- : "=&r" (lockval), "=&r" (newval), "=&r" (tmp)
- : "r" (&lock->slock), "I" (1 << 16)
- : "cc");
-
- while (lockval.tickets.next != lockval.tickets.owner) {
- __asm__ __volatile__("wfe":::"memory");
- lockval.tickets.owner = *(volatile unsigned short *)(&lock->tickets.owner);
- }
-
- __asm__ volatile ("dmb":::"memory");
-}
-
-void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
-{
- __asm__ volatile ("dmb":::"memory");
- lock->tickets.owner++;
- __asm__ volatile ("dsb ishst\nsev":::"memory");
-}
-#endif /*RT_USING_SMP*/
-
-/**
- * @addtogroup ARM CPU
- */
-/*@{*/
-
-/** shutdown CPU */
-void rt_hw_cpu_shutdown()
-{
- rt_uint32_t level;
- rt_kprintf("shutdown...\n");
-
- level = rt_hw_interrupt_disable();
- while (level)
- {
- RT_ASSERT(0);
- }
-}
-
-/*@}*/
diff --git a/bsp/qemu-vexpress-a9/cpu/gic.c b/bsp/qemu-vexpress-a9/cpu/gic.c
deleted file mode 100644
index 66876518ce..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/gic.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * File : gic.c, ARM Generic Interrupt Controller
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013-2014, RT-Thread Develop Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-20 Bernard first version
- * 2014-04-03 Grissiom many enhancements
- * 2018-11-22 Jesven add rt_hw_ipi_send()
- * add rt_hw_ipi_handler_install()
- */
-
-#include <rthw.h>
-#include <rtthread.h>
-#include <board.h>
-
-#include "gic.h"
-#include "cp15.h"
-
-struct arm_gic
-{
- rt_uint32_t offset;
-
- rt_uint32_t dist_hw_base;
- rt_uint32_t cpu_hw_base;
-};
-static struct arm_gic _gic_table[ARM_GIC_MAX_NR];
-
-#define GIC_CPU_CTRL(hw_base) __REG32((hw_base) + 0x00)
-#define GIC_CPU_PRIMASK(hw_base) __REG32((hw_base) + 0x04)
-#define GIC_CPU_BINPOINT(hw_base) __REG32((hw_base) + 0x08)
-#define GIC_CPU_INTACK(hw_base) __REG32((hw_base) + 0x0c)
-#define GIC_CPU_EOI(hw_base) __REG32((hw_base) + 0x10)
-#define GIC_CPU_RUNNINGPRI(hw_base) __REG32((hw_base) + 0x14)
-#define GIC_CPU_HIGHPRI(hw_base) __REG32((hw_base) + 0x18)
-
-#define GIC_DIST_CTRL(hw_base) __REG32((hw_base) + 0x000)
-#define GIC_DIST_TYPE(hw_base) __REG32((hw_base) + 0x004)
-#define GIC_DIST_IGROUP(hw_base, n) __REG32((hw_base) + 0x080 + ((n)/32) * 4)
-#define GIC_DIST_ENABLE_SET(hw_base, n) __REG32((hw_base) + 0x100 + ((n)/32) * 4)
-#define GIC_DIST_ENABLE_CLEAR(hw_base, n) __REG32((hw_base) + 0x180 + ((n)/32) * 4)
-#define GIC_DIST_PENDING_SET(hw_base, n) __REG32((hw_base) + 0x200 + ((n)/32) * 4)
-#define GIC_DIST_PENDING_CLEAR(hw_base, n) __REG32((hw_base) + 0x280 + ((n)/32) * 4)
-#define GIC_DIST_ACTIVE_SET(hw_base, n) __REG32((hw_base) + 0x300 + ((n)/32) * 4)
-#define GIC_DIST_ACTIVE_CLEAR(hw_base, n) __REG32((hw_base) + 0x380 + ((n)/32) * 4)
-#define GIC_DIST_PRI(hw_base, n) __REG32((hw_base) + 0x400 + ((n)/4) * 4)
-#define GIC_DIST_TARGET(hw_base, n) __REG32((hw_base) + 0x800 + ((n)/4) * 4)
-#define GIC_DIST_CONFIG(hw_base, n) __REG32((hw_base) + 0xc00 + ((n)/16) * 4)
-#define GIC_DIST_SOFTINT(hw_base) __REG32((hw_base) + 0xf00)
-#define GIC_DIST_CPENDSGI(hw_base, n) __REG32((hw_base) + 0xf10 + ((n)/4) * 4)
-#define GIC_DIST_ICPIDR2(hw_base) __REG32((hw_base) + 0xfe8)
-
-static unsigned int _gic_max_irq;
-
-int arm_gic_get_active_irq(rt_uint32_t index)
-{
- int irq;
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = GIC_CPU_INTACK(_gic_table[index].cpu_hw_base);
- irq += _gic_table[index].offset;
- return irq;
-}
-
-void arm_gic_ack(rt_uint32_t index, int irq)
-{
- rt_uint32_t mask = 1 << (irq % 32);
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = irq - _gic_table[index].offset;
- RT_ASSERT(irq >= 0);
-
- GIC_DIST_ENABLE_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
- GIC_CPU_EOI(_gic_table[index].cpu_hw_base) = irq;
- GIC_DIST_ENABLE_SET(_gic_table[index].dist_hw_base, irq) = mask;
-}
-
-void arm_gic_mask(rt_uint32_t index, int irq)
-{
- rt_uint32_t mask = 1 << (irq % 32);
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = irq - _gic_table[index].offset;
- RT_ASSERT(irq >= 0);
-
- GIC_DIST_ENABLE_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
-}
-
-void arm_gic_clear_pending(rt_uint32_t index, int irq)
-{
- rt_uint32_t mask = 1 << (irq % 32);
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = irq - _gic_table[index].offset;
- RT_ASSERT(irq >= 0);
-
- GIC_DIST_PENDING_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
-}
-
-void arm_gic_clear_active(rt_uint32_t index, int irq)
-{
- rt_uint32_t mask = 1 << (irq % 32);
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = irq - _gic_table[index].offset;
- RT_ASSERT(irq >= 0);
-
- GIC_DIST_ACTIVE_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
-}
-
-void arm_gic_set_cpu(rt_uint32_t index, int irq, unsigned int cpumask)
-{
- rt_uint32_t old_tgt;
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = irq - _gic_table[index].offset;
- RT_ASSERT(irq >= 0);
-
- old_tgt = GIC_DIST_TARGET(_gic_table[index].dist_hw_base, irq);
-
- old_tgt &= ~(0x0FFUL << ((irq % 4)*8));
- old_tgt |= cpumask << ((irq % 4)*8);
-
- GIC_DIST_TARGET(_gic_table[index].dist_hw_base, irq) = old_tgt;
-}
-
-void arm_gic_umask(rt_uint32_t index, int irq)
-{
- rt_uint32_t mask = 1 << (irq % 32);
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- irq = irq - _gic_table[index].offset;
- RT_ASSERT(irq >= 0);
-
- GIC_DIST_ENABLE_SET(_gic_table[index].dist_hw_base, irq) = mask;
-}
-
-void arm_gic_dump_type(rt_uint32_t index)
-{
- unsigned int gic_type;
-
- gic_type = GIC_DIST_TYPE(_gic_table[index].dist_hw_base);
- rt_kprintf("GICv%d on %p, max IRQs: %d, %s security extension(%08x)\n",
- (GIC_DIST_ICPIDR2(_gic_table[index].dist_hw_base) >> 4) & 0xf,
- _gic_table[index].dist_hw_base,
- _gic_max_irq,
- gic_type & (1 << 10) ? "has" : "no",
- gic_type);
-}
-
-void arm_gic_dump(rt_uint32_t index)
-{
- unsigned int i, k;
-
- k = GIC_CPU_HIGHPRI(_gic_table[index].cpu_hw_base);
- rt_kprintf("--- high pending priority: %d(%08x)\n", k, k);
- rt_kprintf("--- hw mask ---\n");
- for (i = 0; i < _gic_max_irq / 32; i++)
- {
- rt_kprintf("0x%08x, ",
- GIC_DIST_ENABLE_SET(_gic_table[index].dist_hw_base,
- i * 32));
- }
- rt_kprintf("\n--- hw pending ---\n");
- for (i = 0; i < _gic_max_irq / 32; i++)
- {
- rt_kprintf("0x%08x, ",
- GIC_DIST_PENDING_SET(_gic_table[index].dist_hw_base,
- i * 32));
- }
- rt_kprintf("\n--- hw active ---\n");
- for (i = 0; i < _gic_max_irq / 32; i++)
- {
- rt_kprintf("0x%08x, ",
- GIC_DIST_ACTIVE_SET(_gic_table[index].dist_hw_base,
- i * 32));
- }
- rt_kprintf("\n");
-}
-#ifdef RT_USING_FINSH
-#include <finsh.h>
-FINSH_FUNCTION_EXPORT_ALIAS(arm_gic_dump, gic, show gic status);
-#endif
-
-int arm_gic_dist_init(rt_uint32_t index, rt_uint32_t dist_base, int irq_start)
-{
- unsigned int gic_type, i;
- rt_uint32_t cpumask = 1 << 0;
-
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- _gic_table[index].dist_hw_base = dist_base;
- _gic_table[index].offset = irq_start;
-
- /* Find out how many interrupts are supported. */
- gic_type = GIC_DIST_TYPE(dist_base);
- _gic_max_irq = ((gic_type & 0x1f) + 1) * 32;
-
- /*
- * The GIC only supports up to 1020 interrupt sources.
- * Limit this to either the architected maximum, or the
- * platform maximum.
- */
- if (_gic_max_irq > 1020)
- _gic_max_irq = 1020;
- if (_gic_max_irq > ARM_GIC_NR_IRQS)
- _gic_max_irq = ARM_GIC_NR_IRQS;
-
- cpumask |= cpumask << 8;
- cpumask |= cpumask << 16;
-
- GIC_DIST_CTRL(dist_base) = 0x0;
-
- /* Set all global interrupts to be level triggered, active low. */
- for (i = 32; i < _gic_max_irq; i += 16)
- GIC_DIST_CONFIG(dist_base, i) = 0x0;
-
- /* Set all global interrupts to this CPU only. */
- for (i = 32; i < _gic_max_irq; i += 4)
- GIC_DIST_TARGET(dist_base, i) = cpumask;
-
- /* Set priority on all interrupts. */
- for (i = 0; i < _gic_max_irq; i += 4)
- GIC_DIST_PRI(dist_base, i) = 0xa0a0a0a0;
-
- /* Disable all interrupts. */
- for (i = 0; i < _gic_max_irq; i += 32)
- GIC_DIST_ENABLE_CLEAR(dist_base, i) = 0xffffffff;
-
-#if 0
- /* All interrupts defaults to IGROUP1(IRQ). */
- for (i = 0; i < _gic_max_irq; i += 32)
- GIC_DIST_IGROUP(dist_base, i) = 0xffffffff;
-#endif
-
- /* Enable group0 and group1 interrupt forwarding. */
- GIC_DIST_CTRL(dist_base) = 0x03;
-
- return 0;
-}
-
-int arm_gic_cpu_init(rt_uint32_t index, rt_uint32_t cpu_base)
-{
- RT_ASSERT(index < ARM_GIC_MAX_NR);
-
- _gic_table[index].cpu_hw_base = cpu_base;
-
- GIC_CPU_PRIMASK(cpu_base) = 0xf0;
- /* Enable CPU interrupt */
- GIC_CPU_CTRL(cpu_base) = 0x01;
-
- return 0;
-}
-
-void arm_gic_set_group(rt_uint32_t index, int vector, int group)
-{
- /* As for GICv2, there are only group0 and group1. */
- RT_ASSERT(group <= 1);
- RT_ASSERT(vector < _gic_max_irq);
-
- if (group == 0)
- {
- GIC_DIST_IGROUP(_gic_table[index].dist_hw_base,
- vector) &= ~(1 << (vector % 32));
- }
- else if (group == 1)
- {
- GIC_DIST_IGROUP(_gic_table[index].dist_hw_base,
- vector) |= (1 << (vector % 32));
- }
-}
-
-#ifdef RT_USING_SMP
-void rt_hw_ipi_send(int ipi_vector, unsigned int cpu_mask)
- {
- /* note: ipi_vector maybe different with irq_vector */
- GIC_DIST_SOFTINT(_gic_table[0].dist_hw_base) = (cpu_mask << 16) | ipi_vector;
-}
-#endif
-
-#ifdef RT_USING_SMP
-void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler)
-{
- /* note: ipi_vector maybe different with irq_vector */
- rt_hw_interrupt_install(ipi_vector, ipi_isr_handler, 0, "IPI_HANDLER");
-}
-#endif
diff --git a/bsp/qemu-vexpress-a9/cpu/gic.h b/bsp/qemu-vexpress-a9/cpu/gic.h
deleted file mode 100644
index 9d0368ec94..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/gic.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * File : gic.h, ARM Generic Interrupt Controller
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013, RT-Thread Develop Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-20 Bernard first version
- */
-
-#ifndef __GIC_H__
-#define __GIC_H__
-
-int arm_gic_dist_init(rt_uint32_t index, rt_uint32_t dist_base, int irq_start);
-int arm_gic_cpu_init(rt_uint32_t index, rt_uint32_t cpu_base);
-
-void arm_gic_mask(rt_uint32_t index, int irq);
-void arm_gic_umask(rt_uint32_t index, int irq);
-void arm_gic_set_cpu(rt_uint32_t index, int irq, unsigned int cpumask);
-void arm_gic_set_group(rt_uint32_t index, int vector, int group);
-
-int arm_gic_get_active_irq(rt_uint32_t index);
-void arm_gic_ack(rt_uint32_t index, int irq);
-
-void arm_gic_dump_type(rt_uint32_t index);
-void rt_hw_vector_init(void);
-
-#endif
-
diff --git a/bsp/qemu-vexpress-a9/cpu/interrupt.c b/bsp/qemu-vexpress-a9/cpu/interrupt.c
deleted file mode 100644
index d7e9ec08fa..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/interrupt.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * File : interrupt.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013-2014, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-06 Bernard first version
- * 2018-11-22 Jesven add smp support
- */
-
-#include <rthw.h>
-#include <rtthread.h>
-#include "realview.h"
-#include "gic.h"
-
-#define MAX_HANDLERS NR_IRQS_PBA8
-
-/* exception and interrupt handler table */
-struct rt_irq_desc isr_table[MAX_HANDLERS];
-
-#ifndef RT_USING_SMP
-/* Those varibles will be accessed in ISR, so we need to share them. */
-rt_uint32_t rt_interrupt_from_thread = 0;
-rt_uint32_t rt_interrupt_to_thread = 0;
-rt_uint32_t rt_thread_switch_interrupt_flag = 0;
-#endif
-
-const unsigned int VECTOR_BASE = 0x00;
-extern void rt_cpu_vector_set_base(unsigned int addr);
-extern int system_vectors;
-
-void rt_hw_vector_init(void)
-{
- rt_cpu_vector_set_base((unsigned int)&system_vectors);
-}
-
-/**
- * This function will initialize hardware interrupt
- */
-void rt_hw_interrupt_init(void)
-{
- rt_uint32_t gic_cpu_base;
- rt_uint32_t gic_dist_base;
-
- /* initialize vector table */
- rt_hw_vector_init();
-
- /* initialize exceptions table */
- rt_memset(isr_table, 0x00, sizeof(isr_table));
-
- /* initialize ARM GIC */
- gic_dist_base = REALVIEW_GIC_DIST_BASE;
- gic_cpu_base = REALVIEW_GIC_CPU_BASE;
-
- arm_gic_dist_init(0, gic_dist_base, 0);
- arm_gic_cpu_init(0, gic_cpu_base);
-}
-
-/**
- * This function will mask a interrupt.
- * @param vector the interrupt number
- */
-void rt_hw_interrupt_mask(int vector)
-{
- arm_gic_mask(0, vector);
-}
-
-/**
- * This function will un-mask a interrupt.
- * @param vector the interrupt number
- */
-void rt_hw_interrupt_umask(int vector)
-{
- arm_gic_umask(0, vector);
-}
-
-/**
- * This function will install a interrupt service routine to a interrupt.
- * @param vector the interrupt number
- * @param new_handler the interrupt service routine to be installed
- * @param old_handler the old interrupt service routine
- */
-rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
- void *param, const char *name)
-{
- rt_isr_handler_t old_handler = RT_NULL;
-
- if (vector < MAX_HANDLERS)
- {
- old_handler = isr_table[vector].handler;
-
- if (handler != RT_NULL)
- {
-#ifdef RT_USING_INTERRUPT_INFO
- rt_strncpy(isr_table[vector].name, name, RT_NAME_MAX);
-#endif /* RT_USING_INTERRUPT_INFO */
- isr_table[vector].handler = handler;
- isr_table[vector].param = param;
- }
- }
-
- return old_handler;
-}
diff --git a/bsp/qemu-vexpress-a9/cpu/interrupt.h b/bsp/qemu-vexpress-a9/cpu/interrupt.h
deleted file mode 100644
index 045246b21d..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/interrupt.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * File : interrupt.h
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2011, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-06 Bernard first version
- */
-
-#ifndef __INTERRUPT_H__
-#define __INTERRUPT_H__
-
-#define INT_IRQ 0x00
-#define INT_FIQ 0x01
-
-void rt_hw_interrupt_control(int vector, int priority, int route);
-
-void rt_hw_interrupt_init(void);
-
-#endif
diff --git a/bsp/qemu-vexpress-a9/cpu/mmu.c b/bsp/qemu-vexpress-a9/cpu/mmu.c
deleted file mode 100644
index b2503e4260..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/mmu.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * File : mmu.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2006, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2012-01-10 bernard porting to AM1808
- */
-
-#include <rtthread.h>
-#include <rthw.h>
-#include <board.h>
-
-#include "cp15.h"
-
-#define DESC_SEC (0x2)
-#define CB (3<<2) //cache_on, write_back
-#define CNB (2<<2) //cache_on, write_through
-#define NCB (1<<2) //cache_off,WR_BUF on
-#define NCNB (0<<2) //cache_off,WR_BUF off
-#define AP_RW (3<<10) //supervisor=RW, user=RW
-#define AP_RO (2<<10) //supervisor=RW, user=RO
-#define XN (1<<4) // eXecute Never
-
-#define DOMAIN_FAULT (0x0)
-#define DOMAIN_CHK (0x1)
-#define DOMAIN_NOTCHK (0x3)
-#define DOMAIN0 (0x0<<5)
-#define DOMAIN1 (0x1<<5)
-
-#define DOMAIN0_ATTR (DOMAIN_CHK<<0)
-#define DOMAIN1_ATTR (DOMAIN_FAULT<<2)
-
-/* Read/Write, cache, write back */
-#define RW_CB (AP_RW|DOMAIN0|CB|DESC_SEC)
-/* Read/Write, cache, write through */
-#define RW_CNB (AP_RW|DOMAIN0|CNB|DESC_SEC)
-/* Read/Write without cache and write buffer */
-#define RW_NCNB (AP_RW|DOMAIN0|NCNB|DESC_SEC)
-/* Read/Write without cache and write buffer, no execute */
-#define RW_NCNBXN (AP_RW|DOMAIN0|NCNB|DESC_SEC|XN)
-/* Read/Write without cache and write buffer */
-#define RW_FAULT (AP_RW|DOMAIN1|NCNB|DESC_SEC)
-
-/* dump 2nd level page table */
-void rt_hw_cpu_dump_page_table_2nd(rt_uint32_t *ptb)
-{
- int i;
- int fcnt = 0;
-
- for (i = 0; i < 256; i++)
- {
- rt_uint32_t pte2 = ptb[i];
- if ((pte2 & 0x3) == 0)
- {
- if (fcnt == 0)
- rt_kprintf(" ");
- rt_kprintf("%04x: ", i);
- fcnt++;
- if (fcnt == 16)
- {
- rt_kprintf("fault\n");
- fcnt = 0;
- }
- continue;
- }
- if (fcnt != 0)
- {
- rt_kprintf("fault\n");
- fcnt = 0;
- }
-
- rt_kprintf(" %04x: %x: ", i, pte2);
- if ((pte2 & 0x3) == 0x1)
- {
- rt_kprintf("L,ap:%x,xn:%d,texcb:%02x\n",
- ((pte2 >> 7) | (pte2 >> 4))& 0xf,
- (pte2 >> 15) & 0x1,
- ((pte2 >> 10) | (pte2 >> 2)) & 0x1f);
- }
- else
- {
- rt_kprintf("S,ap:%x,xn:%d,texcb:%02x\n",
- ((pte2 >> 7) | (pte2 >> 4))& 0xf, pte2 & 0x1,
- ((pte2 >> 4) | (pte2 >> 2)) & 0x1f);
- }
- }
-}
-
-void rt_hw_cpu_dump_page_table(rt_uint32_t *ptb)
-{
- int i;
- int fcnt = 0;
-
- rt_kprintf("page table@%p\n", ptb);
- for (i = 0; i < 1024*4; i++)
- {
- rt_uint32_t pte1 = ptb[i];
- if ((pte1 & 0x3) == 0)
- {
- rt_kprintf("%03x: ", i);
- fcnt++;
- if (fcnt == 16)
- {
- rt_kprintf("fault\n");
- fcnt = 0;
- }
- continue;
- }
- if (fcnt != 0)
- {
- rt_kprintf("fault\n");
- fcnt = 0;
- }
-
- rt_kprintf("%03x: %08x: ", i, pte1);
- if ((pte1 & 0x3) == 0x3)
- {
- rt_kprintf("LPAE\n");
- }
- else if ((pte1 & 0x3) == 0x1)
- {
- rt_kprintf("pte,ns:%d,domain:%d\n",
- (pte1 >> 3) & 0x1, (pte1 >> 5) & 0xf);
- /*
- *rt_hw_cpu_dump_page_table_2nd((void*)((pte1 & 0xfffffc000)
- * - 0x80000000 + 0xC0000000));
- */
- }
- else if (pte1 & (1 << 18))
- {
- rt_kprintf("super section,ns:%d,ap:%x,xn:%d,texcb:%02x\n",
- (pte1 >> 19) & 0x1,
- ((pte1 >> 13) | (pte1 >> 10))& 0xf,
- (pte1 >> 4) & 0x1,
- ((pte1 >> 10) | (pte1 >> 2)) & 0x1f);
- }
- else
- {
- rt_kprintf("section,ns:%d,ap:%x,"
- "xn:%d,texcb:%02x,domain:%d\n",
- (pte1 >> 19) & 0x1,
- ((pte1 >> 13) | (pte1 >> 10))& 0xf,
- (pte1 >> 4) & 0x1,
- (((pte1 & (0x7 << 12)) >> 10) |
- ((pte1 & 0x0c) >> 2)) & 0x1f,
- (pte1 >> 5) & 0xf);
- }
- }
-}
-
-/* level1 page table, each entry for 1MB memory. */
-volatile static unsigned long MMUTable[4*1024] __attribute__((aligned(16*1024)));
-void rt_hw_mmu_setmtt(rt_uint32_t vaddrStart,
- rt_uint32_t vaddrEnd,
- rt_uint32_t paddrStart,
- rt_uint32_t attr)
-{
- volatile rt_uint32_t *pTT;
- volatile int i, nSec;
- pTT = (rt_uint32_t *)MMUTable + (vaddrStart >> 20);
- nSec = (vaddrEnd >> 20) - (vaddrStart >> 20);
- for(i = 0; i <= nSec; i++)
- {
- *pTT = attr | (((paddrStart >> 20) + i) << 20);
- pTT++;
- }
-}
-
-unsigned long rt_hw_set_domain_register(unsigned long domain_val)
-{
- unsigned long old_domain;
-
- asm volatile ("mrc p15, 0, %0, c3, c0\n" : "=r" (old_domain));
- asm volatile ("mcr p15, 0, %0, c3, c0\n" : :"r" (domain_val) : "memory");
-
- return old_domain;
-}
-
-void rt_hw_mmu_init(void)
-{
- rt_hw_cpu_dcache_disable();
- rt_hw_cpu_icache_disable();
- rt_cpu_mmu_disable();
-
- /* set page table */
- /* 4G 1:1 memory */
- rt_hw_mmu_setmtt(0, 0xffffffff-1, 0, RW_CB);
- /* IO memory region */
- rt_hw_mmu_setmtt(0x44000000, 0x80000000-1, 0x44000000, RW_NCNBXN);
-
- /*rt_hw_cpu_dump_page_table(MMUTable);*/
- rt_hw_set_domain_register(0x55555555);
-
- rt_cpu_tlb_set(MMUTable);
-
- rt_cpu_mmu_enable();
-
- rt_hw_cpu_icache_enable();
- rt_hw_cpu_dcache_enable();
-}
-
diff --git a/bsp/qemu-vexpress-a9/cpu/pmu.c b/bsp/qemu-vexpress-a9/cpu/pmu.c
deleted file mode 100644
index 07911a2db7..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/pmu.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <rtthread.h>
-#include "pmu.h"
-
-void rt_hw_pmu_dump_feature(void)
-{
- unsigned long reg;
-
- reg = rt_hw_pmu_get_control();
- rt_kprintf("ARM PMU Implementor: %c, ID code: %02x, %d counters\n",
- reg >> 24, (reg >> 16) & 0xff, (reg >> 11) & 0x1f);
- RT_ASSERT(ARM_PMU_CNTER_NR == ((reg >> 11) & 0x1f));
-}
diff --git a/bsp/qemu-vexpress-a9/cpu/pmu.h b/bsp/qemu-vexpress-a9/cpu/pmu.h
deleted file mode 100644
index 05c1420dd8..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/pmu.h
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef __PMU_H__
-#define __PMU_H__
-
-#include "board.h"
-
-/* Number of counters */
-#define ARM_PMU_CNTER_NR 4
-
-enum rt_hw_pmu_event_type {
- ARM_PMU_EVENT_PMNC_SW_INCR = 0x00,
- ARM_PMU_EVENT_L1_ICACHE_REFILL = 0x01,
- ARM_PMU_EVENT_ITLB_REFILL = 0x02,
- ARM_PMU_EVENT_L1_DCACHE_REFILL = 0x03,
- ARM_PMU_EVENT_L1_DCACHE_ACCESS = 0x04,
- ARM_PMU_EVENT_DTLB_REFILL = 0x05,
- ARM_PMU_EVENT_MEM_READ = 0x06,
- ARM_PMU_EVENT_MEM_WRITE = 0x07,
- ARM_PMU_EVENT_INSTR_EXECUTED = 0x08,
- ARM_PMU_EVENT_EXC_TAKEN = 0x09,
- ARM_PMU_EVENT_EXC_EXECUTED = 0x0A,
- ARM_PMU_EVENT_CID_WRITE = 0x0B,
-};
-
-/* Enable bit */
-#define ARM_PMU_PMCR_E (0x01 << 0)
-/* Event counter reset */
-#define ARM_PMU_PMCR_P (0x01 << 1)
-/* Cycle counter reset */
-#define ARM_PMU_PMCR_C (0x01 << 2)
-/* Cycle counter divider */
-#define ARM_PMU_PMCR_D (0x01 << 3)
-
-#ifdef __GNUC__
-rt_inline void rt_hw_pmu_enable_cnt(int divide64)
-{
- unsigned long pmcr;
- unsigned long pmcntenset;
-
- asm volatile ("mrc p15, 0, %0, c9, c12, 0" : "=r"(pmcr));
- pmcr |= ARM_PMU_PMCR_E | ARM_PMU_PMCR_P | ARM_PMU_PMCR_C;
- if (divide64)
- pmcr |= ARM_PMU_PMCR_D;
- else
- pmcr &= ~ARM_PMU_PMCR_D;
- asm volatile ("mcr p15, 0, %0, c9, c12, 0" :: "r"(pmcr));
-
- /* enable all the counters */
- pmcntenset = ~0;
- asm volatile ("mcr p15, 0, %0, c9, c12, 1" :: "r"(pmcntenset));
- /* clear overflows(just in case) */
- asm volatile ("mcr p15, 0, %0, c9, c12, 3" :: "r"(pmcntenset));
-}
-
-rt_inline unsigned long rt_hw_pmu_get_control(void)
-{
- unsigned long pmcr;
- asm ("mrc p15, 0, %0, c9, c12, 0" : "=r"(pmcr));
- return pmcr;
-}
-
-rt_inline unsigned long rt_hw_pmu_get_ceid(void)
-{
- unsigned long reg;
- /* only PMCEID0 is supported, PMCEID1 is RAZ. */
- asm ("mrc p15, 0, %0, c9, c12, 6" : "=r"(reg));
- return reg;
-}
-
-rt_inline unsigned long rt_hw_pmu_get_cnten(void)
-{
- unsigned long pmcnt;
- asm ("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcnt));
- return pmcnt;
-}
-
-rt_inline void rt_hw_pmu_reset_cycle(void)
-{
- unsigned long pmcr;
-
- asm volatile ("mrc p15, 0, %0, c9, c12, 0" : "=r"(pmcr));
- pmcr |= ARM_PMU_PMCR_C;
- asm volatile ("mcr p15, 0, %0, c9, c12, 0" :: "r"(pmcr));
- asm volatile ("isb");
-}
-
-rt_inline void rt_hw_pmu_reset_event(void)
-{
- unsigned long pmcr;
-
- asm volatile ("mrc p15, 0, %0, c9, c12, 0" : "=r"(pmcr));
- pmcr |= ARM_PMU_PMCR_P;
- asm volatile ("mcr p15, 0, %0, c9, c12, 0" :: "r"(pmcr));
- asm volatile ("isb");
-}
-
-rt_inline unsigned long rt_hw_pmu_get_cycle(void)
-{
- unsigned long cyc;
- asm volatile ("isb");
- asm volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r"(cyc));
- return cyc;
-}
-
-rt_inline void rt_hw_pmu_select_counter(int idx)
-{
- RT_ASSERT(idx < ARM_PMU_CNTER_NR);
-
- asm volatile ("mcr p15, 0, %0, c9, c12, 5" : : "r"(idx));
- /* Linux add an isb here, don't know why here. */
- asm volatile ("isb");
-}
-
-rt_inline void rt_hw_pmu_select_event(int idx,
- enum rt_hw_pmu_event_type eve)
-{
- RT_ASSERT(idx < ARM_PMU_CNTER_NR);
-
- rt_hw_pmu_select_counter(idx);
- asm volatile ("mcr p15, 0, %0, c9, c13, 1" : : "r"(eve));
-}
-
-rt_inline unsigned long rt_hw_pmu_read_counter(int idx)
-{
- unsigned long reg;
-
- rt_hw_pmu_select_counter(idx);
- asm volatile ("isb");
- asm volatile ("mrc p15, 0, %0, c9, c13, 2" : "=r"(reg));
- return reg;
-}
-
-rt_inline unsigned long rt_hw_pmu_get_ovsr(void)
-{
- unsigned long reg;
- asm volatile ("isb");
- asm ("mrc p15, 0, %0, c9, c12, 3" : "=r"(reg));
- return reg;
-}
-
-rt_inline void rt_hw_pmu_clear_ovsr(unsigned long reg)
-{
- asm ("mcr p15, 0, %0, c9, c12, 3" : : "r"(reg));
- asm volatile ("isb");
-}
-
-#endif
-
-void rt_hw_pmu_dump_feature(void);
-
-#endif /* end of include guard: __PMU_H__ */
-
diff --git a/bsp/qemu-vexpress-a9/cpu/stack.c b/bsp/qemu-vexpress-a9/cpu/stack.c
deleted file mode 100644
index dfb97557bc..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/stack.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * File : stack.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2011, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2011-09-23 Bernard the first version
- * 2011-10-05 Bernard add thumb mode
- */
-#include <rtthread.h>
-#include <board.h>
-
-/**
- * @addtogroup AM33xx
- */
-/*@{*/
-
-/**
- * This function will initialize thread stack
- *
- * @param tentry the entry of thread
- * @param parameter the parameter of entry
- * @param stack_addr the beginning stack address
- * @param texit the function will be called when thread exit
- *
- * @return stack address
- */
-rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
- rt_uint8_t *stack_addr, void *texit)
-{
- rt_uint32_t *stk;
-
- stack_addr += sizeof(rt_uint32_t);
- stack_addr = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)stack_addr, 8);
- stk = (rt_uint32_t*)stack_addr;
- *(--stk) = (rt_uint32_t)tentry; /* entry point */
- *(--stk) = (rt_uint32_t)texit; /* lr */
- *(--stk) = 0; /* r12 */
- *(--stk) = 0; /* r11 */
- *(--stk) = 0; /* r10 */
- *(--stk) = 0; /* r9 */
- *(--stk) = 0; /* r8 */
- *(--stk) = 0; /* r7 */
- *(--stk) = 0; /* r6 */
- *(--stk) = 0; /* r5 */
- *(--stk) = 0; /* r4 */
- *(--stk) = 0; /* r3 */
- *(--stk) = 0; /* r2 */
- *(--stk) = 0; /* r1 */
- *(--stk) = (rt_uint32_t)parameter; /* r0 : argument */
- /* cpsr */
- if ((rt_uint32_t)tentry & 0x01)
- *(--stk) = SVCMODE | 0x20; /* thumb mode */
- else
- *(--stk) = SVCMODE; /* arm mode */
-
-#ifdef RT_USING_LWP
- *(--stk) = 0; /* user lr */
- *(--stk) = 0; /* user sp*/
-#endif
-
- /* return task's current stack address */
- return (rt_uint8_t *)stk;
-}
-
-/*@}*/
diff --git a/bsp/qemu-vexpress-a9/cpu/start_gcc.S b/bsp/qemu-vexpress-a9/cpu/start_gcc.S
deleted file mode 100644
index b71d8a1568..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/start_gcc.S
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * File : start_gcc.S
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013-2014, RT-Thread Development Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-05 Bernard the first version
- * 2018-11-22 Jesven in the interrupt context, use rt_scheduler_do_irq_switch checks
- * and switches to a new thread
- */
-
-#include "rtconfig.h"
-
-.equ Mode_USR, 0x10
-.equ Mode_FIQ, 0x11
-.equ Mode_IRQ, 0x12
-.equ Mode_SVC, 0x13
-.equ Mode_ABT, 0x17
-.equ Mode_UND, 0x1B
-.equ Mode_SYS, 0x1F
-
-.equ I_Bit, 0x80 @ when I bit is set, IRQ is disabled
-.equ F_Bit, 0x40 @ when F bit is set, FIQ is disabled
-
-.equ UND_Stack_Size, 0x00000000
-.equ SVC_Stack_Size, 0x00000400
-.equ ABT_Stack_Size, 0x00000000
-.equ RT_FIQ_STACK_PGSZ, 0x00000000
-.equ RT_IRQ_STACK_PGSZ, 0x00000800
-.equ USR_Stack_Size, 0x00000400
-
-#define ISR_Stack_Size (UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + \
- RT_FIQ_STACK_PGSZ + RT_IRQ_STACK_PGSZ)
-
-.section .data.share.isr
-/* stack */
-.globl stack_start
-.globl stack_top
-
-stack_start:
-.rept ISR_Stack_Size
-.byte 0
-.endr
-stack_top:
-
-.text
-/* reset entry */
-.globl _reset
-_reset:
- /* set the cpu to SVC32 mode and disable interrupt */
- mrs r0, cpsr
- bic r0, r0, #0x1f
- orr r0, r0, #0x13
- msr cpsr_c, r0
-
- mrc p15, 0, r1, c1, c0, 1
- mov r0, #(1<<6)
- orr r1, r0
- mcr p15, 0, r1, c1, c0, 1 //enable smp
-
- ldr lr, =after_enable_mmu
- ldr r0, =mtbl
- b enable_mmu
-
-after_enable_mmu:
-
- /* setup stack */
- bl stack_setup
-
- /* clear .bss */
- mov r0,#0 /* get a zero */
- ldr r1,=__bss_start /* bss start */
- ldr r2,=__bss_end /* bss end */
-
-bss_loop:
- cmp r1,r2 /* check if data to clear */
- strlo r0,[r1],#4 /* clear 4 bytes */
- blo bss_loop /* loop until done */
-
- /* call C++ constructors of global objects */
- ldr r0, =__ctors_start__
- ldr r1, =__ctors_end__
-
-ctor_loop:
- cmp r0, r1
- beq ctor_end
- ldr r2, [r0], #4
- stmfd sp!, {r0-r1}
- mov lr, pc
- bx r2
- ldmfd sp!, {r0-r1}
- b ctor_loop
-ctor_end:
-
- /* start RT-Thread Kernel */
- bl flush_cache_all
- ldr pc, _rtthread_startup
-_rtthread_startup:
- .word rtthread_startup
-
-stack_setup:
- ldr r0, =stack_top
-
- @ Set the startup stack for svc
- mov sp, r0
-
- @ Enter Undefined Instruction Mode and set its Stack Pointer
- msr cpsr_c, #Mode_UND|I_Bit|F_Bit
- mov sp, r0
- sub r0, r0, #UND_Stack_Size
-
- @ Enter Abort Mode and set its Stack Pointer
- msr cpsr_c, #Mode_ABT|I_Bit|F_Bit
- mov sp, r0
- sub r0, r0, #ABT_Stack_Size
-
- @ Enter FIQ Mode and set its Stack Pointer
- msr cpsr_c, #Mode_FIQ|I_Bit|F_Bit
- mov sp, r0
- sub r0, r0, #RT_FIQ_STACK_PGSZ
-
- @ Enter IRQ Mode and set its Stack Pointer
- msr cpsr_c, #Mode_IRQ|I_Bit|F_Bit
- mov sp, r0
- sub r0, r0, #RT_IRQ_STACK_PGSZ
-
- /* come back to SVC mode */
- msr cpsr_c, #Mode_SVC|I_Bit|F_Bit
- bx lr
-
- .global enable_mmu
-enable_mmu:
- orr r0, #0x18
- mcr p15, 0, r0, c2, c0, 0 @ttbr0
-
- mov r0, #(1 << 5) @PD1=1
- mcr p15, 0, r0, c2, c0, 2 @ttbcr
-
- mov r0, #1
- mcr p15, 0, r0, c3, c0, 0 @dacr
-
- mov r0, #0
- mcr p15, 0, r0, c8, c7, 0
- mcr p15, 0, r0, c7, c5, 0 @iciallu
- mcr p15, 0, r0, c7, c5, 6 @bpiall
-
- mrc p15, 0, r0, c1, c0, 0
- orr r0, #(1 | 4)
- orr r0, #(1 << 12)
- mcr p15, 0, r0, c1, c0, 0
- dsb
- isb
- mov pc, lr
-
-.global flush_cache_all
-flush_cache_all:
- stmfd sp!, {r0-r12, lr}
- bl v7_flush_dcache_all
- mov r0, #0
- mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate
- dsb
- isb
- ldmfd sp!, {r0-r12, lr}
- mov pc, lr
-
- v7_flush_dcache_all:
- dmb @ ensure ordering with previous memory accesses
- mrc p15, 1, r0, c0, c0, 1 @ read clidr
- ands r3, r0, #0x7000000 @ extract loc from clidr
- mov r3, r3, lsr #23 @ left align loc bit field
- beq finished @ if loc is 0, then no need to clean
- mov r10, #0 @ start clean at cache level 0
-loop1:
- add r2, r10, r10, lsr #1 @ work out 3x current cache level
- mov r1, r0, lsr r2 @ extract cache type bits from clidr
- and r1, r1, #7 @ mask of the bits for current cache only
- cmp r1, #2 @ see what cache we have at this level
- blt skip @ skip if no cache, or just i-cache
- mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
- isb @ isb to sych the new cssr&csidr
- mrc p15, 1, r1, c0, c0, 0 @ read the new csidr
- and r2, r1, #7 @ extract the length of the cache lines
- add r2, r2, #4 @ add 4 (line length offset)
- ldr r4, =0x3ff
- ands r4, r4, r1, lsr #3 @ find maximum number on the way size
- clz r5, r4 @ find bit position of way size increment
- ldr r7, =0x7fff
- ands r7, r7, r1, lsr #13 @ extract max number of the index size
-loop2:
- mov r9, r4 @ create working copy of max way size
-loop3:
- orr r11, r10, r9, lsl r5 @ factor way and cache number into r11
- orr r11, r11, r7, lsl r2 @ factor index number into r11
- mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way
- subs r9, r9, #1 @ decrement the way
- bge loop3
- subs r7, r7, #1 @ decrement the index
- bge loop2
-skip:
- add r10, r10, #2 @ increment cache number
- cmp r3, r10
- bgt loop1
-finished:
- mov r10, #0 @ swith back to cache level 0
- mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
- dsb
- isb
- mov pc, lr
-
-/* exception handlers: undef, swi, padt, dabt, resv, irq, fiq */
-.section .text.isr, "ax"
- .align 5
-.globl vector_fiq
-vector_fiq:
- stmfd sp!,{r0-r7,lr}
- bl rt_hw_trap_fiq
- ldmfd sp!,{r0-r7,lr}
- subs pc, lr, #4
-
-.globl rt_interrupt_enter
-.globl rt_interrupt_leave
-.globl rt_thread_switch_interrupt_flag
-.globl rt_interrupt_from_thread
-.globl rt_interrupt_to_thread
-
- .align 5
-.globl vector_irq
-vector_irq:
-#ifdef RT_USING_SMP
- clrex
-#endif
- stmfd sp!, {r0-r12,lr}
-
- bl rt_interrupt_enter
- bl rt_hw_trap_irq
- bl rt_interrupt_leave
-
-#ifdef RT_USING_SMP
- mov r0, sp
- bl rt_scheduler_do_irq_switch
-
- ldmfd sp!, {r0-r12,lr}
- subs pc, lr, #4
-#else
- @ if rt_thread_switch_interrupt_flag set, jump to
- @ rt_hw_context_switch_interrupt_do and don't return
- ldr r0, =rt_thread_switch_interrupt_flag
- ldr r1, [r0]
- cmp r1, #1
- beq rt_hw_context_switch_interrupt_do
-
- ldmfd sp!, {r0-r12,lr}
- subs pc, lr, #4
-
-rt_hw_context_switch_interrupt_do:
- mov r1, #0 @ clear flag
- str r1, [r0]
-
- mov r1, sp @ r1 point to {r0-r3} in stack
- add sp, sp, #4*4
- ldmfd sp!, {r4-r12,lr}@ reload saved registers
- mrs r0, spsr @ get cpsr of interrupt thread
- sub r2, lr, #4 @ save old task's pc to r2
-
- @ Switch to SVC mode with no interrupt. If the usr mode guest is
- @ interrupted, this will just switch to the stack of kernel space.
- @ save the registers in kernel space won't trigger data abort.
- msr cpsr_c, #I_Bit|F_Bit|Mode_SVC
-
- stmfd sp!, {r2} @ push old task's pc
- stmfd sp!, {r4-r12,lr}@ push old task's lr,r12-r4
- ldmfd r1, {r1-r4} @ restore r0-r3 of the interrupt thread
- stmfd sp!, {r1-r4} @ push old task's r0-r3
- stmfd sp!, {r0} @ push old task's cpsr
-
-#ifdef RT_USING_LWP
- stmfd sp, {r13, r14}^ @push usr_sp, usr_lr
- sub sp, #8
-#endif
-
- ldr r4, =rt_interrupt_from_thread
- ldr r5, [r4]
- str sp, [r5] @ store sp in preempted tasks's TCB
-
- ldr r6, =rt_interrupt_to_thread
- ldr r6, [r6]
- ldr sp, [r6] @ get new task's stack pointer
-
-#ifdef RT_USING_LWP
- ldmfd sp, {r13, r14}^ @pop usr_sp, usr_lr
- add sp, #8
-#endif
-
- ldmfd sp!, {r4} @ pop new task's cpsr to spsr
- msr spsr_cxsf, r4
-
- ldmfd sp!, {r0-r12,lr,pc}^ @ pop new task's r0-r12,lr & pc, copy spsr to cpsr
-
-#endif
-
-.macro push_svc_reg
- sub sp, sp, #17 * 4 @/* Sizeof(struct rt_hw_exp_stack) */
- stmia sp, {r0 - r12} @/* Calling r0-r12 */
- mov r0, sp
- mrs r6, spsr @/* Save CPSR */
- str lr, [r0, #15*4] @/* Push PC */
- str r6, [r0, #16*4] @/* Push CPSR */
- cps #Mode_SVC
- str sp, [r0, #13*4] @/* Save calling SP */
- str lr, [r0, #14*4] @/* Save calling PC */
-.endm
-
- .align 5
- .globl vector_swi
-.weak SVC_Handler
-SVC_Handler:
-vector_swi:
- push_svc_reg
- bl rt_hw_trap_swi
- b .
-
- .align 5
- .globl vector_undef
-vector_undef:
- push_svc_reg
- bl rt_hw_trap_undef
- b .
-
- .align 5
- .globl vector_pabt
-vector_pabt:
- push_svc_reg
- bl rt_hw_trap_pabt
- b .
-
- .align 5
- .globl vector_dabt
-vector_dabt:
- push_svc_reg
- bl rt_hw_trap_dabt
- b .
-
- .align 5
- .globl vector_resv
-vector_resv:
- push_svc_reg
- bl rt_hw_trap_resv
- b .
-
-#ifdef RT_USING_SMP
-.global set_secondary_cpu_boot_address
-set_secondary_cpu_boot_address:
- ldr r0, =secondary_cpu_start
-
- mvn r1, #0 //0xffffffff
- ldr r2, =0x10000034
- str r1, [r2]
- str r0, [r2, #-4]
- mov pc, lr
-
-.global secondary_cpu_start
-secondary_cpu_start:
- mrc p15, 0, r1, c1, c0, 1
- mov r0, #(1<<6)
- orr r1, r0
- mcr p15, 0, r1, c1, c0, 1 //enable smp
-
- ldr r0, =mtbl
- ldr lr, =1f
-
- b enable_mmu
-1:
- mrc p15, 0, r0, c1, c0, 0
- bic r0, #(1<<13)
- mcr p15, 0, r0, c1, c0, 0
-
- cps #Mode_IRQ
- ldr sp, =irq_stack_2_limit
-
- cps #Mode_FIQ
- ldr sp, =irq_stack_2_limit
-
- cps #Mode_SVC
- ldr sp, =svc_stack_2_limit
-
- b secondary_cpu_c_start
-#endif
-
-.bss
-.align 2 //align to 2~2=4
-svc_stack_2:
- .space (1 << 10)
-svc_stack_2_limit:
-
-irq_stack_2:
- .space (1 << 10)
-irq_stack_2_limit:
-
-.data
-#define DEVICE_MEM 0x10c06
-#define NORMAL_MEM 0x11c0e
-.align 14
-mtbl:
-
- //vaddr: 0x00000000
- .rept 0x100
- .word 0x0
- .endr
-
- //vaddr: 0x10000000
- .equ mmu_tbl_map_paddr, 0x10000000
- .rept 0x400
- .word mmu_tbl_map_paddr | DEVICE_MEM
- .equ mmu_tbl_map_paddr, mmu_tbl_map_paddr + 0x100000
- .endr
-
- //vaddr: 0x50000000
- .rept 0x100
- .word 0x0
- .endr
-
- //vaddr: 0x60000000
- .equ mmu_tbl_map_paddr, 0x60000000
- .rept 0x800
- .word mmu_tbl_map_paddr | NORMAL_MEM
- .equ mmu_tbl_map_paddr, mmu_tbl_map_paddr + 0x100000
- .endr
-
- //vaddr: 0xe0000000
- .rept 0x200
- .word 0x0
- .endr
diff --git a/bsp/qemu-vexpress-a9/cpu/trap.c b/bsp/qemu-vexpress-a9/cpu/trap.c
deleted file mode 100644
index a1f00d0075..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/trap.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * File : trap.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013, RT-Thread Develop Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-20 Bernard first version
- */
-
-#include <rtthread.h>
-#include <rthw.h>
-#include <board.h>
-
-#include "armv7.h"
-
-#include "gic.h"
-
-#ifdef RT_USING_FINSH
-extern long list_thread(void);
-#endif
-
-/**
- * this function will show registers of CPU
- *
- * @param regs the registers point
- */
-void rt_hw_show_register(struct rt_hw_exp_stack *regs)
-{
- rt_kprintf("Execption:\n");
- rt_kprintf("r00:0x%08x r01:0x%08x r02:0x%08x r03:0x%08x\n", regs->r0, regs->r1, regs->r2, regs->r3);
- rt_kprintf("r04:0x%08x r05:0x%08x r06:0x%08x r07:0x%08x\n", regs->r4, regs->r5, regs->r6, regs->r7);
- rt_kprintf("r08:0x%08x r09:0x%08x r10:0x%08x\n", regs->r8, regs->r9, regs->r10);
- rt_kprintf("fp :0x%08x ip :0x%08x\n", regs->fp, regs->ip);
- rt_kprintf("sp :0x%08x lr :0x%08x pc :0x%08x\n", regs->sp, regs->lr, regs->pc);
- rt_kprintf("cpsr:0x%08x\n", regs->cpsr);
-}
-
-/**
- * When comes across an instruction which it cannot handle,
- * it takes the undefined instruction trap.
- *
- * @param regs system registers
- *
- * @note never invoke this function in application
- */
-void rt_hw_trap_undef(struct rt_hw_exp_stack *regs)
-{
- rt_kprintf("undefined instruction:\n");
- rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
- list_thread();
-#endif
- rt_hw_cpu_shutdown();
-}
-
-/**
- * The software interrupt instruction (SWI) is used for entering
- * Supervisor mode, usually to request a particular supervisor
- * function.
- *
- * @param regs system registers
- *
- * @note never invoke this function in application
- */
-void rt_hw_trap_swi(struct rt_hw_exp_stack *regs)
-{
- rt_kprintf("software interrupt:\n");
- rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
- list_thread();
-#endif
- rt_hw_cpu_shutdown();
-}
-
-/**
- * An abort indicates that the current memory access cannot be completed,
- * which occurs during an instruction prefetch.
- *
- * @param regs system registers
- *
- * @note never invoke this function in application
- */
-void rt_hw_trap_pabt(struct rt_hw_exp_stack *regs)
-{
- rt_kprintf("prefetch abort:\n");
- rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
- list_thread();
-#endif
- rt_hw_cpu_shutdown();
-}
-
-/**
- * An abort indicates that the current memory access cannot be completed,
- * which occurs during a data access.
- *
- * @param regs system registers
- *
- * @note never invoke this function in application
- */
-void rt_hw_trap_dabt(struct rt_hw_exp_stack *regs)
-{
- rt_kprintf("data abort:");
- rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
- list_thread();
-#endif
- rt_hw_cpu_shutdown();
-}
-
-/**
- * Normally, system will never reach here
- *
- * @param regs system registers
- *
- * @note never invoke this function in application
- */
-void rt_hw_trap_resv(struct rt_hw_exp_stack *regs)
-{
- rt_kprintf("reserved trap:\n");
- rt_hw_show_register(regs);
-#ifdef RT_USING_FINSH
- list_thread();
-#endif
- rt_hw_cpu_shutdown();
-}
-
-#define GIC_ACK_INTID_MASK 0x000003ff
-
-void rt_hw_trap_irq(void)
-{
- void *param;
- unsigned long ir;
- unsigned long fullir;
- rt_isr_handler_t isr_func;
- extern struct rt_irq_desc isr_table[];
-
- fullir = arm_gic_get_active_irq(0);
- ir = fullir & GIC_ACK_INTID_MASK;
-
- if (ir == 1023)
- {
- /* Spurious interrupt */
- return;
- }
-
- /* get interrupt service routine */
- isr_func = isr_table[ir].handler;
-#ifdef RT_USING_INTERRUPT_INFO
- isr_table[ir].counter++;
-#endif
- if (isr_func)
- {
- /* Interrupt for myself. */
- param = isr_table[ir].param;
- /* turn to interrupt service routine */
- isr_func(ir, param);
- }
-
- /* end of interrupt */
- arm_gic_ack(0, fullir);
-}
-
-void rt_hw_trap_fiq(void)
-{
- void *param;
- unsigned long ir;
- unsigned long fullir;
- rt_isr_handler_t isr_func;
- extern struct rt_irq_desc isr_table[];
-
- fullir = arm_gic_get_active_irq(0);
- ir = fullir & GIC_ACK_INTID_MASK;
-
- /* get interrupt service routine */
- isr_func = isr_table[ir].handler;
- param = isr_table[ir].param;
-
- /* turn to interrupt service routine */
- isr_func(ir, param);
-
- /* end of interrupt */
- arm_gic_ack(0, fullir);
-}
-
diff --git a/bsp/qemu-vexpress-a9/cpu/vector_gcc.S b/bsp/qemu-vexpress-a9/cpu/vector_gcc.S
deleted file mode 100644
index 2473e1f850..0000000000
--- a/bsp/qemu-vexpress-a9/cpu/vector_gcc.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * File : vector_gcc.S
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2013, RT-Thread Development Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Change Logs:
- * Date Author Notes
- * 2013-07-05 Bernard the first version
- */
-
-.section .vectors, "ax"
-.code 32
-
-.globl system_vectors
-system_vectors:
- ldr pc, _vector_reset
- ldr pc, _vector_undef
- ldr pc, _vector_swi
- ldr pc, _vector_pabt
- ldr pc, _vector_dabt
- ldr pc, _vector_resv
- ldr pc, _vector_irq
- ldr pc, _vector_fiq
-
-.globl _reset
-.globl vector_undef
-.globl vector_swi
-.globl vector_pabt
-.globl vector_dabt
-.globl vector_resv
-.globl vector_irq
-.globl vector_fiq
-
-_vector_reset:
- .word _reset
-_vector_undef:
- .word vector_undef
-_vector_swi:
- .word SVC_Handler
-_vector_pabt:
- .word vector_pabt
-_vector_dabt:
- .word vector_dabt
-_vector_resv:
- .word vector_resv
-_vector_irq:
- .word vector_irq
-_vector_fiq:
- .word vector_fiq
-
-.balignl 16,0xdeadbeef
diff --git a/bsp/qemu-vexpress-a9/drivers/board.c b/bsp/qemu-vexpress-a9/drivers/board.c
index 6ffac7efd7..e236c68b80 100644
--- a/bsp/qemu-vexpress-a9/drivers/board.c
+++ b/bsp/qemu-vexpress-a9/drivers/board.c
@@ -17,6 +17,15 @@
#include "board.h"
#include "drv_timer.h"
+#include <mmu.h>
+
+struct mem_desc platform_mem_desc[] = {
+ {0x10000000, 0x50000000, 0x10000000, DEVICE_MEM},
+ {0x60000000, 0xe0000000, 0x60000000, NORMAL_MEM}
+};
+
+const rt_uint32_t platform_mem_desc_size = sizeof(platform_mem_desc)/sizeof(platform_mem_desc[0]);
+
#define SYS_CTRL __REG32(REALVIEW_SCTL_BASE)
extern void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler);
diff --git a/bsp/qemu-vexpress-a9/platform/SConscript b/bsp/qemu-vexpress-a9/platform/SConscript
new file mode 100644
index 0000000000..1b580929da
--- /dev/null
+++ b/bsp/qemu-vexpress-a9/platform/SConscript
@@ -0,0 +1,13 @@
+from building import *
+
+cwd = GetCurrentDir()
+src = Split('''
+''')
+
+CPPPATH = [ cwd + '/cpu',
+cwd + '/include',
+]
+
+group = DefineGroup('Platform', src, depend = [''], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/bsp/qemu-vexpress-a9/platform/cpu/platform.h b/bsp/qemu-vexpress-a9/platform/cpu/platform.h
new file mode 100644
index 0000000000..2d5cc5f61b
--- /dev/null
+++ b/bsp/qemu-vexpress-a9/platform/cpu/platform.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2006-2018, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2018-03-22 quanzhao first version
+ */
+
+#ifndef __PLATFORM_H__
+#define __PLATFORM_H__
+
+/* for 'rt_inline' */
+#include <rtdef.h>
+/* SOC-relative definitions */
+#include "realview.h"
+
+/* the maximum entries of the exception table */
+#define MAX_HANDLERS NR_IRQS_PBA8
+
+/* the basic constants and interfaces needed by gic */
+rt_inline rt_uint32_t platform_get_gic_dist_base(void)
+{
+ return REALVIEW_GIC_DIST_BASE;
+}
+
+rt_inline rt_uint32_t platform_get_gic_cpu_base(void)
+{
+ return REALVIEW_GIC_CPU_BASE;
+}
+
+#define GIC_IRQ_START 0
+
+#define GIC_ACK_INTID_MASK 0x000003ff
+
+#endif /* __PLATFORM_H__ */
diff --git a/bsp/qemu-vexpress-a9/rtconfig.h b/bsp/qemu-vexpress-a9/rtconfig.h
index b6c3399da3..831d54c52f 100644
--- a/bsp/qemu-vexpress-a9/rtconfig.h
+++ b/bsp/qemu-vexpress-a9/rtconfig.h
@@ -10,7 +10,9 @@
#define RT_USING_SMP
#define RT_CPUS_NR 2
#define RT_ALIGN_SIZE 4
+/* RT_THREAD_PRIORITY_8 is not set */
#define RT_THREAD_PRIORITY_32
+/* RT_THREAD_PRIORITY_256 is not set */
#define RT_THREAD_PRIORITY_MAX 32
#define RT_TICK_PER_SECOND 100
#define RT_USING_OVERFLOW_CHECK
@@ -37,7 +39,10 @@
#define RT_USING_MEMPOOL
#define RT_USING_MEMHEAP
+/* RT_USING_NOHEAP is not set */
#define RT_USING_SMALL_MEM
+/* RT_USING_SLAB is not set */
+/* RT_USING_MEMHEAP_AS_HEAP is not set */
#define RT_USING_MEMTRACE
#define RT_USING_HEAP
@@ -53,6 +58,7 @@
#define ARCH_ARM
#define ARCH_ARM_CORTEX_A
#define ARCH_ARM_CORTEX_A9
+/* ARCH_CPU_STACK_GROWS_UPWARD is not set */
/* RT-Thread Components */
@@ -73,11 +79,14 @@
#define FINSH_HISTORY_LINES 5
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION
+/* FINSH_ECHO_DISABLE_DEFAULT is not set */
#define FINSH_THREAD_PRIORITY 20
#define FINSH_THREAD_STACK_SIZE 4096
#define FINSH_CMD_SIZE 80
+/* FINSH_USING_AUTH is not set */
#define FINSH_USING_MSH
#define FINSH_USING_MSH_DEFAULT
+/* FINSH_USING_MSH_ONLY is not set */
#define FINSH_ARG_MAX 10
/* Device virtual file system */
@@ -87,21 +96,29 @@
#define DFS_FILESYSTEMS_MAX 2
#define DFS_FILESYSTEM_TYPES_MAX 8
#define DFS_FD_MAX 16
+/* RT_USING_DFS_MNTTABLE is not set */
#define RT_USING_DFS_ELMFAT
/* elm-chan's FatFs, Generic FAT Filesystem Module */
#define RT_DFS_ELM_CODE_PAGE 437
#define RT_DFS_ELM_WORD_ACCESS
+/* RT_DFS_ELM_USE_LFN_0 is not set */
+/* RT_DFS_ELM_USE_LFN_1 is not set */
+/* RT_DFS_ELM_USE_LFN_2 is not set */
#define RT_DFS_ELM_USE_LFN_3
#define RT_DFS_ELM_USE_LFN 3
#define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
+/* RT_DFS_ELM_USE_ERASE is not set */
#define RT_DFS_ELM_REENTRANT
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_ROMFS
#define RT_USING_DFS_RAMFS
+/* RT_USING_DFS_UFFS is not set */
+/* RT_USING_DFS_JFFS2 is not set */
+/* RT_USING_DFS_NFS is not set */
/* Device Drivers */
@@ -110,12 +127,19 @@
#define RT_USING_SERIAL
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
+/* RT_USING_CAN is not set */
+/* RT_USING_HWTIMER is not set */
+/* RT_USING_CPUTIME is not set */
#define RT_USING_I2C
#define RT_USING_I2C_BITOPS
#define RT_USING_PIN
+/* RT_USING_ADC is not set */
+/* RT_USING_PWM is not set */
#define RT_USING_MTD_NOR
#define RT_USING_MTD_NAND
#define RT_MTD_NAND_DEBUG
+/* RT_USING_MTD is not set */
+/* RT_USING_PM is not set */
#define RT_USING_RTC
#define RT_USING_SOFT_RTC
#define RT_USING_SDIO
@@ -124,18 +148,31 @@
#define RT_MMCSD_STACK_SIZE 1024
#define RT_MMCSD_THREAD_PREORITY 22
#define RT_MMCSD_MAX_PARTITION 16
+/* RT_SDIO_DEBUG is not set */
#define RT_USING_SPI
+/* RT_USING_QSPI is not set */
#define RT_USING_SPI_MSD
#define RT_USING_SFUD
#define RT_SFUD_USING_SFDP
#define RT_SFUD_USING_FLASH_INFO_TABLE
+/* RT_SFUD_USING_QSPI is not set */
+/* RT_DEBUG_SFUD is not set */
+/* RT_USING_W25QXX is not set */
+/* RT_USING_GD is not set */
+/* RT_USING_ENC28J60 is not set */
+/* RT_USING_SPI_WIFI is not set */
#define RT_USING_WDT
+/* RT_USING_AUDIO is not set */
+/* RT_USING_SENSOR is not set */
/* Using WiFi */
+/* RT_USING_WIFI is not set */
/* Using USB */
+/* RT_USING_USB_HOST is not set */
+/* RT_USING_USB_DEVICE is not set */
/* POSIX layer and C standard library */
@@ -145,6 +182,7 @@
#define RT_USING_POSIX_MMAP
#define RT_USING_POSIX_TERMIOS
#define RT_USING_POSIX_AIO
+/* RT_USING_MODULE is not set */
/* Network */
@@ -161,9 +199,13 @@
/* light weight TCP/IP stack */
#define RT_USING_LWIP
+/* RT_USING_LWIP141 is not set */
#define RT_USING_LWIP202
+/* RT_USING_LWIP210 is not set */
#define RT_USING_LWIP_IPV6
+/* RT_LWIP_IGMP is not set */
#define RT_LWIP_ICMP
+/* RT_LWIP_SNMP is not set */
#define RT_LWIP_DNS
#define RT_LWIP_DHCP
#define IP_SOF_BROADCAST 1
@@ -176,6 +218,8 @@
#define RT_LWIP_MSKADDR "255.255.255.0"
#define RT_LWIP_UDP
#define RT_LWIP_TCP
+/* RT_LWIP_RAW is not set */
+/* RT_LWIP_PPP is not set */
#define RT_MEMP_NUM_NETCONN 8
#define RT_LWIP_PBUF_NUM 16
#define RT_LWIP_RAW_PCB_NUM 4
@@ -187,6 +231,8 @@
#define RT_LWIP_TCPTHREAD_PRIORITY 10
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 8
#define RT_LWIP_TCPTHREAD_STACKSIZE 1024
+/* LWIP_NO_RX_THREAD is not set */
+/* LWIP_NO_TX_THREAD is not set */
#define RT_LWIP_ETHTHREAD_PRIORITY 12
#define RT_LWIP_ETHTHREAD_STACKSIZE 1024
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
@@ -196,62 +242,164 @@
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_SNDTIMEO 1
#define LWIP_SO_RCVBUF 1
+/* RT_LWIP_NETIF_LOOPBACK is not set */
#define LWIP_NETIF_LOOPBACK 0
+/* RT_LWIP_STATS is not set */
+/* RT_LWIP_DEBUG is not set */
/* Modbus master and slave stack */
+/* RT_USING_MODBUS is not set */
/* AT commands */
+/* RT_USING_AT is not set */
+/* LWIP_USING_DHCPD is not set */
/* VBUS(Virtual Software BUS) */
+/* RT_USING_VBUS is not set */
/* Utilities */
#define RT_USING_LOGTRACE
#define LOG_TRACE_MAX_SESSION 16
+/* LOG_TRACE_USING_LEVEL_NOTRACE is not set */
+/* LOG_TRACE_USING_LEVEL_ERROR is not set */
+/* LOG_TRACE_USING_LEVEL_WARNING is not set */
#define LOG_TRACE_USING_LEVEL_INFO
+/* LOG_TRACE_USING_LEVEL_VERBOSE is not set */
+/* LOG_TRACE_USING_LEVEL_DEBUG is not set */
+/* LOG_TRACE_USING_MEMLOG is not set */
+/* RT_USING_RYM is not set */
+/* RT_USING_ULOG is not set */
+/* RT_USING_UTEST is not set */
#define RT_USING_LWP
/* RT-Thread online packages */
/* IoT - internet of things */
+/* PKG_USING_PAHOMQTT is not set */
+/* PKG_USING_WEBCLIENT is not set */
+/* PKG_USING_WEBNET is not set */
+/* PKG_USING_MONGOOSE is not set */
+/* PKG_USING_WEBTERMINAL is not set */
+/* PKG_USING_CJSON is not set */
+/* PKG_USING_JSMN is not set */
+/* PKG_USING_LIBMODBUS is not set */
+/* PKG_USING_LJSON is not set */
+/* PKG_USING_EZXML is not set */
+/* PKG_USING_NANOPB is not set */
/* Wi-Fi */
/* Marvell WiFi */
+/* PKG_USING_WLANMARVELL is not set */
/* Wiced WiFi */
+/* PKG_USING_WLAN_WICED is not set */
+/* PKG_USING_RW007 is not set */
+/* PKG_USING_COAP is not set */
+/* PKG_USING_NOPOLL is not set */
+/* PKG_USING_NETUTILS is not set */
+/* PKG_USING_AT_DEVICE is not set */
+/* PKG_USING_WIZNET is not set */
/* IoT Cloud */
+/* PKG_USING_ONENET is not set */
+/* PKG_USING_GAGENT_CLOUD is not set */
+/* PKG_USING_ALI_IOTKIT is not set */
+/* PKG_USING_AZURE is not set */
+/* PKG_USING_TENCENT_IOTKIT is not set */
+/* PKG_USING_NIMBLE is not set */
+/* PKG_USING_OTA_DOWNLOADER is not set */
/* security packages */
+/* PKG_USING_MBEDTLS is not set */
+/* PKG_USING_libsodium is not set */
+/* PKG_USING_TINYCRYPT is not set */
/* language packages */
+/* PKG_USING_LUA is not set */
+/* PKG_USING_JERRYSCRIPT is not set */
+/* PKG_USING_MICROPYTHON is not set */
/* multimedia packages */
+/* PKG_USING_OPENMV is not set */
+/* PKG_USING_MUPDF is not set */
/* tools packages */
+/* PKG_USING_CMBACKTRACE is not set */
+/* PKG_USING_EASYFLASH is not set */
+/* PKG_USING_EASYLOGGER is not set */
+/* PKG_USING_SYSTEMVIEW is not set */
+/* PKG_USING_RDB is not set */
+/* PKG_USING_QRCODE is not set */
+/* PKG_USING_ULOG_EASYFLASH is not set */
+/* PKG_USING_ADBD is not set */
/* system packages */
+/* PKG_USING_GUIENGINE is not set */
+/* PKG_USING_PERSIMMON is not set */
+/* PKG_USING_CAIRO is not set */
+/* PKG_USING_PIXMAN is not set */
+/* PKG_USING_LWEXT4 is not set */
+/* PKG_USING_PARTITION is not set */
+/* PKG_USING_FAL is not set */
+/* PKG_USING_SQLITE is not set */
+/* PKG_USING_RTI is not set */
+/* PKG_USING_LITTLEVGL2RTT is not set */
+/* PKG_USING_CMSIS is not set */
+/* PKG_USING_DFS_YAFFS is not set */
+/* PKG_USING_LITTLEFS is not set */
/* peripheral libraries and drivers */
/* sensors drivers */
+/* PKG_USING_LSM6DSL is not set */
+/* PKG_USING_LPS22HB is not set */
+/* PKG_USING_HTS221 is not set */
+/* PKG_USING_LSM303AGR is not set */
+/* PKG_USING_BME280 is not set */
+/* PKG_USING_BMA400 is not set */
+/* PKG_USING_BMI160_BMX160 is not set */
+/* PKG_USING_SPL0601 is not set */
+/* PKG_USING_REALTEK_AMEBA is not set */
+/* PKG_USING_SHT2X is not set */
+/* PKG_USING_AHT10 is not set */
+/* PKG_USING_AP3216C is not set */
+/* PKG_USING_STM32_SDIO is not set */
+/* PKG_USING_ICM20608 is not set */
+/* PKG_USING_U8G2 is not set */
+/* PKG_USING_BUTTON is not set */
+/* PKG_USING_MPU6XXX is not set */
+/* PKG_USING_PCF8574 is not set */
+/* PKG_USING_SX12XX is not set */
+/* PKG_USING_KENDRYTE_SDK is not set */
/* miscellaneous packages */
+/* PKG_USING_LIBCSV is not set */
+/* PKG_USING_OPTPARSE is not set */
+/* PKG_USING_FASTLZ is not set */
+/* PKG_USING_MINILZO is not set */
+/* PKG_USING_QUICKLZ is not set */
+/* PKG_USING_MULTIBUTTON is not set */
+/* PKG_USING_CANFESTIVAL is not set */
+/* PKG_USING_ZLIB is not set */
+/* PKG_USING_DSTR is not set */
+/* PKG_USING_TINYFRAME is not set */
+/* PKG_USING_KENDRYTE_DEMO is not set */
/* samples: kernel and components samples */
@@ -259,5 +407,6 @@
#define RT_USING_UART0
#define RT_USING_UART1
#define BSP_DRV_EMAC
+/* BSP_DRV_AUDIO is not set */
#endif
diff --git a/bsp/qemu-vexpress-a9/rtconfig.py b/bsp/qemu-vexpress-a9/rtconfig.py
index 8ccd0227e4..d417673898 100644
--- a/bsp/qemu-vexpress-a9/rtconfig.py
+++ b/bsp/qemu-vexpress-a9/rtconfig.py
@@ -2,14 +2,15 @@ import os
# toolchains options
ARCH='arm'
-CPU='cortex-a9'
+CPU='cortex-a'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
+# only support GNU GCC compiler.
PLATFORM = 'gcc'
-EXEC_PATH = '/opt/gcc-arm-none-eabi-4_8-2014q1_gri/bin'
+EXEC_PATH = '/usr/bin'
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')