From 3eb8e3b5aa55367f752cf4f077f4caba6fff8d73 Mon Sep 17 00:00:00 2001 From: Haiwen Xia Date: Thu, 16 Jan 2025 16:17:56 +0800 Subject: [PATCH 1/5] riscv: telink: add compile support for tl7218x . - fix retention ram. Signed-off-by: Haiwen Xia --- .github/workflows/chef.yaml | 6 +++--- .github/workflows/examples-telink.yaml | 14 ++++++++++++-- config/telink/chip-module/Kconfig.defaults | 12 ++++++++++++ scripts/build/build/targets.py | 1 + scripts/build/builders/telink.py | 3 +++ scripts/build/testdata/all_targets_linux_x64.txt | 2 +- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index be8a6421f6776b..2778bef7bbadff 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -109,9 +109,9 @@ jobs: uses: ./.github/actions/checkout-submodules-and-bootstrap with: platform: telink - # - name: Update Zephyr to specific revision (for developers purpose) - # shell: bash - # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py c05c461b1119782cc839cf436fa04ec5e1fb2c8c" + - name: Update Zephyr to specific revision (for developers purpose) + shell: bash + run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py c932a121fa785e02a57c80b80a494ad75f728a29" - name: CI Examples Telink shell: bash run: | diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index a493982513ca0a..f9a22ae0221df8 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -57,8 +57,8 @@ jobs: with: gh-context: ${{ toJson(github) }} - # - name: Update Zephyr to specific revision (for developers purpose) - # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py c05c461b1119782cc839cf436fa04ec5e1fb2c8c" + - name: Update Zephyr to specific revision (for developers purpose) + run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py b6355f59ed78a1a735e9c4c97434ec95f4a27c0a" - name: Build example Telink (B92 retention) Air Quality Sensor App # Run test for master and s07641069 PRs @@ -190,6 +190,16 @@ jobs: out/telink-tl7218x-light-ota-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ + - name: Build example Telink (tl721x) Light Switch App with OTA (LZMA), Factory Data + # Run test for master and all PRs + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tl7218x_retention-light-switch-ota-compress-lzma-factory-data' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tl7218x_retention light-switch-app-ota-compress-lzma-factory-data \ + out/telink-tl7218x_retention-light-switch-ota-compress-lzma-factory-data/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: clean out build output (keep tools) run: rm -rf ./out/telink* diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index e50aa413b90fa6..fcff0c05a71cab 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -218,6 +218,18 @@ config PWM endif +if BOARD_TL7218X_RETENTION || BOARD_TL3218X_RETENTION +config SOC_SERIES_RISCV_TELINK_TLX_NON_RETENTION_RAM_CODE + default n if PM + +config TELINK_TLX_MATTER_RETENTION_LAYOUT + default y if PM + +config PWM + default n + +endif + # Board non-retention config if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1 || \ BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D || BOARD_TL3218X || BOARD_TL7218X diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 807a89b379a926..b27a9d0192914c 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -779,6 +779,7 @@ def BuildTelinkTarget(): TargetPart('tlsr9258a_retention', board=TelinkBoard.TLSR9258A_RETENTION), TargetPart('tl3218x', board=TelinkBoard.TL3218X), TargetPart('tl7218x', board=TelinkBoard.TL7218X), + TargetPart('tl7218x_retention', board=TelinkBoard.TL7218X_RETENTION), ]) target.AppendFixedTargets([ diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index d53a860ebcf944..da2337d5c8f89b 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -123,6 +123,7 @@ class TelinkBoard(Enum): TLSR9258A_RETENTION = auto() TL3218X = auto() TL7218X = auto() + TL7218X_RETENTION = auto() def GnArgName(self): if self == TelinkBoard.TLRS9118BDK40D: @@ -141,6 +142,8 @@ def GnArgName(self): return 'tl3218x' elif self == TelinkBoard.TL7218X: return 'tl7218x' + elif self == TelinkBoard.TL7218X_RETENTION: + return 'tl7218x_retention' else: raise Exception('Unknown board type: %r' % self) diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 38ae7cccdf3560..01d51f98a79e46 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -22,5 +22,5 @@ nuttx-x64-light qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage] stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-coverage][-with-ui] -telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention,tl3218x,tl7218x}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-compress-lzma][-thread-analyzer] +telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention,tl3218x,tl7218x,tl7218x_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-compress-lzma][-thread-analyzer] openiotsdk-{shell,lock}[-mbedtls][-psa] From 1aea1004cc84c9840bbef89848b0c18fb4de8471 Mon Sep 17 00:00:00 2001 From: Haiwen Xia Date: Mon, 20 Jan 2025 16:38:24 +0800 Subject: [PATCH 2/5] riscv: telink: seperate ram for tl3218x . - use retention mode to seperate ram. - reserve more ram for ilm. Signed-off-by: Haiwen Xia --- .github/workflows/chef.yaml | 2 +- .github/workflows/examples-telink.yaml | 2 +- config/telink/chip-module/Kconfig.defaults | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 2778bef7bbadff..38b40b502bebfc 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -111,7 +111,7 @@ jobs: platform: telink - name: Update Zephyr to specific revision (for developers purpose) shell: bash - run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py c932a121fa785e02a57c80b80a494ad75f728a29" + run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py 3186756b6338a3b1cad5b86037f3c5331ba8b4a8" - name: CI Examples Telink shell: bash run: | diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f9a22ae0221df8..1d166d2781d0a5 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -58,7 +58,7 @@ jobs: gh-context: ${{ toJson(github) }} - name: Update Zephyr to specific revision (for developers purpose) - run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py b6355f59ed78a1a735e9c4c97434ec95f4a27c0a" + run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py 3186756b6338a3b1cad5b86037f3c5331ba8b4a8" - name: Build example Telink (B92 retention) Air Quality Sensor App # Run test for master and s07641069 PRs diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index fcff0c05a71cab..7e5d2ed12b12b1 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -218,15 +218,15 @@ config PWM endif -if BOARD_TL7218X_RETENTION || BOARD_TL3218X_RETENTION +if BOARD_TL7218X_RETENTION || BOARD_TL3218X_RETENTION || BOARD_TL3218X config SOC_SERIES_RISCV_TELINK_TLX_NON_RETENTION_RAM_CODE default n if PM config TELINK_TLX_MATTER_RETENTION_LAYOUT - default y if PM + default y if PM || BOARD_TL3218X config PWM - default n + default n if PM endif From e386787bd6b3d00abba10b0c2449bdf055117c21 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Fri, 24 Jan 2025 11:51:13 +0000 Subject: [PATCH 3/5] [Telink] Fix broken GitHub CI after adding tl721x target --- .github/workflows/examples-telink.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 1d166d2781d0a5..02ad7e60cd9001 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -190,7 +190,7 @@ jobs: out/telink-tl7218x-light-ota-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - - name: Build example Telink (tl721x) Light Switch App with OTA (LZMA), Factory Data + - name: Build example Telink (tl721x retention) Light Switch App with OTA (LZMA), Factory Data # Run test for master and all PRs run: | ./scripts/run_in_build_env.sh \ From 22ffc4a1fa11b33370a6e41fbf3b1b260c3f1976 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Fri, 24 Jan 2025 14:14:18 +0000 Subject: [PATCH 4/5] [Telink] remove temporary LZMA for tl321x due to bug --- .github/workflows/examples-telink.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 02ad7e60cd9001..0e839a4d4963c9 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -167,14 +167,14 @@ jobs: - name: clean out build output (keep tools) run: rm -rf ./out/telink* - - name: Build example Telink (tl321x) Lighting App with OTA (LZMA), Shell, Factory Data + - name: Build example Telink (tl321x) Lighting App with OTA, Shell, Factory Data # Run test for master and all PRs run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tl3218x-light-ota-compress-lzma-shell-factory-data' build" + "./scripts/build/build_examples.py --target 'telink-tl3218x-light-ota-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tl3218x light-app-ota-compress-lzma-shell-factory-data \ - out/telink-tl3218x-light-ota-compress-lzma-shell-factory-data/zephyr/zephyr.elf \ + telink tl3218x light-app-ota-shell-factory-data \ + out/telink-tl3218x-light-ota-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output (keep tools) From 8d494f6899eefab989ab7b66a0c17a180d5e302f Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Mon, 27 Jan 2025 13:44:33 +0000 Subject: [PATCH 5/5] [Telink] Add missed clean out build output step --- .github/workflows/examples-telink.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 0e839a4d4963c9..fa5e4de2e471f2 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -190,6 +190,9 @@ jobs: out/telink-tl7218x-light-ota-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ + - name: clean out build output (keep tools) + run: rm -rf ./out/telink* + - name: Build example Telink (tl721x retention) Light Switch App with OTA (LZMA), Factory Data # Run test for master and all PRs run: |