while calling this function:

static inline void writel(unsigned int v, volatile void __iomem *addr)
{
    *(volatile unsigned int __force *)addr = cpu_to_le32(v);
}
  1. Does the address is absoulute or pass through the MMU?
  2. DMA - does writing to address is translated by the MMU?
  3. Why the registers address in the system aren't mentioned here?
有帮助吗?

解决方案

Here is my answers, hope they help you:

  1. Yes, address is translated by the MMU. Address passed to writel should be Virtual Address (VA) obtained via ioremap call. ioremap will take Physical Address (PA).
  2. No, address is not translated by the MMU. Address passed to DMA should be Physical Address. A typical DMA is a dedicated peripheral which exists outside of the MMU.
  3. You have to search, for example, 'bcm2835 arm peripherals', not 'Kernel Memory Layout on ARM Linux'. As a hint, if you want to find register location inside linux kernel, do search for ioremap inside linux-kernel-tree/arch/arm.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top