[U-Boot] [PATCH] Using I/O accessor instead of volatile pointers in SMC911x driver

Ben Warren biggerbadderben at gmail.com
Thu Jul 23 23:25:34 CEST 2009


Wolfgang Denk wrote:
> Dear Matthias Weisser,
>
> In message <1248250473-12694-1-git-send-email-matthias.weisser at 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


More information about the U-Boot mailing list