Skip to content

Commit

Permalink
[Bouffalolab] Adjust BL702L memory layout to let hardware SHA engine …
Browse files Browse the repository at this point in the history
…use RAM as cache (project-chip#29755)
  • Loading branch information
wy-hh authored Oct 17, 2023
1 parent 78eac9c commit cdcbd8c
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ ENTRY( bl702_start )

__EM_SIZE = DEFINED(btble_controller_init) ? 16K : 0K;
__CACHE_SIZE = DEFINED(__CACHE_SIZE) ? __CACHE_SIZE : 16K;
__stack_size = DEFINED(__stack_size) ? __stack_size : 2K;

MEMORY
{
flash (rxai!w) : ORIGIN = 0x23000000, LENGTH = (2M)
tcm_ocram (wxa) : ORIGIN = 0x4201C000 + __CACHE_SIZE, LENGTH = (16K - __CACHE_SIZE + 80K - __EM_SIZE)
tcm_ocram (wxa) : ORIGIN = 0x4201C000 + __CACHE_SIZE, LENGTH = (16K - __CACHE_SIZE + 80K - __EM_SIZE - __stack_size)
sys_stack (wxa) : ORIGIN = 0x42034000 - __EM_SIZE - __stack_size, LENGTH = __stack_size
hbnram (wxa) : ORIGIN = 0x40010000, LENGTH = (4K)
psram (wxa) : ORIGIN = 0x24000000, LENGTH = (2M)
}

SECTIONS
{
__stack_size = DEFINED(__stack_size) ? __stack_size : 2K;
BOOT2_PT_ADDR = 0x4202e094;

.init :
Expand Down Expand Up @@ -232,12 +233,9 @@ SECTIONS
*(COMMON)
} >tcm_ocram

.stack (NOLOAD) : ALIGN(8)
.sha_ocram (NOLOAD) :
{
PROVIDE ( _sp_base = . );
. = . + __stack_size;
PROVIDE( _sp_main = . );
__freertos_irq_stack_top = .;
*(.sha_ocram*)
} >tcm_ocram

. = ALIGN(8);
Expand All @@ -247,6 +245,28 @@ SECTIONS
PROVIDE( _heap2_start = 0 );
PROVIDE( _heap2_size = 0 );

.stack (NOLOAD) : ALIGN(8)
{
PROVIDE ( _sp_base = . );
. = . + __stack_size;
PROVIDE( _sp_main = . );
__freertos_irq_stack_top = .;
} >sys_stack

.psram (NOLOAD) :
{
. = ALIGN(16);
PROVIDE( _psram_start = . );
*(.wifi_ram*)
. = ALIGN(16);
PROVIDE( _psram_end = . );
} >psram

. = ALIGN(8);
PROVIDE( _heap3_start = . );
PROVIDE( _heap3_size = ORIGIN(psram) + LENGTH(psram) - _heap3_start );


/* cli */
PROVIDE( _ld_bl_static_cli_cmds_start = _bl_static_cli_cmds_start );
PROVIDE( _ld_bl_static_cli_cmds_end = _bl_static_cli_cmds_end );
Expand Down

0 comments on commit cdcbd8c

Please sign in to comment.