Subject: Re: [PATCH] powerpc/mpc52xx/mtd: fix mtd-ram access for 16-bit Local Plus Bus

From: Albrecht Dreß <[email-masked]>
Date: Sat, 13 Jun 2009 18:45:44 +0200

Am 11.06.09 18:27 schrieb(en) Grant Likely:
>> +               *(u16 *)buf = *((volatile u16 *)(vdest - 1));
>> +               buf[1] = *((u8 *)src);
>> +               *((volatile u16 *)(vdest - 1)) = *(u16 *)buf;
> 
> what is the purpose of volatile here?  If you need io barriers, then  
> use the in_/out_be16 macros.

Yes, you're right - should be completely superfluous here.  A result of  
copy & paste without thinking... :-(

> Blech.  ugly #ifdef and not really multiplatform safe (yeah, I know  
> it shouldn't break non-5200 platforms, but it does have an  
> undesirable impact).  There's got to be a better way.

Ouch, yes - I completely forgot the possibility of multi-platform  
builds.

Am 11.06.09 19:28 schrieb(en) Grant Likely:
> So; the solution to me seems to be on an MPC5200 platform replace the  
> offending hooks with MPC5200 specific variants at runtime.

Will re-work the patch that way!  BTW, a dumb question: what is the  
proper way to determine which cpu the system is running on?  Check the  
CPU node of the of tree?

Thanks, Albrecht.