• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 ASR Microelectronics (Shanghai) Co., Ltd. All rights reserved.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//kernel/liteos_m/liteos.gni")
15
16lib_path = rebase_path("../drivers/libs/Cortex-M4")
17
18asr582x_release_type = "release"
19
20# debug/release
21
22config("public") {
23  include_dirs = [
24    "../",
25    ".",
26    "../drivers/include/",
27    "../drivers/platform/system/include/",
28    "../drivers/driver/inc/",
29    "../drivers/platform/CMSIS/Include/",
30    "../startup/",
31    "../drivers/common/",
32
33    #at cmd
34    "../drivers/at_cmd/",
35
36    #at cmd end
37    "../drivers/kv/include",
38    "../rtos/",
39    "../drivers/common",
40    "../hal/inc",
41    "../drivers/security/inc",
42
43    #        "security_test",
44    "../drivers/iperf",
45    "../drivers/ble_inc",
46    "../drivers/ota",
47    "//foundation/communication/wifi_lite/interfaces/wifiservice/",
48    "//base/iothardware/peripheral/interfaces/inner_api",
49
50    #        "security/mbedtls/include/",
51    "//third_party/mbedtls/include/mbedtls",
52    "//third_party/mbedtls/include",
53  ]
54  ldflags = [
55    "-nostartfiles",
56    "-Wl,-T" + rebase_path("../gcc.ld"),
57    "-Wl,-R" + rebase_path(
58            "../tools/ble_rom_symbol/asr_ble_rom_symbol_v20200507204845.txt"),
59    "-nostdlib",
60  ]
61  libs = [
62    "nosys",
63    "gcc",
64    "$lib_path/libasr_combo.a",
65  ]
66
67  if (defined(LOSCFG_LIBC_NEWLIB)) {
68    ldflags -= [ "-nostdlib" ]
69    libs -= [ "nosys" ]
70    libs += [
71      "c",
72      "m",
73    ]
74  }
75
76  if (asr582x_release_type == "debug") {
77    libs -= [ "$lib_path/libasr_combo.a" ]
78  }
79  ldflags += [
80    "-Llibs",
81    "-Wl,--whole-archive",
82    "-lbootstrap",
83    "-lbroadcast",
84  ]
85
86  defines = []
87
88  foreach(xts_item, xts_list) {
89    xts_enable = xts_item.enable
90    if (xts_enable == "true") {
91      defines += [ "CFG_HARMONY_SUPPORT" ]
92      ldflags += [ "-lhctest" ]
93      foreach(xts_module, xts_item.xts_modules) {
94        ldflags += [ "-lmodule_${xts_module}" ]
95      }
96    }
97  }
98
99  foreach(test_item, tests_list) {
100    test_enable = test_item.enable
101    if (test_enable == "true") {
102      defines += [ "CFG_HARMONY_TESTS" ]
103      ldflags += [ "-lhilog_static" ]
104      foreach(test_module, test_item.test_modules) {
105        ldflags += [ "-l${test_module}" ]
106      }
107    }
108  }
109
110  ldflags += [ "-Wl,--no-whole-archive" ]
111
112  defines += [
113    "WIFI_BLE_INIT_ENABLE",
114    "HARMONYOS_SUPPORT",
115    "SYSTEM_SUPPORT_OS",
116    "_SPI_FLASH_ENABLE_",
117    "DUET_FLASH_KV_SUPPORT",
118    "STAR_MPU_ENABLE",
119    "AT_USER_DEBUG",
120    "DUET_CM4",
121    "DCDC_PFMMODE_CLOSE",
122
123    #      "LWIP_APP_IPERF",
124    "__FPU_PRESENT=1",
125    "SYSTEM_COREDUMP",
126    "SECURITY_ENGINE_INIT",
127    "CFG_RTC_INDEPENDENT",
128    "DUET_RF_SLEEP",
129    "FAST_DHCP",
130
131    #        "CFG_MRFOTA_TEST",
132    "CFG_RFOTA_BLE",
133    "CFG_TMMT_DETECT",
134    "_SPI_FLASH_240MHz_",
135    "XO_FREQ_BIAS_CONFIG",
136    "CFG_NVDS",
137    "CFG_APP",
138    "CFG_APP_SEC",
139    "CFG_SEG",
140    "CFG_PLF_DUET",
141    "SONATA_RTOS_SUPPORT",
142    "CFG_HOST",
143    "CFG_BLE",
144    "DUET_BLE_NO_BLOCK",
145    "LEGA_A0V2",
146    "CFG_NAN_CONFIG",
147    "CFG_NAN_OPTIMIZE_EN",
148    "LEGAOS_SUPPORT",
149
150    #        "BLE_APP_AT_CMD",
151  ]
152}
153
154kernel_module("asr_config") {
155  sources = [ "partition_conf.c" ]
156  if (asr582x_release_type == "debug") {
157    deps = [ "//device/soc/asrmicro/asr582x/liteos_m/sdk/lib:asr_combo" ]
158  }
159}
160