- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello to everyone! I am struggling to make this work, let me share my efforts to make the mutex work between a NIOS2-MMU Linux and a NIOS2- w/o LINUX
My NIOS2 NO-LINUX is running this program:
int main()
{
alt_putstr("Proc 2!\n");
/* get the mutex device handle */
alt_mutex_dev* mutex = altera_avalon_mutex_open( "/dev/mutex" );
/* acquire the mutex, setting the value to one */
altera_avalon_mutex_trylock( mutex, 1 );
while(1){
if(altera_avalon_mutex_is_mine(mutex))
{
usleep(100);
alt_printf("%x\n", IORD_32DIRECT(SHARED_MEM_BASE, 0x00));
}
altera_avalon_mutex_unlock( mutex );
}
return 0;
}
My Device Driver of the MMU Linux is written here: http://pastebin.com/gwlfqawv However it is'nt working. When i boot my Linux it says that my Mutex is at the adress e0000001c4, i dont understand why it has this "e" in the front of the adress? Also it isn't locking because when i lock in Linux i still can lock/unlock at NIOS2-NOLINUX outl(0x00000001, shmem.mutex); if (inl(shmem.mutex) == 0x00000001) {printk(KERN_INFO "locked\n"); return 1;} I get the locked message at Linux, however the mutex isnt locking. Any help is appreciated
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe the MMU programming for Kernel space defines this region as non-cached. I don't know if this includes translating the address do 0x000.. for the hardware access.
-Michael- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page