Skip to content

Commit

Permalink
build/configs/rtl8720e/scripts: Correct PSRAM Heap size and layout
Browse files Browse the repository at this point in the history
Current LD has removed PSRAM layout and assigned incorrect PSRAM HEAP start address
Add PSRAM layout into LD and correct PSRAM Heap start address.
  • Loading branch information
ziyik authored and sunghan-chang committed Nov 30, 2022
1 parent 24d2156 commit c1ea05d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion build/configs/rtl8720e/scripts/rlx8720e_img2_ns.ld
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ MEMORY
/* IMG2 RAM */
KM4_BD_RAM (rwx) : ORIGIN = 0x20012020, LENGTH = 0x20040000 - 0x20012020 /* KM4 BD RAM: 184k */
KR4_BD_RAM (rwx) : ORIGIN = 0x20040060, LENGTH = 0x2007A000 - 0x20040060 /* KR4 BD RAM: 232k */
KM4_HEAP_EXT (rwx) : ORIGIN = 0x2007A000, LENGTH = 0x200B0000 - 0x2007A000 /* KM4 HEAP EXT: 280k(8720EA) */
KM4_HEAP_EXT (rwx) : ORIGIN = 0x2007A000, LENGTH = 0x200B0000 - 0x2007A000 /* KM4 HEAP EXT: 216k(8720EA) */
KM4_BD_RAM_TZ_NSC (rwx) : ORIGIN = 0x200B0020, LENGTH = 0x200B1000 - 0x200B0020 /* KM4 BD RAM NSC: 4k */
KM4_BD_RAM_TZ_ENTRY (rwx) : ORIGIN = 0x200B1000, LENGTH = 0x200B3000 - 0x200B1000 /* KM4 BD RAM ENTRY: 8k */
KM4_BD_RAM_TZ_S (rwx) : ORIGIN = 0x300B3020, LENGTH = 0x300C0000 - 0x300B3020 /* KM4 BD RAM S: 52k */
Expand Down Expand Up @@ -299,11 +299,28 @@ SECTIONS

.bdram_heap.start (NOLOAD):
{
/* For TizenRT to locate idle thread stack */
_sbss = ABSOLUTE(.);
__bdram_heap_buffer_start__ = .;
/* For TizenRT to locate idle thread stack */
_ebss = ABSOLUTE(.);
} > KM4_BD_RAM

/* psram part */
.psram_image2.text.data :
{
*(.timesensitive.data*)
*(.data*)

/*cache line size aligned in order to avoid MMU remap err*/
. = ALIGN(32);
} > KM4_BD_PSRAM

.psram_heap.start (NOLOAD):
{
__psram_heap_buffer_start__ = .;
} > KM4_BD_PSRAM

.bluetooth_trace.text :
{
__btrace_start__ = .;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ extern u32 GlobalDebugEnable;
#ifdef CONFIG_PLATFORM_TIZENRT_OS
extern unsigned int __StackStart;
extern unsigned int __StackLimit;
extern unsigned int _ebss;
extern uint8_t __psram_heap_buffer_start__[];
extern unsigned int __PsramStackLimit;
void NS_ENTRY BOOT_IMG3(void);
void app_init_psram(void);

#define IDLE_STACK ((uintptr_t)&__StackStart+CONFIG_IDLETHREAD_STACKSIZE-4)
#define HEAP_BASE ((uintptr_t)&__StackStart+CONFIG_IDLETHREAD_STACKSIZE)
#define HEAP_LIMIT ((uintptr_t)&__StackLimit)
#define PSRAM_HEAP_BASE ((uintptr_t)&_ebss)
#define PSRAM_HEAP_BASE ((uintptr_t)&__psram_heap_buffer_start__)
#define PSRAM_HEAP_LIMIT ((uintptr_t)&__PsramStackLimit)

void os_heap_init(void){
Expand Down

0 comments on commit c1ea05d

Please sign in to comment.