regs-timrot.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * stmp378x: TIMROT register definitions
  3. *
  4. * Copyright (c) 2008 Freescale Semiconductor
  5. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef _MACH_REGS_TIMROT
  22. #define _MACH_REGS_TIMROT
  23. #define REGS_TIMROT_BASE (STMP3XXX_REGS_BASE + 0x68000)
  24. #define REGS_TIMROT_PHYS 0x80068000
  25. #define REGS_TIMROT_SIZE 0x2000
  26. #define HW_TIMROT_ROTCTRL 0x0
  27. #define BM_TIMROT_ROTCTRL_SELECT_A 0x00000007
  28. #define BP_TIMROT_ROTCTRL_SELECT_A 0
  29. #define BM_TIMROT_ROTCTRL_SELECT_B 0x00000070
  30. #define BP_TIMROT_ROTCTRL_SELECT_B 4
  31. #define BM_TIMROT_ROTCTRL_POLARITY_A 0x00000100
  32. #define BM_TIMROT_ROTCTRL_POLARITY_B 0x00000200
  33. #define BM_TIMROT_ROTCTRL_OVERSAMPLE 0x00000C00
  34. #define BP_TIMROT_ROTCTRL_OVERSAMPLE 10
  35. #define BM_TIMROT_ROTCTRL_RELATIVE 0x00001000
  36. #define BM_TIMROT_ROTCTRL_DIVIDER 0x003F0000
  37. #define BP_TIMROT_ROTCTRL_DIVIDER 16
  38. #define BM_TIMROT_ROTCTRL_ROTARY_PRESENT 0x20000000
  39. #define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000
  40. #define BM_TIMROT_ROTCTRL_SFTRST 0x80000000
  41. #define HW_TIMROT_ROTCOUNT 0x10
  42. #define BM_TIMROT_ROTCOUNT_UPDOWN 0x0000FFFF
  43. #define BP_TIMROT_ROTCOUNT_UPDOWN 0
  44. #define HW_TIMROT_TIMCTRL0 (0x20 + 0 * 0x20)
  45. #define HW_TIMROT_TIMCTRL1 (0x20 + 1 * 0x20)
  46. #define HW_TIMROT_TIMCTRL2 (0x20 + 2 * 0x20)
  47. #define HW_TIMROT_TIMCTRLn 0x20
  48. #define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
  49. #define BP_TIMROT_TIMCTRLn_SELECT 0
  50. #define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
  51. #define BP_TIMROT_TIMCTRLn_PRESCALE 4
  52. #define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
  53. #define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
  54. #define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
  55. #define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
  56. #define HW_TIMROT_TIMCOUNT0 (0x30 + 0 * 0x20)
  57. #define HW_TIMROT_TIMCOUNT1 (0x30 + 1 * 0x20)
  58. #define HW_TIMROT_TIMCOUNT2 (0x30 + 2 * 0x20)
  59. #define HW_TIMROT_TIMCOUNTn 0x30
  60. #endif