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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Mar 2014 12:49:01 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Max Filippov <jcmvbkbc@...il.com>
Cc:	linux-xtensa@...ux-xtensa.org, linux-spi@...r.kernel.org,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	Chris Zankel <chris@...kel.net>,
	Marc Gauthier <marc@...ence.com>,
	Rob Herring <robh+dt@...nel.org>,
	Grant Likely <grant.likely@...aro.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 1/3] spi: add xtfpga SPI controller driver

On Wed, Mar 12, 2014 at 04:21:03PM +0400, Max Filippov wrote:

> +	case 16:
> +		/* Bytes that should go out earlier have lower addresses,
> +		 * but the hardware operates with 16 bit words and transmits
> +		 * higher bits first. Thus data in memory is in BE order.
> +		 */
> +		xspi->data = (xspi->data << 16) | be16_to_cpu(v);
> +		xspi->data_sz += 2;
> +		break;

Are you sure you need to do this byte swap?  SPI words are big endian so
if you are running on a little endian processor if you are transmitting
16 bit words you should see the data getting swapped on the bus (this is
why I say you should never have more than 8 bits per word for regmap).

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ