diff options
Diffstat (limited to 'bsps/arm/stm32h7/boards/stm/stm32h743i-eval')
5 files changed, 85 insertions, 3 deletions
diff --git a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-bspstarthooks.c b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-bspstarthooks.c new file mode 100644 index 0000000000..450c916346 --- /dev/null +++ b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-bspstarthooks.c @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 embedded brains GmbH & Co. KG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <bsp.h> +#include <bsp/bootcard.h> +#include <bsp/linker-symbols.h> +#include <bsp/start.h> +#include <stm32h7/hal.h> +#include <stm32h7/memory.h> +#include <stm32h7/mpu-config.h> +#include <rtems/score/armv7m.h> + +#include <string.h> + +void bsp_start_hook_0(void) +{ + if ((RCC->AHB3ENR & RCC_AHB3ENR_FMCEN) == 0) { + /* + * Only perform the low-level initialization if necessary. An initialized + * FMC indicates that a boot loader already performed the low-level + * initialization. + */ + SystemInit(); + stm32h7_init_power(); + stm32h7_init_oscillator(); + stm32h7_init_clocks(); + stm32h7_init_peripheral_clocks(); + HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSI, RCC_MCODIV_1); + HAL_Init(); + SystemInit_ExtMemCtl(); + } + +#if __CORTEX_M == 0x07U + if ((SCB->CCR & SCB_CCR_IC_Msk) == 0) { + SCB_EnableICache(); + } + + if ((SCB->CCR & SCB_CCR_DC_Msk) == 0) { + SCB_EnableDCache(); + } + + _ARMV7M_MPU_Setup(ARMV7M_MPU_CTRL_DEFAULT, stm32h7_config_mpu_region, stm32h7_config_mpu_region_count); +#endif +} + +void bsp_start_hook_1(void) +{ + bsp_start_copy_sections_compact(); +#if __CORTEX_M == 0x07U + SCB_CleanDCache(); + SCB_InvalidateICache(); +#endif + bsp_start_clear_bss(); +} diff --git a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-clk.c b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-clk.c index 3e7c930201..de7955fe91 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-clk.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-clk.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-osc.c b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-osc.c index b639c7ca36..df55a49b3c 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-osc.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-osc.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-per.c b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-per.c index 79aa1494dd..8ca665915f 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-per.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/stm32h7-config-per.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/system_stm32h7xx.c b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/system_stm32h7xx.c index a8a9ff0b4b..2d53f114c1 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/system_stm32h7xx.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h743i-eval/system_stm32h7xx.c @@ -49,6 +49,10 @@ #include <math.h> #ifdef __rtems__ #include <bsp/linker-symbols.h> +#include <bspopts.h> + +#define HSE_VALUE STM32H7_HSE_FREQUENCY + #endif /* __rtems__ */ #if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ |