2022-11-10 22:22:48 +08:00
|
|
|
import os
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
objs = []
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
2023-11-21 17:42:23 +08:00
|
|
|
PORT_DRV_DIR = cwd + '/drivers'
|
|
|
|
PHYTIUM_SDK_DIR = cwd + '/phytium_standalone_sdk'
|
|
|
|
COMMON_DIR = cwd + '/common'
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
# common source
|
2023-11-21 17:42:23 +08:00
|
|
|
src = Glob(PHYTIUM_SDK_DIR+'/common/fassert.c')
|
|
|
|
path = [PHYTIUM_SDK_DIR + '/common/']
|
|
|
|
|
|
|
|
src += Glob(COMMON_DIR+'/*.c')
|
|
|
|
path += [COMMON_DIR ]
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-11-21 17:42:23 +08:00
|
|
|
# arch port
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/arch/armv8/gcc']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
if GetDepend(['TARGET_ARMV8_AARCH32']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/arch/armv8/aarch32/fsmcc.c') + Glob(PHYTIUM_SDK_DIR+'/arch/armv8/aarch32/gcc/fcpu_asm.S')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/arch/armv8/aarch32']
|
2022-11-10 22:22:48 +08:00
|
|
|
elif GetDepend(['TARGET_ARMV8_AARCH64']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/arch/armv8/aarch64/fsmcc.c') + Glob(PHYTIUM_SDK_DIR+'/arch/armv8/aarch64/gcc/fcpu_asm.S')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/arch/armv8/aarch64']
|
2023-08-02 13:27:09 +08:00
|
|
|
|
2023-11-21 17:42:23 +08:00
|
|
|
# soc & soc_port
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/soc/common/fcpu_info.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/soc/common']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
if GetDepend(['TARGET_F2000_4']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(cwd+'/port/soc_port/ft2004/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/soc/ft2004']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['TARGET_E2000Q']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(cwd+'/port/soc_port/e2000/*.c') + Glob(cwd+'/port/soc_port/e2000/q/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/soc/e2000'] + [PHYTIUM_SDK_DIR + '/soc/e2000/q']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['TARGET_E2000D']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(cwd+'/port/soc_port/e2000/*.c') + Glob(cwd+'/port/soc_port/e2000/d/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/soc/e2000'] + [PHYTIUM_SDK_DIR + '/soc/e2000/d']
|
2023-05-11 10:25:21 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['TARGET_PHYTIUMPI']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(cwd+'/port/soc_port/phytiumpi/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/soc/phytiumpi']
|
2023-08-29 10:27:54 +08:00
|
|
|
|
2022-11-10 22:22:48 +08:00
|
|
|
if GetDepend(['TARGET_D2000']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(cwd+'/port/soc_port/d2000/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/soc/d2000']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
# driver
|
2023-11-21 17:42:23 +08:00
|
|
|
path += [PORT_DRV_DIR]
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
## spim
|
|
|
|
if GetDepend(['BSP_USING_SPI']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/spi/fspim/*.c') + Glob(PORT_DRV_DIR+'/drv_spi.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/spi/fspim']
|
2023-05-11 10:25:21 +08:00
|
|
|
|
2022-11-10 22:22:48 +08:00
|
|
|
## serial
|
2023-05-11 10:25:21 +08:00
|
|
|
if GetDepend(['BSP_USING_UART']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/serial/fpl011/*.c') + Glob(PORT_DRV_DIR+'/drv_usart.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/serial/fpl011']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
## can
|
|
|
|
if GetDepend(['BSP_USING_CAN']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/can/fcan/*.c') + Glob(PORT_DRV_DIR+'/drv_can.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/can/fcan/']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
## qspi
|
|
|
|
if GetDepend(['BSP_USING_QSPI']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/qspi/fqspi/*.c') + Glob(PORT_DRV_DIR+'/drv_qspi.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/qspi/fqspi/']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
## eth
|
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/eth/fxmac/*.c') + Glob(PORT_DRV_DIR+'/drv_xmac.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/eth/fxmac/'] + [PHYTIUM_SDK_DIR + '/drivers/eth/fxmac/phy/']
|
2023-08-02 13:27:09 +08:00
|
|
|
|
2023-11-21 17:42:23 +08:00
|
|
|
## sdif
|
|
|
|
if GetDepend(['BSP_USING_SDIF']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/mmc/fsdif/*.c') + Glob(PORT_DRV_DIR+'/drv_sdif.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/mmc/fsdif/']
|
2023-08-02 13:27:09 +08:00
|
|
|
|
|
|
|
## gpio
|
|
|
|
if GetDepend(['BSP_USING_GPIO']):
|
2023-11-21 17:42:23 +08:00
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/pin/fgpio/*.c') + Glob(PORT_DRV_DIR+'/drv_gpio.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/pin/fgpio/']
|
|
|
|
|
|
|
|
## pwm
|
|
|
|
if GetDepend(['BSP_USING_PWM']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/pwm/fpwm/*.c') + Glob(PORT_DRV_DIR+'/drv_pwm.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/pwm/fpwm/']
|
|
|
|
|
|
|
|
## i2C
|
|
|
|
if GetDepend(['BSP_USING_I2C']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/i2c/fi2c/*.c') + Glob(PORT_DRV_DIR+'/drv_i2c.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/i2c/fi2c/']
|
2023-08-02 13:27:09 +08:00
|
|
|
|
|
|
|
## iopad
|
2023-11-21 17:42:23 +08:00
|
|
|
if GetDepend(['BSP_USING_IOPAD']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/iomux/fiopad/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/iomux/fiopad/']
|
2023-08-02 13:27:09 +08:00
|
|
|
|
2023-11-21 17:42:23 +08:00
|
|
|
## mio
|
|
|
|
if GetDepend(['I2C_USE_MIO']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/mio/fmio/*.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/mio/fmio/']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-11-21 17:42:23 +08:00
|
|
|
## board
|
|
|
|
if GetDepend(['E2000D_DEMO_BOARD']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/e2000d_demo/fio_mux.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/board/e2000d_demo/']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDIF']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/e2000d_demo/fsdif_timing.c')
|
|
|
|
|
|
|
|
if GetDepend(['E2000Q_DEMO_BOARD']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/e2000q_demo/fio_mux.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/board/e2000q_demo/']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDIF']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/e2000q_demo/fsdif_timing.c')
|
|
|
|
|
|
|
|
if GetDepend(['FIREFLY_DEMO_BOARD']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/firefly/fio_mux.c')
|
|
|
|
path += [PHYTIUM_SDK_DIR + '/board/firefly/']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDIF']):
|
|
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/firefly/fsdif_timing.c')
|
|
|
|
|
|
|
|
## fdriver port
|
|
|
|
src += Glob(cwd+'/port/fdriver_port/*.c')
|
|
|
|
path += [cwd + '/port/fdriver_port']
|
|
|
|
|
|
|
|
## fboard port
|
|
|
|
src += Glob(cwd+'/port/fboard_port/*.c')
|
|
|
|
path += [cwd + '/port/fboard_port']
|
2023-05-11 10:25:21 +08:00
|
|
|
|
2023-12-08 17:57:55 +08:00
|
|
|
## lwip port
|
|
|
|
src += Glob(cwd+'/port/lwip_port/*.c')
|
|
|
|
path += [cwd + '/port/lwip_port']
|
|
|
|
|
2023-12-08 20:01:34 +08:00
|
|
|
## lwip port
|
|
|
|
src += Glob(cwd+'/port/lwip_port/*.c')
|
|
|
|
path += [cwd + '/port/lwip_port']
|
|
|
|
|
|
|
|
## cherryusb port
|
|
|
|
if GetDepend(['BSP_USING_XHCI']):
|
|
|
|
src += Glob(cwd +'/port/cherryusb_port/drv_xhci.c')
|
|
|
|
path += [cwd + '/port/cherryusb_port']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_PUSB2']):
|
|
|
|
if GetDepend(['PKG_CHERRYUSB_HOST_PUSB2']):
|
|
|
|
src += Glob(cwd +'/port/cherryusb_port/drv_pusb2_hc.c')
|
|
|
|
if GetDepend(['PKG_CHERRYUSB_DEVICE_PUSB2']):
|
|
|
|
src += Glob(cwd +'/port/cherryusb_port/drv_pusb2_dc.c')
|
|
|
|
path += [cwd + '/port/cherryusb_port']
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
# phytium ports rt-thread examples
|
|
|
|
PORT_DRV_DIR = cwd + '/examples'
|
|
|
|
|
|
|
|
src += Glob(PORT_DRV_DIR + '/*.c')
|
|
|
|
|
|
|
|
# sdkcomfig.h
|
|
|
|
path += [cwd]
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
# add group
|
2022-11-10 22:22:48 +08:00
|
|
|
ASFLAGS = ''
|
|
|
|
group = DefineGroup('FT_DRIVER', src, depend=[
|
|
|
|
''], CPPPATH=path, ASFLAGS = ASFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
Return('group')
|