LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2011, 01:32 PM   #1
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
LKM, MMIO, can not read from 0xFED00000


Yes I can, but linux dos not find a suitable read function and gives back 0xFFFFFFFF.
Is this area (HPET MMIO) restricted?

Here my module:
Code:
#include <linux/module.h>       /* Needed by all modules */
#include <linux/kernel.h>       /* Needed for KERN_INFO */
#include <linux/init.h>         /* Needed for the macros */
#include <asm/io.h>


MODULE_LICENSE("GPL");
MODULE_AUTHOR("That is me");
MODULE_DESCRIPTION("Simple module");

unsigned long *addr;

int init_module(void)
	{
	unsigned long ui, i;
	
	printk(KERN_INFO "Hello\n" );
	
	addr = ioremap( 0xFED00000, 100 );
	
	printk( KERN_INFO "addr :  %X\n", (int) addr );
	
	for( i=0; i < 10; i++ )
		{
		ui = readl( addr + 4 * i );
		printk( KERN_INFO "Value %d", (int) i );
		printk( KERN_INFO " = %X\n", (int) ui );
		}
	
        return 0;
	}

void cleanup_module(void)
	{
	iounmap( addr );
	printk(KERN_INFO "Goodbye, world \n");
	}

Last edited by bastl; 07-01-2011 at 02:48 PM.
 
  


Reply



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
Translating ISA MMIO to USB device vyhd Programming 1 12-02-2008 08:26 AM
Lkm sci3ntist Programming 1 11-27-2007 03:18 PM
LKM talking to another LKM? Ljunge Programming 4 11-13-2007 01:29 PM
Need help with PCI MMIO, do I need to map this first? cracauer Linux - Kernel 1 11-16-2006 12:15 PM
LKM - Read Config gr33ndata Programming 8 02-22-2005 04:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:17 PM.

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