From 3a197b2fe49d6fa03978e60af2394efe9c70b527 Mon Sep 17 00:00:00 2001 From: Haiying Wang Date: Wed, 21 Feb 2007 16:52:31 +0100 Subject: [PATCH v3] Add sync to ensure flash_write_cmd is fully finished Some CPUs like PPC, BLACKFIN need sync() to ensure cfi flash write command is fully finished. The sync() is defined in each CPU's io.h file. For those CPUs which do not need sync for now, a dummy sync() is defined in their io.h as well. Signed-off-by: Haiying Wang --- include/asm-ppc/io.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/asm-ppc') diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 8e5fe11..bbc9ba0 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -95,8 +95,15 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); * Acts as a barrier to ensure all previous I/O accesses have * completed before any further ones are issued. */ -#define eieio() __asm__ __volatile__ ("eieio" : : : "memory"); -#define sync() __asm__ __volatile__ ("sync" : : : "memory"); +static inline void eieio(void) +{ + __asm__ __volatile__ ("eieio" : : : "memory"); +} + +static inline void sync(void) +{ + __asm__ __volatile__ ("sync" : : : "memory"); +} /* Enforce in-order execution of data I/O. * No distinction between read/write on PPC; use eieio for all three. -- cgit v1.1