Skip to content

Commit 364aef8

Browse files
committed
RDKBACCL-985 : Barton support
Reason for change: IoT stack for RDK-B Test Procedure: configure wifi and test with thread and wifi devices Risks: Low Signed-off-by: Chandrakanth Pokuru <[email protected]>
1 parent 40aeaa0 commit 364aef8

25 files changed

+4976
-4
lines changed

conf/distro/include/rdk-bpi.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,6 @@ DISTRO_FEATURES_append = " resource_optimization"
6565

6666
DISTRO_FEATURES_append = " CONFIG_IEEE80211BE"
6767

68+
DISTRO_FEATURES_append = " matter"
69+
6870
#DISTRO_FEATURES_append = " generic_mlo"

meta-rdk-mtk-bpir4/recipes-ccsp/util/utopia.bbappend

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
44

55
SRC_URI += "file://service_bridge_bpi.sh"
66

7+
CFLAGS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'matter', ' -DFEATURE_MATTER_ENABLED', '', d)}"
8+
79
do_install_append() {
810

911
install -d ${D}${sysconfdir}/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add this new section
2+
do_install_append() {
3+
install -m 0755 ${B}/tools/btattach ${D}${bindir}
4+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
DESCRIPTION = "Bluetooth CPC HCI Bridge"
2+
LICENSE = "Proprietary"
3+
LIC_FILES_CHKSUM = "file://${WORKDIR}/git/gsdk/License.txt;md5=9a041f41aad5520b22ab2bb033c11e3c"
4+
5+
# GSDK path definition
6+
GSDK_DIR = "${WORKDIR}/git/gsdk"
7+
BT_BRIDGE_DIR = "${GSDK_DIR}/app/bluetooth/example_host/bt_host_cpc_hci_bridge"
8+
9+
SRC_URI = "git://github.com/SiliconLabs/gecko_sdk.git;protocol=https;branch=gsdk_4.4;destsuffix=git/gsdk;name=gsdk"
10+
SRCREV_gsdk = "9ad9e19638a2d0ce01ce21d32f5049c5f1b21d70"
11+
12+
SRC_URI += "file://bt-host-cpc-hci-bridge.service \
13+
file://bt-host-cpc-hci-bridge-attach.service \
14+
"
15+
16+
DEPENDS += "cpcd"
17+
RDEPENDS_${PN} += "cpcd (= 4.4.1.0-r0) bluez5-noinst-tools"
18+
19+
S = "${BT_BRIDGE_DIR}"
20+
21+
inherit pkgconfig systemd
22+
23+
# Ensure we're using the correct toolchain
24+
TOOLCHAIN = "gcc"
25+
INHIBIT_DEFAULT_DEPS = "1"
26+
DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ virtual/libc"
27+
28+
# Basic compilation flags
29+
CFLAGS = "${TARGET_CFLAGS} -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHOST_TOOLCHAIN -DPOSIX -DSL_CATALOG_APP_LOG_PRESENT"
30+
31+
EXTRA_OEMAKE = "\
32+
CPC=1 \
33+
CC='${CC}' \
34+
CROSS_COMPILE=${TARGET_PREFIX} \
35+
CFLAGS='${CFLAGS} \
36+
-I${STAGING_INCDIR} \
37+
-I${STAGING_INCDIR}/sl_cpc \
38+
-I${GSDK_DIR}/app/bluetooth/common_host/iostream_mock \
39+
-I${GSDK_DIR}/app/bluetooth/common_host/app_log \
40+
-I${GSDK_DIR}/app/bluetooth/common_host/app_log/config \
41+
-I${GSDK_DIR}/platform/common/inc \
42+
-I${GSDK_DIR}/protocol/bluetooth/bgstack/ll/utils/hci_packet/inc \
43+
-fno-short-enums -Wall -std=c99' \
44+
LDFLAGS='${LDFLAGS}' \
45+
"
46+
47+
do_configure[noexec] = "1"
48+
49+
do_compile() {
50+
oe_runmake
51+
}
52+
53+
do_install() {
54+
# Install binary from the exe directory
55+
install -d ${D}${bindir}
56+
install -m 0755 ${S}/exe/bt_host_cpc_hci_bridge ${D}${bindir}
57+
58+
# Install systemd services
59+
install -d ${D}${systemd_system_unitdir}
60+
install -m 0644 ${WORKDIR}/bt-host-cpc-hci-bridge.service ${D}${systemd_system_unitdir}
61+
install -m 0644 ${WORKDIR}/bt-host-cpc-hci-bridge-attach.service ${D}${systemd_system_unitdir}
62+
}
63+
64+
FILES_${PN} += "${systemd_system_unitdir}"
65+
66+
SYSTEMD_SERVICE_${PN} = "bt-host-cpc-hci-bridge.service bt-host-cpc-hci-bridge-attach.service"
67+
SYSTEMD_AUTO_ENABLE = "enable"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Attach Bluetooth HCI Bridge
3+
After=bt-host-cpc-hci-bridge.service
4+
Requires=bt-host-cpc-hci-bridge.service
5+
6+
[Service]
7+
Type=simple
8+
ExecStartPre=/bin/sh -c 'while [ ! -e /dev/pts/0 ]; do sleep 1; done'
9+
ExecStart=/usr/bin/btattach -B /dev/pts/0 -S 115200
10+
Restart=always
11+
RestartSec=5
12+
13+
[Install]
14+
WantedBy=multi-user.target
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Bluetooth CPC HCI Bridge
3+
After=cpcd.service
4+
Requires=cpcd.service
5+
6+
[Service]
7+
Type=simple
8+
ExecStart=/usr/bin/bt_host_cpc_hci_bridge
9+
Restart=always
10+
RestartSec=5
11+
WorkingDirectory=/tmp
12+
13+
[Install]
14+
WantedBy=multi-user.target
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# TODO: Verify license -- it is Silabs specific
2+
DESCRIPTION = "Co-Processor Communication Daemon"
3+
LICENSE = "Proprietary"
4+
LIC_FILES_CHKSUM = "file://LICENSE;md5=5e588136d392e8e0e36bd310e9ca0ab3"
5+
SRC_URI = "git://github.com/SiliconLabs/cpc_daemon;protocol=https;name=cpc-daemon;branch=main"
6+
PR = "r0"
7+
# Tag v4.4.1
8+
SRCREV_cpc-daemon = "283b31aef4f32df23596b8cff1a646dd1dc442c6"
9+
SRC_URI += "file://cpcd.service \
10+
file://cpcd.conf \
11+
"
12+
DEPENDS += "mbedtls systemd"
13+
RDEPENDS_${PN} += "systemd"
14+
S = "${WORKDIR}/git"
15+
inherit cmake pkgconfig
16+
EXTRA_OECMAKE += "-DUSE_LEGACY_GPIO_SYSFS=TRUE \
17+
"
18+
do_install_append() {
19+
install -d ${D}${sysconfdir}
20+
install -m 0644 ${WORKDIR}/cpcd.conf ${D}${sysconfdir}/cpcd.conf
21+
install -d ${D}${bindir}
22+
install -d ${D}${systemd_unitdir}/system
23+
install -m 0644 ${WORKDIR}/cpcd.service ${D}${systemd_unitdir}/system/cpcd.service
24+
}
25+
FILES_${PN} += "${systemd_unitdir}/system/"
26+
inherit systemd
27+
SYSTEMD_SERVICE_${PN} = "cpcd.service"
28+
SYSTEMD_AUTO_ENABLE = "enable"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Instance Name
2+
# Optional, defaults to "cpcd_0"
3+
# This string uniquely identifies the running cpcd instance.
4+
# An application must pass this value to cpc_init() to connect
5+
# to this particular instance.
6+
instance_name: cpcd_0
7+
8+
# Bus type selection
9+
# Mandatory
10+
# Allowed values : UART or SPI
11+
bus_type: UART
12+
13+
# SPI device file
14+
# Mandatory if spi chosen, ignored if uart chosen
15+
spi_device_file: /dev/spidev0.0
16+
17+
# SPI RX IRQ gpio chip
18+
# Mandatory if spi chosen, ignored if uart chosen
19+
spi_rx_irq_gpio_chip: gpiochip0
20+
21+
# SPI RX IRQ gpio
22+
# RX interrupt gpio selection
23+
spi_rx_irq_gpio: 22
24+
25+
# SPI bitrate.
26+
# Ignored if uart chosen.
27+
# See doc/spi_bitrate.md for a complete explanation
28+
spi_device_bitrate: 1000000
29+
30+
# UART device file
31+
# Mandatory if uart chosen, ignored if spi chosen
32+
uart_device_file: /dev/ttyACM0
33+
34+
# UART baud rate.
35+
# Optional if uart chosen, ignored if spi chosen. Defaults to 115200
36+
# Allowed values : standard UART baud rates listed in 'termios.h'
37+
uart_device_baud: 115200
38+
39+
# UART flow control.
40+
# Optional if uart chosen, ignored if spi chosen. Defaults to 'true'
41+
# Allowed values are 'true' or 'false'
42+
uart_hardflow: true
43+
44+
# BOOTLOADER Recovery Pins Enabled
45+
# Set to true to enter bootloader via wake and reset pins
46+
# If true, bootloader_wake_gpio/chip and bootloader_reset_gpio/chip must be configured
47+
bootloader_recovery_pins_enabled: false
48+
49+
# BOOTLOADER WAKE gpio chip
50+
# Wakeup gpio chip used by the bootloader
51+
bootloader_wake_gpio_chip: gpiochip0
52+
53+
# BOOTLOADER WAKE gpio
54+
# Wakeup gpio used by the bootloader
55+
# Ensure bootloader_recovery_pins_enabled=true to use this pin
56+
bootloader_wake_gpio: 24
57+
58+
# BOOTLOADER RESET gpio chip
59+
# Reset gpio chip used by the bootloader
60+
bootloader_reset_gpio_chip: gpiochip0
61+
62+
# BOOTLOADER RESET gpio
63+
# Reset gpio used by the bootloader
64+
# Ensure bootloader_recovery_pins_enabled=true to use this pin
65+
bootloader_reset_gpio: 23
66+
67+
# Prints tracing information to stdout
68+
# Optional, defaults to 'false'
69+
# Allowed values are 'true' or 'false'
70+
stdout_trace: false
71+
72+
# Prints tracing information to a file located under traces_folder
73+
# Optional, defaults to 'false'
74+
# Allowed values are 'true' or 'false'
75+
trace_to_file: false
76+
77+
# Traces folder
78+
# Optional, defaults to '/dev/shm/cpcd-traces'
79+
# Folder mounted on a tmpfs is preferred
80+
traces_folder: /dev/shm/cpcd-traces
81+
82+
# Enable frame trace
83+
# Optional, defaults to 'false'
84+
# Allowed values are 'true' or 'false'
85+
enable_frame_trace: false
86+
87+
# Number of open file descriptors.
88+
# Optional, defaults to 2000
89+
# If the error 'Too many open files' occurs, this is the value to increase.
90+
rlimit_nofile: 2000
91+
92+
# Disable the encryption over CPC endpoints
93+
# Optional, defaults false
94+
disable_encryption: true
95+
96+
# Binding key file
97+
# Mandatory when security is used
98+
# Must have 32 alphanumeric characters as the first line, representing a 128 bit binding key
99+
# If ECDH encryption is used, this file will be created during the binding process
100+
binding_key_file: ~/.cpcd/binding.key
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Service for the 802.15.4 co-processor communication daemon
3+
StartLimitIntervalSec=300
4+
StartLimitBurst=5
5+
[Service]
6+
Type=simple
7+
Restart=always
8+
RestartSec=5
9+
TimeoutStartSec=60
10+
ExecStart=/usr/bin/cpcd -c /etc/cpcd.conf
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)