Re: mc13xxx-core: kernel hangs after 'regmap_read'

From: Philippe Rétornaz
Date: Thu May 24 2012 - 12:16:53 EST


> > Still reading 0x810 for all registers (0x810000 is the value of
> > register 0 , btw).
>
> This could mean that all the registers are being sent as 0 and the value is
> shifted by 12 bits. (which is a bit weird). It's also a strange that Shawn's
> board seems to work.
>
> Do you have any other devices on that SPI that you can verify are working
> correctly? (you said it worked from the bootloader, I'm running out of
> ideas... :| )


Well, I think I found out why it's not working on mc13783.
With regmap, each transfert is done with 8bits words. The SPI hardware assert
the SS signal only during 8 bits "register" transfert then deassert the SS.
Then the SS is asserted and 24bits (3 bytes) are transfered (datas).
This clearly violate the datasheet which say SS must be asserted for the
*whole* transfert: register + data.

This is why the old code used a 32bits word transfert, it ensured that the SPI
hardware was keeping SS asserted without interruptions.

Is there any way to tell regmap to use 32bits transfert with the following
configuration (or doing it in a single shot 4x8bits):
To read register 0x42 we need to "write" to SPI:

0x42 << 24

and the mc13783 will answer immediatly in the low-24 bits of the _same_ spi
exchange.

to write register 0x42 we need to "write" to SPI:

(0x80 | 0x42) << 24 | data

I have an oscilloscope screenshot of a transfert if needed.

Regards,

Philippe




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/