UART's register read/write

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART's register read/write

891件の閲覧回数
JamesLeung
Contributor I

Hi i.mx experts,

I am trying create a hardware driver module for linux kernel. The hardware is connecting to the i.mx28 through UART, therefore I am trying to access the UART register directly through iowrite(). However I found that I can never write to the register address. Below is code I am using:


release_mem_region(UARTBASE_PA, 145); 
if(request_mem_region(UARTBASE_PA, 145, "myserial") ==NULL){ 
 printk("iomem request refused\n"); 
} else 
 UARTBASE =(u32) ioremap_nocache((u32) UARTBASE_PA, 145); 
iowrite32((u32) 0x100,(u32) (UARTBASE+0x20)); 
x=ioread32(UARTBASE+0x20); 
printk("%x\ \n", x);



Where the ioread() output always is the default value instead of the one I write to it.

I have no idea how to solve this problem, please help, any idea will be helpful.

Thank you in advance!

James


ラベル(1)
0 件の賞賛
返信
0 返答(返信)