From 5429211e0acefeecc16a045bbda99be9f1aaaf37 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Wed, 18 Aug 2010 09:11:45 +0000 Subject: [PATCH] Add a DDR flush function, inspired by both Linux and if_arge.c. --- sys/mips/atheros/ar71xxreg.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/mips/atheros/ar71xxreg.h b/sys/mips/atheros/ar71xxreg.h index a87151f62429..e6b7b8e8ac53 100644 --- a/sys/mips/atheros/ar71xxreg.h +++ b/sys/mips/atheros/ar71xxreg.h @@ -491,5 +491,15 @@ ar71xx_ahb_freq(void) return (freq); } +static inline void +ar71xx_ddr_flush(uint32_t reg) +{ + ATH_WRITE_REG(reg, 1); + while ((ATH_READ_REG(reg) & 0x1)) + ; + ATH_WRITE_REG(reg, 1); + while ((ATH_READ_REG(reg) & 0x1)) + ; +} #endif /* _AR71XX_REG_H_ */