diff --git a/boards/mips-malta/Makefile b/boards/mips-malta/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f8fcbb53a06595771dae356338a7bf2c0673734d --- /dev/null +++ b/boards/mips-malta/Makefile @@ -0,0 +1,3 @@ +MODULE = board + +include $(RIOTBASE)/Makefile.base diff --git a/boards/mips-malta/Makefile.features b/boards/mips-malta/Makefile.features new file mode 100644 index 0000000000000000000000000000000000000000..bf4ba1fe2699438258058420567b2246aecf829f --- /dev/null +++ b/boards/mips-malta/Makefile.features @@ -0,0 +1,9 @@ +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_timer +FEATURES_PROVIDED += periph_uart + +# Various other features (if any) +FEATURES_PROVIDED += cpp + +# The board MPU family (used for grouping by the CI system) +FEATURES_MCU_GROUP = mips32r2 diff --git a/boards/mips-malta/Makefile.include b/boards/mips-malta/Makefile.include new file mode 100644 index 0000000000000000000000000000000000000000..f162303b4d5cd2738a24c30f3781227cc25cf8c0 --- /dev/null +++ b/boards/mips-malta/Makefile.include @@ -0,0 +1,4 @@ +export CPU = mips32r2_common +export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ +export USE_HARD_FLOAT = 1 +export USE_DSP = 1 diff --git a/boards/mips-malta/include/board.h b/boards/mips-malta/include/board.h new file mode 100644 index 0000000000000000000000000000000000000000..9d69c1bbc69ce86631d77c462d7ce9c0327b6790 --- /dev/null +++ b/boards/mips-malta/include/board.h @@ -0,0 +1,46 @@ +/* + * Copyright 2016, Imagination Technologies Limited and/or its + * affiliated group companies. + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + * + */ + +/** + * @defgroup boards_mips-malta MIPS MALTA + * @ingroup boards + * @brief Board specific files for the MIPS Malta FPGA system + * @{ + * + * @file + * @brief Board specific definitions for the MIPS Malta FPGA System. + * + * @author Neil Jones <neil.jones@imgtec.com> + */ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Set how many increments of the count register per uS + * needed by timer code + */ +#define TICKS_PER_US (15) + +/** + * @brief Board level initialisation + */ +void board_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _BOARD_H_ */ +/** @} */ diff --git a/boards/mips-malta/include/periph_conf.h b/boards/mips-malta/include/periph_conf.h new file mode 100644 index 0000000000000000000000000000000000000000..d8dad5660d0ef3ac3e9fc960259ad980d702311f --- /dev/null +++ b/boards/mips-malta/include/periph_conf.h @@ -0,0 +1,59 @@ +/* + * Copyright 2016, Imagination Technologies Limited and/or its + * affiliated group companies. + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + * + */ + +/** + * @defgroup boards_mips-malta MIPS MALTA + * @ingroup boards + * @brief peripheral configuration for the MIPS Malta FPGA system + * @{ + * + * @file + * @brief peripheral configuration for the MIPS Malta FPGA system + * + * @author Neil Jones <neil.jones@imgtec.com> + */ + +#ifndef _PERIPH_CONF_H_ +#define _PERIPH_CONF_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Timer definitions + * @{ + */ +#define TIMER_NUMOF (1) +#define TIMER_0_CHANNELS (3) +/** @} */ + +/** + * @brief No UART driver for this board currently + * Note this value must be set though (to 0) + */ +#define UART_NUMOF (0) + +/** + * @brief Enable DSP context save + restore. + */ +#define MIPS_DSP (1) + +/** + * @brief Enable FPU context save + restore. + */ +#define MIPS_HARD_FLOAT (1) + +#ifdef __cplusplus +} +#endif + +#endif /*_PERIPH_CONF_H_*/ +/** @} */ diff --git a/boards/mips-malta/malta.c b/boards/mips-malta/malta.c new file mode 100644 index 0000000000000000000000000000000000000000..e2be4e3d0278cdfd57affffd60cc709affb06d54 --- /dev/null +++ b/boards/mips-malta/malta.c @@ -0,0 +1,28 @@ +/* + * Copyright 2016, Imagination Technologies Limited and/or its + * affiliated group companies. + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ +#include <stdio.h> +#include "periph/uart.h" + +#define MIPS_MALTA_ADDR (0xbf000500) +#define MIPS_MALTA_VAL_RST (0x42) + +static void malta_reset(void) +{ + *(volatile long *)MIPS_MALTA_ADDR = MIPS_MALTA_VAL_RST; + __asm__ volatile ("wait"); +} + +void board_init(void) +{ + /* Board initialisation is done by the bootloader (u-boot) on Malta */ +} + +void pm_reboot(void) +{ + malta_reset(); +}