Download Latest Version Driver source (32.1 kB)
Email in envelope

Get an email when there's a new version of Linux drivers for Xilinx MailBox IP

Home
Name Modified Size InfoDownloads / Week
README 2012-02-07 3.5 kB
mailbox_linux_drivers.7z 2012-02-07 32.1 kB
Totals: 2 Items   35.6 kB 0
======================================================================
*** Instructions to adapt the MailBox driver to your architecture. ***
======================================================================
1. Copy driver_config.h file from config-xyz/ directory to ./  where mailbox_driver.c is located. Then modify it. "xyz" represents a specific configuration. For example,
cp config-microblaze/driver_config.h ./    # for MicroBlaze configuration
cp config-powerpc/driver_config.h ./       # for PowerPC 440 configuration

Configuration parameters are described in the header file. They select Netlink communication with user-space and interrupts, special PowerPC codes support and endianness.

2. In mailbox_driver.h, adapt the NUMBER_OF_MAILBOXES constant to match your own. Note that if you use Xilinx's xparameters.h file, you can use the value from this file. In this case make sure the #include statement is uncommented.
Also, if using NETLINK and interrupts, only one mailbox is supported. In this case set NUMBER_OF_MAILBOXES to 1.

3. In mailbox_driver.h, set IRQ_NUM to the number assigned to your mailbox. The IRQ is assigned statically in this version of the driver.
Set NETLINK_USER to the same number as used by a user-space application. 
Set MAX_PAYLOAD to the size of the used mailbox. This is a threshold beyond which the driver does not read.

4. In file mailbox_driver.c, adapt each instance's base address in the mbox_driver_init function. 
If using a single mailbox and/or NETLINK, set MAILBOX_ID to 0.

5. In the Makefile file, change /path/to/linux/installation/files by the path to the linux installation files that you used for building your kernel.

If using Petalinux distribution, take advantage of Makefile_petalinux. Read its comments first. Rename Makefile_petalinux to Makefile, or create a link, or use 'make -f Makefile_petalinux' to reference it with make.

6. Run the following commands:
make clean
make
(optional) make docs

If using Petalinux distribution, run the following commands (assumes Makefile points to Makefile_petalinux):
make clean
make
make romfs   # to automatically install the driver into Embedded Linux
             # root, i.e.
			 # petalinux/software/petalinux-dist/romfs/lib/modules/...

======================================================================
*** Limitations ***
======================================================================
1. IRQ is assigned statically
2. When using interrupts with Netlink, only one mailbox can be used at a time.
3. When using interrupts with Netlink, only one Netlink packet should reside in the mailbox at a time. Thus, pay attention to flow control. The reason is that the current implementation of the bottom half interrupt handler reads everything from the mailbox, but the top half tasklet disregards anything that is beyond the first packet. This can be updated in future.

======================================================================
*** Other TODO Items ***
======================================================================
- Use dynamic major dev number allocation via alloc_chrdev_region rather than register_chrdev_region.

======================================================================
*** Improvements ***
======================================================================
If you add improvements to that driver, please add your name to the header's contributor list and send it back to epok13@users.sourceforge.net so that I can update the file and allow everyone to enjoy your changes.


Source: README, updated 2012-02-07