From 6a658007a5145147bd7435346f3617a7cda589b7 Mon Sep 17 00:00:00 2001 From: Gordon McNab Date: Wed, 27 Oct 2021 12:30:51 +0100 Subject: Changes to use ft90x-sdk as submodule or installed SDK from toolchain. --- hw/bsp/brtmm90x/family.mk | 57 +++- hw/mcu/bridgetek/ft9xx/hardware/scripts/crt0.S | 286 --------------------- .../bridgetek/ft9xx/hardware/scripts/ldscript.ld | 94 ------- hw/mcu/bridgetek/ft9xx/scripts/crt0.S | 286 +++++++++++++++++++++ hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld | 95 +++++++ src/portable/bridgetek/ft9xx/dcd_ft9xx.c | 11 +- 6 files changed, 430 insertions(+), 399 deletions(-) delete mode 100644 hw/mcu/bridgetek/ft9xx/hardware/scripts/crt0.S delete mode 100644 hw/mcu/bridgetek/ft9xx/hardware/scripts/ldscript.ld create mode 100644 hw/mcu/bridgetek/ft9xx/scripts/crt0.S create mode 100644 hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld diff --git a/hw/bsp/brtmm90x/family.mk b/hw/bsp/brtmm90x/family.mk index 211f97f1b..d47f4820c 100644 --- a/hw/bsp/brtmm90x/family.mk +++ b/hw/bsp/brtmm90x/family.mk @@ -1,11 +1,28 @@ - +# GCC prefix for FT90X compile tools. CROSS_COMPILE = ft32-elf- -DEPS_SUBMODULES += hw/mcu/bridgetek/ft9xx/hardware SKIP_NANOLIB = 1 -# This is installed at "C:/Program Files(x86)/Bridgetek/FT9xx Toolchain/Toolchain/hardware" -FT9XX_SDK = $(TOP)/hw/mcu/bridgetek/ft9xx/hardware +# Set to use FT90X prebuilt libraries. +FT90X_PREBUILT_LIBS = 1 +ifeq ($(FT90X_PREBUILT_LIBS),1) +# If the FT90X toolchain is installed on Windows systems then the SDK +# include files and prebuilt libraries are at: %FT90X_TOOLCHAIN%/hardware +FT9XX_SDK = $(FT90X_TOOLCHAIN)/hardware +else +# The submodule BRTSG-FOSS/ft90x-sdk contains header files and source +# code for the Bridgetek SDK. This can be used instead of the prebuilt +# library. +DEPS_SUBMODULES += hw/mcu/bridgetek/ft9xx/hardware +# The SDK can be used to load specific files from the Bridgetek SDK. +FT9XX_SDK = hw/mcu/bridgetek/ft9xx/hardware/Source +endif + +# Add include files which are within the TinyUSB directory structure. +INC += \ + $(TOP)/hw/mcu/bridgetek/ft9xx/hardware/Source/include \ + $(TOP)/$(BOARD_PATH) +# Add required C Compiler flags for FT90X. CFLAGS += \ -D__FT900__ \ -fvar-tracking \ @@ -16,20 +33,34 @@ CFLAGS += \ # lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration CFLAGS += -Wno-error=shadow -CFLAGS:=$(filter-out -Wcast-function-type,$(CFLAGS)) -# All source paths should be relative to the top level. -LDINC += $(FT9XX_SDK)/lib/Release -LIBS += -lft900 -LD_FILE = hw/mcu/bridgetek/ft9xx/hardware/scripts/ldscript.ld +# Add include files outside the TinyUSB structure that are added manually. +CFLAGS += -I"$(FT9XX_SDK)/include" + +# Set Linker flags. +LD_FILE = hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld LDFLAGS += $(addprefix -L,$(LDINC)) \ -Xlinker --entry=_start \ -Wl,-lc +# Additional Source files for FT90X. SRC_C += src/portable/bridgetek/ft9xx/dcd_ft9xx.c -#SRC_S += hw/mcu/bridgetek/ft9xx/hardware/scripts/crt0.S +# Linker library. +ifneq ($(FT90X_PREBUILT_LIBS),1) +# Optionally add in files from the Bridgetek SDK instead of the prebuilt +# library. These are the minimum required. +SRC_C += $(FT9XX_SDK)/src/sys.c +SRC_C += $(FT9XX_SDK)/src/interrupt.c +SRC_C += $(FT9XX_SDK)/src/delay.c +SRC_C += $(FT9XX_SDK)/src/timers.c +SRC_C += $(FT9XX_SDK)/src/uart_simple.c +SRC_C += $(FT9XX_SDK)/src/gpio.c +else +# Or if using the prebuilt libraries add them. +LDFLAGS += -L"$(FT9XX_SDK)/lib" +LIBS += -lft900 +endif -INC += \ - $(FT9XX_SDK)/include \ - $(TOP)/$(BOARD_PATH) +# Not required crt0 file for FT90X. Use compiler built-in file. +#SRC_S += hw/mcu/bridgetek/ft9xx/scripts/crt0.S diff --git a/hw/mcu/bridgetek/ft9xx/hardware/scripts/crt0.S b/hw/mcu/bridgetek/ft9xx/hardware/scripts/crt0.S deleted file mode 100644 index 62fa266ee..000000000 --- a/hw/mcu/bridgetek/ft9xx/hardware/scripts/crt0.S +++ /dev/null @@ -1,286 +0,0 @@ -.equ SYS_REGMSC0CFG_B3 , 0x1001b -.equ SYS_REGIRQCTL_B3 , 0x100e3 -.equ MAILBOX_MEMORY , 0x13000 - -.equ IS_IMG_SDBL_PRESENT, 0 -.equ IS_IMG_D2XX_PRESENT, 0 -.equ IS_IMG_DLOG_PRESENT, 0 - -.section .crt0 -.global _start - -_start: -# START Interrupt Vector Table [[ - jmp __PMSIZE-4 # RESET Vector - jmp interrupt_33 # Watchdog reset vector - jmp interrupt_0 - jmp interrupt_1 - jmp interrupt_2 - jmp interrupt_3 - jmp interrupt_4 - jmp interrupt_5 - jmp interrupt_6 - jmp interrupt_7 - jmp interrupt_8 - jmp interrupt_9 - jmp interrupt_10 - jmp interrupt_11 - jmp interrupt_12 - jmp interrupt_13 - jmp interrupt_14 - jmp interrupt_15 - jmp interrupt_16 - jmp interrupt_17 - jmp interrupt_18 - jmp interrupt_19 - jmp interrupt_20 - jmp interrupt_21 - jmp interrupt_22 - jmp interrupt_23 - jmp interrupt_24 - jmp interrupt_25 - jmp interrupt_26 - jmp interrupt_27 - jmp interrupt_28 - jmp interrupt_29 - jmp interrupt_30 - jmp interrupt_31 - jmp __PMSIZE-8 #Interrupt vector 32 (NMI) -# ]] END Interrupt Vector Table - -codestart: - jmp init - -.global _exithook -_exithook: # Debugger uses '_exithook' at 0x90 to catch program exit - return - -init: - # Disable all interrupts - ldk $r0,0x80 -.ifdef __FT930__ - sta.b 0x10123, $r0 -.else - sta.b 0x100e3,$r0 -.endif - - # Reset all peripherals - # lda.l $r0, 0x10018 - # bins.l $r0, $r0, 0x23F # Set bit 31 - # sta.l 0x10018, $r0 - - # Initialize DATA by copying from program memory - ldk.l $r0,__data_load_start - ldk.l $r1,__data_load_end - ldk.l $r2,0 # Will use __data after binutils patch - - jmp .dscopy -.dsloop: - # Copy PM[$r0] to RAM $r2 - lpmi.l $r3,$r0,0 - sti.l $r2,0,$r3 - add.l $r0,$r0,4 - add.l $r2,$r2,4 -.dscopy: - cmp.l $r0,$r1 - jmpc lt,.dsloop - - # Zero BSS - ldk.l $r0,_bss_start - ldk.l $r2,_end - sub.l $r2,$r2,$r0 - ldk.l $r1,0 - ldk $r3,32764 -1: - cmp $r2,$r3 - jmpc lt,2f - memset $r0,$r1,$r3 - add $r0,$r0,$r3 - sub $r2,$r2,$r3 - jmp 1b -2: - memset $r0,$r1,$r2 -.ifdef __FT930__ -/*##############################################################*/ - # copy UserConfig DATA from flash to mailbox memory -/*##############################################################*/ - ldk.l $r0,D2XX_Struct_start /*start of d2xx config in PM memory */ - ldk.l $r1,D2XX_Struct_end /*end of d2xx config in PM memory */ - ldk.l $r2,D2XXTEST_UserD2xxConfig /* RAM cache where the d2xx config from PM to be copied*/ - jmp .configcopy - -.configloop: - # Copy PM[$r0] to RAM[$r2] - lpmi.l $r3,$r0,0 - sti.l $r2,0,$r3 - # Increment - add.l $r0,$r0,4 - add.l $r2,$r2,4 -.configcopy: - cmp.l $r0,$r1 - jmpc lt,.configloop - - ldk.l $r1,D2XX_Struct_start - ldk.l $r2,D2XX_Struct_end - #compute size - sub.l $r2,$r2,$r1 - ldk.l $r1,D2XXTEST_UserD2xxConfig - ldk.l $r0,MAILBOX_MEMORY /* D2xx config from RAM cache to be copied to Mailbox memory */ - # Copy RAM[$r1] to Mailbox $r0, for $r2 bytes - streamouti.b $r0,$r1,$r2 -/*############################################################*/ -.endif - sub.l $sp,$sp,24 # Space for the caller argument frame - call main - -.equ EXITEXIT , 0x1fffc - -.global _exit -_exit: - sta.l EXITEXIT,$r0 # simulator end of test - jmp _exithook - -#_watchdog_isr: -# ldk $sp,__RAMSIZE -# jmp __PMSIZE-4 - -# Macro to construct the interrupt stub code. -# it just saves r0, loads r0 with the int vector -# and branches to interrupt_common. - -.macro inth i=0 -interrupt_\i: - push $r0 # { - lda $r0,(vector_table + 4 * \i) - jmp interrupt_common -.endm - - inth 0 - inth 1 - inth 2 - inth 3 - inth 4 - inth 5 - inth 6 - inth 7 - inth 8 - inth 9 - inth 10 - inth 11 - inth 12 - inth 13 - inth 14 - inth 15 - inth 16 - inth 17 - inth 18 - inth 19 - inth 20 - inth 21 - inth 22 - inth 23 - inth 24 - inth 25 - inth 26 - inth 27 - inth 28 - inth 29 - inth 30 - inth 31 - inth 32 - inth 33 - - # On entry: r0, already saved, holds the handler function -interrupt_common: - push $r1 # { - push $r2 # { - push $r3 # { - push $r4 # { - push $r5 # { - push $r6 # { - push $r7 # { - push $r8 # { - push $r9 # { - push $r10 # { - push $r11 # { - push $r12 # { - push $cc # { - - calli $r0 - - pop $cc # } - pop $r12 # } - pop $r11 # } - pop $r10 # } - pop $r9 # } - pop $r8 # } - pop $r7 # } - pop $r6 # } - pop $r5 # } - pop $r4 # } - pop $r3 # } - pop $r2 # } - pop $r1 # } - pop $r0 # } matching push in interrupt_0-31 above - reti - - # Null function for unassigned interrupt to point at -.global nullvector -nullvector: - return - -.section .data -.global vector_table - .align (4) # assembler alignment is in the power of 2 (in this case 2^4) -vector_table: - .rept 34 - .long nullvector - .endr - - -.section .text -.global __gxx_personality_sj0 -__gxx_personality_sj0: - - - .section ._flash_d2xx_config -.global __pD2XXDefaultConfiguration - .align (10) - -D2XX_partition_start = . - -.if IS_IMG_D2XX_PRESENT -.ifdef __FT930__ -.include "ft930_d2xx_default_config.inc" -.else -.include "ft900_d2xx_default_config.inc" -.endif -.endif - -D2XX_partition_end = . - - .section ._flash_dlog_partition - .align (10) -.global __dlog_partition -__dlog_partition: -dlog_partition_start = . -.if IS_IMG_DLOG_PRESENT - .long 0xF7D1D106 - .rept (0x1000-4) - .byte 0xFF - .endr -.endif -dlog_partition_end = . - - .section ._pm -.global __sdbl_partition_sizeof -.global __D2XX_partition_sizeof -.global __dlog_partition_sizeof - .if IS_IMG_SDBL_PRESENT -__sdbl_partition_sizeof = 0x2000 - .else -__sdbl_partition_sizeof = 0 - .endif - -__D2XX_partition_sizeof = D2XX_partition_end - D2XX_partition_start -__dlog_partition_sizeof = dlog_partition_end - dlog_partition_start diff --git a/hw/mcu/bridgetek/ft9xx/hardware/scripts/ldscript.ld b/hw/mcu/bridgetek/ft9xx/hardware/scripts/ldscript.ld deleted file mode 100644 index d1b4d46cd..000000000 --- a/hw/mcu/bridgetek/ft9xx/hardware/scripts/ldscript.ld +++ /dev/null @@ -1,94 +0,0 @@ -/* Default linker script, for normal executables */ -OUTPUT_FORMAT("elf32-ft32") -OUTPUT_ARCH(ft32) -SEARCH_DIR("/data/win8/ft32/ft32-elf/lib"); -/* Allow the command line to override the memory region sizes. */ -__PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K; -__RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K; -MEMORY -{ - flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE - ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE -} -SECTIONS -{ - .text : - { - *(.text*) - *(.strings) - *(._pm*) - *(.init) - *(.fini) - _etext = . ; - . = ALIGN(4); - } > flash - .tors : - { - ___ctors = . ; - *(.ctors) - ___ctors_end = . ; - ___dtors = . ; - *(.dtors) - ___dtors_end = . ; - . = ALIGN(4); - } > ram - .data : AT (ADDR (.text) + SIZEOF (.text)) - { - *(.data) - *(.data*) - *(.rodata) - *(.rodata*) - _edata = . ; - . = ALIGN(4); - } > ram - .bss SIZEOF(.data) + ADDR(.data) : - { - _bss_start = . ; - *(.bss) - *(.bss*) - *(COMMON) - _end = . ; - . = ALIGN(4); - } > ram - __data_load_start = LOADADDR(.data); - __data_load_end = __data_load_start + SIZEOF(.data); - .stab 0 (NOLOAD) : - { - *(.stab) - } - .stabstr 0 (NOLOAD) : - { - *(.stabstr) - } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } - /* DWARF Extension. */ - .debug_macro 0 : { *(.debug_macro) } - .debug_addr 0 : { *(.debug_addr) } -} diff --git a/hw/mcu/bridgetek/ft9xx/scripts/crt0.S b/hw/mcu/bridgetek/ft9xx/scripts/crt0.S new file mode 100644 index 000000000..62fa266ee --- /dev/null +++ b/hw/mcu/bridgetek/ft9xx/scripts/crt0.S @@ -0,0 +1,286 @@ +.equ SYS_REGMSC0CFG_B3 , 0x1001b +.equ SYS_REGIRQCTL_B3 , 0x100e3 +.equ MAILBOX_MEMORY , 0x13000 + +.equ IS_IMG_SDBL_PRESENT, 0 +.equ IS_IMG_D2XX_PRESENT, 0 +.equ IS_IMG_DLOG_PRESENT, 0 + +.section .crt0 +.global _start + +_start: +# START Interrupt Vector Table [[ + jmp __PMSIZE-4 # RESET Vector + jmp interrupt_33 # Watchdog reset vector + jmp interrupt_0 + jmp interrupt_1 + jmp interrupt_2 + jmp interrupt_3 + jmp interrupt_4 + jmp interrupt_5 + jmp interrupt_6 + jmp interrupt_7 + jmp interrupt_8 + jmp interrupt_9 + jmp interrupt_10 + jmp interrupt_11 + jmp interrupt_12 + jmp interrupt_13 + jmp interrupt_14 + jmp interrupt_15 + jmp interrupt_16 + jmp interrupt_17 + jmp interrupt_18 + jmp interrupt_19 + jmp interrupt_20 + jmp interrupt_21 + jmp interrupt_22 + jmp interrupt_23 + jmp interrupt_24 + jmp interrupt_25 + jmp interrupt_26 + jmp interrupt_27 + jmp interrupt_28 + jmp interrupt_29 + jmp interrupt_30 + jmp interrupt_31 + jmp __PMSIZE-8 #Interrupt vector 32 (NMI) +# ]] END Interrupt Vector Table + +codestart: + jmp init + +.global _exithook +_exithook: # Debugger uses '_exithook' at 0x90 to catch program exit + return + +init: + # Disable all interrupts + ldk $r0,0x80 +.ifdef __FT930__ + sta.b 0x10123, $r0 +.else + sta.b 0x100e3,$r0 +.endif + + # Reset all peripherals + # lda.l $r0, 0x10018 + # bins.l $r0, $r0, 0x23F # Set bit 31 + # sta.l 0x10018, $r0 + + # Initialize DATA by copying from program memory + ldk.l $r0,__data_load_start + ldk.l $r1,__data_load_end + ldk.l $r2,0 # Will use __data after binutils patch + + jmp .dscopy +.dsloop: + # Copy PM[$r0] to RAM $r2 + lpmi.l $r3,$r0,0 + sti.l $r2,0,$r3 + add.l $r0,$r0,4 + add.l $r2,$r2,4 +.dscopy: + cmp.l $r0,$r1 + jmpc lt,.dsloop + + # Zero BSS + ldk.l $r0,_bss_start + ldk.l $r2,_end + sub.l $r2,$r2,$r0 + ldk.l $r1,0 + ldk $r3,32764 +1: + cmp $r2,$r3 + jmpc lt,2f + memset $r0,$r1,$r3 + add $r0,$r0,$r3 + sub $r2,$r2,$r3 + jmp 1b +2: + memset $r0,$r1,$r2 +.ifdef __FT930__ +/*##############################################################*/ + # copy UserConfig DATA from flash to mailbox memory +/*##############################################################*/ + ldk.l $r0,D2XX_Struct_start /*start of d2xx config in PM memory */ + ldk.l $r1,D2XX_Struct_end /*end of d2xx config in PM memory */ + ldk.l $r2,D2XXTEST_UserD2xxConfig /* RAM cache where the d2xx config from PM to be copied*/ + jmp .configcopy + +.configloop: + # Copy PM[$r0] to RAM[$r2] + lpmi.l $r3,$r0,0 + sti.l $r2,0,$r3 + # Increment + add.l $r0,$r0,4 + add.l $r2,$r2,4 +.configcopy: + cmp.l $r0,$r1 + jmpc lt,.configloop + + ldk.l $r1,D2XX_Struct_start + ldk.l $r2,D2XX_Struct_end + #compute size + sub.l $r2,$r2,$r1 + ldk.l $r1,D2XXTEST_UserD2xxConfig + ldk.l $r0,MAILBOX_MEMORY /* D2xx config from RAM cache to be copied to Mailbox memory */ + # Copy RAM[$r1] to Mailbox $r0, for $r2 bytes + streamouti.b $r0,$r1,$r2 +/*############################################################*/ +.endif + sub.l $sp,$sp,24 # Space for the caller argument frame + call main + +.equ EXITEXIT , 0x1fffc + +.global _exit +_exit: + sta.l EXITEXIT,$r0 # simulator end of test + jmp _exithook + +#_watchdog_isr: +# ldk $sp,__RAMSIZE +# jmp __PMSIZE-4 + +# Macro to construct the interrupt stub code. +# it just saves r0, loads r0 with the int vector +# and branches to interrupt_common. + +.macro inth i=0 +interrupt_\i: + push $r0 # { + lda $r0,(vector_table + 4 * \i) + jmp interrupt_common +.endm + + inth 0 + inth 1 + inth 2 + inth 3 + inth 4 + inth 5 + inth 6 + inth 7 + inth 8 + inth 9 + inth 10 + inth 11 + inth 12 + inth 13 + inth 14 + inth 15 + inth 16 + inth 17 + inth 18 + inth 19 + inth 20 + inth 21 + inth 22 + inth 23 + inth 24 + inth 25 + inth 26 + inth 27 + inth 28 + inth 29 + inth 30 + inth 31 + inth 32 + inth 33 + + # On entry: r0, already saved, holds the handler function +interrupt_common: + push $r1 # { + push $r2 # { + push $r3 # { + push $r4 # { + push $r5 # { + push $r6 # { + push $r7 # { + push $r8 # { + push $r9 # { + push $r10 # { + push $r11 # { + push $r12 # { + push $cc # { + + calli $r0 + + pop $cc # } + pop $r12 # } + pop $r11 # } + pop $r10 # } + pop $r9 # } + pop $r8 # } + pop $r7 # } + pop $r6 # } + pop $r5 # } + pop $r4 # } + pop $r3 # } + pop $r2 # } + pop $r1 # } + pop $r0 # } matching push in interrupt_0-31 above + reti + + # Null function for unassigned interrupt to point at +.global nullvector +nullvector: + return + +.section .data +.global vector_table + .align (4) # assembler alignment is in the power of 2 (in this case 2^4) +vector_table: + .rept 34 + .long nullvector + .endr + + +.section .text +.global __gxx_personality_sj0 +__gxx_personality_sj0: + + + .section ._flash_d2xx_config +.global __pD2XXDefaultConfiguration + .align (10) + +D2XX_partition_start = . + +.if IS_IMG_D2XX_PRESENT +.ifdef __FT930__ +.include "ft930_d2xx_default_config.inc" +.else +.include "ft900_d2xx_default_config.inc" +.endif +.endif + +D2XX_partition_end = . + + .section ._flash_dlog_partition + .align (10) +.global __dlog_partition +__dlog_partition: +dlog_partition_start = . +.if IS_IMG_DLOG_PRESENT + .long 0xF7D1D106 + .rept (0x1000-4) + .byte 0xFF + .endr +.endif +dlog_partition_end = . + + .section ._pm +.global __sdbl_partition_sizeof +.global __D2XX_partition_sizeof +.global __dlog_partition_sizeof + .if IS_IMG_SDBL_PRESENT +__sdbl_partition_sizeof = 0x2000 + .else +__sdbl_partition_sizeof = 0 + .endif + +__D2XX_partition_sizeof = D2XX_partition_end - D2XX_partition_start +__dlog_partition_sizeof = dlog_partition_end - dlog_partition_start diff --git a/hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld b/hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld new file mode 100644 index 000000000..987c2b2ba --- /dev/null +++ b/hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld @@ -0,0 +1,95 @@ +/* Default linker script, for normal executables */ +OUTPUT_FORMAT("elf32-ft32") +OUTPUT_ARCH(ft32) +SEARCH_DIR("/data/win8/ft32/ft32-elf/lib"); +/* Allow the command line to override the memory region sizes. */ +__PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K; +__RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K; +MEMORY +{ + flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE + ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE + ehci_mmap (rw!x) : ORIGIN = 0x811000, LENGTH = 2K +} +SECTIONS +{ + .text : + { + *(.text*) + *(.strings) + *(._pm*) + *(.init) + *(.fini) + _etext = . ; + . = ALIGN(4); + } > flash + .tors : + { + ___ctors = . ; + *(.ctors) + ___ctors_end = . ; + ___dtors = . ; + *(.dtors) + ___dtors_end = . ; + . = ALIGN(4); + } > ram + .data : AT (ADDR (.text) + SIZEOF (.text)) + { + *(.data) + *(.data*) + *(.rodata) + *(.rodata*) + _edata = . ; + . = ALIGN(4); + } > ram + .bss SIZEOF(.data) + ADDR(.data) : + { + _bss_start = . ; + *(.bss) + *(.bss*) + *(COMMON) + _end = . ; + . = ALIGN(4); + } > ram + __data_load_start = LOADADDR(.data); + __data_load_end = __data_load_start + SIZEOF(.data); + .stab 0 (NOLOAD) : + { + *(.stab) + } + .stabstr 0 (NOLOAD) : + { + *(.stabstr) + } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* DWARF 3 */ + .debug_pubtypes 0 : { *(.debug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges) } + /* DWARF Extension. */ + .debug_macro 0 : { *(.debug_macro) } + .debug_addr 0 : { *(.debug_addr) } +} diff --git a/src/portable/bridgetek/ft9xx/dcd_ft9xx.c b/src/portable/bridgetek/ft9xx/dcd_ft9xx.c index 09ca2904f..3235d0ef1 100644 --- a/src/portable/bridgetek/ft9xx/dcd_ft9xx.c +++ b/src/portable/bridgetek/ft9xx/dcd_ft9xx.c @@ -29,20 +29,19 @@ * in https://brtchip.com/BRTSourceCodeLicenseAgreement */ +#include +#include +#include + #include "board.h" #include "bsp/board.h" #include "tusb_option.h" #if TUSB_OPT_DEVICE_ENABLED && \ - (CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X) + (CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X) #define USBD_USE_STREAMS -#include -#include -#include -#include - #include "device/dcd.h" //--------------------------------------------------------------------+ -- cgit v1.3.1