Andes Workshop

It is currently Thu Mar 28, 2024 6:52 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: local memory之programming注意事項
PostPosted: Mon Apr 16, 2012 4:44 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
下面是以DLM做為說明。
如果是ILM的話,ILM可以config為一開電就是enabled。
ILM接flash就可以由ILM開機。(稱為boot from local memory功能)

local memory之programming注意事項

(1)dlm的位址空間的指定:
li $r0,0x800001
mtsr $r0, $dlmb
設定dlmb暫存器,指定dlm的起始位址為0x00800000

(2)在linker script裏指定:
SDRAM (awx) : ORIGIN = 0x00800000, LENGTH = 64K
是不是完成以上兩個步驟,dlm就被指定為0x00800000位址開始的64k的位址空間。

(3)data區都要指定程式的LMA、VMA。
LMA:logical位址,指的是bin檔的位址
VMA:virtual位址,指的是程式運行時的位址,為DLM
例如:(不止有.data..其他為rw特性的section都要加入)
.data :
{
__data_start = .;
*(.data .data.* .gnu.linkonce.d.*)
} > SDRAM AT> FLASH

(4)程式要將.data區copy到DLM上。
您可以參考,demo-ls1裡的寫法
/* data section will be copied before we remap.
* We don't need to copy data section here. */
extern char __data_lmastart;
extern char __data_start;
extern char _edata;
/* Copy data section to RAM */
size = &_edata - &__data_start;
MEMCPY(&__data_start, &__data_lmastart, size);


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group