soc: microchip: mec: Add MEC165xB chip series
We add Microchip MEC165xB SoC series.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
diff --git a/soc/microchip/mec/mec165xb/CMakeLists.txt b/soc/microchip/mec/mec165xb/CMakeLists.txt
new file mode 100644
index 0000000..f8f479c
--- /dev/null
+++ b/soc/microchip/mec/mec165xb/CMakeLists.txt
@@ -0,0 +1,11 @@
+#
+# Copyright (c) 2025, Microchip Technology Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+zephyr_include_directories(${ZEPHYR_BASE}/drivers)
+zephyr_sources(soc.c)
+zephyr_include_directories(.)
+
+set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
diff --git a/soc/microchip/mec/mec165xb/Kconfig b/soc/microchip/mec/mec165xb/Kconfig
new file mode 100644
index 0000000..79ff7dd
--- /dev/null
+++ b/soc/microchip/mec/mec165xb/Kconfig
@@ -0,0 +1,13 @@
+# Microchip MEC165XB MCU core series
+
+# Copyright (c) 2025 Microchip Technology Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+config SOC_SERIES_MEC165XB
+ select ARM
+ select CPU_CORTEX_M4
+ select CPU_CORTEX_M_HAS_DWT
+ select CPU_HAS_ARM_MPU
+ select HAS_SWO
+ select HAS_MEC5_HAL
+ select SOC_PREP_HOOK
diff --git a/soc/microchip/mec/mec165xb/Kconfig.defconfig.series b/soc/microchip/mec/mec165xb/Kconfig.defconfig.series
new file mode 100644
index 0000000..1c554a7
--- /dev/null
+++ b/soc/microchip/mec/mec165xb/Kconfig.defconfig.series
@@ -0,0 +1,31 @@
+# Copyright (c) 2025 Microchip Technology Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# Microchip MEC165xB MCU series configuration options
+
+if SOC_SERIES_MEC165XB
+
+config NUM_IRQS
+ # must be >= the highest interrupt number used
+ # - include the UART interrupts
+ # All NVIC external sources.
+ default 198
+
+config CORTEX_M_SYSTICK
+ depends on !MCHP_XEC_RTOS_TIMER
+
+config SYS_CLOCK_HW_CYCLES_PER_SEC
+ default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) if CORTEX_M_SYSTICK
+ default $(dt_node_int_prop_int,/soc/timer@40007400,clock-frequency) if MCHP_XEC_RTOS_TIMER
+
+if MCHP_XEC_RTOS_TIMER
+
+config SYS_CLOCK_TICKS_PER_SEC
+ default $(dt_node_int_prop_int,/soc/timer@40007400,clock-frequency)
+
+endif # MCHP_XEC_RTOS_TIMER
+
+config ARCH_HAS_CUSTOM_BUSY_WAIT
+ default y
+
+endif # SOC_SERIES_MEC165XB
diff --git a/soc/microchip/mec/mec165xb/Kconfig.soc b/soc/microchip/mec/mec165xb/Kconfig.soc
new file mode 100644
index 0000000..49544c0
--- /dev/null
+++ b/soc/microchip/mec/mec165xb/Kconfig.soc
@@ -0,0 +1,20 @@
+# Copyright (c) 2025 Microchip Technology Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# Microchip MEC165xB MCU core series
+
+config SOC_SERIES_MEC165XB
+ bool
+ select SOC_FAMILY_MICROCHIP_MEC
+ help
+ Enable support for Microchip MEC Cortex-M4 MCU series
+
+config SOC_SERIES
+ default "mec165xb" if SOC_SERIES_MEC165XB
+
+config SOC_MEC1653B_NSZ
+ bool
+ select SOC_SERIES_MEC165XB
+
+config SOC
+ default "mec1653b_nsz" if SOC_MEC1653B_NSZ
diff --git a/soc/microchip/mec/mec165xb/soc.c b/soc/microchip/mec/mec165xb/soc.c
new file mode 100644
index 0000000..20028ed
--- /dev/null
+++ b/soc/microchip/mec/mec165xb/soc.c
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2025 Microchip Technology Inc.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include <zephyr/device.h>
+#include <zephyr/init.h>
+#include <zephyr/kernel.h>
+#include <soc.h>
+#include <soc_cmn_init.h>
+
+void soc_prep_hook(void)
+{
+ mec5_soc_common_init();
+}
diff --git a/soc/microchip/mec/mec165xb/soc.h b/soc/microchip/mec/mec165xb/soc.h
new file mode 100644
index 0000000..446be10
--- /dev/null
+++ b/soc/microchip/mec/mec165xb/soc.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2025 Microchip Technology Inc.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#ifndef __SOC_MICROCHIP_MEC_MEC165XB_SOC_H
+#define __SOC_MICROCHIP_MEC_MEC165XB_SOC_H
+
+#define SYSCLK_DEFAULT_IOSC_HZ MHZ(96)
+
+#ifndef _ASMLANGUAGE
+
+#include "device_mec5.h"
+
+/* common SoC API */
+#include <soc_dt.h>
+#include <soc_ecia.h>
+#include <soc_espi_channels.h>
+#include <soc_gpio.h>
+#include <soc_mmcr.h>
+#include <soc_pcr.h>
+#include <soc_pins.h>
+
+#endif
+#endif
diff --git a/soc/microchip/mec/soc.yml b/soc/microchip/mec/soc.yml
index b3c68a8..b5e2153 100644
--- a/soc/microchip/mec/soc.yml
+++ b/soc/microchip/mec/soc.yml
@@ -4,6 +4,9 @@
- name: mec15xx
socs:
- name: mec1501_hsz
+ - name: mec165xb
+ socs:
+ - name: mec1653b_nsz
- name: mec172x
socs:
- name: mec172x_nsz