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

RE: [microblaze-uclinux] spi and spidev usage



Good to hear that something is working.  
I hope you don't get into trouble with the names spidev-X.Y and spi-Z and so on. I was using spi-Z do avoid any conflicts if udev will be working eventually and will create the spidev-X.Y names. Nevertheless spi-0 is a single device, not a bus. But you know this already.

So you don't have real contact to your devices yet. I recommend using an oscilloscope or logic analyzer to see what is happening. Otherwise you might not see that your device answers but the driver doesn't listen or that you chose the wrong chip select or ...

> I also had to make some changes to xspi.c with regards 
> to how the constants in autoconf.h were named.
Strange, it's only predefined names and numbers.

Have fun,
Carsten


De: owner-microblaze-uclinux@xxxxxxxxxxxxxx [mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] En nombre de Matt Staniszewski
Enviado el: jueves, 05 de marzo de 2009 8:31
Para: microblaze-uclinux@xxxxxxxxxxxxxx
Asunto: Re: [microblaze-uclinux] spi and spidev usage

Hi Carsten,

Success!  I finally got my SPI driver to initialize and both your test code and the one under the SPI documentation gave me some results.  Here's my boot now (with PLENTY of printk's):

xilinx_spi xilinx_spi.0: at 0x41600000 mapped to 0x41600000, irq=1
spi spi1.0: xilinx_spi_setup_transfer, unsupported clock rate 1000000Hz, bus uses 1562500Hz
xilinx_spi xilinx_spi.1: at 0x41800000 mapped to 0x41800000, irq=0
SPIDEV: Probing for Devices...
SPIDEV: Initializing Device Data...
SPIDEV: Looking for Minor Number...
SPIDEV: Found Minor Number, Hooking up...
SPIDEV: Setting Minor Numbers
SPIDEV: Device spidev0.0 Initialized!

I know that my clock rate is wrong, I'll adjust the slave settings later.  Then your test:

# spi /dev/spi-0
Write mode: 01, Result: spidev spi0.0: xilinx_spi_setup_transfer, unsupported clock rate 500000Hz, bus uses 1562500Hz

And the documentation's spi_test.c:

# spi-test /dev/spi-0
spidev spi0.0: xilinx_spi_setup_transfer, unsupported clock rate 500000Hz, bus uses 1562500Hz
can't set max speed hz: Invalid argument
Abort

The problem: user error.  I found out that either the patch didn't apply a few settings to some files or a make clean in petalinux-dist wiped out a bunch of files.  I discovered while adding printk's that my kernel config didn't have the setting anymore to enable XILINX_SPI, so I reapplied the patch and enabled it.  I also had to make some changes to xspi.c with regards to how the constants in autoconf.h were named.

However, after all that, it works!  I guess I'll move on to trying to getting my DAC actually running and then on to more SPI devices.

Thanks so much again!

Matt

___________________________
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/