Skip to content

Commit 7c3e543

Browse files
author
Dong Xiang
committed
soc: system: Adjust code structure.
Adjust code structure. Signed-off-by: Dong Xiang <dong.xiang@unisoc.com>
1 parent 7ab6afb commit 7c3e543

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

soc/system.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
1010
#include <zephyr.h>
1111
#include <uwp_hal.h>
1212

13+
#if defined(CONFIG_SOC_UWP5661)
1314
void uwp_clock_init(void)
1415
{
1516
/* Set system clock to 416M */
@@ -36,24 +37,21 @@ void uwp_clock_init(void)
3637
/* 0x40844024 */
3738
sci_reg_and(REG_AON_CLK_PRE_DIV_PLL_WAIT_SEL0_CFG, ~BIT(2));
3839
}
39-
40-
41-
void uwp5662_clock_init(void)
40+
#elif defined(CONFIG_SOC_UWP5662)
41+
void uwp_clock_init(void)
4242
{
4343
/*set 320M cpu*/
4444
/*0x40844200 + 0x24*/
4545
sci_write32(0x40844224, BIT(8));
4646
/*0x40844200 + 0x20*/
4747
sci_write32(0x40844220, 0x5);
4848
}
49+
#else
50+
#error None UNISOC soc specified!
51+
#endif
4952

5053
void uwp_glb_init(void)
5154
{
52-
#ifdef CONFIG_SOC_UWP5661
5355
uwp_clock_init();
54-
#endif
55-
#ifdef CONFIG_SOC_UWP5662
56-
uwp5662_clock_init();
57-
#endif
5856
uwp_cache_init();
5957
}

0 commit comments

Comments
 (0)