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:
Antony Pavlov 2020-12-03 01:33:36 +03:00 committed by Anas Nashif
parent 6a12fb20ab
commit 76769a42d0
9 changed files with 90 additions and 0 deletions

View file

@ -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

View file

@ -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
View file

@ -0,0 +1,5 @@
if(SOC_FAMILY)
add_subdirectory(${SOC_FAMILY})
else()
add_subdirectory(${SOC_NAME})
endif()

View 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}
)

View 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

View 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

View 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
View 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__ */

View 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