hardware.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * include/asm-arm/arch-at91/hardware.h
  3. *
  4. * Copyright (C) 2003 SAN People
  5. * Copyright (C) 2003 ATMEL
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. */
  13. #ifndef __ASM_ARCH_HARDWARE_H
  14. #define __ASM_ARCH_HARDWARE_H
  15. #include <asm/sizes.h>
  16. #if defined(CONFIG_AT91RM9200)
  17. #include <asm/arch/at91rm9200.h>
  18. #elif defined(CONFIG_AT91SAM9260)
  19. #include <asm/arch/at91sam9260.h>
  20. #elif defined(CONFIG_AT91SAM9261)
  21. #include <asm/arch/at91sam9261.h>
  22. #elif defined(CONFIG_AT91SAM9263)
  23. #include <asm/arch/at91sam9263.h>
  24. #elif defined(CONFIG_AT91SAM9RL)
  25. #include <asm/arch/at91sam9rl.h>
  26. #elif defined(CONFIG_AT91CAP9)
  27. #include <asm/arch/at91cap9.h>
  28. #define AT91_BASE_EMAC AT91CAP9_BASE_EMAC
  29. #define AT91_BASE_SPI AT91CAP9_BASE_SPI0
  30. #define AT91_ID_UHP AT91CAP9_ID_UHP
  31. #define AT91_PMC_UHP AT91CAP9_PMC_UHP
  32. #elif defined(CONFIG_AT91X40)
  33. #include <asm/arch/at91x40.h>
  34. #else
  35. #error "Unsupported AT91 processor"
  36. #endif
  37. /*
  38. * container_of - cast a member of a structure out to the containing structure
  39. *
  40. * @ptr: the pointer to the member.
  41. * @type: the type of the container struct this is embedded in.
  42. * @member: the name of the member within the struct.
  43. */
  44. #define container_of(ptr, type, member) ({ \
  45. const typeof(((type *)0)->member) *__mptr = (ptr); \
  46. (type *)((char *)__mptr - offsetof(type, member)); })
  47. #endif