Skip to content

Commit

Permalink
boards: ti: Create a common folder to share code between boards
Browse files Browse the repository at this point in the history
This creates a common folder in order to share code between similar
boards. This is mostly for the CC1352P1 and CC1352P7 launchpad which
are very similar but it could be probably useful for some other boards.

Signed-off-by: Alexandre Bailon <[email protected]>
  • Loading branch information
anobli authored and nashif committed Jul 28, 2024
1 parent b09972b commit 200e8d4
Show file tree
Hide file tree
Showing 19 changed files with 288 additions and 585 deletions.
3 changes: 1 addition & 2 deletions boards/ti/cc1352p1_launchxl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources(board_antenna.c)
add_subdirectory(${ZEPHYR_BASE}/boards/ti/common/ ${CMAKE_CURRENT_BINARY_DIR}/common)
14 changes: 2 additions & 12 deletions boards/ti/cc1352p1_launchxl/Kconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# TI CC1352R LaunchXL board

# Copyright (c) 2021 Florin Stancu
# Copyright (c) 2024 Alexandre Bailon
# SPDX-License-Identifier: Apache-2.0

if BOARD_CC1352P1_LAUNCHXL

config BOARD_ANTENNA_INIT_PRIO
int "Board antenna switch initialization priority"
default 70
help
Set the priority for board init, must be greater than
KERNEL_INIT_PRIORITY_DEVICE but smaller than
IEEE802154_CC13XX_CC26XX_SUB_GHZ_INIT_PRIO.

endif # BOARD_CC1352P1_LAUNCHXL
source "boards/ti/common/Kconfig"
87 changes: 0 additions & 87 deletions boards/ti/cc1352p1_launchxl/cc1352p1_launchxl-pinctrl.dtsi

This file was deleted.

158 changes: 3 additions & 155 deletions boards/ti/cc1352p1_launchxl/cc1352p1_launchxl.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,163 +7,11 @@
/dts-v1/;

#include <ti/cc1352r.dtsi>
#include "../cc1352r1_launchxl/boosterpack_connector.dtsi"
#include "cc1352p1_launchxl-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "../common/launchxl.dtsi"
#include "../common/launchxl-flash.dtsi"
#include "../common/launchxl_sky13317.dtsi"

/ {
model = "TI CC1352P1 LaunchXL";
compatible = "ti,launchxl-cc1352p1";

aliases {
led0 = &led0;
led1 = &led1;
sw0 = &btn0;
sw1 = &btn1;
watchdog0 = &wdt0;
mcuboot-led0 = &led1;
mcuboot-button0 = &btn1;
};

chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,ieee802154 = &ieee802154;
zephyr,code-partition = &slot0_partition;
};

/**
* The CC1352P LAUNCHXL has an on-board antenna switch (SKY13317-373LF) used to select the
* appropriate RF signal port based on the currently-used PHY.
*
* Truth table:
*
* Path DIO28 DIO29 DIO30
* =========== ===== ===== =====
* Off 0 0 0
* Sub-1 GHz 0 0 1 // DIO30 mux to IOC_PORT_RFC_GPO0 for auto
* 2.4 GHz 1 0 0 // DIO28 mux to IOC_PORT_RFC_GPO0 for auto
* 20 dBm TX 0 1 0 // DIO29 mux to IOC_PORT_RFC_GPO3 for auto
*/
antenna_mux0: antenna_mux0 {
compatible = "skyworks,sky13317";
status = "okay";
gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>, \
<&gpio0 30 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&board_ant_24g_off &board_ant_tx_pa_off &board_ant_subg_off>;
pinctrl-1 = <&board_ant_24g_on &board_ant_tx_pa_off &board_ant_subg_off>;
pinctrl-2 = <&board_ant_24g_on &board_ant_tx_pa_on &board_ant_subg_off>;
pinctrl-3 = <&board_ant_24g_off &board_ant_tx_pa_off &board_ant_subg_on>;
pinctrl-4 = <&board_ant_24g_off &board_ant_tx_pa_on &board_ant_subg_on>;
pinctrl-names = "default", "ant_24g", "ant_24g_pa", "ant_subg", "ant_subg_pa";
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
label = "Green LED";
};
led1: led_1 {
gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
label = "Red LED";
};
};

keys {
compatible = "gpio-keys";
btn0: btn_0 {
gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "Push button 1";
zephyr,code = <INPUT_KEY_0>;
};
btn1: btn_1 {
gpios = <&gpio0 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "Push button 2";
zephyr,code = <INPUT_KEY_1>;
};
};
};

&flash0 {
partitions {
/* 40 KiB (0xa000) for MCUboot */
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000a000>;
};

/* 136 KiB (0x22000) per slot for application */
slot0_partition: partition@a000 {
label = "image-0";
reg = <0x0000a000 0x00022000>;
};

slot1_partition: partition@2c000 {
label = "image-1";
reg = <0x0002c000 0x00022000>;
};

/* 32 KiB (0x8000) for storage */
storage_partition: partition@4e000 {
label = "storage";
reg = <0x0004e000 0x00008000>;
};

/* CCFG (customer configuration area) is located in uppermost
* flash sector (0x2000/8 KiB @ 0x56000), keep it unused.
*/
};
};

&cpu0 {
clock-frequency = <48000000>;
};

&trng {
status = "okay";
};

&gpio0 {
status = "okay";
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_rx_default &uart0_tx_default>;
pinctrl-names = "default";
};

&i2c0 {
status = "okay";
pinctrl-0 = <&i2c0_scl_default &i2c0_sda_default>;
pinctrl-1 = <&i2c0_scl_sleep &i2c0_sda_sleep>;
pinctrl-names = "default", "sleep";
};

&spi0 {
status = "okay";
pinctrl-0 = <&spi0_sck_default &spi0_mosi_default
&spi0_miso_default &spi0_cs_default>;
pinctrl-names = "default";
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};

&radio {
status = "okay";
};

&ieee802154 {
status = "okay";
};

&ieee802154g {
status = "disabled";
};

&wdt0 {
status = "okay";
};
Loading

0 comments on commit 200e8d4

Please sign in to comment.