From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by ozlabs.org (Postfix) with ESMTP id 02472DDEE9 for ; Sat, 7 Mar 2009 21:10:09 +1100 (EST) From: Juergen Beisert To: linuxppc-dev@ozlabs.org Date: Sat, 7 Mar 2009 11:09:48 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200903071109.49726.jbe@pengutronix.de> Subject: Re: Davicom DM9000A on MPC5200B (powerpc) works using a dirty offsetting and byte trick Cc: Henk Stegeman List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Henk, On Freitag, 20. Februar 2009, Henk Stegeman wrote: > - Any suggestions to what could be wrong here? Or does the MPC5200 in > this case only byte swap u16 reads, but a u8 read is unchanged? You should not follow the Freescale bus signal names when you connect your external little endian device. Otherwise the offsets are always wrong. Do it in this way instead: MPC LE Device D[0..7] <-> D[24..31] D[8..15] <-> D[16..23] D[16..23] <-> D[8..15] D[24..31] <-> D[0..7] If you connect your device in such a way, just enable CS's byte swap feature depending on your bus size and you are done (no additional software manipulation required). Now you can write bytes, words or longs and you will always write the correct data into the corresponding device register. Hope it helps Juergen -- Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | Phone: +49-8766-939 228 | Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |