hardware.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * linux/include/asm-arm/arch-aaec2000/hardware.h
  3. *
  4. * Copyright (c) 2005 Nicolas Bellido Y Ortega
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARCH_HARDWARE_H
  11. #define __ASM_ARCH_HARDWARE_H
  12. #include <linux/config.h>
  13. /* The kernel is loaded at physical address 0xf8000000.
  14. * We map the IO space a bit after
  15. */
  16. #define PIO_APB_BASE 0x80000000
  17. #define VIO_APB_BASE 0xf8000000
  18. #define IO_APB_LENGTH 0x2000
  19. #define PIO_AHB_BASE 0x80002000
  20. #define VIO_AHB_BASE 0xf8002000
  21. #define IO_AHB_LENGTH 0x2000
  22. #define VIO_BASE VIO_APB_BASE
  23. #define PIO_BASE PIO_APB_BASE
  24. #define io_p2v(x) ( (x) - PIO_BASE + VIO_BASE )
  25. #define io_v2p(x) ( (x) + PIO_BASE - VIO_BASE )
  26. #ifndef __ASSEMBLY__
  27. #include <asm/types.h>
  28. /* FIXME: Is it needed to optimize this a la pxa ?? */
  29. #define __REG(x) (*((volatile u32 *)io_p2v(x)))
  30. #define __PREG(x) (io_v2p((u32)&(x)))
  31. #else /* __ASSEMBLY__ */
  32. #define __REG(x) io_p2v(x)
  33. #define __PREG(x) io_v2p(x)
  34. #endif
  35. #include "aaec2000.h"
  36. #endif /* __ASM_ARCH_HARDWARE_H */