File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,6 @@ if (CONFIG_SOF AND CONFIG_BOARD_IMX95_EVK_MIMX9596_M7_DDR)
1111 DEPENDS ${CMAKE_BINARY_DIR} /zephyr/${KERNEL_ELF_NAME}
1212 )
1313endif ()
14+
15+ zephyr_library()
16+ zephyr_library_sources(board.c)
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2024 NXP
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ #include <zephyr/devicetree.h>
7+ #include <zephyr/init.h>
8+ #include <zephyr/kernel.h>
9+ #include <soc.h>
10+
11+ static int board_init (void )
12+ {
13+ #if defined(CONFIG_ETH_NXP_IMX_NETC ) && (DT_CHILD_NUM_STATUS_OKAY (DT_NODELABEL (netc )) != 0 )
14+ /* Port 0 to 2 protocol configure: RGMII, RGMII, XGMII */
15+ BLK_CTRL_NETCMIX -> CFG_LINK_MII_PROT = 0x00000522 ;
16+ BLK_CTRL_NETCMIX -> CFG_LINK_PCS_PROT_2 = 0x00000040 ;
17+
18+ /* Unlock the IERB. It will warm reset whole NETC. */
19+ NETC_PRIV -> NETCRR &= ~NETC_PRIV_NETCRR_LOCK_MASK ;
20+ while ((NETC_PRIV -> NETCRR & NETC_PRIV_NETCRR_LOCK_MASK ) != 0U ) {
21+ }
22+
23+ /* Lock the IERB. */
24+ NETC_PRIV -> NETCRR |= NETC_PRIV_NETCRR_LOCK_MASK ;
25+ while ((NETC_PRIV -> NETCSR & NETC_PRIV_NETCSR_STATE_MASK ) != 0U ) {
26+ }
27+ #endif
28+ return 0 ;
29+ }
30+
31+ /*
32+ * Because platform is using ARM SCMI, drivers like scmi, mbox etc. are
33+ * initialized during PRE_KERNEL_1. Common init hooks is not able to use.
34+ * SoC early init and board early init could be run during PRE_KERNEL_2 instead.
35+ */
36+ SYS_INIT (board_init , PRE_KERNEL_2 , 10 );
You can’t perform that action at this time.
0 commit comments