help: physical and virtual memory in arm-linux (S3C2440)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi all,
   
  I'm a newbie for linux device driver. Just reading the <<linux device drivers -3rd edition>> from O'reilly, and I'm trying to write the device driver for S3C2440 camera interface.
   
  first I found none of the S3C2410/S3C2440 peripheral equipment drivers calls request_mem_region() / ioremap() pair, for example, in linux-2.6.18/drivers/video/s3c2410fb.c, there *IS*: 
   
   if (!request_mem_region((unsigned long)S3C24XX_VA_LCD, SZ_1M, "s3c2410-lcd")) {
  ret = -EBUSY;
  goto dealloc_fb;
 }

  but there is *NOT* ioremap()/ioremap_noncache() called.
   
  I guess the request_mem_region() might be needless, and I remove these three lines, rebuild and reload the kernel, of cause, the LCD still works fine.
   
  my questions are,
   
  1> why the driver can use S3C24XX_VA_XXX(e.g. S3C24XX_VA_LCD) without request_mem_region() & ioremap() called?
   
  2> when I define S3C24XX_VA_CAMIF as, 
  #define S3C24XX_VA_CAMIF S3C2410_ADDR(0x01300000)
  whether I call:
       request_mem_region((unsigned long)S3C2440_VA_CAMIF, S3C2440_SZ_CAMIF, DRIVER_NAME)
  or not, bothly, I got oops as :
  Unable to handle kernel paging request at virtual address f1300008
pgd = c3950000
[f1300008] *pgd=00000000
Internal error: Oops: 5 [#1]
Modules linked in: camif
CPU: 0
PC is at init_module+0x200/0x3a0 [camif]
  ......
   
  3> I call request_mem_region() and ioremap() with S3C2440_PA_CAMIF, it seems the camif doesn't work because the CIPRSTATUS bit 0 is still 0 when I write 1 to CIPRSCCTRL bit 15 and 0xe0 to CIIMGCPT.
   
  Can anyone help me ?
   
  yours.
  sunxq.
   

 		
---------------------------------
抢注雅虎免费邮箱-3.5G容量,20M附件! 
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Linux ARM]     [Linux ARM MSM]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

Add to Google Follow linuxarm on Twitter