diff --git a/boards/beagle/beagleplay/CMakeLists.txt b/boards/beagle/beagleplay/CMakeLists.txt new file mode 100644 index 0000000000000..b772e653618f1 --- /dev/null +++ b/boards/beagle/beagleplay/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_library() + +if(CONFIG_SOC_CC1352P7) + zephyr_library_sources(../beagleconnect_freedom/board_antenna.c) + zephyr_library_compile_definitions("DeviceFamily_CC13X2X7") +endif() diff --git a/boards/beagle/beagleplay/Kconfig b/boards/beagle/beagleplay/Kconfig new file mode 100644 index 0000000000000..373566d6f26ce --- /dev/null +++ b/boards/beagle/beagleplay/Kconfig @@ -0,0 +1,18 @@ +# BeaglePlay CC1352 board configuration + +# Copyright (c) 2020 Erik Larson +# Copyright (c) 2021-2022 Jason Kridner, BeagleBoard.org Foundation +# Copyright (c) 2024 Ayush Singh +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_BEAGLEPLAY_CC1352P7 + +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_BEAGLEPLAY_CC1352 diff --git a/boards/beagle/beagleplay/Kconfig.beagleplay b/boards/beagle/beagleplay/Kconfig.beagleplay new file mode 100644 index 0000000000000..e0f220288d5d7 --- /dev/null +++ b/boards/beagle/beagleplay/Kconfig.beagleplay @@ -0,0 +1,11 @@ +# BeaglePlay board configuration + +# Copyright (c) 2020 Erik Larson +# Copyright (c) 2021-2022 Jason Kridner, BeagleBoard.org Foundation +# Copyright (c) 2024 Ayush Singh, BeagleBoard.org Foundation +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_BEAGLEPLAY + select SOC_CC1352P7 if BOARD_BEAGLEPLAY_CC1352P7 + help + BeagleBoard.org BeaglePlay CC1352P7 diff --git a/boards/beagle/beagleplay/beagleplay-cc1352p7-pinctrl.dtsi b/boards/beagle/beagleplay/beagleplay-cc1352p7-pinctrl.dtsi new file mode 100644 index 0000000000000..9f6b33da2ff0c --- /dev/null +++ b/boards/beagle/beagleplay/beagleplay-cc1352p7-pinctrl.dtsi @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 Vaishnav Achath + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + /* UART0 */ + uart0_tx_default: uart0_tx_default { + pinmux = <13 IOC_PORT_MCU_UART0_TX>; + bias-disable; + }; + uart0_rx_default: uart0_rx_default { + pinmux = <12 IOC_PORT_MCU_UART0_RX>; + bias-disable; + input-enable; + }; + + /* Antenna pinmux states */ + board_ant_tx_pa_off: board_ant_tx_pa_off { + pinmux = <29 IOC_PORT_GPIO>; + bias-disable; + }; + board_ant_tx_pa_on: board_ant_tx_pa_on { + pinmux = <29 IOC_PORT_RFC_GPO3>; + bias-disable; + }; + board_ant_subg_off: board_ant_subg_off { + pinmux = <30 IOC_PORT_GPIO>; + bias-disable; + }; + board_ant_subg_on: board_ant_subg_on { + pinmux = <30 IOC_PORT_RFC_GPO0>; + bias-disable; + }; +}; diff --git a/boards/beagle/beagleplay/beagleplay_cc1352p7.dts b/boards/beagle/beagleplay/beagleplay_cc1352p7.dts new file mode 100644 index 0000000000000..858ca21d162df --- /dev/null +++ b/boards/beagle/beagleplay/beagleplay_cc1352p7.dts @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2022 Jason Kridner, BeagleBoard.org Foundation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; + +#include +#include "beagleplay-cc1352p7-pinctrl.dtsi" + +/ { + model = "beagleplay"; + compatible = "beagle,beagleplay-cc1352p7"; + + aliases { + led0 = &led0; + led1 = &led1; + }; + + chosen { + zephyr,sram = &sram0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,ieee802154 = &ieee802154g; + }; + + leds: leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; + label = "LED1"; + }; + + led1: led_1 { + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + label = "LED2"; + }; + }; + + /** + * The BeaglePlay cc1352 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 DIO29 DIO30 + * =========== ===== ===== + * Off 0 0 + * Sub-1 GHz 0 1 // DIO30 mux to IOC_PORT_RFC_GPO0 for auto + * 20 dBm TX 1 0 // DIO29 mux to IOC_PORT_RFC_GPO3 for auto + */ + antenna_mux0: antenna_mux0 { + compatible = "skyworks,sky13317"; + status = "okay"; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>, <&gpio0 30 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&board_ant_tx_pa_off &board_ant_subg_off>; + pinctrl-1 = <&board_ant_tx_pa_off &board_ant_subg_on>; + pinctrl-2 = <&board_ant_tx_pa_on &board_ant_subg_on>; + pinctrl-names = "default", "ant_subg", "ant_subg_pa"; + }; +}; + +&cpu0 { + clock-frequency = <48000000>; + cpu-power-states = <&idle &standby>; +}; + +&trng { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_rx_default &uart0_tx_default>; + pinctrl-names = "default"; +}; + +&rtc { + status = "okay"; +}; + +&ieee802154 { + status = "okay"; +}; + +&ieee802154g { + status = "okay"; +}; diff --git a/boards/beagle/beagleplay/beagleplay_cc1352p7.yaml b/boards/beagle/beagleplay/beagleplay_cc1352p7.yaml new file mode 100644 index 0000000000000..816b755471fa1 --- /dev/null +++ b/boards/beagle/beagleplay/beagleplay_cc1352p7.yaml @@ -0,0 +1,15 @@ +identifier: beagleplay/cc1352p7 +name: BeaglePlay CC1352P7 +type: mcu +arch: arm +ram: 144 +flash: 704 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - gpio + - uart + - hwinfo +vendor: beagle diff --git a/boards/beagle/beagleplay/beagleplay_cc1352p7_defconfig b/boards/beagle/beagleplay/beagleplay_cc1352p7_defconfig new file mode 100644 index 0000000000000..b56ce4d3e8d91 --- /dev/null +++ b/boards/beagle/beagleplay/beagleplay_cc1352p7_defconfig @@ -0,0 +1,20 @@ +# +# Copyright (c) 2022 Jason Kridner, BeagleBoard.org Foundation +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_GPIO=y + +CONFIG_BUILD_OUTPUT_HEX=y +# Custom callback for the antenna switch configuration +CONFIG_CC13X2_CC26X2_HAS_CUSTOM_RF_HWATTRS=y +CONFIG_CC13X2_CC26X2_BOOTLOADER_ENABLE=y +CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_ENABLE=y +CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN=15 + +CONFIG_ARM_MPU=y +CONFIG_HW_STACK_PROTECTION=y + +# Adjust for oscillator capacitors +CONFIG_CC13X2_CC26X2_XOSC_CAPARRAY_DELTA=0x02 diff --git a/boards/beagle/beagleplay/board.cmake b/boards/beagle/beagleplay/board.cmake new file mode 100644 index 0000000000000..61ee3cc23583b --- /dev/null +++ b/boards/beagle/beagleplay/board.cmake @@ -0,0 +1,15 @@ +# Copyright (c) 2020 Erik Larson +# Copyright (c) 2023 Jason Kridner, BeagleBoard.org Foundation +# Copyright (c) 2024 Ayush Singh, BeagleBoard.org Foundation +# +# SPDX-License-Identifier: Apache-2.0 + +# Download cc1352-flasher (https://pypi.org/project/cc1352-flasher/) using the following command: +# pip3 install cc1352-flasher +# Be sure to disable the bcfserial driver because it will capture /dev/ttyS4 + +if(CONFIG_SOC_CC1352P7) + find_program(CC1352_FLASHER NAMES cc1352_flasher) + board_set_flasher_ifnset(misc-flasher) + board_finalize_runner_args(misc-flasher ${CC1352_FLASHER} --play) +endif() diff --git a/boards/beagle/beagleplay/board.yml b/boards/beagle/beagleplay/board.yml new file mode 100644 index 0000000000000..b412fda0ef3a7 --- /dev/null +++ b/boards/beagle/beagleplay/board.yml @@ -0,0 +1,5 @@ +board: + name: beagleplay + vendor: beagle + socs: + - name: cc1352p7 diff --git a/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst b/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst new file mode 100644 index 0000000000000..fc36f0ce430d0 --- /dev/null +++ b/boards/beagle/beagleplay/doc/beagleplay_cc1352p7.rst @@ -0,0 +1,194 @@ +.. _beagleplay_cc1352p7: + +BeaglePlay (CC1352) +################### + +Overview +******** + +BeagleBoard.org BeaglePlay is an open hardware single board computer based on a TI Sitara AM6254 +quad-core ARM Cortex-A53 SoC with an external TI SimpleLink multi-standard CC1352P7 wireless MCU +providing long-range, low-power connectivity. + + +.. figure:: img/beagle_play.webp + :align: center + :width: 500px + :alt: BeagleBoard.org BeaglePlay + + BeagleBoard.org BeaglePlay + +Hardware +******** + +* Processors + + * TI Sitara AM6252 SoC + + * 4x ARM Cortex-A53 + * ARM Cortex-R5 + * ARM Cortex-M4 + * Dual-core 32-bit RISC Programmble Real-Time Unit (PRU) + + * TI SimpleLink CC1352P7 Wireless MCU + + * ARM Cortex-M4F programmable MCU + * ARM Cortex-M0+ software-defined radio processor + +* Memory + + * 2GB DDR4 + * 16GB eMMC flash + * I2C EEPROM + +* Wired connectivity + + * Gigabit Ethernet (RJ45) + * Single-pair Ethernet with 5V/250mA PoDL output (RJ11) + * HDMI + * USB Type-A (host) + * USB Type-C (client/power) + +* Wireless connectivity + + * TI WL1807 2.4GHz/5GHz WiFi + * BLE/SubG via CC1352P7 + +* Expansion + + * mikroBUS + * Grove + * QWIIC + +BeaglePlay ARM Cortex-A53 CPUs typically run Linux, while the CC1352P7 Cortex-M4 typically runs Zephyr. + + +Supported Features +================== + +The ``beagleplay/cc1352p7`` board target supports the following hardware features: + ++-----------+------------+----------------------+ +| Interface | Controller | Driver/Component | ++===========+============+======================+ +| GPIO | on-chip | gpio | ++-----------+------------+----------------------+ +| MPU | on-chip | arch/arm | ++-----------+------------+----------------------+ +| NVIC | on-chip | arch/arm | ++-----------+------------+----------------------+ +| PINMUX | on-chip | pinmux | ++-----------+------------+----------------------+ +| UART | on-chip | serial | ++-----------+------------+----------------------+ +| RADIO | on-chip | ieee802154 | ++-----------+------------+----------------------+ + +Connections and IOs +=================== + +CC1352 reset is connected to AM62 GPIO0_14. + ++-------+--------------+-------------------------------------+ +| Pin | Function | Usage | ++=======+==============+=====================================+ +| DIO5 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO6 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO7 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO8 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO9 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO10 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO11 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO12 | CC1352_RX | AM62 UART6_TXD | ++-------+--------------+-------------------------------------+ +| DIO13 | CC1352_TX | AM62 UART6_RXD | ++-------+--------------+-------------------------------------+ +| DIO14 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO15 | CC1352_BOOT | AM62 GPIO0_13 | ++-------+--------------+-------------------------------------+ +| DIO16 | CC1352_TDO | TAG-CONNECT TDO | ++-------+--------------+-------------------------------------+ +| DIO17 | CC1352_TDI | TAG-CONNECT TDI | ++-------+--------------+-------------------------------------+ +| DIO18 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO19 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO20 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO21 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO22 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO23 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO24 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO25 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO26 | N/C | | ++-------+--------------+-------------------------------------+ +| DIO27 | LED1 | CC1352_LED1 yellow LED9 | ++-------+--------------+-------------------------------------+ +| DIO28 | LED2 | CC1352_LED2 yellow LED8 | ++-------+--------------+-------------------------------------+ +| DIO29 | RF_PA | SubG/PA Antenna mux PA enable | ++-------+--------------+-------------------------------------+ +| DIO30 | RF_SUB1G | SubG/PA Antenna mux SubG enable | ++-------+--------------+-------------------------------------+ + +Programming and Debugging +************************* + +Flashing +======== + +To flash, disable the existing driver that ties up the serial port and use +the customized BSL Python script. + +1. Ensure the bcfserial or gb-beagleplay driver isn’t blocking the serial port. This can be done by + loading :file: ``/overlays/k3-am625-beagleplay-bcfserial-no-firmware.dtbo`` or selecting uboot + entry which disables bcfserial/gb-beagleplay. + +2. Now reboot the board. + + .. code-block:: console + + sudo shutdown -r now + +3. Install CC1352-flasher if not already installed + + .. code-block:: console + + if ! command -v cc1352_flasher &> /dev/null; then pip install cc1352-flasher; fi + + +4. Flash the CC1352P7 + + .. code-block:: console + + west flash + +Debugging +========= + +For debugging, you can use the serial port or JTAG. You can use OpenOCD +over the Tag-Connect header on the board. + +* Tagconnect JTAG + +References +********** + +.. target-notes:: + +.. _BeagleBoard.org BeaglePlay: https://beagleplay.org +.. _Tagconnect JTAG: https://docs.beagleboard.org/latest/accessories/cables.html#tagconnect-jtag diff --git a/boards/beagle/beagleplay/doc/img/beagle_play.webp b/boards/beagle/beagleplay/doc/img/beagle_play.webp new file mode 100644 index 0000000000000..031cfc7e75413 Binary files /dev/null and b/boards/beagle/beagleplay/doc/img/beagle_play.webp differ diff --git a/boards/beagle/beagleplay/support/openocd.cfg b/boards/beagle/beagleplay/support/openocd.cfg new file mode 100644 index 0000000000000..64adba40393d0 --- /dev/null +++ b/boards/beagle/beagleplay/support/openocd.cfg @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +# +# TI CC13x2 LaunchPad Evaluation Kit +# +# Since BeaglePlay CC1352 does not have a built in debugger, we use XDS110 in launchpad +# +source [find board/ti_cc13x2_launchpad.cfg] diff --git a/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig b/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig index d1b2fc58bd373..9e9f3cb321a84 100644 --- a/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig +++ b/soc/ti/simplelink/cc13x2x7_cc26x2x7/Kconfig @@ -15,6 +15,7 @@ config SOC_SERIES_CC13X2X7_CC26X2X7 select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE select HAS_PM select SOC_EARLY_INIT_HOOK + select PINCTRL menu "Customer Configuration (CCFG)" depends on SOC_SERIES_CC13X2X7_CC26X2X7