File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
boards/nxp/mimxrt1180_evk Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 44# SPDX-License-Identifier: Apache-2.0
55#
66
7+ zephyr_library()
8+ zephyr_library_sources(board.c)
9+
710if (CONFIG_NXP_IMXRT_BOOT_HEADER)
8- zephyr_library()
911 if (NOT ((DEFINED CONFIG_BOARD_MIMXRT1180_EVK_MIMXRT1189_CM33)
1012 OR (DEFINED CONFIG_BOARD_MIMXRT1180_EVK_MIMXRT1189_CM7)))
1113 message (WARNING "It appears you are using the board definition for "
Original file line number Diff line number Diff line change @@ -12,4 +12,6 @@ config EXTERNAL_MEM_CONFIG_DATA
1212config NXP_IMX_EXTERNAL_HYPERRAM
1313 default y if CPU_CORTEX_M33
1414
15+ config BOARD_EARLY_INIT_HOOK
16+ default y
1517endif # BOARD_MIMXRT1180_EVK
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/platform/hooks.h>
8+ #include <soc.h>
9+
10+ #if CONFIG_BOARD_EARLY_INIT_HOOK
11+ void board_early_init_hook (void )
12+ {
13+ #if defined(CONFIG_ETH_NXP_IMX_NETC ) && (DT_CHILD_NUM_STATUS_OKAY (DT_NODELABEL (netc )) != 0 )
14+ /* RMII mode */
15+ BLK_CTRL_WAKEUPMIX -> NETC_LINK_CFG [4 ] = BLK_CTRL_WAKEUPMIX_NETC_LINK_CFG_MII_PROT (1 );
16+
17+ /* Output reference clock for RMII */
18+ BLK_CTRL_WAKEUPMIX -> NETC_PORT_MISC_CFG |=
19+ BLK_CTRL_WAKEUPMIX_NETC_PORT_MISC_CFG_PORT4_RMII_REF_CLK_DIR_MASK ;
20+
21+ /* Unlock the IERB. It will warm reset whole NETC. */
22+ NETC_PRIV -> NETCRR &= ~NETC_PRIV_NETCRR_LOCK_MASK ;
23+
24+ while ((NETC_PRIV -> NETCRR & NETC_PRIV_NETCRR_LOCK_MASK ) != 0U ) {
25+ }
26+
27+ /* Set the access attribute, otherwise MSIX access will be blocked. */
28+ NETC_IERB -> ARRAY_NUM_RC [0 ].RCMSIAMQR &= ~(7U << 27 );
29+ NETC_IERB -> ARRAY_NUM_RC [0 ].RCMSIAMQR |= (1U << 27 );
30+
31+ /* Lock the IERB. */
32+ NETC_PRIV -> NETCRR |= NETC_PRIV_NETCRR_LOCK_MASK ;
33+ while ((NETC_PRIV -> NETCSR & NETC_PRIV_NETCSR_STATE_MASK ) != 0U ) {
34+ }
35+ #endif
36+ }
37+ #endif
You can’t perform that action at this time.
0 commit comments