Skip to content

Commit efdd858

Browse files
decsnynashif
authored andcommitted
soc: nxp: Flatten MCX SOCs
Turn MCX series into families. Reasoning: 1. The MCX SOCs are quite different from each other and having them all under one family in the HWMv2 hierarchy is fruitless because there are so many differences that it is confusing to try to introduce family-level code and configs since they would each only apply to a subset of the series. There is almost nothing that can be shared between all of them. Which is why there are comments in the MCX family files saying not to put anything in them. This is a technical waste. 2. Therefore, turning all of them into families is almost 0 effort and makes sense. It will allow these different types of MCX to be further subdivided into series in the future as the MCX portfolio expands and such division will be necessary as new SOCs within each letter family are released. Signed-off-by: Declan Snyder <[email protected]>
1 parent 1495e2e commit efdd858

File tree

28 files changed

+113
-147
lines changed

28 files changed

+113
-147
lines changed

drivers/clock_control/clock_control_mcux_syscon.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
2626
#if defined(CONFIG_COUNTER_NXP_MRT)
2727
if ((uint32_t)sub_system == MCUX_MRT_CLK) {
2828
#if defined(CONFIG_SOC_FAMILY_LPC) || defined(CONFIG_SOC_SERIES_RW6XX) || \
29-
defined(CONFIG_SOC_SERIES_MCXN)
29+
defined(CONFIG_SOC_FAMILY_MCXN)
3030
CLOCK_EnableClock(kCLOCK_Mrt);
3131
#elif defined(CONFIG_SOC_FAMILY_NXP_IMXRT)
3232
CLOCK_EnableClock(kCLOCK_Mrt0);
@@ -46,7 +46,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
4646

4747
#if defined(CONFIG_PINCTRL_NXP_PORT)
4848
switch ((uint32_t)sub_system) {
49-
#if defined(CONFIG_SOC_SERIES_MCXA)
49+
#if defined(CONFIG_SOC_FAMILY_MCXA)
5050
case MCUX_PORT0_CLK:
5151
CLOCK_EnableClock(kCLOCK_GatePORT0);
5252
break;
@@ -80,7 +80,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
8080
case MCUX_PORT4_CLK:
8181
CLOCK_EnableClock(kCLOCK_Port4);
8282
break;
83-
#endif /* defined(CONFIG_SOC_SERIES_MCXA) */
83+
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
8484
default:
8585
break;
8686
}
@@ -94,7 +94,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
9494

9595
#if defined(CONFIG_CAN_MCUX_FLEXCAN)
9696
switch ((uint32_t)sub_system) {
97-
#if defined(CONFIG_SOC_SERIES_MCXA)
97+
#if defined(CONFIG_SOC_FAMILY_MCXA)
9898
case MCUX_FLEXCAN0_CLK:
9999
CLOCK_EnableClock(kCLOCK_GateFLEXCAN0);
100100
break;
@@ -105,7 +105,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
105105
case MCUX_FLEXCAN1_CLK:
106106
CLOCK_EnableClock(kCLOCK_Flexcan1);
107107
break;
108-
#endif /* defined(CONFIG_SOC_SERIES_MCXA) */
108+
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
109109
default:
110110
break;
111111
}
@@ -124,7 +124,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
124124
#if DT_NODE_HAS_STATUS(DT_NODELABEL(rtc), okay)
125125
#if defined(CONFIG_SOC_SERIES_IMXRT5XX) || defined(CONFIG_SOC_SERIES_IMXRT6XX)
126126
CLOCK_EnableOsc32K(true);
127-
#elif CONFIG_SOC_SERIES_MCXN
127+
#elif CONFIG_SOC_FAMILY_MCXN
128128
/* 0x0 Clock Select Value Set IRTC to use FRO 16K Clk */
129129
#if DT_PROP(DT_NODELABEL(rtc), clock_select) == 0x0
130130
CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVbat | kCLOCK_Clk16KToMain);
@@ -133,7 +133,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
133133
CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVbat | kCLOCK_Osc32kToMain);
134134
#endif /* DT_PROP(DT_NODELABEL(rtc), clock_select) */
135135
CLOCK_EnableClock(kCLOCK_Rtc0);
136-
#endif /* CONFIG_SOC_SERIES_MCXN */
136+
#endif /* CONFIG_SOC_FAMILY_MCXN */
137137
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(rtc), okay) */
138138

139139
return 0;
@@ -290,7 +290,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
290290

291291
#if (defined(FSL_FEATURE_SOC_USDHC_COUNT) && FSL_FEATURE_SOC_USDHC_COUNT)
292292

293-
#if defined(CONFIG_SOC_SERIES_MCXN)
293+
#if defined(CONFIG_SOC_FAMILY_MCXN)
294294
case MCUX_USDHC1_CLK:
295295
*rate = CLOCK_GetUsdhcClkFreq();
296296
break;
@@ -372,17 +372,17 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
372372

373373
#if defined(CONFIG_I3C_MCUX)
374374
case MCUX_I3C_CLK:
375-
#if CONFIG_SOC_SERIES_MCXN
375+
#if CONFIG_SOC_FAMILY_MCXN
376376
*rate = CLOCK_GetI3cClkFreq(0);
377-
#elif CONFIG_SOC_SERIES_MCXA
377+
#elif CONFIG_SOC_FAMILY_MCXA
378378
*rate = CLOCK_GetI3CFClkFreq();
379379
#else
380380
*rate = CLOCK_GetI3cClkFreq();
381381
#endif
382382
break;
383383
#if (FSL_FEATURE_SOC_I3C_COUNT == 2)
384384
case MCUX_I3C2_CLK:
385-
#if CONFIG_SOC_SERIES_MCXN
385+
#if CONFIG_SOC_FAMILY_MCXN
386386
*rate = CLOCK_GetI3cClkFreq(1);
387387
#else
388388
*rate = CLOCK_GetI3cClkFreq();
@@ -486,7 +486,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
486486
#endif /* CONFIG_ADC_MCUX_LPADC */
487487

488488
#if defined(CONFIG_CAN_MCUX_FLEXCAN)
489-
#if defined(CONFIG_SOC_SERIES_MCXA)
489+
#if defined(CONFIG_SOC_FAMILY_MCXA)
490490
case MCUX_FLEXCAN0_CLK:
491491
*rate = CLOCK_GetFlexcanClkFreq();
492492
break;
@@ -497,7 +497,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
497497
case MCUX_FLEXCAN1_CLK:
498498
*rate = CLOCK_GetFlexcanClkFreq(1);
499499
break;
500-
#endif /* defined(CONFIG_SOC_SERIES_MCXA) */
500+
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
501501
#endif /* defined(CONFIG_CAN_MCUX_FLEXCAN) */
502502

503503
#if defined(CONFIG_MCUX_FLEXIO)
@@ -512,7 +512,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
512512
break;
513513
#endif /* defined(CONFIG_I2S_MCUX_FLEXCOMM) */
514514

515-
#if (defined(CONFIG_UART_MCUX_LPUART) && CONFIG_SOC_SERIES_MCXA)
515+
#if (defined(CONFIG_UART_MCUX_LPUART) && CONFIG_SOC_FAMILY_MCXA)
516516
case MCUX_LPUART0_CLK:
517517
*rate = CLOCK_GetLpuartClkFreq(0);
518518
break;
@@ -530,7 +530,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
530530
break;
531531
#endif /* defined(CONFIG_UART_MCUX_LPUART) */
532532

533-
#if (defined(CONFIG_I2C_MCUX_LPI2C) && CONFIG_SOC_SERIES_MCXA)
533+
#if (defined(CONFIG_I2C_MCUX_LPI2C) && CONFIG_SOC_FAMILY_MCXA)
534534
#if (defined(FSL_FEATURE_SOC_LPI2C_COUNT) && (FSL_FEATURE_SOC_LPI2C_COUNT == 1))
535535
case MCUX_LPI2C0_CLK:
536536
*rate = CLOCK_GetLpi2cClkFreq();
@@ -563,7 +563,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
563563
break;
564564
#endif /* defined(CONFIG_DT_HAS_NXP_XSPI_ENABLED) */
565565

566-
#if (defined(CONFIG_SPI_NXP_LPSPI) && CONFIG_SOC_SERIES_MCXA)
566+
#if (defined(CONFIG_SPI_NXP_LPSPI) && CONFIG_SOC_FAMILY_MCXA)
567567
case MCUX_LPSPI0_CLK:
568568
*rate = CLOCK_GetLpspiClkFreq(0);
569569
break;

drivers/flash/soc_flash_mcux.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ LOG_MODULE_REGISTER(flash_mcux);
4343

4444
#if defined(SOC_HAS_IAP) && !defined(CONFIG_SOC_LPC55S36)
4545
#include "fsl_iap.h"
46-
#elif defined(CONFIG_SOC_SERIES_MCXA)
46+
#elif defined(CONFIG_SOC_FAMILY_MCXA)
4747
#include "fsl_romapi.h"
4848
#define FLASH_Erase FLASH_EraseSector
4949
#define FLASH_Program FLASH_ProgramPhrase
@@ -118,7 +118,7 @@ static status_t is_area_readable(uint32_t addr, size_t len)
118118
#endif /* CONFIG_CHECK_BEFORE_READING && ! CONFIG_SOC_SERIES_LPC55XXX */
119119

120120
#define SOC_FLASH_NEED_CLEAR_CACHES 1
121-
#ifdef CONFIG_SOC_SERIES_MCXW
121+
#ifdef CONFIG_SOC_FAMILY_MCXW
122122
static void clear_flash_caches(void)
123123
{
124124
volatile uint32_t *const smscm_ocmdr0 = (volatile uint32_t *)0x40015400;
@@ -128,7 +128,7 @@ static void clear_flash_caches(void)
128128
/* this bit clears the code cache */
129129
*mcm_cpcr2 |= BIT(0);
130130
}
131-
#elif CONFIG_SOC_SERIES_MCXN
131+
#elif CONFIG_SOC_FAMILY_MCXN
132132
static void clear_flash_caches(void)
133133
{
134134
volatile uint32_t *const nvm_ctrl = (volatile uint32_t *)0x40000400;
@@ -138,7 +138,7 @@ static void clear_flash_caches(void)
138138
/* this bit clears the code cache */
139139
*lpcac_ctrl |= BIT(1);
140140
}
141-
#elif CONFIG_SOC_SERIES_MCXA
141+
#elif CONFIG_SOC_FAMILY_MCXA
142142
static void clear_flash_caches(void)
143143
{
144144
SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC(1U);

drivers/ipm/ipm_mcux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define MCUX_IPM_MAX_ID_VAL 0
2222

2323
#if (defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES) || \
24-
defined(CONFIG_SOC_SERIES_MCXN))
24+
defined(CONFIG_SOC_FAMILY_MCXN))
2525
#if (defined(LPC55S69_cm33_core0_SERIES) || defined(MCXN947_cm33_core0_SERIES) || \
2626
defined(MCXN946_cm33_core0_SERIES) || defined(MCXN547_cm33_core0_SERIES) || \
2727
defined(MCXN546_cm33_core0_SERIES))

drivers/mbox/mbox_nxp_mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(nxp_mbox_mailbox);
2222
#define MAILBOX_MBOX_SIZE 3
2323

2424
#if (defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES) || \
25-
defined(CONFIG_SOC_SERIES_MCXN))
25+
defined(CONFIG_SOC_FAMILY_MCXN))
2626
#if (defined(LPC55S69_cm33_core0_SERIES) || defined(MCXN947_cm33_core0_SERIES) || \
2727
defined(MCXN946_cm33_core0_SERIES) || defined(MCXN547_cm33_core0_SERIES) || \
2828
defined(MCXN546_cm33_core0_SERIES))

drivers/timer/mcux_os_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <zephyr/drivers/counter.h>
1717
#include <zephyr/pm/pm.h>
1818
#include "fsl_ostimer.h"
19-
#if !defined(CONFIG_SOC_SERIES_MCXN) && !defined(CONFIG_SOC_SERIES_MCXA)
19+
#if !defined(CONFIG_SOC_FAMILY_MCXN) && !defined(CONFIG_SOC_FAMILY_MCXA)
2020
#include "fsl_power.h"
2121
#endif
2222

drivers/usb/device/usb_dc_mcux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ BUILD_ASSERT(NUM_INSTS <= 1, "Only one USB device supported");
9292
#elif defined(CONFIG_SOC_SERIES_IMXRT11XX) || \
9393
defined(CONFIG_SOC_SERIES_IMXRT118X) || \
9494
defined(CONFIG_SOC_SERIES_IMXRT10XX) || \
95-
defined(CONFIG_SOC_SERIES_MCXN)
95+
defined(CONFIG_SOC_FAMILY_MCXN)
9696
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb1))
9797
#define CONTROLLER_ID kUSB_ControllerEhci0
9898
#elif DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb2))

drivers/watchdog/wdt_mcux_wwdt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ static int mcux_wwdt_install_timeout(const struct device *dev,
8686
}
8787

8888
#if defined(CONFIG_SOC_MIMXRT685S_CM33) || defined(CONFIG_SOC_MIMXRT595S_CM33) \
89-
|| defined(CONFIG_SOC_SERIES_MCXN) || defined(CONFIG_SOC_MIMXRT798S_CM33_CPU0) \
89+
|| defined(CONFIG_SOC_FAMILY_MCXN) || defined(CONFIG_SOC_MIMXRT798S_CM33_CPU0) \
9090
|| defined(CONFIG_SOC_MIMXRT798S_CM33_CPU1)
9191
clock_freq = CLOCK_GetWdtClkFreq(0);
9292
#elif defined(CONFIG_SOC_SERIES_RW6XX)
9393
clock_freq = CLOCK_GetWdtClkFreq();
94-
#elif defined(CONFIG_SOC_SERIES_MCXA)
94+
#elif defined(CONFIG_SOC_FAMILY_MCXA)
9595
clock_freq = CLOCK_GetWwdtClkFreq();
9696
#else
9797
const struct mcux_wwdt_config *config = dev->config;

include/zephyr/drivers/ethernet/eth_nxp_enet_qos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <zephyr/drivers/clock_control.h>
1212

1313
/* Different platforms named the peripheral different in the register definitions */
14-
#ifdef CONFIG_SOC_SERIES_MCXN
14+
#ifdef CONFIG_SOC_FAMILY_MCXN
1515
#undef ENET
1616
#define ENET_QOS_NAME ENET
1717
#define ENET_QOS_ALIGNMENT 4

modules/hal_nxp/mcux/Kconfig.mcux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config HAS_MCUX
88
bool
99
depends on SOC_FAMILY_KINETIS || SOC_FAMILY_NXP_IMX || SOC_FAMILY_LPC || \
1010
SOC_FAMILY_NXP_S32 || SOC_FAMILY_NXP_IMXRT || SOC_FAMILY_NXP_RW || \
11-
SOC_FAMILY_NXP_MCX
11+
SOC_FAMILY_MCXN || SOC_FAMILY_MCXA || SOC_FAMILY_MCXW || SOC_FAMILY_MCXC
1212

1313
if HAS_MCUX
1414

modules/hal_nxp/mcux/mcux-sdk-ng/components/components.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ if(CONFIG_NXP_RF_IMU)
3030
set(CONFIG_MCUX_COMPONENT_driver.gdma ON)
3131
set(CONFIG_MCUX_COMPONENT_component.wireless_imu_adapter ON)
3232
set(CONFIG_MCUX_PRJSEG_component.osa_interface.osa_macro_used ON)
33-
elseif(CONFIG_SOC_SERIES_MCXW)
33+
elseif(CONFIG_SOC_FAMILY_MCXW)
3434
set(CONFIG_MCUX_COMPONENT_component.lists ON)
3535
set(CONFIG_MCUX_COMPONENT_component.rpmsg_adapter ON)
3636
zephyr_compile_definitions(HAL_RPMSG_SELECT_ROLE=0U)
3737
endif()
3838
endif()
3939

40-
if(CONFIG_SOC_SERIES_MCXW AND CONFIG_IEEE802154)
40+
if(CONFIG_SOC_FAMILY_MCXW AND CONFIG_IEEE802154)
4141
set(CONFIG_MCUX_COMPONENT_driver.spc ON)
4242
set(CONFIG_MCUX_COMPONENT_component.lists ON)
4343
set(CONFIG_USE_component_osa_zephyr ON)
@@ -51,7 +51,7 @@ if(CONFIG_USE_component_osa_zephyr)
5151
endif()
5252

5353
# Component definitions
54-
if(CONFIG_NXP_RF_IMU AND CONFIG_SOC_SERIES_MCXW)
54+
if(CONFIG_NXP_RF_IMU AND CONFIG_SOC_FAMILY_MCXW)
5555
zephyr_compile_definitions(HAL_RPMSG_SELECT_ROLE=0U)
5656
endif()
5757

0 commit comments

Comments
 (0)