Skip to content

Commit 64a3083

Browse files
Yuriy Vynnychekcfriedt
authored andcommitted
boards: riscv: tlsr9518adk80d: new Telink B91 board support
New Telink RISC-V B91 Generic Starter Kit board support. Signed-off-by: Yuriy Vynnychek <[email protected]>
1 parent 4b0b1e0 commit 64a3083

File tree

8 files changed

+388
-0
lines changed

8 files changed

+388
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021 Telink Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_TLSR9518ADK80D
5+
bool "Telink B91 Platform"
6+
depends on SOC_RISCV_TELINK_B91
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2021 Telink Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_TLSR9518ADK80D
5+
6+
config BOARD
7+
default "tlsr9518adk80d"
8+
9+
config COMPRESSED_ISA
10+
default y
11+
12+
config GPIO_TELINK_B91
13+
default y if GPIO
14+
15+
config UART_TELINK_B91
16+
default y if SERIAL
17+
18+
config PINMUX_TELINK_B91
19+
default y if PINMUX
20+
21+
endif
111 KB
Loading
585 KB
Loading
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
.. _tlst9518adk80d:
2+
3+
Telink TLSR9518ADK80D
4+
#####################
5+
6+
Overview
7+
********
8+
9+
The TLSR9518A Generic Starter Kit is a hardware platform which
10+
can be used to verify the `Telink TLSR9 series chipset`_ and develop applications
11+
for several 2.4 GHz air interface standards including Bluetooth 5.2 (Basic data
12+
rate, Enhanced data rate, LE, Indoor positioning and BLE Mesh),
13+
Zigbee 3.0, Homekit, 6LoWPAN, Thread and 2.4 Ghz proprietary.
14+
15+
.. figure:: img/tlsr9518adk80d.jpg
16+
:width: 400px
17+
:align: center
18+
:alt: TLSR9518ADK80D
19+
20+
More information about the board can be found at the `Telink B91 Generic Starter Kit Hardware Guide`_ website.
21+
22+
Hardware
23+
********
24+
25+
The TLSR9518A SoC integrates a powerful 32-bit RISC-V MCU, DSP, AI Engine, 2.4 GHz ISM Radio, 256
26+
KB SRAM (128 KB of Data Local Memory and 128 KB of Instruction Local Memory), external Flash memory,
27+
stereo audio codec, 14 bit AUX ADC, analog and digital Microphone input, PWM, flexible IO interfaces,
28+
and other peripheral blocks required for advanced IoT, hearable, and wearable devices.
29+
30+
.. figure:: img/tlsr9518_block_diagram.jpg
31+
:width: 400px
32+
:align: center
33+
:alt: TLSR9518ADK80D_SOC
34+
35+
The TLSR9518ADK80D default board configuration provides the following hardware components:
36+
37+
- RF conducted antenna
38+
- 1 MB External Flash memory with reset button
39+
- Chip reset button
40+
- Mini USB interface
41+
- 4-wire JTAG
42+
- 4 LEDs, Key matrix up to 4 keys
43+
- 2 line-in function (Dual Analog microphone supported when switching jumper from microphone path)
44+
- Dual Digital microphone
45+
- Stereo line-out
46+
47+
Supported Features
48+
==================
49+
50+
The Zephyr TLSR9518ADK80D board configuration supports the following hardware features:
51+
52+
+----------------+------------+------------------------------+
53+
| Interface | Controller | Driver/Component |
54+
+================+============+==============================+
55+
| PLIC | on-chip | interrupt_controller |
56+
+----------------+------------+------------------------------+
57+
| RISC-V Machine | on-chip | timer |
58+
| Timer (32 KHz) | | |
59+
+----------------+------------+------------------------------+
60+
| PINMUX | on-chip | pinmux |
61+
+----------------+------------+------------------------------+
62+
| GPIO | on-chip | gpio |
63+
+----------------+------------+------------------------------+
64+
| UART | on-chip | serial |
65+
+----------------+------------+------------------------------+
66+
67+
The following example projects are supported:
68+
69+
- samples/hello_world
70+
- samples/synchronization
71+
- samples/philosophers
72+
- samples/basic/threads
73+
- samples/basic/blinky
74+
- samples/basic/button
75+
- samples/subsys/console/echo
76+
- samples/subsys/console/getchar
77+
- samples/subsys/console/getline
78+
- samples/subsys/shell/shell_module
79+
- samples/subsys/cpp/cpp_synchronization
80+
81+
.. note::
82+
To support "button" example project PC3-KEY3 (J20-19, J20-20) jumper needs to be removed and KEY3 (J20-19) should be connected to VDD3_DCDC (J51-13) externally.
83+
84+
For the rest example projects use the default jumpers configuration.
85+
86+
Other hardware features and example projects are not supported yet.
87+
88+
Limitations
89+
-----------
90+
91+
- Maximum 3 GPIO pins could be configured to generate interrupts simultaneously. All pins must be related to different ports and use different IRQ numbers.
92+
- DMA mode is not supported by Serial Port.
93+
- UART hardware flow control is not implemented.
94+
95+
Default configuration and IOs
96+
=============================
97+
98+
System Clock
99+
------------
100+
101+
The TLSR9518ADK80D board is configured to use the 24 MHz external crystal oscillator
102+
with the on-chip PLL/DIV generating the 48 MHz system clock.
103+
The following values also could be assigned to the system clock in the board DTS file
104+
(``boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts``):
105+
106+
- 16000000
107+
- 24000000
108+
- 32000000
109+
- 48000000
110+
- 64000000
111+
- 96000000
112+
113+
.. code-block::
114+
115+
&cpu0 {
116+
clock-frequency = <48000000>;
117+
};
118+
119+
PINs Configuration
120+
------------------
121+
122+
The TLSR9518A SoC has five GPIO controllers (PORT_A to PORT_E), but only two are
123+
currently enabled (PORT_B for LEDs control and PORT_C for buttons) in the board DTS file:
124+
125+
- LED0 (blue): PB4, LED1 (green): PB5, LED2 (white): PB6, LED3 (red): PB7
126+
- Key Matrix SW0: PC2_PC3, SW1: PC2_PC1, SW2: PC0_PC3, SW3: PC0_PC1
127+
128+
Peripheral's pins on the SoC are mapped to the following GPIO pins in the
129+
``boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts`` file:
130+
131+
- UART0 RX: PB2, TX: PB3
132+
- UART1 RX: PC6, TX: PC7
133+
134+
Serial Port
135+
-----------
136+
137+
The TLSR9518A SoC has 2 UARTs. The Zephyr console output is assigned
138+
to UART0 in the ``boards/riscv/tlsr9518adk80d/tlsr9518adk80d_defconfig`` file.
139+
The default settings are 115200 8N1.
140+
141+
Programming and debugging
142+
*************************
143+
144+
Building
145+
========
146+
147+
You can build applications in the usual way. Here is an example for
148+
the "hello_world" application.
149+
150+
.. code-block:: console
151+
152+
# From the root of the zephyr repository
153+
west build -b tlsr9518adk80d samples/hello_world
154+
155+
To use `Telink RISC-V Linux Toolchain`_, ``ZEPHYR_TOOLCHAIN_VARIANT`` and ``CROSS_COMPILE`` variables need to be set.
156+
157+
.. code-block:: console
158+
159+
# Set Zephyr toolchain variant to cross-compile
160+
export ZEPHYR_TOOLCHAIN_VARIANT=cross-compile
161+
# Specify the Telink RISC-V Toolchain location
162+
export CROSS_COMPILE=~/toolchains/nds32le-elf-mculib-v5f/bin/riscv32-elf-
163+
# From the root of the zephyr repository
164+
west build -b tlsr9518adk80d samples/hello_world
165+
166+
`Telink RISC-V Linux Toolchain`_ is available on the `Burning and Debugging Tools for TLSR9 Series in Linux`_ page.
167+
168+
Open a serial terminal with the following settings:
169+
170+
- Speed: 115200
171+
- Data: 8 bits
172+
- Parity: None
173+
- Stop bits: 1
174+
175+
Flash the board, reset and observe the following messages on the selected
176+
serial port:
177+
178+
.. code-block:: console
179+
180+
*** Booting Zephyr OS version 2.5.0 ***
181+
Hello World! tlsr9518adk80d
182+
183+
184+
Flashing
185+
========
186+
187+
In order to flash the TLSR9518ADK80D board check the following resources:
188+
189+
- `Burning and Debugging Tools for all Series`_
190+
- `Burning and Debugging Tools for TLSR9 Series`_
191+
- `Burning and Debugging Tools for TLSR9 Series in Linux`_
192+
193+
Debugging
194+
=========
195+
196+
Supporting UART debug and OpenOCD+GDB.
197+
198+
References
199+
**********
200+
201+
.. target-notes::
202+
203+
.. _Telink TLSR9 series chipset: http://wiki.telink-semi.cn/wiki/chip-series/TLSR9-Series/
204+
.. _Telink B91 Generic Starter Kit Hardware Guide: http://wiki.telink-semi.cn/wiki/Hardware/B91_Generic_Starter_Kit_Hardware_Guide/
205+
.. _Telink RISC-V Linux Toolchain: http://wiki.telink-semi.cn/tools_and_sdk/Tools/IDE/telink_riscv_linux_toolchain.zip
206+
.. _Burning and Debugging Tools for all Series: http://wiki.telink-semi.cn/wiki/IDE-and-Tools/Burning-and-Debugging-Tools-for-all-Series/
207+
.. _Burning and Debugging Tools for TLSR9 Series: http://wiki.telink-semi.cn/wiki/IDE-and-Tools/Burning-and-Debugging-Tools-for-TLSR9-Series/
208+
.. _Burning and Debugging Tools for TLSR9 Series in Linux: http://wiki.telink-semi.cn/wiki/IDE-and-Tools/BDT_for_TLSR9_Series_in_Linux/
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/*
2+
* Copyright (c) 2021 Telink Semiconductor
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <telink_b91.dtsi>
10+
11+
/ {
12+
model = "telink,b91";
13+
compatible = "telink,tlsr9518adk80d";
14+
15+
aliases {
16+
led0 = &led_blue;
17+
led1 = &led_green;
18+
sw0 = &key_1;
19+
};
20+
21+
leds {
22+
compatible = "gpio-leds";
23+
24+
led_blue: led_0 {
25+
gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>;
26+
label = "LED Blue";
27+
};
28+
29+
led_green: led_1 {
30+
gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>;
31+
label = "LED Green";
32+
};
33+
34+
led_white: led_2 {
35+
gpios = <&gpiob 6 GPIO_ACTIVE_HIGH>;
36+
label = "LED White";
37+
};
38+
39+
led_red: led_3 {
40+
gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>;
41+
label = "LED Red";
42+
};
43+
};
44+
45+
keys {
46+
compatible = "gpio-keys";
47+
key_1: button_1 {
48+
label = "User KEY1";
49+
gpios = <&gpioc 2 GPIO_PULL_DOWN>;
50+
};
51+
};
52+
53+
chosen {
54+
zephyr,console = &uart0;
55+
zephyr,shell-uart = &uart0;
56+
zephyr,sram = &ram_dlm;
57+
zephyr,flash = &flash;
58+
zephyr,flash-controller = &flash_mspi;
59+
};
60+
};
61+
62+
&cpu0 {
63+
clock-frequency = <48000000>;
64+
};
65+
66+
&ram_ilm {
67+
reg = <0x00000000 0x00020000>;
68+
};
69+
70+
&ram_dlm {
71+
reg = <0x00080000 0x00020000>;
72+
};
73+
74+
&flash {
75+
reg = <0x20000000 0x100000>;
76+
};
77+
78+
&gpiob {
79+
status = "okay";
80+
};
81+
82+
&gpioc {
83+
interrupts = <25 1>;
84+
status = "okay";
85+
};
86+
87+
&pinmux {
88+
status = "okay";
89+
pad-mul-sel = <1>;
90+
};
91+
92+
&uart0 {
93+
status = "okay";
94+
current-speed = <115200>;
95+
pinctrl-0 = <&uart0_tx_pb2 &uart0_rx_pb3>;
96+
};
97+
98+
&flash_mspi {
99+
partitions {
100+
compatible = "fixed-partitions";
101+
#address-cells = <1>;
102+
#size-cells = <1>;
103+
104+
boot_partition: partition@0 {
105+
label = "mcuboot";
106+
reg = <0x00000000 0x8000>;
107+
};
108+
slot0_partition: partition@8000 {
109+
label = "image-0";
110+
reg = <0x00008000 0x1a000>;
111+
};
112+
slot1_partition: partition@22000 {
113+
label = "image-1";
114+
reg = <0x00022000 0x1a000>;
115+
};
116+
scratch_partition: partition@3c000 {
117+
label = "image-scratch";
118+
reg = <0x0003c000 0x2000>;
119+
};
120+
storage_partition: partition@f0000 {
121+
label = "storage";
122+
reg = <0x000f0000 0x00010000>;
123+
};
124+
};
125+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
identifier: tlsr9518adk80d
2+
name: Telink TLSR9518ADK80D
3+
type: mcu
4+
arch: riscv32
5+
toolchain:
6+
- cross-compile
7+
- zephyr
8+
ram: 128
9+
flash: 1024
10+
supported:
11+
- gpio
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2021 Telink Semiconductor
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SOC_SERIES_RISCV_TELINK_B91=y
5+
CONFIG_SOC_RISCV_TELINK_B91=y
6+
CONFIG_BOARD_TLSR9518ADK80D=y
7+
CONFIG_PLIC=y
8+
CONFIG_RISCV_MACHINE_TIMER=y
9+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
10+
CONFIG_PINMUX=y
11+
CONFIG_UART_INTERRUPT_DRIVEN=y
12+
CONFIG_SERIAL=y
13+
CONFIG_CONSOLE=y
14+
CONFIG_UART_CONSOLE=y
15+
16+
# HW DSP options
17+
CONFIG_TELINK_B91_HWDSP=n

0 commit comments

Comments
 (0)