Skip to content

Commit d6882ec

Browse files
committed
riscv: telink: add some macro support for tl7218x .
- optimize retention power. Signed-off-by: Liang Zhong <liang.zhong@telink-semi.com>
1 parent 3275e55 commit d6882ec

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

config/telink/chip-module/Kconfig.defaults

+14-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ config HEAP_MEM_POOL_SIZE
8484

8585
config COMMON_LIBC_MALLOC_ARENA_SIZE
8686
default 20716 if SOC_RISCV_TELINK_TL321X || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
87-
default 16384 if SOC_RISCV_TELINK_TL721X
87+
default 20716 if SOC_RISCV_TELINK_TL721X
8888
default 12288
8989

9090
config NET_IPV6_MLD
@@ -307,6 +307,19 @@ endchoice
307307
config CHIP_ENABLE_ICD_SUPPORT
308308
default y if CHIP_THREAD_DEVICE_ROLE_SLEEPY_END_DEVICE
309309

310+
config OPENTHREAD_CSMABACKOFF_OPTIMIZATION
311+
bool "Skip the first backoff during sending data request"
312+
depends on CHIP_ENABLE_ICD_SUPPORT
313+
default y if SOC_SERIES_RISCV_TELINK_TLX_RETENTION || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
314+
default n
315+
316+
config IEEE802154_TLX_OPTIMIZATION
317+
bool "optimize the rf performance for tlx"
318+
default y if SOC_SERIES_RISCV_TELINK_TLX_RETENTION
319+
default n
320+
help
321+
optimize the rf performance for tlx.
322+
310323
config OPENTHREAD_THREAD_STACK_SIZE
311324
default 2400 if PM || SOC_RISCV_TELINK_TL321X
312325

src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ extern "C" void otSysProcessDrivers(otInstance * aInstance);
6666
extern "C" void otAppCliInit(otInstance * aInstance);
6767
#endif
6868

69+
#if defined CONFIG_IEEE802154_TLX_OPTIMIZATION && CONFIG_IEEE802154_TLX_OPTIMIZATION
70+
bool isThreadCommissioned = false;
71+
#endif /* CONFIG_IEEE802154_TLX_OPTIMIZATION */
72+
6973
namespace chip {
7074
namespace DeviceLayer {
7175
namespace Internal {
@@ -372,6 +376,14 @@ bool GenericThreadStackManagerImpl_OpenThread<ImplClass>::_IsThreadAttached()
372376
curRole = otThreadGetDeviceRole(mOTInst);
373377
Impl()->UnlockThreadStack();
374378

379+
#if defined CONFIG_IEEE802154_TLX_OPTIMIZATION && CONFIG_IEEE802154_TLX_OPTIMIZATION
380+
if ((curRole != OT_DEVICE_ROLE_DISABLED && curRole != OT_DEVICE_ROLE_DETACHED))
381+
{
382+
if (isThreadCommissioned == false)
383+
isThreadCommissioned = true;
384+
}
385+
#endif /* CONFIG_IEEE802154_TLX_OPTIMIZATION */
386+
375387
return (curRole != OT_DEVICE_ROLE_DISABLED && curRole != OT_DEVICE_ROLE_DETACHED);
376388
}
377389

@@ -2111,4 +2123,4 @@ template class GenericThreadStackManagerImpl_OpenThread<ThreadStackManagerImpl>;
21112123
} // namespace DeviceLayer
21122124
} // namespace chip
21132125

2114-
#endif // GENERIC_THREAD_STACK_MANAGER_IMPL_OPENTHREAD_IPP
2126+
#endif // GENERIC_THREAD_STACK_MANAGER_IMPL_OPENTHREAD_IPP

0 commit comments

Comments
 (0)