1# Copyright (c) 2022 HPMicro. 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 16module_name = get_path_info(rebase_path("."), "name") 17module_switch = true 18hpm_sdk_path = "//device/soc/hpmicro/sdk/hpm_sdk" 19kernel_module(module_name) { 20 include_dirs = [ 21 22 ] 23 24 sources = [ 25 "${hpm_sdk_path}/drivers/src/hpm_uart_drv.c", 26 "${hpm_sdk_path}/drivers/src/hpm_gpio_drv.c", 27 "${hpm_sdk_path}/drivers/src/hpm_mchtmr_drv.c", 28 "${hpm_sdk_path}/drivers/src/hpm_pmp_drv.c", 29 "${hpm_sdk_path}/drivers/src/hpm_can_drv.c", 30 "${hpm_sdk_path}/drivers/src/hpm_wdg_drv.c", 31 "${hpm_sdk_path}/drivers/src/hpm_i2c_drv.c", 32 "${hpm_sdk_path}/drivers/src/hpm_spi_drv.c", 33 ] 34 35 if (defined(LOSCFG_SOC_HPM6750)) { 36 sources += [ 37 "${hpm_sdk_path}/soc/HPM6750/toolchains/reset.c", 38 "${hpm_sdk_path}/soc/HPM6750/boot/hpm_bootheader.c", 39 "${hpm_sdk_path}/soc/HPM6750/hpm_sysctl_drv.c", 40 "${hpm_sdk_path}/soc/HPM6750/system.c", 41 "${hpm_sdk_path}/soc/HPM6750/hpm_l1c_drv.c", 42 "${hpm_sdk_path}/soc/HPM6750/hpm_otp_drv.c", 43 "${hpm_sdk_path}/soc/HPM6750/hpm_clock_drv.c", 44 "${hpm_sdk_path}/drivers/src/hpm_pllctl_drv.c", 45 "${hpm_sdk_path}/drivers/src/hpm_enet_drv.c", 46 ] 47 } 48 49 if (defined(LOSCFG_NET_LWIP_SACK)) { 50 sources += [ 51 "${hpm_sdk_path}/components/enet_phy/rtl8201/hpm_rtl8201.c", 52 "${hpm_sdk_path}/components/enet_phy/rtl8211/hpm_rtl8211.c", 53 ] 54 } 55} 56 57config("public") { 58 include_dirs = [ 59 "${hpm_sdk_path}/drivers/inc", 60 "${hpm_sdk_path}/soc/ip", 61 "${hpm_sdk_path}/arch", 62 ] 63 64 if (defined(LOSCFG_SOC_HPM6750)) { 65 include_dirs += [ 66 "${hpm_sdk_path}/soc/HPM6750", 67 "${hpm_sdk_path}/soc/HPM6750/boot", 68 ] 69 } 70 71 if (defined(LOSCFG_NET_LWIP_SACK)) { 72 include_dirs += [ 73 "${hpm_sdk_path}/components/enet_phy/rtl8201", 74 "${hpm_sdk_path}/components/enet_phy/rtl8211", 75 ] 76 } 77} 78