mvrtc.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (C) 2011
  3. * Jason Cooper <u-boot@lakedaemon.net>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * Date & Time support for Marvell Integrated RTC
  25. */
  26. #ifndef _MVRTC_H_
  27. #define _MVRTC_H_
  28. #include <asm/arch/kirkwood.h>
  29. #include <compiler.h>
  30. /* RTC registers */
  31. struct mvrtc_registers {
  32. u32 time;
  33. u32 date;
  34. };
  35. /* time register */
  36. #define MVRTC_SEC_SFT 0
  37. #define MVRTC_SEC_MSK 0x7f
  38. #define MVRTC_MIN_SFT 8
  39. #define MVRTC_MIN_MSK 0x7f
  40. #define MVRTC_HOUR_SFT 16
  41. #define MVRTC_HOUR_MSK 0x3f
  42. #define MVRTC_DAY_SFT 24
  43. #define MVRTC_DAY_MSK 0x7
  44. /*
  45. * Hour format bit
  46. * 1 = 12 hour clock
  47. * 0 = 24 hour clock
  48. */
  49. #define MVRTC_HRFMT_MSK 0x00400000
  50. /* date register */
  51. #define MVRTC_DATE_SFT 0
  52. #define MVRTC_DATE_MSK 0x3f
  53. #define MVRTC_MON_SFT 8
  54. #define MVRTC_MON_MSK 0x1f
  55. #define MVRTC_YEAR_SFT 16
  56. #define MVRTC_YEAR_MSK 0xff
  57. #endif