soc: mips: add Qemu Malta support
The MIPS Malta is an ATX form factor evaluation board made by MIPS Technologies. Malta board is the most popular platform for MIPS full-system emulation. See https://www.linux-mips.org/wiki/MIPS_Malta for details. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Remy Luisant <remy@luisant.ca>
This commit is contained in:
parent
6a12fb20ab
commit
76769a42d0
|
@ -70,6 +70,7 @@
|
|||
/arch/nios2/ @nashif
|
||||
/arch/posix/ @aescolar @daor-oti
|
||||
/arch/riscv/ @kgugala @pgielda
|
||||
/soc/mips/ @frantony
|
||||
/soc/posix/ @aescolar @daor-oti
|
||||
/soc/riscv/ @kgugala @pgielda
|
||||
/soc/riscv/openisa*/ @dleach02
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
if("${ARCH}" STREQUAL "x86")
|
||||
set_ifndef(QEMU_binary_suffix i386)
|
||||
elseif("${ARCH}" STREQUAL "mips")
|
||||
if(CONFIG_BIG_ENDIAN)
|
||||
set_ifndef(QEMU_binary_suffix mips)
|
||||
else()
|
||||
set_ifndef(QEMU_binary_suffix mipsel)
|
||||
endif()
|
||||
elseif(DEFINED QEMU_ARCH)
|
||||
set_ifndef(QEMU_binary_suffix ${QEMU_ARCH})
|
||||
else()
|
||||
|
|
5
soc/mips/CMakeLists.txt
Normal file
5
soc/mips/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
if(SOC_FAMILY)
|
||||
add_subdirectory(${SOC_FAMILY})
|
||||
else()
|
||||
add_subdirectory(${SOC_NAME})
|
||||
endif()
|
17
soc/mips/qemu_malta/CMakeLists.txt
Normal file
17
soc/mips/qemu_malta/CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright (c) 2020, 2021 Antony Pavlov <antonynpavlov@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_compile_options(
|
||||
-mips32
|
||||
${TOOLCHAIN_C_FLAGS}
|
||||
)
|
||||
|
||||
zephyr_sources(
|
||||
vector.S
|
||||
)
|
||||
|
||||
zephyr_ld_options(
|
||||
-mips32
|
||||
${TOOLCHAIN_LD_FLAGS}
|
||||
)
|
16
soc/mips/qemu_malta/Kconfig.defconfig
Normal file
16
soc/mips/qemu_malta/Kconfig.defconfig
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Copyright (c) 2020 Antony Pavlov <antonynpavlov@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if SOC_QEMU_MALTA
|
||||
|
||||
config SOC
|
||||
default "qemu_malta"
|
||||
|
||||
config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||
default 200000000
|
||||
|
||||
config NUM_IRQS
|
||||
default 8
|
||||
|
||||
endif # SOC_QEMU_MALTA
|
7
soc/mips/qemu_malta/Kconfig.soc
Normal file
7
soc/mips/qemu_malta/Kconfig.soc
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Copyright (c) 2020 Antony Pavlov <antonynpavlov@gmail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SOC_QEMU_MALTA
|
||||
bool "MIPS Qemu Malta implementation"
|
||||
select MIPS
|
7
soc/mips/qemu_malta/linker.ld
Normal file
7
soc/mips/qemu_malta/linker.ld
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Antony Pavlov <antonynpavlov@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <arch/mips/linker.ld>
|
12
soc/mips/qemu_malta/soc.h
Normal file
12
soc/mips/qemu_malta/soc.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2020, 2021 Antony Pavlov <antonynpavlov@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __QEMU_MALTA_SOC_H__
|
||||
#define __QEMU_MALTA_SOC_H__
|
||||
|
||||
#define MIPS_MACHINE_TIMER_IRQ 7 /* Machine Timer Interrupt */
|
||||
|
||||
#endif /* __QEMU_MALTA_SOC_H__ */
|
19
soc/mips/qemu_malta/vector.S
Normal file
19
soc/mips/qemu_malta/vector.S
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Antony Pavlov <antonynpavlov@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <toolchain.h>
|
||||
#include <mips/regdef.h>
|
||||
|
||||
/* Imports */
|
||||
GTEXT(__initialize)
|
||||
|
||||
/* Exports */
|
||||
GTEXT(__start)
|
||||
|
||||
SECTION_FUNC(vectors, __start)
|
||||
/* Call into Zephyr initialization. */
|
||||
la v0, __initialize
|
||||
jal v0
|
Loading…
Reference in a new issue