155 lines
5.0 KiB
Python
155 lines
5.0 KiB
Python
import os
|
|
from building import *
|
|
|
|
objs = []
|
|
cwd = GetCurrentDir()
|
|
|
|
PORT_DRV_DIR = cwd + '/drivers'
|
|
PHYTIUM_SDK_DIR = cwd + '/phytium_standalone_sdk'
|
|
COMMON_DIR = cwd + '/common'
|
|
|
|
# common source
|
|
src = Glob(PHYTIUM_SDK_DIR+'/common/fassert.c')
|
|
path = [PHYTIUM_SDK_DIR + '/common/']
|
|
|
|
src += Glob(COMMON_DIR+'/*.c')
|
|
path += [COMMON_DIR ]
|
|
|
|
# arch port
|
|
path += [PHYTIUM_SDK_DIR + '/arch/armv8/gcc']
|
|
|
|
if GetDepend(['TARGET_ARMV8_AARCH32']):
|
|
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']
|
|
elif GetDepend(['TARGET_ARMV8_AARCH64']):
|
|
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']
|
|
|
|
# soc & soc_port
|
|
src += Glob(PHYTIUM_SDK_DIR+'/soc/common/fcpu_info.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/common']
|
|
|
|
if GetDepend(['TARGET_F2000_4']):
|
|
src += Glob(cwd+'/port/soc_port/ft2004/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/ft2004']
|
|
|
|
if GetDepend(['TARGET_E2000Q']):
|
|
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']
|
|
|
|
if GetDepend(['TARGET_E2000D']):
|
|
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']
|
|
|
|
if GetDepend(['TARGET_PHYTIUMPI']):
|
|
src += Glob(cwd+'/port/soc_port/phytiumpi/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/phytiumpi']
|
|
|
|
if GetDepend(['TARGET_D2000']):
|
|
src += Glob(cwd+'/port/soc_port/d2000/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/d2000']
|
|
|
|
# driver
|
|
path += [PORT_DRV_DIR]
|
|
|
|
## spim
|
|
if GetDepend(['BSP_USING_SPI']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/spi/fspim/*.c') + Glob(PORT_DRV_DIR+'/drv_spi.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/spi/fspim']
|
|
|
|
## serial
|
|
if GetDepend(['BSP_USING_UART']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/serial/fpl011/*.c') + Glob(PORT_DRV_DIR+'/drv_usart.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/serial/fpl011']
|
|
|
|
## can
|
|
if GetDepend(['BSP_USING_CAN']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/can/fcan/*.c') + Glob(PORT_DRV_DIR+'/drv_can.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/can/fcan/']
|
|
|
|
## qspi
|
|
if GetDepend(['BSP_USING_QSPI']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/qspi/fqspi/*.c') + Glob(PORT_DRV_DIR+'/drv_qspi.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/qspi/fqspi/']
|
|
|
|
## eth
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
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/']
|
|
|
|
## 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/']
|
|
|
|
## gpio
|
|
if GetDepend(['BSP_USING_GPIO']):
|
|
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/']
|
|
|
|
## iopad
|
|
if GetDepend(['BSP_USING_IOPAD']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/iomux/fiopad/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/iomux/fiopad/']
|
|
|
|
## mio
|
|
if GetDepend(['I2C_USE_MIO']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/mio/fmio/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/mio/fmio/']
|
|
|
|
## 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']
|
|
|
|
# phytium ports rt-thread examples
|
|
PORT_DRV_DIR = cwd + '/examples'
|
|
|
|
src += Glob(PORT_DRV_DIR + '/*.c')
|
|
|
|
# sdkcomfig.h
|
|
path += [cwd]
|
|
|
|
# add group
|
|
ASFLAGS = ''
|
|
group = DefineGroup('FT_DRIVER', src, depend=[
|
|
''], CPPPATH=path, ASFLAGS = ASFLAGS)
|
|
|
|
|
|
Return('group')
|