Skip to content

Commit 4d09a30

Browse files
committed
boards: Add Microchip CEC SoC family and SecureIoT1702 board
Adds minimal support for CEC1702 with support to communicate via serial port. Signed-off-by: Timo Teräs <[email protected]>
1 parent 69b7a88 commit 4d09a30

File tree

22 files changed

+6702
-0
lines changed

22 files changed

+6702
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
zephyr_sources(
2+
soc_config.c
3+
)

arch/arm/soc/microchip_cec/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
config SOC_FAMILY_CEC
2+
bool
3+
# omit prompt to signify a "hidden" option
4+
default n
5+
6+
if SOC_FAMILY_CEC
7+
config SOC_FAMILY
8+
string
9+
default "microchip_cec"
10+
endif
11+
12+
choice
13+
prompt "Microchip CECxxxx MCU Selection"
14+
depends on SOC_FAMILY_CEC
15+
16+
config SOC_CEC1702
17+
bool "CEC1702"
18+
19+
endchoice
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
if SOC_FAMILY_CEC
2+
3+
config SOC
4+
default microchip_cec
5+
6+
config NUM_IRQS
7+
int
8+
# must be >= the highest interrupt number used
9+
# - include the UART interrupts
10+
default 34
11+
12+
config SYS_CLOCK_HW_CYCLES_PER_SEC
13+
int
14+
default 48000000
15+
16+
endif
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
config SOC_FAMILY_CEC
2+
bool "Microchip CECxxxx MCU"
3+
select CPU_CORTEX_M
4+
select CPU_CORTEX_M4
5+
select CPU_HAS_SYSTICK
6+
select HAS_CEC_HAL
7+
help
8+
Enable support for Micochip CEC Cortex-M4 microcontrollers.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* linker.ld - Linker command/script file */
2+
3+
/*
4+
* Copyright (c) 2014 Wind River Systems, Inc.
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
#include <arch/arm/cortex_m/scripts/linker.ld>

arch/arm/soc/microchip_cec/soc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef CEC_SOC_H
2+
#define CEC_SOC_H
3+
4+
#define SYSCLK_DEFAULT_IOSC_HZ MHZ(48)
5+
6+
#include "MEC2016_INTERNAL.h"
7+
8+
#endif
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* @file Board config file
3+
*/
4+
5+
#include <device.h>
6+
#include <init.h>
7+
8+
#include <kernel.h>
9+
10+
#include "soc.h"
11+
12+
static int soc_init(struct device *dev)
13+
{
14+
__enable_irq(); /* Enable IRQs as ROM loader does PRIMASK=1 */
15+
PCR->CLK_REQ_1 |= 1 << 0; /* Clock: Interrupt block */
16+
PCR->CLK_REQ_1 |= 1 << 8; /* Clock: Processor */
17+
#ifdef CONFIG_UART_NS16550_PORT_0
18+
PCR->CLK_REQ_2 |= 1 << 1; /* Clock: UART0 */
19+
GPIO_100_137->GPIO_104_PIN_CONTROL = 1 << 12; /* GPIO104 Alt1 = UART0_TX */
20+
GPIO_100_137->GPIO_105_PIN_CONTROL = 1 << 12; /* GPIO105 Alt1 = UART0_RX */
21+
UART0->CONFIG = 0; /* Reset on RESET_SYS */
22+
UART0->ACTIVATE = 1; /* Power up UART0 */
23+
#endif
24+
#ifdef CONFIG_UART_NS16550_PORT_1
25+
PCR->CLK_REQ_2 |= 1 << 2; /* Clock: UART1 */
26+
GPIO_140_176->GPIO_170_PIN_CONTROL = 2 << 12; /* GPIO170 Alt2 = UART1_TX */
27+
GPIO_140_176->GPIO_171_PIN_CONTROL = 2 << 12; /* GPIO171 Alt2 = UART1_RX */
28+
GPIO_100_137->GPIO_113_PIN_CONTROL = 1 << 9; /* GPIO113 drives UART1_RX_EN on secureiot1702 board */
29+
UART1->CONFIG = 0; /* Reset on RESET_SYS */
30+
UART1->ACTIVATE = 1; /* Power up UART1 */
31+
#endif
32+
return 0;
33+
}
34+
35+
SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
config BOARD_SECUREIOT1702
2+
bool "Microchip SecureIoT1702"
3+
depends on SOC_FAMILY_CEC
4+
select HAS_DTS
5+
select SOC_PART_NUMBER_CEC1702
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
if BOARD_SECUREIOT1702
2+
3+
config BOARD
4+
default secureiot1702
5+
6+
endif

boards/arm/secureiot1702/board.h

Whitespace-only changes.

0 commit comments

Comments
 (0)