Skip to content

Commit 01ebba3

Browse files
committed
soc: microchip: mec: Add MEC165xB chip series
We add Microchip MEC165xB SoC series. Signed-off-by: Scott Worley <scott.worley@microchip.com>
1 parent fbf4fd7 commit 01ebba3

File tree

7 files changed

+118
-0
lines changed

7 files changed

+118
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Copyright (c) 2025, Microchip Technology Inc.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
zephyr_include_directories(${ZEPHYR_BASE}/drivers)
8+
zephyr_sources(soc.c)
9+
zephyr_include_directories(.)
10+
11+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

soc/microchip/mec/mec165xb/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Microchip MEC165XB MCU core series
2+
3+
# Copyright (c) 2025 Microchip Technology Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config SOC_SERIES_MEC165XB
7+
select ARM
8+
select CPU_CORTEX_M4
9+
select CPU_CORTEX_M_HAS_DWT
10+
select CPU_HAS_ARM_MPU
11+
select HAS_SWO
12+
select HAS_MEC5_HAL
13+
select SOC_PREP_HOOK
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Microchip MEC165xB MCU series configuration options
5+
6+
if SOC_SERIES_MEC165XB
7+
8+
config NUM_IRQS
9+
# must be >= the highest interrupt number used
10+
# - include the UART interrupts
11+
# All NVIC external sources.
12+
default 198
13+
14+
config CORTEX_M_SYSTICK
15+
depends on !MCHP_XEC_RTOS_TIMER
16+
17+
config SYS_CLOCK_HW_CYCLES_PER_SEC
18+
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) if CORTEX_M_SYSTICK
19+
default $(dt_node_int_prop_int,/soc/timer@40007400,clock-frequency) if MCHP_XEC_RTOS_TIMER
20+
21+
if MCHP_XEC_RTOS_TIMER
22+
23+
config SYS_CLOCK_TICKS_PER_SEC
24+
default $(dt_node_int_prop_int,/soc/timer@40007400,clock-frequency)
25+
26+
endif # MCHP_XEC_RTOS_TIMER
27+
28+
config ARCH_HAS_CUSTOM_BUSY_WAIT
29+
default y
30+
31+
endif # SOC_SERIES_MEC165XB
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Microchip MEC165xB MCU core series
5+
6+
config SOC_SERIES_MEC165XB
7+
bool
8+
select SOC_FAMILY_MICROCHIP_MEC
9+
help
10+
Enable support for Microchip MEC Cortex-M4 MCU series
11+
12+
config SOC_SERIES
13+
default "mec165xb" if SOC_SERIES_MEC165XB
14+
15+
config SOC_MEC1653B_NSZ
16+
bool
17+
select SOC_SERIES_MEC165XB
18+
19+
config SOC
20+
default "mec1653b_nsz" if SOC_MEC1653B_NSZ

soc/microchip/mec/mec165xb/soc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/device.h>
8+
#include <zephyr/init.h>
9+
#include <zephyr/kernel.h>
10+
#include <soc.h>
11+
#include <soc_cmn_init.h>
12+
13+
void soc_prep_hook(void)
14+
{
15+
mec5_soc_common_init();
16+
}

soc/microchip/mec/mec165xb/soc.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef __SOC_MICROCHIP_MEC_MEC165XB_SOC_H
8+
#define __SOC_MICROCHIP_MEC_MEC165XB_SOC_H
9+
10+
#define SYSCLK_DEFAULT_IOSC_HZ MHZ(96)
11+
12+
#ifndef _ASMLANGUAGE
13+
14+
#include "device_mec5.h"
15+
16+
/* common SoC API */
17+
#include "soc_dt.h"
18+
#include "soc_espi_channels.h"
19+
#include "soc_gpio.h"
20+
#include "soc_pcr.h"
21+
#include "soc_pins.h"
22+
23+
#endif
24+
#endif

soc/microchip/mec/soc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ family:
44
- name: mec15xx
55
socs:
66
- name: mec1501_hsz
7+
- name: mec165xb
8+
socs:
9+
- name: mec1653b_nsz
710
- name: mec172x
811
socs:
912
- name: mec172x_nsz

0 commit comments

Comments
 (0)