Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Access to DMAC registers (AHB Slave 3)
PostPosted: Tue Jun 17, 2008 5:51 pm 
Offline

Joined: Tue Jun 17, 2008 5:31 pm
Posts: 3
Location: Munich
Has anyone program the DMAC registers directly?

In our Linux distribution even the DMAC related symbols aren't defined.

The system controller memory area can be accessed from the kernel space simply using the macros at91_sys_read and at91_sys_write, no need for remapping (linux kernel level).

Accessing the Internal memory Map (0x00000000-0x00B00000) requires on a kernel module requesting the targeted memory region. In case of the LCD controller (from atmel_lcdfb.c):

/*******************************/
/* LCDC registers */
info->fix.mmio_start = regs->start;
info->fix.mmio_len = regs->end - regs->start + 1;

if (!request_mem_region(info->fix.mmio_start,
info->fix.mmio_len, pdev->name)) {
ret = -EBUSY;
goto free_fb;
}

sinfo->mmio = ioremap(info->fix.mmio_start, info->fix.mmio_len);
if (!sinfo->mmio) {
dev_err(dev, "cannot map LCDC registers\n");
goto release_mem;
}
/**************************/

This code configures properly the acces to the LCD controller internal registers that are marked in the third AT91 AHB Slave group. Within this group is also the DMAC controller, following the guidelines from the code in atmel_lcdfb.c we try to do our simple own DMAC driver:

/**************************************/
/*Requests IO ports for DMAC memory region*/
if(!request_mem_region(DMAC_IOMEM_START,DMAC_IOMEM_LENGTH,DMAC_IOMEM_NAME)){
printk("Error requesting DMAC IOMEM\n");
//fpga_dev_exit();
return -ENXIO;
}

DMAC_base_address= ioremap(DMAC_IOMEM_START,DMAC_IOMEM_LENGTH);
if(!DMAC_base_address){
printk("Error remaping DMAC IOMEM\n");
//fpga_dev_exit();
return -ENXIO;
}
/************************************/


With the code shown above, the LCD controller registers can be read. The internal registers of the DMAC controller can NOT be read.
A read instruction on a mapped DMAC internal register returns allways zero.
A read instruction on a unmapped DMAC internal register returns allways access violation exception.

Both LCD controller and DMAC are in the same AHB slave interface.

Does anyone face this problem?

thanks


Top
 Profile  
 
 Post subject: DMAC and other peripherals register access
PostPosted: Wed Jun 25, 2008 8:07 pm 
Offline

Joined: Tue Jun 17, 2008 5:31 pm
Posts: 3
Location: Munich
Concerning the AT91SAM9263:

All kind of access to a given peripheral are blocked while its corresponding clock is disabled.
Our mistake: trying to access the DMAC registers without enabling its clock.

The Power Managment controller allows to enable or disable each peripheral clock.
For those stuck in a similar situation:
-> From the AT91SAM9263 datasheet Page 32, section 10, for peripherals ID's.
-> From the AT91SAM9263 datasheet Page 352-378, section 27, Power Management controller.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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: