I am stuck at two fundamental questions to map HW register in kernel space.
void __iomem * ioremap(unsigned long offset, unsigned long size);
- Does offset have to be aligned on page size, and the size have to be a multiple of a page size? The public opinion is contradicting. My current code seems ok without page alignment.
- Can I de-reference the pointer directly to access the registers mapped? I have de-reference it in the directly in the past and it worked out. But the majority people on the internet say that it is not allowed. Should I use ioread/iowrite() (or, readb/readw/readl/writeb/ writew/writel) special functions?