tqm8260_setup.c 1.0 KB

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