[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] spi and spidev usage



Hi Carsten,

On Wed, Jan 21, 2009 at 5:23 AM, Bartsch Carsten <cbartsch@xxxxxxxxxx> wrote:

> I'm trying to use SPI. I added a 2nd SPI core to my FPGA.
> The software-part is based on petalinux-mmu-v0.10.
>
> The drivers spi and spidev can be build, the kernel says
> xilinx_spi 0: at 0x83400000 mapped to 0xC8100000, irq=0
> xilinx_spi 1: at 0x83500000 mapped to 0xC8120000, irq=1
> and in the list of /proc/devices there are character devices
> 123 xilinx_spi and 153 spidev.
>
> Can I test to access these devices already?
>
> The spidev documentation says to configure the SPI-slaves in the
> board initialization code using spi_register_board_info or
> defining tables of devices
> static struct spi_board_info spi_board_info[] __initdata = {...
>
> Where can I do this?

I've not used spidev however typically we place these platform
initialisers in arch/microblaze/platform/common - there is xspi.c in
there, however it sets up platform_device info for the xps_spi
controller itself.  You may have a liitle more work to do using
spidev.

> The documentation told me to use udev or mdev to populate /dev
> dynamically.
> mdev is not available in the busybox config (maybe to old) and udev
> cannot
> be build. I don't need dynamic configuration.
>
> Can I add the devices in the makefile of my platform instead?

Yes, edit vendors/<myvendor>/<myplatform>/Makefile

under the romfs:: target you can do something like
[tab]touch $(ROMFSDIR)/@devname,c,maj,min

where
 *  [tab] is a proper tab character
 * devname is the device node name
 * c is for char, b for clock device
 * maj is major number
 * min is minor number

alternatively, you can add it to vendors/PetaLogix/common/common.mak,
look for "DEVICES =" string

Regards,

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/