Commit efdd8580 authored by Declan Snyder's avatar Declan Snyder Committed by Anas Nashif
Browse files

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: default avatarDeclan Snyder <declan.snyder@nxp.com>
parent 1495e2e3
Loading
Loading
Loading
Loading
+16 −16
Changes for drivers/clock_control/clock_control_mcux_syscon.c: 16 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
#if defined(CONFIG_COUNTER_NXP_MRT)
	if ((uint32_t)sub_system == MCUX_MRT_CLK) {
#if defined(CONFIG_SOC_FAMILY_LPC) || defined(CONFIG_SOC_SERIES_RW6XX) ||                          \
	defined(CONFIG_SOC_SERIES_MCXN)
	defined(CONFIG_SOC_FAMILY_MCXN)
		CLOCK_EnableClock(kCLOCK_Mrt);
#elif defined(CONFIG_SOC_FAMILY_NXP_IMXRT)
		CLOCK_EnableClock(kCLOCK_Mrt0);
@@ -46,7 +46,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,

#if defined(CONFIG_PINCTRL_NXP_PORT)
	switch ((uint32_t)sub_system) {
#if defined(CONFIG_SOC_SERIES_MCXA)
#if defined(CONFIG_SOC_FAMILY_MCXA)
	case MCUX_PORT0_CLK:
		CLOCK_EnableClock(kCLOCK_GatePORT0);
		break;
@@ -80,7 +80,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
	case MCUX_PORT4_CLK:
		CLOCK_EnableClock(kCLOCK_Port4);
		break;
#endif /* defined(CONFIG_SOC_SERIES_MCXA) */
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
	default:
		break;
	}
@@ -94,7 +94,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,

#if defined(CONFIG_CAN_MCUX_FLEXCAN)
	switch ((uint32_t)sub_system) {
#if defined(CONFIG_SOC_SERIES_MCXA)
#if defined(CONFIG_SOC_FAMILY_MCXA)
	case MCUX_FLEXCAN0_CLK:
		CLOCK_EnableClock(kCLOCK_GateFLEXCAN0);
		break;
@@ -105,7 +105,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
	case MCUX_FLEXCAN1_CLK:
		CLOCK_EnableClock(kCLOCK_Flexcan1);
		break;
#endif /* defined(CONFIG_SOC_SERIES_MCXA) */
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
	default:
		break;
	}
@@ -124,7 +124,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
#if DT_NODE_HAS_STATUS(DT_NODELABEL(rtc), okay)
#if defined(CONFIG_SOC_SERIES_IMXRT5XX) || defined(CONFIG_SOC_SERIES_IMXRT6XX)
	CLOCK_EnableOsc32K(true);
#elif CONFIG_SOC_SERIES_MCXN
#elif CONFIG_SOC_FAMILY_MCXN
/* 0x0 Clock Select Value Set IRTC to use FRO 16K Clk */
#if DT_PROP(DT_NODELABEL(rtc), clock_select) == 0x0
	CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVbat | kCLOCK_Clk16KToMain);
@@ -133,7 +133,7 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
	CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVbat | kCLOCK_Osc32kToMain);
#endif /* DT_PROP(DT_NODELABEL(rtc), clock_select) */
	CLOCK_EnableClock(kCLOCK_Rtc0);
#endif /* CONFIG_SOC_SERIES_MCXN */
#endif /* CONFIG_SOC_FAMILY_MCXN */
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(rtc), okay) */

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

#if (defined(FSL_FEATURE_SOC_USDHC_COUNT) && FSL_FEATURE_SOC_USDHC_COUNT)

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

#if defined(CONFIG_I3C_MCUX)
	case MCUX_I3C_CLK:
#if CONFIG_SOC_SERIES_MCXN
#if CONFIG_SOC_FAMILY_MCXN
		*rate = CLOCK_GetI3cClkFreq(0);
#elif CONFIG_SOC_SERIES_MCXA
#elif CONFIG_SOC_FAMILY_MCXA
		*rate = CLOCK_GetI3CFClkFreq();
#else
		*rate = CLOCK_GetI3cClkFreq();
@@ -382,7 +382,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
		break;
#if (FSL_FEATURE_SOC_I3C_COUNT == 2)
	case MCUX_I3C2_CLK:
#if CONFIG_SOC_SERIES_MCXN
#if CONFIG_SOC_FAMILY_MCXN
		*rate = CLOCK_GetI3cClkFreq(1);
#else
		*rate = CLOCK_GetI3cClkFreq();
@@ -486,7 +486,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
#endif /* CONFIG_ADC_MCUX_LPADC */

#if defined(CONFIG_CAN_MCUX_FLEXCAN)
#if defined(CONFIG_SOC_SERIES_MCXA)
#if defined(CONFIG_SOC_FAMILY_MCXA)
	case MCUX_FLEXCAN0_CLK:
		*rate = CLOCK_GetFlexcanClkFreq();
		break;
@@ -497,7 +497,7 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
	case MCUX_FLEXCAN1_CLK:
		*rate = CLOCK_GetFlexcanClkFreq(1);
		break;
#endif /* defined(CONFIG_SOC_SERIES_MCXA) */
#endif /* defined(CONFIG_SOC_FAMILY_MCXA) */
#endif /* defined(CONFIG_CAN_MCUX_FLEXCAN) */

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

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

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

#if (defined(CONFIG_SPI_NXP_LPSPI) && CONFIG_SOC_SERIES_MCXA)
#if (defined(CONFIG_SPI_NXP_LPSPI) && CONFIG_SOC_FAMILY_MCXA)
	case MCUX_LPSPI0_CLK:
		*rate = CLOCK_GetLpspiClkFreq(0);
		break;
+4 −4
Changes for drivers/flash/soc_flash_mcux.c: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ LOG_MODULE_REGISTER(flash_mcux);

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

#define SOC_FLASH_NEED_CLEAR_CACHES 1
#ifdef CONFIG_SOC_SERIES_MCXW
#ifdef CONFIG_SOC_FAMILY_MCXW
static void clear_flash_caches(void)
{
	volatile uint32_t *const smscm_ocmdr0 = (volatile uint32_t *)0x40015400;
@@ -128,7 +128,7 @@ static void clear_flash_caches(void)
	/* this bit clears the code cache */
	*mcm_cpcr2 |= BIT(0);
}
#elif CONFIG_SOC_SERIES_MCXN
#elif CONFIG_SOC_FAMILY_MCXN
static void clear_flash_caches(void)
{
	volatile uint32_t *const nvm_ctrl = (volatile uint32_t *)0x40000400;
@@ -138,7 +138,7 @@ static void clear_flash_caches(void)
	/* this bit clears the code cache */
	*lpcac_ctrl |= BIT(1);
}
#elif CONFIG_SOC_SERIES_MCXA
#elif CONFIG_SOC_FAMILY_MCXA
static void clear_flash_caches(void)
{
	SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_DIS_LPCAC(1U);
+1 −1
Changes for drivers/ipm/ipm_mcux.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#define MCUX_IPM_MAX_ID_VAL 0

#if (defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES) || \
defined(CONFIG_SOC_SERIES_MCXN))
defined(CONFIG_SOC_FAMILY_MCXN))
#if (defined(LPC55S69_cm33_core0_SERIES) || defined(MCXN947_cm33_core0_SERIES) || \
defined(MCXN946_cm33_core0_SERIES) || defined(MCXN547_cm33_core0_SERIES) || \
defined(MCXN546_cm33_core0_SERIES))
+1 −1
Changes for drivers/mbox/mbox_nxp_mailbox.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(nxp_mbox_mailbox);
#define MAILBOX_MBOX_SIZE    3

#if (defined(LPC55S69_cm33_core0_SERIES) || defined(LPC55S69_cm33_core1_SERIES) ||                 \
defined(CONFIG_SOC_SERIES_MCXN))
defined(CONFIG_SOC_FAMILY_MCXN))
#if (defined(LPC55S69_cm33_core0_SERIES) || defined(MCXN947_cm33_core0_SERIES) ||                  \
defined(MCXN946_cm33_core0_SERIES) || defined(MCXN547_cm33_core0_SERIES) ||                   \
defined(MCXN546_cm33_core0_SERIES))
+1 −1
Changes for drivers/timer/mcux_os_timer.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#include <zephyr/drivers/counter.h>
#include <zephyr/pm/pm.h>
#include "fsl_ostimer.h"
#if !defined(CONFIG_SOC_SERIES_MCXN) && !defined(CONFIG_SOC_SERIES_MCXA)
#if !defined(CONFIG_SOC_FAMILY_MCXN) && !defined(CONFIG_SOC_FAMILY_MCXA)
#include "fsl_power.h"
#endif

Loading