zephyr/soc/gd/gd32/gd32a50x/soc.c
Anas Nashif f519dd1411 arch: arm: replace PLATFORM_SPECIFIC_INIT with PLATFORM_RESET_HOOK
Use generic hook infrastrucutre instead of custom Kconfig and hooks for
ARM.

Replace z_arm_platform_init() with platform_reset().

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-09 10:07:33 +02:00

29 lines
589 B
C

/*
* Copyright (c) 2022 YuLong Yao <feilongphone@gmail.com>
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <soc.h>
/* initial ecc memory */
void soc_reset_hook(void)
{
register unsigned r0 __asm("r0") = DT_REG_ADDR(DT_CHOSEN(zephyr_sram));
register unsigned r1 __asm("r1") =
DT_REG_ADDR(DT_CHOSEN(zephyr_sram)) + DT_REG_SIZE(DT_CHOSEN(zephyr_sram));
for (; r0 < r1; r0 += 4) {
*(unsigned int *)r0 = 0;
}
}
static int gd32a50x_soc_init(void)
{
SystemInit();
return 0;
}
SYS_INIT(gd32a50x_soc_init, PRE_KERNEL_1, 0);