fs_pd.h 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <asm/cpm2.h>
  14. #include <sysdev/fsl_soc.h>
  15. #include <asm/time.h>
  16. static inline int uart_baudrate(void)
  17. {
  18. return get_baudrate();
  19. }
  20. static inline int uart_clock(void)
  21. {
  22. return ppc_proc_freq;
  23. }
  24. #define cpm2_map(member) \
  25. ({ \
  26. u32 offset = offsetof(cpm2_map_t, member); \
  27. void *addr = ioremap (CPM_MAP_ADDR + offset, \
  28. sizeof( ((cpm2_map_t*)0)->member)); \
  29. addr; \
  30. })
  31. #define cpm2_map_size(member, size) \
  32. ({ \
  33. u32 offset = offsetof(cpm2_map_t, member); \
  34. void *addr = ioremap (CPM_MAP_ADDR + offset, size); \
  35. addr; \
  36. })
  37. #define cpm2_unmap(addr) iounmap(addr)
  38. #endif