Skip to content

Commit

Permalink
riscv: telink: add some macro support for tl7218x .
Browse files Browse the repository at this point in the history
- optimize retention power.

Signed-off-by: Liang Zhong <liang.zhong@telink-semi.com>
  • Loading branch information
liang4804 committed Jan 21, 2025
1 parent 3275e55 commit d6882ec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
15 changes: 14 additions & 1 deletion config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ config HEAP_MEM_POOL_SIZE

config COMMON_LIBC_MALLOC_ARENA_SIZE
default 20716 if SOC_RISCV_TELINK_TL321X || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
default 16384 if SOC_RISCV_TELINK_TL721X
default 20716 if SOC_RISCV_TELINK_TL721X
default 12288

config NET_IPV6_MLD
Expand Down Expand Up @@ -307,6 +307,19 @@ endchoice
config CHIP_ENABLE_ICD_SUPPORT
default y if CHIP_THREAD_DEVICE_ROLE_SLEEPY_END_DEVICE

config OPENTHREAD_CSMABACKOFF_OPTIMIZATION
bool "Skip the first backoff during sending data request"
depends on CHIP_ENABLE_ICD_SUPPORT
default y if SOC_SERIES_RISCV_TELINK_TLX_RETENTION || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
default n

config IEEE802154_TLX_OPTIMIZATION
bool "optimize the rf performance for tlx"
default y if SOC_SERIES_RISCV_TELINK_TLX_RETENTION
default n
help
optimize the rf performance for tlx.

config OPENTHREAD_THREAD_STACK_SIZE
default 2400 if PM || SOC_RISCV_TELINK_TL321X

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ extern "C" void otSysProcessDrivers(otInstance * aInstance);
extern "C" void otAppCliInit(otInstance * aInstance);
#endif

#if defined CONFIG_IEEE802154_TLX_OPTIMIZATION && CONFIG_IEEE802154_TLX_OPTIMIZATION
bool isThreadCommissioned = false;
#endif /* CONFIG_IEEE802154_TLX_OPTIMIZATION */

namespace chip {
namespace DeviceLayer {
namespace Internal {
Expand Down Expand Up @@ -372,6 +376,14 @@ bool GenericThreadStackManagerImpl_OpenThread<ImplClass>::_IsThreadAttached()
curRole = otThreadGetDeviceRole(mOTInst);
Impl()->UnlockThreadStack();

#if defined CONFIG_IEEE802154_TLX_OPTIMIZATION && CONFIG_IEEE802154_TLX_OPTIMIZATION
if ((curRole != OT_DEVICE_ROLE_DISABLED && curRole != OT_DEVICE_ROLE_DETACHED))
{
if (isThreadCommissioned == false)
isThreadCommissioned = true;
}
#endif /* CONFIG_IEEE802154_TLX_OPTIMIZATION */

return (curRole != OT_DEVICE_ROLE_DISABLED && curRole != OT_DEVICE_ROLE_DETACHED);
}

Expand Down Expand Up @@ -2111,4 +2123,4 @@ template class GenericThreadStackManagerImpl_OpenThread<ThreadStackManagerImpl>;
} // namespace DeviceLayer
} // namespace chip

#endif // GENERIC_THREAD_STACK_MANAGER_IMPL_OPENTHREAD_IPP
#endif // GENERIC_THREAD_STACK_MANAGER_IMPL_OPENTHREAD_IPP

0 comments on commit d6882ec

Please sign in to comment.