tqm8260_setup.c 997 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * TQM8260 platform support
  3. *
  4. * Author: Allen Curtis <acurtis@onz.com>
  5. * Derived from: m8260_setup.c by Dan Malek, MVista
  6. *
  7. * Copyright 2002 Ones and Zeros, Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. */
  14. #include <linux/init.h>
  15. #include <asm/mpc8260.h>
  16. #include <asm/cpm2.h>
  17. #include <asm/machdep.h>
  18. static int
  19. tqm8260_set_rtc_time(unsigned long time)
  20. {
  21. ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt = time;
  22. ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcntsc = 0x3;
  23. return(0);
  24. }
  25. static unsigned long
  26. tqm8260_get_rtc_time(void)
  27. {
  28. return ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt;
  29. }
  30. void __init
  31. m82xx_board_init(void)
  32. {
  33. /* Anything special for this platform */
  34. ppc_md.set_rtc_time = tqm8260_set_rtc_time;
  35. ppc_md.get_rtc_time = tqm8260_get_rtc_time;
  36. }