virtex 4 linux driver bus error

John Linn John.Linn at xilinx.com
Thu Oct 23 10:38:07 EST 2008


See the inline comments.

> -----Original Message-----
> From: linuxppc-embedded-bounces+john.linn=xilinx.com at ozlabs.org [mailto:linuxppc-embedded-
> bounces+john.linn=xilinx.com at ozlabs.org] On Behalf Of Mirsad Vejseli
> Sent: Wednesday, October 22, 2008 6:10 AM
> To: linuxppc-embedded at ozlabs.org
> Subject: virtex 4 linux driver bus error
> 
> 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

I don't know MontaVista Linux, but in general these are functions provided by Xilinx for standalone (no RTOS) operation unless MontaVista has changed them.  I would recommend that you go look at other Linux drivers to see the pattern for I/O such as the uartlite serial driver or the xilinx_ps2.c driver.  I realize each driver already in the mainline can be different but they are working.

I would also add some debug to print out the virtual address after the ioremap. You aren't checking the result of the ioremap to make sure it didn't fail. 

Is the ioremap bad or the I/O operation is the question.

> 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:
> 
> #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
> 
> const static long remap_size = REG_HIGH - REG_BASE + 1;
> 
> static void read_register_values(void)
> {
> 	static u32 upper;
> 
> 
> 	printk("%s:\n",DRIVERNAME);
> 	printk("%s:                      |     upper         |\n",DRIVERNAME);
> 	printk("%s:----------------------|-------------------|\n",DRIVERNAME);
> 
> 	upper = XIo_In32(reg_remapped_address + reg1_upper);
> 
>     printk("%s: Daten im Register 35 |%15X |\n", DRIVERNAME, upper );
> 
> }
> 
> 
> static int __init meintreiber_init(void)
> reg_remapped_address = (u32) ioremap(REG_BASE, remap_size);
> 
>     rtn = misc_register(&miscdev);
>     if (rtn)
>     {
> 		printk("%s: %s error driver not reg. \n",DRIVERNAME, miscdev.name);
>         return rtn;
>     }
> 
> 	read2_register_values();
> 
> in the messeges log file i got the 3 printk lins and this line
> "upper = XIo_In32(reg_remapped_address + reg1_upper);"
> creates a error
> 
> 
> 
> 
> Thank you very much for your kind help!
> ________________________________________________________________________
> Schon gehört? Bei WEB.DE gibt' s viele kostenlose Spiele:
> http://games.entertainment.web.de/de/entertainment/games/free/index.html
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




More information about the Linuxppc-embedded mailing list