From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Thu, 23 Jul 2009 14:25:34 -0700 Subject: [U-Boot] [PATCH] Using I/O accessor instead of volatile pointers in SMC911x driver In-Reply-To: <20090723195422.8E91F832E416@gemini.denx.de> References: <1248250473-12694-1-git-send-email-matthias.weisser@graf-syteco.de> <20090723195422.8E91F832E416@gemini.denx.de> Message-ID: <4A68D54E.3060902@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > Dear Matthias Weisser, > > In message <1248250473-12694-1-git-send-email-matthias.weisser@graf-syteco.de> you wrote: > >> Volatile pointer usage caused lockup with arm-gcc 4.3.2 >> Using I/O accessor fixed that. >> > > Hm... > > >> - return *(volatile u32*)addr; >> + return readl(addr); >> > > On big-endian systems like PowerPC, readl() is a byte-swapping > (little-endian) input function, which means that your patch changes > the byte order of all I/O operations. > > Yeah, that's why I left these alone when re-working this driver. I don't know what the correct approach is when using memory-mapped devices that could in theory go on the local bus of any processor. Most people I know would hook them up according to the native endianness. regards, Ben