lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 May 2012 18:16:50 +0200
From:	Philippe Rétornaz <philippe.retornaz@...l.ch>
To:	marc@...esign.com.au
Cc:	Fabio Estevam <festevam@...il.com>,
	Shawn Guo <shawn.guo@...escale.com>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Sascha Hauer <kernel@...gutronix.de>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: mc13xxx-core: kernel hangs after 'regmap_read'

> > 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ