Skip to content

Commit

Permalink
Merge pull request #3 from kendryte/develop
Browse files Browse the repository at this point in the history
release 0.3.0
  • Loading branch information
ly0 authored Oct 10, 2018
2 parents 20efe17 + 9430d19 commit 8c9490d
Show file tree
Hide file tree
Showing 77 changed files with 2,896 additions and 8,545 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ Kendryte K210 first SDK with FreeRTOS, have fun.
- Fix spi lcd unwork issues
- Fix dual core startup issues
- Use "__global_pointer$" instead of "_gp"

## 0.3.0

- Major change
- Modify AES、FFT、SHA、I2C、SPI、WDT、SPI driver
- Breaking changes
- Modify struct enum union format
- Non-breaking bug fixes
- Fix out of memory issues
- Fix lcd unused issues

190 changes: 97 additions & 93 deletions lds/kendryte.ld
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ MEMORY
ram_nocache (wxa!ri) : ORIGIN = 0x40000000, LENGTH = (6 * 1024 * 1024)
}

PROVIDE( _rom_start = ORIGIN(rom) );
PROVIDE( _rom_end = ORIGIN(rom) + LENGTH(rom) );
PROVIDE( _ram_start = ORIGIN(ram) );
PROVIDE( _ram_end = ORIGIN(ram) + LENGTH(ram) );
PROVIDE( _io_start = 0x40000000 );
PROVIDE( _io_end = _io_start + LENGTH(ram) );
PROVIDE( _stack_size = 1 << 17 );


/*
* The OUTPUT_ARCH command specifies the machine architecture where the
* argument is one of the names used in the Kendryte library.
Expand All @@ -32,14 +38,25 @@ OUTPUT_ARCH( "riscv" )
*/
ENTRY(_start)

/*
* The GROUP command is special since the listed archives will be
* searched repeatedly until there are no new undefined references. We
* need this since -lc depends on -lgloss and -lgloss depends on -lc. I
* thought gcc would automatically include -lgcc when needed, but
* in this file includes it explicitly here and I was seeing link errors
* without it.
*/
/* GROUP( -lc -lgloss -lgcc ) */

/*
* The linker only pays attention to the PHDRS command when generating
* an ELF output file. In other cases, the linker will simply ignore PHDRS.
*/
PHDRS
{
DATA PT_LOAD;
DYN_DATA PT_NULL;
ram_ro PT_LOAD;
ram_init PT_LOAD;
ram PT_NULL;
}

/*
Expand All @@ -48,60 +65,55 @@ PHDRS
*/
SECTIONS
{
.text.start :
{
KEEP( *(.text.start) )
} > ram : DATA

.init :
{
KEEP (*(SORT_NONE(.init)))
} > ram : DATA

/* Program code segment, also known as a text segment */
.text :
{
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text.exit .text.exit.*)
PROVIDE( _text = ABSOLUTE(.) );
/* Initialization code segment */
KEEP( *(.text.start) )
*(.text.unlikely .text.unlikely.*)
*(.text.startup .text.startup.*)
*(.text.hot .text.hot.*)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} > ram : DATA
/* Normal code segment */
*(.text .text.*)
*(.gnu.linkonce.t.*)

.fini :
{
KEEP (*(SORT_NONE(.fini)))
} > ram : DATA
. = ALIGN(8);
PROVIDE( _etext = ABSOLUTE(.) );
} >ram AT>ram :ram_ro

/* Read-only data segment */
.rodata :
{
*(.rdata)
*(.rodata .rodata.*)
*(.gnu.linkonce.r.*)
} > ram : DATA
} >ram AT>ram :ram_ro

. = ALIGN(8);

/* Init array and fini array */
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
} > ram : DATA
} >ram AT>ram :ram_ro

.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
PROVIDE_HIDDEN (__init_array_end = .);
} > ram : DATA
} >ram AT>ram :ram_ro

.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
PROVIDE_HIDDEN (__fini_array_end = .);
} > ram : DATA
} >ram AT>ram :ram_ro

.ctors :
{
Expand All @@ -123,46 +135,73 @@ SECTIONS
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} > ram : DATA
} >ram AT>ram :ram_ro

.dtors :
{
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} > ram : DATA
} >ram AT>ram :ram_ro

.data :
. = ALIGN(8);

.lalign :
{
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
} > ram : DATA
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata :
. = ALIGN(8);
PROVIDE( _data_lma = . );
} >ram AT>ram :ram_ro

.dalign :
{
__global_pointer$ = . + 0x800;
*(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)
*(.sdata .sdata.* .gnu.linkonce.s.*)
} > ram : DATA
_edata = .; PROVIDE (edata = .);

__bss_start = .;
.sbss :
. = ALIGN(8);
PROVIDE( _data = . );
} >ram AT>ram :ram_init

. = ALIGN(8);

/* .data, .sdata and .srodata segment */
.data :
{
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
} > ram : DYN_DATA
/* Writable data segment (.data segment) */
*(.data .data.*)
*(.gnu.linkonce.d.*)
/* Have _gp point to middle of sdata/sbss to maximize displacement range */
. = ALIGN(8);
PROVIDE( __global_pointer$ = ABSOLUTE(.) + 0x800);
/* Writable small data segment (.sdata segment) */
*(.sdata .sdata.*)
*(.gnu.linkonce.s.*)
/* Read-only small data segment (.srodata segment) */
. = ALIGN(8);
*(.srodata.cst16)
*(.srodata.cst8)
*(.srodata.cst4)
*(.srodata.cst2)
*(.srodata .srodata.*)
/* Align _edata to cache line size */
. = ALIGN(64);
PROVIDE( _edata = ABSOLUTE(.) );
} >ram AT>ram :ram_init

/* .bss and .sbss segment */
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
PROVIDE( _bss = ABSOLUTE(.) );
/* Writable uninitialized small data segment (.sbss segment)*/
*(.sbss .sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
/* Uninitialized writeable data section (.bss segment)*/
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
} > ram : DYN_DATA
__bss_end = .;

. = ALIGN(8);
PROVIDE( _ebss = ABSOLUTE(.) );
} >ram AT>ram :ram

PROVIDE( _tls_data = ABSOLUTE(.) );
/*
Expand All @@ -179,15 +218,15 @@ SECTIONS
*(.tdata .tdata.*)
*(.gnu.linkonce.td.*)
KEEP( *(.tdata.end) )
} > ram : DATA
} >ram AT>ram :ram

/* Thread-local bss segment, .tbss (zero-initialized tls). */
.tbss :
{
*(.tbss .tbss.*)
*(.gnu.linkonce.tb.*)
KEEP( *(.tbss.end) )
} > ram : DYN_DATA
} >ram AT>ram :ram

/*
* End of uninitalized data segement
Expand All @@ -200,47 +239,12 @@ SECTIONS
. = ALIGN(64);
PROVIDE( _end = ABSOLUTE(.) );
/* Leave 2 holes for stack & TLS, the size can set in kconfig */
PROVIDE( _heap_start = ABSOLUTE(.) + _stack_size * 5 );
PROVIDE( _heap_start = ABSOLUTE(.) + _stack_size * 2 );
PROVIDE( _tp0 = (_end + 63) & (-64) );
PROVIDE( _tp1 = _tp0 + _stack_size );
PROVIDE( _sp0 = _tp1 + _stack_size );
PROVIDE( _sp1 = _sp0 + _stack_size );
PROVIDE( _sp0 = _tp0 + _stack_size );
PROVIDE( _sp1 = _tp1 + _stack_size );
/* Heap end is at the end of memory, the memory size can set in kconfig */
PROVIDE( _heap_end = _ram_end );


/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* 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_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) }
}

29 changes: 0 additions & 29 deletions lib/bsp/config/fpioa_cfg.c

This file was deleted.

42 changes: 0 additions & 42 deletions lib/bsp/config/fpioa_cfg.h

This file was deleted.

Loading

0 comments on commit 8c9490d

Please sign in to comment.