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

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


On Wed, Mar 4, 2009 at 00:53, Bartsch Carsten <cbartsch@xxxxxxxxxx> wrote:

Hi Matt,

 

You could try to follow the initialization. I added a lot of printk to the drivers to see what happens. Can you verify that spidev_probe gets called for every device you declare?

I think your current problem is not the driver of the SPI itself.

 

The board I don't know. From the user guide I see there are four devices sharing one bus (AMP, ADC, DAC, Flash). So you would declare your DAC using the first (or 2nd) bus with the appropriate chip select. (I would also declare the other devices on that bus. The flash is a handy victim for tests.)

3 header pins? I assume you have a second bus connected to an external device -> declare that device using the 2nd (or 1st) bus and chip select.

 

Btw: Hopefully the ADC is not too picky about additional and asynchronous clock cycles. Otherwise it could be hard to make 34-bit transfers.

 

Carsten

 

 

De: owner-microblaze-uclinux@xxxxxxxxxxxxxx [mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] En nombre de Matt Staniszewski
Enviado el: miércoles, 04 de marzo de 2009 8:18
Para: microblaze-uclinux@xxxxxxxxxxxxxx
Asunto: Re: [microblaze-uclinux] spi and spidev usage

 

Hi Carsten,

No luck yet on detecting the SPI interfaces.  I've tried every /dev/spi-# entry using spi-test and all of them report:

can't open device: No such device or address
Abort

Do you have any suggestions?  I have two SPI devices, one set to the 3 header pins and another to a DAC.  I'm using the Spartan 3E Starter Kit.

Thanks for the help.

Matt