You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.3 KiB

  1. m4_divert(`-1')
  2. /***************************************************************************
  3. * Copyright (C) 2008 Lou Deluxe *
  4. * lou.openocd012@fixit.nospammail.net *
  5. * *
  6. * This program is free software; you can redistribute it and/or modify *
  7. * it under the terms of the GNU General Public License as published by *
  8. * the Free Software Foundation; either version 2 of the License, or *
  9. * (at your option) any later version. *
  10. * *
  11. * This program is distributed in the hope that it will be useful, *
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  14. * GNU General Public License for more details. *
  15. * *
  16. * You should have received a copy of the GNU General Public License *
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  18. ***************************************************************************/
  19. m4_undefine(`CTRL_MPEG_L')
  20. m4_undefine(`CTRL_CARD_L')
  21. m4_ifelse(SHIFTER_PRESCALER, 1, `
  22. m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x0')')
  23. ')
  24. m4_ifelse(SHIFTER_PRESCALER, 2, `
  25. m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x2')')
  26. m4_define(`CTRL_CARD_L', `m4_eval(`0x8 | 0x1')')
  27. ')
  28. m4_ifelse(SHIFTER_PRESCALER, 8, `
  29. m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x3')')
  30. ')
  31. m4_ifelse(SHIFTER_PRESCALER, 11, `
  32. m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x4')')
  33. ')
  34. m4_ifelse(SHIFTER_PRESCALER, 64, `
  35. m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x7')')
  36. ')
  37. m4_ifdef(`CTRL_MPEG_L',,`
  38. m4_errprint(`SHIFTER_PRESCALER was not defined with a supported value
  39. ') m4_m4exit(`1')
  40. ')
  41. m4_divert(`0')m4_dnl
  42. init:
  43. A.H = 0
  44. A.L = 0
  45. DR_MPEG = A ; TDI and TCK start out low
  46. DR_CARD = A ; TMS starts out low
  47. A.L = 0x6
  48. CTRL_FCI = A ; MPEG and CARD driven by FCI
  49. DDR_MPEG = A ; TDI and TCK are outputs
  50. A.L = 0x1
  51. X = A ; X == 1
  52. DDR_CARD = A ; TMS is output
  53. A.L = CTRL_MPEG_L
  54. CTRL_MPEG = A
  55. m4_ifdef(`CTRL_CARD_L',
  56. ` A.L = 'CTRL_CARD_L`
  57. ')m4_dnl
  58. CTRL_CARD = A
  59. STATUS STOP