| ############################################################################ |
| # arch/risc-v/src/bl602/Make.defs |
| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. The |
| # ASF licenses this file to you 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. |
| # |
| ############################################################################ |
| |
| include common/Make.defs |
| |
| # Specify our HEAD assembly file. This will be linked as |
| # the first object file, so it will appear at address 0 |
| HEAD_ASRC = bl602_head.S |
| |
| # Specify our C code within this directory to be included |
| CHIP_CSRCS = bl602_allocateheap.c |
| CHIP_CSRCS += bl602_irq.c bl602_irq_dispatch.c |
| CHIP_CSRCS += bl602_serial.c bl602_lowputc.c bl602_tim.c |
| CHIP_CSRCS += bl602_start.c bl602_timerisr.c bl602_efuse.c |
| CHIP_CSRCS += bl602_os_hal.c |
| |
| ifeq ($(CONFIG_I2C),y) |
| CHIP_CSRCS += bl602_i2c.c |
| endif |
| |
| ifeq ($(CONFIG_SPI),y) |
| CHIP_CSRCS += bl602_spi.c |
| endif |
| |
| ifeq ($(CONFIG_TIMER),y) |
| CHIP_CSRCS += bl602_tim_lowerhalf.c |
| endif |
| ifeq ($(CONFIG_ONESHOT),y) |
| CHIP_CSRCS += bl602_oneshot_lowerhalf.c |
| endif |
| ifeq ($(CONFIG_WATCHDOG),y) |
| CHIP_CSRCS += bl602_wdt_lowerhalf.c |
| endif |
| ifeq ($(CONFIG_PWM),y) |
| CHIP_CSRCS += bl602_pwm_lowerhalf.c |
| endif |
| ifeq ($(CONFIG_BL602_SPIFLASH),y) |
| CHIP_CSRCS += bl602_flash.c bl602_spiflash.c |
| endif |
| ifeq ($(CONFIG_RTC_DRIVER),y) |
| CHIP_CSRCS += bl602_rtc.c bl602_rtc_lowerhalf.c |
| endif |
| |
| ifeq ($(CONFIG_BL602_DMA),y) |
| CHIP_CSRCS += bl602_dma.c |
| endif |
| |
| CHIP_CSRCS += bl602_glb.c bl602_gpio.c bl602_hbn.c bl602_systemreset.c |
| |
| ifeq ($(CONFIG_BL602_WIRELESS),y) |
| WIRELESS_DRV_UNPACK = bl_blob |
| WIRELESS_DRV_VERSION = 1.9.1-ble-test |
| WIRELESS_DRV_ZIP = v$(WIRELESS_DRV_VERSION).zip |
| WIRELESS_DRV_URL = https://github.com/bouffalolab/bl_blob/archive/refs/heads |
| |
| $(WIRELESS_DRV_ZIP): |
| $(call DOWNLOAD,$(WIRELESS_DRV_URL),$(WIRELESS_DRV_ZIP),chip/$(WIRELESS_DRV_ZIP)) |
| |
| chip/$(WIRELESS_DRV_UNPACK): $(WIRELESS_DRV_ZIP) |
| $(Q) echo "Unpacking: BL602 Wireless Drivers" |
| $(Q) mkdir -p chip/$(WIRELESS_DRV_UNPACK) |
| $(Q) unzip -oqq chip/$(WIRELESS_DRV_ZIP) -d chip/ |
| $(Q) mv chip/$(WIRELESS_DRV_UNPACK)-$(WIRELESS_DRV_VERSION)/* chip/$(WIRELESS_DRV_UNPACK) |
| $(Q) touch chip/$(WIRELESS_DRV_UNPACK) |
| |
| ifeq ($(wildcard chip/$(WIRELESS_DRV_UNPACK)/.git),) |
| context:: chip/$(WIRELESS_DRV_UNPACK) |
| |
| distclean:: |
| $(call DELFILE, chip/$(WIRELESS_DRV_ZIP)) |
| $(call DELDIR, chip/$(WIRELESS_DRV_UNPACK)) |
| endif |
| |
| INCLUDES += ${INCDIR_PREFIX}$(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)includes$(DELIM)BL602$(DELIM)nuttx |
| CHIP_CSRCS += bl602_netdev.c |
| |
| EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)libs$(DELIM)BL602$(DELIM)nuttx |
| EXTRA_LIBS += -lbl602_wifi -lbl602_wifi_manage -lblecontroller |
| |
| ifeq ($(CONFIG_BL602_WIRELESS_DEBUG),y) |
| LDFLAGS += -defsym _wifi_log_flag=1 |
| endif |
| |
| endif |
| |