In linux kernel. I get a reg [phy_addr], and do ioremap(), get [vir_addr], when i want to get val of this reg, What's the difference between readl() and *?
u32 value;
phys_addr_t phy_addr = 0x12345678; // it is reg addr
void *vir_addr = ioremap(phy_addr, sizeof(u32));
val = readl(vir_addr);
val = *(u32 *)vir_addr;
readw()/readl()/writew()/writel()and friends assume the hardware registers being accessed use little-endian byte order, and the functions convert the values to/from the CPU's native byte order.readl()might take care about alignment, while*is violating that on some architectures.