Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 03-29-2007, 10:42 PM   #1
LQ Newbie
Registered: Sep 2006
Posts: 15

Rep: Reputation: 0
Question regarding ioremap() for accessing hardware

Hello Everybody,

I have one query regarding ioremap(). Once we do ioremap() to specific hardware base address, it will return a virtual address which is mapped to hardware address.

I am trying to write a small char device driver where it will do read/write/ioctl on a small hardware device.

I have written hardware register structure and then mapped the same using the ioremap()
ptr = ioremap(HW_ADDR, sizeof(RegisterStructure),Chardriver_name);

The funny thing happening is i can do a read and write using only the pointer (returned by ioremap()).

But when i am trying to write to registers using the structure which i have defined, it is not writing the same. i.e, ptr->RegStructure.Reg1

Does anybody know where the things are going wrong. Is there any other way to access hardware or anything missing after/before doing ioremap(). Please help me out.

Thanks & Regards


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ioremap and remap_page_range mspies Linux - Software 1 08-20-2005 10:41 PM
accessing hardware configuration stored in BIOS Tafta Programming 5 08-13-2004 03:02 PM
ioremap() and readl() not compiling CyberEE Linux - Software 0 01-19-2004 10:10 AM
Accessing / Mounting Hardware Help! mudelf Linux - Hardware 0 11-12-2003 04:34 AM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration