io.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2004-2010 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later.
  5. */
  6. #ifndef _BFIN_IO_H
  7. #define _BFIN_IO_H
  8. #include <linux/compiler.h>
  9. #include <linux/types.h>
  10. #include <asm/byteorder.h>
  11. #include <asm/def_LPBlackfin.h>
  12. #define __raw_readb bfin_read8
  13. #define __raw_readw bfin_read16
  14. #define __raw_readl bfin_read32
  15. #define __raw_writeb(val, addr) bfin_write8(addr, val)
  16. #define __raw_writew(val, addr) bfin_write16(addr, val)
  17. #define __raw_writel(val, addr) bfin_write32(addr, val)
  18. extern void outsb(unsigned long port, const void *addr, unsigned long count);
  19. extern void outsw(unsigned long port, const void *addr, unsigned long count);
  20. extern void outsw_8(unsigned long port, const void *addr, unsigned long count);
  21. extern void outsl(unsigned long port, const void *addr, unsigned long count);
  22. #define outsb outsb
  23. #define outsw outsw
  24. #define outsl outsl
  25. extern void insb(unsigned long port, void *addr, unsigned long count);
  26. extern void insw(unsigned long port, void *addr, unsigned long count);
  27. extern void insw_8(unsigned long port, void *addr, unsigned long count);
  28. extern void insl(unsigned long port, void *addr, unsigned long count);
  29. extern void insl_16(unsigned long port, void *addr, unsigned long count);
  30. #define insb insb
  31. #define insw insw
  32. #define insl insl
  33. /**
  34. * I/O write barrier
  35. *
  36. * Ensure ordering of I/O space writes. This will make sure that writes
  37. * following the barrier will arrive after all previous writes.
  38. */
  39. #define mmiowb() do { SSYNC(); wmb(); } while (0)
  40. #include <asm-generic/io.h>
  41. #endif