Browse Source
The hal_entry.c code is duplicated across all boards, so consolidate it to a common ra_hal.c file. And remove the hal_entry() function because it simply calls main(). Signed-off-by: Damien George <damien@micropython.org>pull/11590/head
Damien George
1 year ago
18 changed files with 39 additions and 333 deletions
@ -1,6 +0,0 @@ |
|||
/* generated main source file - do not edit */ |
|||
#include "hal_data.h" |
|||
int main(void) { |
|||
hal_entry(); |
|||
return 0; |
|||
} |
@ -1,58 +0,0 @@ |
|||
#include "hal_data.h" |
|||
|
|||
FSP_CPP_HEADER |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event); |
|||
FSP_CPP_FOOTER |
|||
|
|||
void ra_main(uint32_t reset_mode); |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function |
|||
* is called by main() when no RTOS is used. |
|||
**********************************************************************************************************************/ |
|||
void hal_entry(void) { |
|||
/* TODO: add your own code here */ |
|||
|
|||
ra_main(1); |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
/* Enter non-secure code */ |
|||
R_BSP_NonSecureEnter(); |
|||
#endif |
|||
} |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* This function is called at various points during the startup process. This implementation uses the event that is |
|||
* called right before main() to set up the pins. |
|||
* |
|||
* @param[in] event Where at in the start up process the code is currently at |
|||
**********************************************************************************************************************/ |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event) { |
|||
if (BSP_WARM_START_RESET == event) { |
|||
#if BSP_FEATURE_FLASH_LP_VERSION != 0 |
|||
|
|||
/* Enable reading from data flash. */ |
|||
R_FACI_LP->DFLCTL = 1U; |
|||
|
|||
/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and
|
|||
* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */ |
|||
#endif |
|||
} |
|||
|
|||
if (BSP_WARM_START_POST_C == event) { |
|||
/* C runtime environment and system clocks are setup. */ |
|||
|
|||
/* Configure pins. */ |
|||
R_IOPORT_Open(&g_ioport_ctrl, &g_bsp_pin_cfg); |
|||
} |
|||
} |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable(); |
|||
|
|||
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */ |
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable() { |
|||
|
|||
} |
|||
#endif |
@ -1,6 +0,0 @@ |
|||
/* generated main source file - do not edit */ |
|||
#include "hal_data.h" |
|||
int main(void) { |
|||
hal_entry(); |
|||
return 0; |
|||
} |
@ -1,59 +0,0 @@ |
|||
#include "stdbool.h" |
|||
#include "hal_data.h" |
|||
|
|||
FSP_CPP_HEADER |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event); |
|||
FSP_CPP_FOOTER |
|||
|
|||
void ra_main(uint32_t reset_mode); |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function |
|||
* is called by main() when no RTOS is used. |
|||
**********************************************************************************************************************/ |
|||
void hal_entry(void) { |
|||
/* TODO: add your own code here */ |
|||
|
|||
ra_main(1); |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
/* Enter non-secure code */ |
|||
R_BSP_NonSecureEnter(); |
|||
#endif |
|||
} |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* This function is called at various points during the startup process. This implementation uses the event that is |
|||
* called right before main() to set up the pins. |
|||
* |
|||
* @param[in] event Where at in the start up process the code is currently at |
|||
**********************************************************************************************************************/ |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event) { |
|||
if (BSP_WARM_START_RESET == event) { |
|||
#if BSP_FEATURE_FLASH_LP_VERSION != 0 |
|||
|
|||
/* Enable reading from data flash. */ |
|||
R_FACI_LP->DFLCTL = 1U; |
|||
|
|||
/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and
|
|||
* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */ |
|||
#endif |
|||
} |
|||
|
|||
if (BSP_WARM_START_POST_C == event) { |
|||
/* C runtime environment and system clocks are setup. */ |
|||
|
|||
/* Configure pins. */ |
|||
R_IOPORT_Open(&g_ioport_ctrl, &g_bsp_pin_cfg); |
|||
} |
|||
} |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable(); |
|||
|
|||
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */ |
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable() { |
|||
|
|||
} |
|||
#endif |
@ -1,6 +0,0 @@ |
|||
/* generated main source file - do not edit */ |
|||
#include "hal_data.h" |
|||
int main(void) { |
|||
hal_entry(); |
|||
return 0; |
|||
} |
@ -1,58 +0,0 @@ |
|||
#include "hal_data.h" |
|||
|
|||
FSP_CPP_HEADER |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event); |
|||
FSP_CPP_FOOTER |
|||
|
|||
void ra_main(uint32_t reset_mode); |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function |
|||
* is called by main() when no RTOS is used. |
|||
**********************************************************************************************************************/ |
|||
void hal_entry(void) { |
|||
/* TODO: add your own code here */ |
|||
|
|||
ra_main(1); |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
/* Enter non-secure code */ |
|||
R_BSP_NonSecureEnter(); |
|||
#endif |
|||
} |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* This function is called at various points during the startup process. This implementation uses the event that is |
|||
* called right before main() to set up the pins. |
|||
* |
|||
* @param[in] event Where at in the start up process the code is currently at |
|||
**********************************************************************************************************************/ |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event) { |
|||
if (BSP_WARM_START_RESET == event) { |
|||
#if BSP_FEATURE_FLASH_LP_VERSION != 0 |
|||
|
|||
/* Enable reading from data flash. */ |
|||
R_FACI_LP->DFLCTL = 1U; |
|||
|
|||
/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and
|
|||
* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */ |
|||
#endif |
|||
} |
|||
|
|||
if (BSP_WARM_START_POST_C == event) { |
|||
/* C runtime environment and system clocks are setup. */ |
|||
|
|||
/* Configure pins. */ |
|||
R_IOPORT_Open(&g_ioport_ctrl, &g_bsp_pin_cfg); |
|||
} |
|||
} |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable(); |
|||
|
|||
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */ |
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable() { |
|||
|
|||
} |
|||
#endif |
@ -1,6 +0,0 @@ |
|||
/* generated main source file - do not edit */ |
|||
#include "hal_data.h" |
|||
int main(void) { |
|||
hal_entry(); |
|||
return 0; |
|||
} |
@ -1,58 +0,0 @@ |
|||
#include "hal_data.h" |
|||
|
|||
FSP_CPP_HEADER |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event); |
|||
FSP_CPP_FOOTER |
|||
|
|||
void ra_main(uint32_t reset_mode); |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function |
|||
* is called by main() when no RTOS is used. |
|||
**********************************************************************************************************************/ |
|||
void hal_entry(void) { |
|||
/* TODO: add your own code here */ |
|||
|
|||
ra_main(1); |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
/* Enter non-secure code */ |
|||
R_BSP_NonSecureEnter(); |
|||
#endif |
|||
} |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* This function is called at various points during the startup process. This implementation uses the event that is |
|||
* called right before main() to set up the pins. |
|||
* |
|||
* @param[in] event Where at in the start up process the code is currently at |
|||
**********************************************************************************************************************/ |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event) { |
|||
if (BSP_WARM_START_RESET == event) { |
|||
#if BSP_FEATURE_FLASH_LP_VERSION != 0 |
|||
|
|||
/* Enable reading from data flash. */ |
|||
R_FACI_LP->DFLCTL = 1U; |
|||
|
|||
/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and
|
|||
* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */ |
|||
#endif |
|||
} |
|||
|
|||
if (BSP_WARM_START_POST_C == event) { |
|||
/* C runtime environment and system clocks are setup. */ |
|||
|
|||
/* Configure pins. */ |
|||
R_IOPORT_Open(&g_ioport_ctrl, &g_bsp_pin_cfg); |
|||
} |
|||
} |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable(); |
|||
|
|||
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */ |
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable() { |
|||
|
|||
} |
|||
#endif |
@ -1,6 +0,0 @@ |
|||
/* generated main source file - do not edit */ |
|||
#include "hal_data.h" |
|||
int main(void) { |
|||
hal_entry(); |
|||
return 0; |
|||
} |
@ -1,58 +0,0 @@ |
|||
#include "hal_data.h" |
|||
|
|||
FSP_CPP_HEADER |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event); |
|||
FSP_CPP_FOOTER |
|||
|
|||
void ra_main(uint32_t reset_mode); |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function |
|||
* is called by main() when no RTOS is used. |
|||
**********************************************************************************************************************/ |
|||
void hal_entry(void) { |
|||
/* TODO: add your own code here */ |
|||
|
|||
ra_main(1); |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
/* Enter non-secure code */ |
|||
R_BSP_NonSecureEnter(); |
|||
#endif |
|||
} |
|||
|
|||
/*******************************************************************************************************************//**
|
|||
* This function is called at various points during the startup process. This implementation uses the event that is |
|||
* called right before main() to set up the pins. |
|||
* |
|||
* @param[in] event Where at in the start up process the code is currently at |
|||
**********************************************************************************************************************/ |
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event) { |
|||
if (BSP_WARM_START_RESET == event) { |
|||
#if BSP_FEATURE_FLASH_LP_VERSION != 0 |
|||
|
|||
/* Enable reading from data flash. */ |
|||
R_FACI_LP->DFLCTL = 1U; |
|||
|
|||
/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and
|
|||
* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */ |
|||
#endif |
|||
} |
|||
|
|||
if (BSP_WARM_START_POST_C == event) { |
|||
/* C runtime environment and system clocks are setup. */ |
|||
|
|||
/* Configure pins. */ |
|||
R_IOPORT_Open(&g_ioport_ctrl, &g_bsp_pin_cfg); |
|||
} |
|||
} |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable(); |
|||
|
|||
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */ |
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable() { |
|||
|
|||
} |
|||
#endif |
@ -0,0 +1,36 @@ |
|||
#include "hal_data.h" |
|||
|
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event); |
|||
|
|||
// This function is called at various points during the startup process.
|
|||
// event: where in the start up process the code is currently at.
|
|||
void R_BSP_WarmStart(bsp_warm_start_event_t event) { |
|||
if (BSP_WARM_START_RESET == event) { |
|||
#if BSP_FEATURE_FLASH_LP_VERSION != 0 |
|||
|
|||
// Enable reading from data flash.
|
|||
R_FACI_LP->DFLCTL = 1U; |
|||
|
|||
// Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the
|
|||
// enable here, before clock and C runtime initialization, should negate the need
|
|||
// for a delay since the initialization will typically take more than 6us.
|
|||
#endif |
|||
} |
|||
|
|||
if (BSP_WARM_START_POST_C == event) { |
|||
// At this point, C runtime environment and system clocks are set up.
|
|||
|
|||
// Configure pins.
|
|||
R_IOPORT_Open(&g_ioport_ctrl, &g_bsp_pin_cfg); |
|||
} |
|||
} |
|||
|
|||
#if BSP_TZ_SECURE_BUILD |
|||
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable(); |
|||
|
|||
// Trustzone Secure Projects require at least one nonsecure callable function in order to build.
|
|||
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable() { |
|||
} |
|||
|
|||
#endif |
Loading…
Reference in new issue