Skip to content

Commit

Permalink
riscv:b92: clean code and adjust config.
Browse files Browse the repository at this point in the history
- change the kconfig.default value .
- merge the same setting for save ram.

Signed-off-by: Haiwen Xia <[email protected]>
  • Loading branch information
haiwentelink committed Nov 20, 2024
1 parent 72e4e7d commit e1d1659
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
9 changes: 5 additions & 4 deletions config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,11 @@ config NET_PKT_TX_COUNT
default 8

config NET_BUF_RX_COUNT
default 12 if SOC_RISCV_TELINK_TL321X || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
default 16 if PM
default 12 if PM || SOC_RISCV_TELINK_TL321X
default 32

config NET_BUF_TX_COUNT
default 12 if SOC_RISCV_TELINK_TL321X || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
default 16 if PM
default 12 if PM || SOC_RISCV_TELINK_TL321X
default 32

config GPIO
Expand Down Expand Up @@ -206,6 +204,9 @@ endif # SOC_SERIES_RISCV_TELINK_B9X || SOC_SERIES_RISCV_TELINK_TLX
endif # BT

# Board retention config
# Cut down the ram cost by matter's change,it can keep ramcode (driver).
# No need load the ramcode every time in thread mode (retention mode).
# If the ram is not enough , can change it back , initial setting is n.
if BOARD_TLSR9528A_RETENTION || BOARD_TLSR9258A_RETENTION || BOARD_TLSR9518ADK80D_RETENTION
config SOC_SERIES_RISCV_TELINK_B9X_NON_RETENTION_RAM_CODE
default n if PM
Expand Down
2 changes: 1 addition & 1 deletion src/platform/telink/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
#define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET 0
#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET

#ifdef CONFIG_SOC_RISCV_TELINK_TL321X
#if defined(CONFIG_SOC_RISCV_TELINK_TL321X) || defined(CONFIG_SOC_SERIES_RISCV_TELINK_B9X_RETENTION)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE (256)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE (256)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (256)
Expand Down
6 changes: 0 additions & 6 deletions src/platform/telink/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@
#define CHIP_CONFIG_MAX_FABRICS 5
#endif

#ifdef CONFIG_SOC_SERIES_RISCV_TELINK_B9X_RETENTION
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE (256)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE (256)
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (256)
#endif

#ifdef CONFIG_CHIP_LOG_SIZE_OPTIMIZATION
// Disable some of the too detailed log modules to save flash
#define CHIP_CONFIG_LOG_MODULE_ExchangeManager_DETAIL 0
Expand Down
8 changes: 1 addition & 7 deletions src/platform/telink/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct ChipDeviceEvent;
#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1
#endif // CHIP_SYSTEM_CONFIG_USE_POSIX_TIME_FUNCTS

#ifdef CONFIG_SOC_RISCV_TELINK_TL321X
#if defined(CONFIG_SOC_RISCV_TELINK_TL321X) || defined(CONFIG_SOC_SERIES_RISCV_TELINK_B9X_RETENTION)
#define CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_HEAP 1
#define CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_POOL 0
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1
Expand All @@ -62,9 +62,3 @@ struct ChipDeviceEvent;
#endif

// ========== Platform-specific Configuration Overrides =========
#ifdef CONFIG_SOC_SERIES_RISCV_TELINK_B9X_RETENTION
#define CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_HEAP 1
#define CHIP_SYSTEM_PACKETBUFFER_FROM_CHIP_POOL 0
#define CHIP_SYSTEM_CONFIG_POOL_USE_HEAP 1
#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_CAPACITY_MAX 1280
#endif

0 comments on commit e1d1659

Please sign in to comment.