From: Grant Likely <grant.likely@secretlab.ca>
To: Mirsad Vejseli <Vejseli@web.de>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: virtex 4 linux driver bus error
Date: Wed, 22 Oct 2008 22:17:13 -0600 [thread overview]
Message-ID: <20081023041713.GA7165@secretlab.ca> (raw)
In-Reply-To: <1695261910@web.de>
On Wed, Oct 22, 2008 at 02:10:12PM +0200, Mirsad Vejseli wrote:
> hello at all,
>
> at the moment I use development board ML410 with montavistalinux.
>
> I have a problem, please help me!
>
> I try to write a linux-driver for writing or reading registers.
> I have a ace-file, which contents Linux and EDK-project with a component (IP-wizard) which is added on a PLB-bus.
> I also have a driver-construct which I can register (insmod driver.ko) into the linux-Kernel only if i do not use functions to write or read the bus (XIO_out32() or XIO_in32 () ). If I use this function after registering the driver I got an error.
> If I try to insert the modul with Insmod driver.ko I get a bus error!
>
> my driver is similar to http://ozlabs.org/pipermail/linuxppc-embedded/2006-January/021578.html
>
>
> her the two importent functions of the driver:
>
Try something like this:
#define REG_BASE (u32) XPAR_komponente_0_BASEADDR // defined in xparameters_ml41x.h
#define REG_HIGH (u32) XPAR_komponente_0_HIGHADDR // defined in xparameters_ml41x.h
#define reg0_upper (u32) komponente_SLV_REG0_OFFSET // 32-bit register / defined in komponente.h
#define reg1_upper (u32) komponente_SLV_REG1_OFFSET // 32-bit register / defined in komponente.h
#define reg2_upper (u32) komponente_SLV_REG2_OFFSET // 32-bit register / defined in komponente.h
static int __init meintreiber_init(void)
{
int rtn, upper;
reg_remapped_address = (u32) ioremap(REG_BASE, REG_HIGH - REG_BASE + 1);
if (!reg_remapped_address) {
printk("error mapping registers\n");
return -ENOMEM;
}
upper = in_be32(reg_mapped_address + reg1_upper);
printk("Data in: %.8X\n", upper);
return 0;
}
g.
prev parent reply other threads:[~2008-10-23 4:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 12:10 virtex 4 linux driver bus error Mirsad Vejseli
2008-10-22 23:38 ` John Linn
2008-10-23 4:17 ` Grant Likely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081023041713.GA7165@secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=Vejseli@web.de \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).