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'] # board port if GetDepend(['E2000D_DEMO_BOARD']): path += cwd + '/fboard_port/e2000d_demo' if GetDepend(['E2000D_DEMO_BOARD']): path += cwd + '/fboard_port/e2000q_demo' if GetDepend(['FIREFLY_DEMO_BOARD']): path += cwd + '/fboard_port/firefly' if GetDepend(['BSP_USING_SDCARD_FATFS']): if GetDepend(['E2000D_DEMO_BOARD']): src += Glob(cwd + '/port/fboard_port/e2000d_demo/mnt_sdcard.c') if GetDepend(['E2000Q_DEMO_BOARD']): src += Glob(cwd + '/port/fboard_port/e2000q_demo/mnt_sdcard.c') if GetDepend(['FIREFLY_DEMO_BOARD']): src += Glob(cwd + '/port/fboard_port/firefly/mnt_sdcard.c') else: src += Glob(cwd + '/port/fboard_port/mnt_ramdisk.c') # 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/'] if GetDepend(['TARGET_E2000D']): src += Glob(PHYTIUM_SDK_DIR+'/soc/e2000/fgpio_table.c') if GetDepend(['TARGET_E2000Q']): src += Glob(PHYTIUM_SDK_DIR+'/soc/e2000/fgpio_table.c') if GetDepend(['TARGET_PHYTIUMPI']): src += Glob(PHYTIUM_SDK_DIR+'/soc/phytiumpi/fgpio_table.c') ## 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') LIBS = [] LIBPATH = [] # fdriver dc if GetDepend(['BSP_USING_DC']): src += Glob(PORT_DRV_DIR+'/drv_dc.c') path += [PHYTIUM_SDK_DIR + '/drivers/media/fdcdp_lib/inc'] if GetDepend(['TARGET_ARMV8_AARCH64']): LIBPATH = [PHYTIUM_SDK_DIR + '/drivers/media/fdcdp_lib/'] LIBS = ['libfdcdp_standalone_a64.a'] elif GetDepend(['TARGET_ARMV8_AARCH32']): LIBPATH = [PHYTIUM_SDK_DIR + '/drivers/media/fdcdp_lib/'] LIBS = ['libfdcdp_standalone_soft_a32.a'] ## fdriver port src += Glob(cwd+'/port/fdriver_port/*.c') path += [cwd + '/port/fdriver_port'] ## fboard port path += [cwd + '/port/fboard_port'] ## 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'] # 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=[ ''],LIBS = LIBS,LIBPATH=LIBPATH, CPPPATH=path, ASFLAGS = ASFLAGS) Return('group')