hardware.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * arch/arm/mach-aaec2000/include/mach/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 <asm/sizes.h>
  13. #include <mach/aaec2000.h>
  14. /* The kernel is loaded at physical address 0xf8000000.
  15. * We map the IO space a bit after
  16. */
  17. #define PIO_APB_BASE 0x80000000
  18. #define VIO_APB_BASE 0xf8000000
  19. #define IO_APB_LENGTH 0x2000
  20. #define PIO_AHB_BASE 0x80002000
  21. #define VIO_AHB_BASE 0xf8002000
  22. #define IO_AHB_LENGTH 0x2000
  23. #define VIO_BASE VIO_APB_BASE
  24. #define PIO_BASE PIO_APB_BASE
  25. #define io_p2v(x) ( (x) - PIO_BASE + VIO_BASE )
  26. #define io_v2p(x) ( (x) + PIO_BASE - VIO_BASE )
  27. #ifndef __ASSEMBLY__
  28. #include <asm/types.h>
  29. /* FIXME: Is it needed to optimize this a la pxa ?? */
  30. #define __REG(x) (*((volatile u32 *)io_p2v(x)))
  31. #define __PREG(x) (io_v2p((u32)&(x)))
  32. #else /* __ASSEMBLY__ */
  33. #define __REG(x) io_p2v(x)
  34. #define __PREG(x) io_v2p(x)
  35. #endif
  36. #include "aaec2000.h"
  37. #endif /* __ASM_ARCH_HARDWARE_H */