From 45b41c16400f9999580496de029d9faa536c1e8a Mon Sep 17 00:00:00 2001 From: yuanbo Date: Wed, 15 Jun 2022 19:24:19 +0800 Subject: [PATCH] feat: normalize drivers framework component and repos Signed-off-by: yuanbo --- BUILD.gn | 6 +- common/platform/BUILD.gn | 90 +++++++++++------------ common/platform/adc/BUILD.gn | 2 +- common/platform/adc/Makefile | 2 +- common/platform/gpio/BUILD.gn | 11 +-- common/platform/gpio/Makefile | 2 +- common/platform/i2c/BUILD.gn | 49 ++++++------ common/platform/i2c/Makefile | 2 +- common/platform/iwdg/BUILD.gn | 42 +++++------ common/platform/iwdg/Makefile | 2 +- common/platform/pwm/BUILD.gn | 48 ++++++------ common/platform/pwm/Makefile | 2 +- common/platform/rng/BUILD.gn | 8 +- common/platform/rng/Makefile | 2 +- common/platform/smp/BUILD.gn | 5 +- common/platform/spi/BUILD.gn | 48 ++++++------ common/platform/spi/Makefile | 2 +- common/platform/stm32mp1xx_hal/BUILD.gn | 8 +- common/platform/stm32mp1xx_hal/Makefile | 2 +- common/platform/uart/BUILD.gn | 46 ++++++------ common/platform/uart/Makefile | 2 +- stm32f4xx/BUILD.gn | 2 +- stm32f4xx/sdk/BUILD.gn | 38 +++++----- stm32mp1xx/sdk_linux/BUILD.gn | 32 ++++---- stm32mp1xx/sdk_liteos/BUILD.gn | 71 +++++++++--------- stm32mp1xx/sdk_liteos/hdf_config/BUILD.gn | 38 +++++----- stm32mp1xx/sdk_liteos/hdf_config/Makefile | 2 +- 27 files changed, 270 insertions(+), 294 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index a0b8182..a95bde4 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -15,8 +15,6 @@ if (ohos_kernel_type == "liteos_m") { import("//kernel/liteos_m/liteos.gni") module_name = get_path_info(rebase_path("."), "name") module_group(module_name) { - modules = [ - "stm32f4xx" - ] + modules = [ "stm32f4xx" ] } -} \ No newline at end of file +} diff --git a/common/platform/BUILD.gn b/common/platform/BUILD.gn index e9f4dc4..2f03472 100755 --- a/common/platform/BUILD.gn +++ b/common/platform/BUILD.gn @@ -1,46 +1,46 @@ -# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -group("drivers") { - deps = [ - "adc", - "spi", - "gpio", - "i2c", - "iwdg", - "uart", - "pwm", - "rng", - "smp", - "stm32mp1xx_hal", - "wlan:wifi_firmware", - ] -} - -config("public") { - lib_dirs = [ "//device/soc/st/common/platform/libs/ohos/llvm/stm32mp1xx" ] - ldflags = [ "-Wl,--push-state,--whole-archive" ] - - ldflags += [ "-lltdc" ] -if (defined(LOSCFG_DRIVERS_MMC)) { - ldflags += [ "-lmmc" ] - } -if (defined(LOSCFG_DRIVERS_HDF_WIFI)) { - ldflags += [ "-lhdf_vendor_wifi" ] - } -if (defined(LOSCFG_DRIVERS_HDF_WIFI) && defined(LOSCFG_DRIVERS_HI3881)) { - ldflags += [ "-lhi3881" ] - } -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +group("drivers") { + deps = [ + "adc", + "gpio", + "i2c", + "iwdg", + "pwm", + "rng", + "smp", + "spi", + "stm32mp1xx_hal", + "uart", + "wlan:wifi_firmware", + ] +} + +config("public") { + lib_dirs = [ "//device/soc/st/common/platform/libs/ohos/llvm/stm32mp1xx" ] + ldflags = [ "-Wl,--push-state,--whole-archive" ] + + ldflags += [ "-lltdc" ] + if (defined(LOSCFG_DRIVERS_MMC)) { + ldflags += [ "-lmmc" ] + } + if (defined(LOSCFG_DRIVERS_HDF_WIFI)) { + ldflags += [ "-lhdf_vendor_wifi" ] + } + if (defined(LOSCFG_DRIVERS_HDF_WIFI) && defined(LOSCFG_DRIVERS_HI3881)) { + ldflags += [ "-lhi3881" ] + } +} diff --git a/common/platform/adc/BUILD.gn b/common/platform/adc/BUILD.gn index 4f448b6..a73c7ed 100755 --- a/common/platform/adc/BUILD.gn +++ b/common/platform/adc/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/adapter/khdf/liteos/hdf.gni") +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_ADC) module_name = "hdf_adc" diff --git a/common/platform/adc/Makefile b/common/platform/adc/Makefile index 85d9be3..cde4c5e 100755 --- a/common/platform/adc/Makefile +++ b/common/platform/adc/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_adc diff --git a/common/platform/gpio/BUILD.gn b/common/platform/gpio/BUILD.gn index 1df9648..77f0c28 100755 --- a/common/platform/gpio/BUILD.gn +++ b/common/platform/gpio/BUILD.gn @@ -11,16 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/adapter/khdf/liteos/hdf.gni") +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_GPIO) hdf_driver("hdf_gpio") { - sources = [ - "stm32mp1_gpio.c", - ] - include_dirs = [ - "." , + sources = [ "stm32mp1_gpio.c" ] + include_dirs = [ + ".", "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", - ] } diff --git a/common/platform/gpio/Makefile b/common/platform/gpio/Makefile index e1e1bda..9db59d3 100755 --- a/common/platform/gpio/Makefile +++ b/common/platform/gpio/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_gpio diff --git a/common/platform/i2c/BUILD.gn b/common/platform/i2c/BUILD.gn index e1142a5..8532510 100755 --- a/common/platform/i2c/BUILD.gn +++ b/common/platform/i2c/BUILD.gn @@ -1,27 +1,24 @@ -# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_I2C) -module_name = "hdf_i2c" -hdf_driver(module_name) { - sources = [ - "stm32mp1_i2c.c", - ] - include_dirs = [ - "." , - "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", - - ] -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_I2C) +module_name = "hdf_i2c" +hdf_driver(module_name) { + sources = [ "stm32mp1_i2c.c" ] + include_dirs = [ + ".", + "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", + ] +} diff --git a/common/platform/i2c/Makefile b/common/platform/i2c/Makefile index bb8fee1..f8e1087 100755 --- a/common/platform/i2c/Makefile +++ b/common/platform/i2c/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_i2c diff --git a/common/platform/iwdg/BUILD.gn b/common/platform/iwdg/BUILD.gn index e5f7603..d1d65e8 100755 --- a/common/platform/iwdg/BUILD.gn +++ b/common/platform/iwdg/BUILD.gn @@ -1,24 +1,20 @@ -# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG) -module_name = "hdf_iwdg" -hdf_driver(module_name) { - sources = [ - "stm32mp1_iwdg.c" - ] - - -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG) +module_name = "hdf_iwdg" +hdf_driver(module_name) { + sources = [ "stm32mp1_iwdg.c" ] +} diff --git a/common/platform/iwdg/Makefile b/common/platform/iwdg/Makefile index 4861800..02f80c8 100755 --- a/common/platform/iwdg/Makefile +++ b/common/platform/iwdg/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_iwdg diff --git a/common/platform/pwm/BUILD.gn b/common/platform/pwm/BUILD.gn index d09717a..78ab151 100755 --- a/common/platform/pwm/BUILD.gn +++ b/common/platform/pwm/BUILD.gn @@ -1,26 +1,24 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_PWM) -module_name = "hdf_pwm" -hdf_driver(module_name) { - sources = [ - "stm32mp1_pwm.c" - ] - include_dirs = [ - "." , - "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", - ] -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_PWM) +module_name = "hdf_pwm" +hdf_driver(module_name) { + sources = [ "stm32mp1_pwm.c" ] + include_dirs = [ + ".", + "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", + ] +} diff --git a/common/platform/pwm/Makefile b/common/platform/pwm/Makefile index f0ef3c1..48ba890 100755 --- a/common/platform/pwm/Makefile +++ b/common/platform/pwm/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_pwm diff --git a/common/platform/rng/BUILD.gn b/common/platform/rng/BUILD.gn index e7b35dc..c6e06f8 100755 --- a/common/platform/rng/BUILD.gn +++ b/common/platform/rng/BUILD.gn @@ -27,17 +27,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//drivers/adapter/khdf/liteos/hdf.gni") +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") module_name = get_path_info(rebase_path("."), "name") hdf_driver(module_name) { - if (defined(LOSCFG_HW_RANDOM_ENABLE)) { sources = [ "stm32mp1_rng.c" ] - include_dirs = [ - "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", - - ] + include_dirs = [ "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc" ] } } diff --git a/common/platform/rng/Makefile b/common/platform/rng/Makefile index 6ae40c5..a9b804a 100755 --- a/common/platform/rng/Makefile +++ b/common/platform/rng/Makefile @@ -1,4 +1,4 @@ -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := $(notdir $(shell pwd)) ifdef LOSCFG_HW_RANDOM_ENABLE diff --git a/common/platform/smp/BUILD.gn b/common/platform/smp/BUILD.gn index d569a04..107c665 100755 --- a/common/platform/smp/BUILD.gn +++ b/common/platform/smp/BUILD.gn @@ -11,14 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") module_switch = defined(LOSCFG_KERNEL_SMP) hdf_driver("smp") { sources = [ + "smccc-call.S", "stm32mp1_smp.c", - "smccc-call.S" ] } diff --git a/common/platform/spi/BUILD.gn b/common/platform/spi/BUILD.gn index 5714d43..7c66e8d 100755 --- a/common/platform/spi/BUILD.gn +++ b/common/platform/spi/BUILD.gn @@ -1,26 +1,24 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_SPI) -module_name = "hdf_spi" -hdf_driver(module_name) { - sources = [ - "stm32mp1_spi.c", - ] - include_dirs = [ - "." , - "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", - ] -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_SPI) +module_name = "hdf_spi" +hdf_driver(module_name) { + sources = [ "stm32mp1_spi.c" ] + include_dirs = [ + ".", + "../stm32mp1xx_hal/STM32MP1xx_HAL_Driver/Inc", + ] +} diff --git a/common/platform/spi/Makefile b/common/platform/spi/Makefile index f8087ab..bcf1854 100755 --- a/common/platform/spi/Makefile +++ b/common/platform/spi/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_spi diff --git a/common/platform/stm32mp1xx_hal/BUILD.gn b/common/platform/stm32mp1xx_hal/BUILD.gn index dd7a9d2..90a0dd9 100755 --- a/common/platform/stm32mp1xx_hal/BUILD.gn +++ b/common/platform/stm32mp1xx_hal/BUILD.gn @@ -11,26 +11,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/adapter/khdf/liteos/hdf.gni") +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") module_name = "hdf_stm32mp1xx_hal" hdf_driver(module_name) { sources = [ - "STM32MP1xx_HAL_Driver/Src/system_stm32mp1xx.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal.c", + "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_exti.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_gpio.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_i2c.c", - "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_exti.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_ltdc.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_rcc.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_rcc_ex.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_rng.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_tim.c", "STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_tim_ex.c", - + "STM32MP1xx_HAL_Driver/Src/system_stm32mp1xx.c", ] include_dirs = [ ".", "STM32MP1xx_HAL_Driver/Inc", - ] } diff --git a/common/platform/stm32mp1xx_hal/Makefile b/common/platform/stm32mp1xx_hal/Makefile index 23c8b56..40e5429 100755 --- a/common/platform/stm32mp1xx_hal/Makefile +++ b/common/platform/stm32mp1xx_hal/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := stm32mp1x_hal diff --git a/common/platform/uart/BUILD.gn b/common/platform/uart/BUILD.gn index 5875b76..204ae85 100755 --- a/common/platform/uart/BUILD.gn +++ b/common/platform/uart/BUILD.gn @@ -1,24 +1,24 @@ -# Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_UART) -module_name = "hdf_uart" -hdf_driver(module_name) { - sources = [ - "stm32mp1_uart.c", - "stm32mp1_uart_hw.c", - "KRecvBuf.c" - ] -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF_PLATFORM_UART) +module_name = "hdf_uart" +hdf_driver(module_name) { + sources = [ + "KRecvBuf.c", + "stm32mp1_uart.c", + "stm32mp1_uart_hw.c", + ] +} diff --git a/common/platform/uart/Makefile b/common/platform/uart/Makefile index 62755e4..5c58342 100755 --- a/common/platform/uart/Makefile +++ b/common/platform/uart/Makefile @@ -12,7 +12,7 @@ # limitations under the License. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_uart diff --git a/stm32f4xx/BUILD.gn b/stm32f4xx/BUILD.gn index eadc5b3..ef0fd28 100644 --- a/stm32f4xx/BUILD.gn +++ b/stm32f4xx/BUILD.gn @@ -18,4 +18,4 @@ import("//kernel/liteos_m/liteos.gni") module_name = get_path_info(rebase_path("."), "name") module_group(module_name) { modules = [ "sdk" ] -} \ No newline at end of file +} diff --git a/stm32f4xx/sdk/BUILD.gn b/stm32f4xx/sdk/BUILD.gn index 93691ff..7c3d888 100644 --- a/stm32f4xx/sdk/BUILD.gn +++ b/stm32f4xx/sdk/BUILD.gn @@ -17,40 +17,40 @@ module_name = "stm32f4xx_sdk" kernel_module(module_name) { asmflags = board_asmflags - + sources = [ + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c", + # ll driver "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_spi.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c", "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_tim.c", - "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c", + "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c", ] - } diff --git a/stm32mp1xx/sdk_linux/BUILD.gn b/stm32mp1xx/sdk_linux/BUILD.gn index d93adef..ccfd7b8 100755 --- a/stm32mp1xx/sdk_linux/BUILD.gn +++ b/stm32mp1xx/sdk_linux/BUILD.gn @@ -1,18 +1,16 @@ -# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - - -group("sdk_linux") { - deps = [ - ] -} + +group("sdk_linux") { + deps = [] +} diff --git a/stm32mp1xx/sdk_liteos/BUILD.gn b/stm32mp1xx/sdk_liteos/BUILD.gn index e315431..e422104 100755 --- a/stm32mp1xx/sdk_liteos/BUILD.gn +++ b/stm32mp1xx/sdk_liteos/BUILD.gn @@ -1,36 +1,37 @@ -# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# cmd = "if [ -f $product_path/hdf_config/BUILD.gn ]; then echo true; else echo false; fi" +# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# cmd = "if [ -f $product_path/hdf_config/BUILD.gn ]; then echo true; else echo false; fi" # HAVE_PRODUCT_CONFIG = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") - -cmd = "if [ -f $product_path/hdf_config/BUILD.gn ]; then echo true; else echo false; fi" -HAVE_PRODUCT_CONFIG = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") - -group("sdk_liteos") { - deps = [ - "board", - "drivers", - ] - if (HAVE_PRODUCT_CONFIG) { - deps += [ "$product_path/hdf_config" ] - } else { - deps += [ "hdf_config" ] - } -} - -config("public") { - configs = [ - "board:public", - "drivers:public", - ] -} + +cmd = "if [ -f $product_path/hdf_config/BUILD.gn ]; then echo true; else echo false; fi" +HAVE_PRODUCT_CONFIG = + exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") + +group("sdk_liteos") { + deps = [ + "board", + "drivers", + ] + if (HAVE_PRODUCT_CONFIG) { + deps += [ "$product_path/hdf_config" ] + } else { + deps += [ "hdf_config" ] + } +} + +config("public") { + configs = [ + "board:public", + "drivers:public", + ] +} diff --git a/stm32mp1xx/sdk_liteos/hdf_config/BUILD.gn b/stm32mp1xx/sdk_liteos/hdf_config/BUILD.gn index 99b52ad..e114e5a 100755 --- a/stm32mp1xx/sdk_liteos/hdf_config/BUILD.gn +++ b/stm32mp1xx/sdk_liteos/hdf_config/BUILD.gn @@ -1,20 +1,20 @@ -# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and +# Copyright (c) 2021 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and # limitations under the License. - -import("//drivers/adapter/khdf/liteos/hdf.gni") - -module_switch = defined(LOSCFG_DRIVERS_HDF) -module_name = "hdf_config" -hdf_driver(module_name) { - hcs_sources = [ "hdf.hcs" ] -} + +import("//drivers/hdf_core/adapter/khdf/liteos/hdf.gni") + +module_switch = defined(LOSCFG_DRIVERS_HDF) +module_name = "hdf_config" +hdf_driver(module_name) { + hcs_sources = [ "hdf.hcs" ] +} diff --git a/stm32mp1xx/sdk_liteos/hdf_config/Makefile b/stm32mp1xx/sdk_liteos/hdf_config/Makefile index c84411b..c7b3a94 100755 --- a/stm32mp1xx/sdk_liteos/hdf_config/Makefile +++ b/stm32mp1xx/sdk_liteos/hdf_config/Makefile @@ -1,6 +1,6 @@ # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. -include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk MODULE_NAME := hdf_config