public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [MIPS] cpu/mips/cpu.c: Fix flush_cache bug
@ 2008-04-08  7:20 Shinya Kuribayashi
  2008-04-18  4:14 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Shinya Kuribayashi @ 2008-04-08  7:20 UTC (permalink / raw)
  To: u-boot

Cache operations have to take line address (addr), not start_addr.
I noticed this bug when debugging ping failure.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
---

 cpu/mips/cpu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/cpu/mips/cpu.c b/cpu/mips/cpu.c
index 8b43d8e..e267bba 100644
--- a/cpu/mips/cpu.c
+++ b/cpu/mips/cpu.c
@@ -56,8 +56,8 @@ void flush_cache(ulong start_addr, ulong size)
 	unsigned long aend = (start_addr + size - 1) & ~(lsize - 1);
 
 	while (1) {
-		cache_op(Hit_Writeback_Inv_D, start_addr);
-		cache_op(Hit_Invalidate_I, start_addr);
+		cache_op(Hit_Writeback_Inv_D, addr);
+		cache_op(Hit_Invalidate_I, addr);
 		if (addr == aend)
 			break;
 		addr += lsize;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot-Users] [MIPS] cpu/mips/cpu.c: Fix flush_cache bug
  2008-04-08  7:20 [U-Boot-Users] [MIPS] cpu/mips/cpu.c: Fix flush_cache bug Shinya Kuribayashi
@ 2008-04-18  4:14 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2008-04-18  4:14 UTC (permalink / raw)
  To: u-boot

In message <47FB1CC3.2090904@necel.com> you wrote:
> Cache operations have to take line address (addr), not start_addr.
> I noticed this bug when debugging ping failure.
> 
> Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
> ---
> 
>  cpu/mips/cpu.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is impractical for  the  standard  to  attempt  to  constrain  the
behavior  of code that does not obey the constraints of the standard.
                                                          - Doug Gwyn

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-18  4:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08  7:20 [U-Boot-Users] [MIPS] cpu/mips/cpu.c: Fix flush_cache bug Shinya Kuribayashi
2008-04-18  4:14 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox