-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: ct: ctcc: add nrf9161 soc variant
Add support for CTHINGS.CO Connectivity Card with nRF9161 SoC variant. Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
- Loading branch information
1 parent
ebd140d
commit 7b804dc
Showing
12 changed files
with
314 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
board_runner_args(nrfjprog "--softreset") | ||
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") | ||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) | ||
if(CONFIG_BOARD_CTCC_NRF52840) | ||
board_runner_args(nrfjprog "--softreset") | ||
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") | ||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) | ||
elseif(CONFIG_BOARD_CTCC_NRF9161 OR CONFIG_BOARD_CTCC_NRF9161_NS) | ||
if(CONFIG_BOARD_CTCC_NRF9161_NS) | ||
set(TFM_PUBLIC_KEY_FORMAT "full") | ||
endif() | ||
if(CONFIG_TFM_FLASH_MERGED_BINARY) | ||
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) | ||
endif() | ||
board_runner_args(nrfjprog "--softreset") | ||
board_runner_args(pyocd "--target=nrf9161" "--frequency=4000000") | ||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
board: | ||
name: ctcc | ||
full_name: Connectivity Card nRF52840 | ||
full_name: CTHINGS.CO Connectivity Card | ||
socs: | ||
- name: nrf52840 | ||
- name: nrf9161 | ||
variants: | ||
- name: 'ns' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2024 CTHINGS.CO | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&pinctrl { | ||
uart0_default: uart0_default { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 0, 28)>, | ||
<NRF_PSEL(UART_RTS, 0, 14)>; | ||
}; | ||
group2 { | ||
psels = <NRF_PSEL(UART_RX, 0, 29)>, | ||
<NRF_PSEL(UART_CTS, 0, 15)>; | ||
}; | ||
}; | ||
|
||
uart0_sleep: uart0_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 0, 28)>, | ||
<NRF_PSEL(UART_RX, 0, 29)>, | ||
<NRF_PSEL(UART_RTS, 0, 14)>, | ||
<NRF_PSEL(UART_CTS, 0, 15)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
uart1_default: uart1_default { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 0, 27)>, | ||
<NRF_PSEL(UART_RTS, 0, 16)>; | ||
}; | ||
group2 { | ||
psels = <NRF_PSEL(UART_RX, 0, 26)>, | ||
<NRF_PSEL(UART_CTS, 0, 17)>; | ||
bias-pull-up; | ||
}; | ||
}; | ||
|
||
uart1_sleep: uart1_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(UART_TX, 0, 27)>, | ||
<NRF_PSEL(UART_RX, 0, 26)>, | ||
<NRF_PSEL(UART_RTS, 0, 16)>, | ||
<NRF_PSEL(UART_CTS, 0, 17)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
spi3_default: spi3_default { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>, | ||
<NRF_PSEL(SPIM_MISO, 0, 5)>, | ||
<NRF_PSEL(SPIM_MOSI, 0, 4)>; | ||
nordic,drive-mode = <NRF_DRIVE_H0H1>; | ||
}; | ||
}; | ||
|
||
spi3_sleep: spi3_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>, | ||
<NRF_PSEL(SPIM_MISO, 0, 5)>, | ||
<NRF_PSEL(SPIM_MOSI, 0, 4)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2024 CTHINGS.CO | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <nordic/nrf9161_laca.dtsi> | ||
#include "ctcc_nrf9161_common.dtsi" | ||
|
||
/ { | ||
chosen { | ||
zephyr,sram = &sram0_s; | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &slot0_partition; | ||
zephyr,sram-secure-partition = &sram0_s; | ||
zephyr,sram-non-secure-partition = &sram0_ns; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
identifier: ctcc/nrf9161 | ||
name: CTHINGS.CO Connectivity Card nRF9161 | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
- xtools | ||
ram: 88 | ||
flash: 1024 | ||
supported: | ||
- gpio | ||
- watchdog | ||
- counter | ||
vendor: ct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* Copyright (c) 2024 CTHINGS.CO | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "ctcc_nrf9161-pinctrl.dtsi" | ||
#include <zephyr/dt-bindings/input/input-event-codes.h> | ||
|
||
/ { | ||
model = "CTHINGS.CO Connectivity Card nRF9161"; | ||
compatible = "ct,ctcc-nrf9161"; | ||
|
||
chosen { | ||
zephyr,console = &uart0; | ||
zephyr,shell-uart = &uart0; | ||
zephyr,uart-mcumgr = &uart0; | ||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
led1: led_1 { | ||
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; | ||
label = "LED 1"; | ||
}; | ||
led2: led_2 { | ||
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; | ||
label = "LED 2"; | ||
}; | ||
}; | ||
|
||
aliases { | ||
led0 = &led1; | ||
led1 = &led2; | ||
mcuboot-led0 = &led1; | ||
bootloader-led0 = &led1; | ||
watchdog0 = &wdt0; | ||
spi-flash0 = &mx25r6435; | ||
}; | ||
}; | ||
|
||
&adc { | ||
status = "okay"; | ||
}; | ||
|
||
&gpiote { | ||
status = "okay"; | ||
}; | ||
|
||
&gpio0 { | ||
status = "okay"; | ||
}; | ||
|
||
&uart0 { | ||
status = "okay"; | ||
current-speed = <115200>; | ||
pinctrl-0 = <&uart0_default>; | ||
pinctrl-1 = <&uart0_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
}; | ||
|
||
&uart1 { | ||
status = "okay"; | ||
current-speed = <115200>; | ||
pinctrl-0 = <&uart1_default>; | ||
pinctrl-1 = <&uart1_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
}; | ||
|
||
&spi3 { | ||
compatible = "nordic,nrf-spim"; | ||
status = "okay"; | ||
cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; | ||
pinctrl-0 = <&spi3_default>; | ||
pinctrl-1 = <&spi3_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
|
||
mx25r6435: mx25r6435fm2il0@0 { | ||
compatible = "jedec,spi-nor"; | ||
status = "disabled"; | ||
reg = <0>; | ||
spi-max-frequency = <10000000>; | ||
size = <DT_SIZE_M(64)>; | ||
has-dpd; | ||
dpd-wakeup-sequence = <30000>, <20>, <30000>; | ||
jedec-id = [c2 25 38]; | ||
}; | ||
}; | ||
|
||
/* Include default memory partition configuration file */ | ||
#include <common/nordic/nrf91xx_partition.dtsi> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# Enable hardware stack protection | ||
CONFIG_HW_STACK_PROTECTION=y | ||
|
||
# Enable TrustZone-M | ||
CONFIG_ARM_TRUSTZONE_M=y | ||
|
||
# Enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Enable UART driver | ||
CONFIG_SERIAL=y | ||
|
||
# Enable console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2024 CTHINGS.CO | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <nordic/nrf9161ns_laca.dtsi> | ||
#include "ctcc_nrf9161_common.dtsi" | ||
|
||
/ { | ||
chosen { | ||
zephyr,flash = &flash0; | ||
zephyr,sram = &sram0_ns; | ||
zephyr,code-partition = &slot0_ns_partition; | ||
}; | ||
}; | ||
|
||
/* Disable UART1, because it is used by default in TF-M */ | ||
&uart1 { | ||
status = "disabled"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
identifier: ctcc/nrf9161/ns | ||
name: CTHINGS.CO Connectivity Card nRF9161 Non Secure | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
- xtools | ||
ram: 128 | ||
flash: 192 | ||
supported: | ||
- gpio | ||
- watchdog | ||
vendor: ct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# Enable hardware stack protection | ||
CONFIG_HW_STACK_PROTECTION=y | ||
|
||
# Enable TrustZone-M | ||
CONFIG_ARM_TRUSTZONE_M=y | ||
|
||
# This board implies building Non-Secure firmware | ||
CONFIG_TRUSTED_EXECUTION_NONSECURE=y | ||
|
||
# Enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Enable UART driver | ||
CONFIG_SERIAL=y | ||
|
||
# Enable console | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y |