fs_pd.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Platform information definitions.
  3. *
  4. * 2006 (c) MontaVista Software, Inc.
  5. * Vitaly Bordug <vbordug@ru.mvista.com>
  6. *
  7. * This file is licensed under the terms of the GNU General Public License
  8. * version 2. This program is licensed "as is" without any warranty of any
  9. * kind, whether express or implied.
  10. */
  11. #ifndef FS_PD_H
  12. #define FS_PD_H
  13. #include <sysdev/fsl_soc.h>
  14. #include <asm/time.h>
  15. #ifdef CONFIG_CPM2
  16. #include <asm/cpm2.h>
  17. #if defined(CONFIG_8260)
  18. #include <asm/mpc8260.h>
  19. #elif defined(CONFIG_85xx)
  20. #include <asm/mpc85xx.h>
  21. #endif
  22. #define cpm2_map(member) \
  23. ({ \
  24. u32 offset = offsetof(cpm2_map_t, member); \
  25. void *addr = ioremap (CPM_MAP_ADDR + offset, \
  26. sizeof( ((cpm2_map_t*)0)->member)); \
  27. addr; \
  28. })
  29. #define cpm2_map_size(member, size) \
  30. ({ \
  31. u32 offset = offsetof(cpm2_map_t, member); \
  32. void *addr = ioremap (CPM_MAP_ADDR + offset, size); \
  33. addr; \
  34. })
  35. #define cpm2_unmap(addr) iounmap(addr)
  36. #endif
  37. #ifdef CONFIG_8xx
  38. #include <asm/8xx_immap.h>
  39. #include <asm/mpc8xx.h>
  40. #define immr_map(member) \
  41. ({ \
  42. u32 offset = offsetof(immap_t, member); \
  43. void *addr = ioremap (IMAP_ADDR + offset, \
  44. sizeof( ((immap_t*)0)->member)); \
  45. addr; \
  46. })
  47. #define immr_map_size(member, size) \
  48. ({ \
  49. u32 offset = offsetof(immap_t, member); \
  50. void *addr = ioremap (IMAP_ADDR + offset, size); \
  51. addr; \
  52. })
  53. #define immr_unmap(addr) iounmap(addr)
  54. #endif
  55. static inline int uart_baudrate(void)
  56. {
  57. return get_baudrate();
  58. }
  59. static inline int uart_clock(void)
  60. {
  61. return ppc_proc_freq;
  62. }
  63. #endif