[U-Boot] bootcount: Add dcache flush to bootcount_store()

Tom Rini trini at konsulko.com
Mon Mar 16 18:05:58 CET 2015


On Mon, Mar 16, 2015 at 08:57:02AM -0700, York Sun wrote:
> Tom,
> 
> On 03/15/2015 11:30 AM, Tom Rini wrote:
> > ... Add a few more PowerPC people.
> > 
> > On Fri, Mar 13, 2015 at 10:34:03AM -0400, Tom Rini wrote:
> >> On Fri, Mar 13, 2015 at 09:48:56AM -0400, Tom Rini wrote:
> >>> On Wed, Mar 11, 2015 at 09:51:38AM +0100, Stefan Roese wrote:
> >>>
> >>>> Without this dcache_flush the updated bootcounter may not be saved to
> >>>> its location.
> >>>>
> >>>> This was detected on an iMX.6 platform using the OCRAM (internal SRAM)
> >>>> as bootcounter storage area. And issuing "reset" from within U-Boot
> >>>> cause the bootcounter to stay on its initial value.
> >>>>
> >>>> Signed-off-by: Stefan Roese <sr at denx.de>
> >>>> Reviewed-by: Tom Rini <trini at konsulko.com>
> >>>
> >>> OK, this breaks some platforms:
> >>>    powerpc:  +   TQM850L
> >>> +(TQM850L) drivers/built-in.o: In function `bootcount_store':
> >>> +(TQM850L) build/../drivers/bootcount/bootcount.c:64: undefined reference to `flush_dcache_range'
> >>> +(TQM850L) make[1]: *** [u-boot] Error 1
> >>> +(TQM850L) make: *** [sub-make] Error 2
> >>>
> >>> We'll see how many others have the same problem soon and then I'll
> >>> decide on nuking the old platforms of holding off on this change.
> >>
> >> Aside from the TQM 8xx family that Wolfgang owns we have mgcoge and
> >> mgcoge3ne also breaking from this
> >> (http://patchwork.ozlabs.org/patch/448849/) change.  Wolfgang, Holger,
> >> how do you want to proceed?  We either need cache operations or dropping
> >> bootcount from the platforms or dropping the platforms.
> >>
> >> Frankly, after looking at most of arch/powerpc/cpu/*/cache.c I suspect
> >> 8xx and 83xx just need the dummy files copied over.
> > 
> > OK, I went and poked at going one direction on this and then dug into
> > the higher level problem more.  PowerPC _needs_ the current kernel's
> > arch/powerpc/kernel/misc_32.S relevant cache functions ported over for
> > everyone and we should kill the dummy functions we have today.  To try
> > and encourage some folks to do this I'm going to drop this bootcount
> > patch for now.
> > 
> 
> FWIW, powerpc mpc83xx, mpc85xx, mpc86xx all have flush_dcache_range() function
> defined.

Yes and no:
$ git grep -l flush_dcache_range arch/powerpc/
arch/powerpc/cpu/mpc512x/cache.c
arch/powerpc/cpu/mpc5xxx/cache.c
arch/powerpc/cpu/mpc83xx/cache.c
arch/powerpc/cpu/mpc85xx/cache.c
arch/powerpc/cpu/mpc86xx/cache.S
arch/powerpc/cpu/ppc4xx/cache.S

Of these only ppc4xx and mpc86xx are real functions, borrowed from the
kernel long long ago.  The rest are dummy functions.  And we should
instead make everyone have the same real functions the kernel does :)

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150316/6300d4b8/attachment.sig>


More information about the U-Boot mailing list