mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-08 03:03:07 +08:00
Some checks failed
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
适配Phytium开发板
259 lines
9.3 KiB
Python
259 lines
9.3 KiB
Python
import os
|
|
from building import *
|
|
|
|
objs = []
|
|
cwd = GetCurrentDir()
|
|
|
|
PORT_DRV_DIR = cwd + '/drivers'
|
|
DRIVERS_EXAMPLE_DIR = cwd + '/drivers_example'
|
|
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_PE2204']):
|
|
src += Glob(cwd+'/port/soc_port/pe220x/*.c') + Glob(cwd+'/port/soc_port/pe220x/pe2204/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/pe220x'] + [PHYTIUM_SDK_DIR + '/soc/pe220x/pe2204']
|
|
|
|
if GetDepend(['TARGET_PE2202']):
|
|
src += Glob(cwd+'/port/soc_port/pe220x/*.c') + Glob(cwd+'/port/soc_port/pe220x/pe2202/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/pe220x'] + [PHYTIUM_SDK_DIR + '/soc/pe220x/pe2202']
|
|
|
|
if GetDepend(['TARGET_PD2408']):
|
|
src += Glob(cwd+'/port/soc_port/pd2408/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/soc/pd2408']
|
|
|
|
# board port
|
|
if GetDepend(['E2000D_DEMO_BOARD']):
|
|
path += cwd + '/fboard_port/e2000d_demo'
|
|
|
|
if GetDepend(['E2000Q_DEMO_BOARD']):
|
|
path += cwd + '/fboard_port/e2000q_demo'
|
|
|
|
if GetDepend(['PHYTIUMPI_FIREFLY_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(['PHYTIUMPI_FIREFLY_BOARD']):
|
|
src += Glob(cwd + '/port/fboard_port/firefly/mnt_sdcard.c')
|
|
|
|
if GetDepend(['PD2408_TEST_A_BOARD']):
|
|
src += Glob(cwd + '/port/fboard_port/pd2408_test_a/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']
|
|
|
|
## spim msg
|
|
if GetDepend(['BSP_USING_SPI_MSG']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/spi/fspim_v2_0/*.c') + Glob(PORT_DRV_DIR+'/drv_spi_msg.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/spi/fspim_v2_0'] + [PHYTIUM_SDK_DIR + '/drivers/msg']
|
|
|
|
## 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']
|
|
|
|
## serial_v2
|
|
if GetDepend(['BSP_USING_UART_MSG']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/serial/fpl011/*.c')
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/serial/fserial_v2_0/*.c') + Glob(PORT_DRV_DIR+'/drv_usart_msg.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/serial/fpl011']
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/serial/fserial_v2_0'] + [PHYTIUM_SDK_DIR + '/drivers/msg/']
|
|
|
|
## 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/']
|
|
|
|
|
|
## eth_v2
|
|
if GetDepend(['BSP_USING_ETH_MSG']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/eth/fxmac_v2_0/*.c') + Glob(PORT_DRV_DIR+'/drv_xmac_msg.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/eth/fxmac_v2_0/'] + [PHYTIUM_SDK_DIR + '/drivers/msg']
|
|
|
|
|
|
## 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/']
|
|
|
|
## sdif_msg
|
|
if GetDepend(['BSP_USING_SDIF_MSG']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/mmc/fsdif_v2_0/*.c') + Glob(PORT_DRV_DIR+'/drv_sdif_msg.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/mmc/fsdif_v2_0/'] + [PHYTIUM_SDK_DIR + '/drivers/msg/']
|
|
|
|
## 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_PE220X']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/soc/pe220x/fgpio_table.c')
|
|
if GetDepend(['TARGET_PD2408']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/soc/pd2408/fgpio_table.c')
|
|
|
|
## i2s
|
|
if GetDepend(['BSP_USING_I2S']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/i2s/fi2s/*.c') \
|
|
+ Glob(PHYTIUM_SDK_DIR+'/drivers/dma/fddma/*.c') \
|
|
+ Glob(PORT_DRV_DIR+'/drv_i2s.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/i2s/fi2s/'] \
|
|
+ [PHYTIUM_SDK_DIR + '/drivers/dma/fddma/']
|
|
|
|
## 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/']
|
|
|
|
## i2c msg
|
|
if GetDepend(['BSP_USING_I2C_MSG']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/i2c/fi2c_v2_0/*.c') + Glob(PORT_DRV_DIR+'/drv_i2c_msg.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/i2c/fi2c_v2_0/'] + [PHYTIUM_SDK_DIR + '/drivers/msg/']
|
|
|
|
# fdriver dc
|
|
if GetDepend(['BSP_USING_DC']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/media/fdcdp/*.c') + Glob(PORT_DRV_DIR+'/drv_dc.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/media/fdcdp/']
|
|
|
|
## 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/']
|
|
|
|
## device
|
|
if GetDepend(['BSP_USING_DEVICE']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/device/fdevice/fdevice.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/device/fdevice/']
|
|
if GetDepend(['BSP_USING_ES8336']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/device/fes8336/fes8336.c') + Glob(PHYTIUM_SDK_DIR+'/drivers/i2c/fi2c/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/device/fes8336/'] + [PHYTIUM_SDK_DIR + '/drivers/i2c/fi2c/']
|
|
if GetDepend(['BSP_USING_ES8388']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/drivers/device/fes8388/fes8388.c') + Glob(PHYTIUM_SDK_DIR+'/drivers/i2c/fi2c/*.c')
|
|
path += [PHYTIUM_SDK_DIR + '/drivers/device/fes8388/'] + [PHYTIUM_SDK_DIR + '/drivers/i2c/fi2c/']
|
|
|
|
## drivers_example
|
|
if GetDepend(['BSP_USING_DRIVERS_EXAMPLE']):
|
|
src += Glob(DRIVERS_EXAMPLE_DIR+'/*.c')
|
|
path += [DRIVERS_EXAMPLE_DIR]
|
|
|
|
## 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_LAYER']):
|
|
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_LAYER']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/e2000q_demo/fsdif_timing.c')
|
|
|
|
if GetDepend(['PD2408_TEST_A_BOARD']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/pd2408_test_a/fio_mux.c')
|
|
path += [PHYTIUM_SDK_DIR + '/board/pd2408_test_a/']
|
|
|
|
if GetDepend(['BSP_USING_SDIF_LAYER']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/pd2408_test_a/fsdif_timing.c')
|
|
|
|
if GetDepend(['PD2408_TEST_B_BOARD']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/pd2408_test_b/fio_mux.c')
|
|
path += [PHYTIUM_SDK_DIR + '/board/pd2408_test_b/']
|
|
|
|
if GetDepend(['BSP_USING_SDIF_LAYER']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/pd2408_test_b/fsdif_timing.c')
|
|
|
|
if GetDepend(['PHYTIUMPI_FIREFLY_BOARD']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/phytiumpi_firefly/fio_mux.c')
|
|
path += [PHYTIUM_SDK_DIR + '/board/phytiumpi_firefly/']
|
|
|
|
if GetDepend(['BSP_USING_SDIF_LAYER']):
|
|
src += Glob(PHYTIUM_SDK_DIR+'/board/phytiumpi_firefly/fsdif_timing.c')
|
|
|
|
|
|
LIBS = []
|
|
LIBPATH = []
|
|
|
|
## 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
|
|
src += Glob(cwd + '/port/cherryusb_port/*.c')
|
|
|
|
# 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')
|