ls1b.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * File : ls1b.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006-2011, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-08-08 lgnq first version
  13. */
  14. #ifndef __LS1B_H__
  15. #define __LS1B_H__
  16. #include "../common/mipsregs.h"
  17. #define LS1B_ACPI_IRQ 0
  18. #define LS1B_HPET_IRQ 1
  19. #define LS1B_UART0_IRQ 2
  20. #define LS1B_UART1_IRQ 3
  21. #define LS1B_UART2_IRQ 4
  22. #define LS1B_UART3_IRQ 5
  23. #define LS1B_CAN0_IRQ 6
  24. #define LS1B_CAN1_IRQ 7
  25. #define LS1B_SPI0_IRQ 8
  26. #define LS1B_SPI1_IRQ 9
  27. #define LS1B_AC97_IRQ 10
  28. #define LS1B_MS_IRQ 11
  29. #define LS1B_KB_IRQ 12
  30. #define LS1B_DMA0_IRQ 13
  31. #define LS1B_DMA1_IRQ 14
  32. #define LS1B_NAND_IRQ 15
  33. #define LS1B_I2C0_IRQ 16
  34. #define LS1B_I2C1_IRQ 17
  35. #define LS1B_PWM0_IRQ 18
  36. #define LS1B_PWM1_IRQ 19
  37. #define LS1B_PWM2_IRQ 20
  38. #define LS1B_PWM3_IRQ 21
  39. #define LS1B_LPC_IRQ 22
  40. #define LS1B_EHCI_IRQ 32
  41. #define LS1B_OHCI_IRQ 33
  42. #define LS1B_GMAC1_IRQ 34
  43. #define LS1B_GMAC2_IRQ 35
  44. #define LS1B_SATA_IRQ 36
  45. #define LS1B_GPU_IRQ 37
  46. #define LS1B_PCI_INTA_IRQ 38
  47. #define LS1B_PCI_INTB_IRQ 39
  48. #define LS1B_PCI_INTC_IRQ 40
  49. #define LS1B_PCI_INTD_IRQ 41
  50. #define LS1B_GPIO_IRQ 64
  51. #define LS1B_GPIO_FIRST_IRQ 64
  52. #define LS1B_GPIO_IRQ_COUNT 96
  53. #define LS1B_GPIO_LAST_IRQ (LS1B_GPIO_FIRST_IRQ + LS1B_GPIO_IRQ_COUNT-1)
  54. #define INT_PCI_INTA (1<<6)
  55. #define INT_PCI_INTB (1<<7)
  56. #define INT_PCI_INTC (1<<8)
  57. #define INT_PCI_INTD (1<<9)
  58. #define LS1B_LAST_IRQ 159
  59. #define MIPS_CPU_TIMER_IRQ 167
  60. #define LS1B_INTREG_BASE 0xbfd01040
  61. #define LS1B_DMA_IRQ_BASE 168
  62. #define LS1B_DMA_IRQ_COUNT 16
  63. struct ls1b_intc_regs
  64. {
  65. volatile unsigned int int_isr;
  66. volatile unsigned int int_en;
  67. volatile unsigned int int_set;
  68. volatile unsigned int int_clr; /* offset 0x10*/
  69. volatile unsigned int int_pol;
  70. volatile unsigned int int_edge; /* offset 0 */
  71. };
  72. struct ls1b_cop_global_regs
  73. {
  74. volatile unsigned int control;
  75. volatile unsigned int rd_inten;
  76. volatile unsigned int wr_inten;
  77. volatile unsigned int rd_intisr; /* offset 0x10*/
  78. volatile unsigned int wr_intisr;
  79. unsigned int unused[11];
  80. } ;
  81. struct ls1b_cop_channel_regs
  82. {
  83. volatile unsigned int rd_control;
  84. volatile unsigned int rd_src;
  85. volatile unsigned int rd_cnt;
  86. volatile unsigned int rd_status; /* offset 0x10*/
  87. volatile unsigned int wr_control;
  88. volatile unsigned int wr_src;
  89. volatile unsigned int wr_cnt;
  90. volatile unsigned int wr_status; /* offset 0x10*/
  91. } ;
  92. struct ls1b_cop_regs
  93. {
  94. struct ls1b_cop_global_regs global;
  95. struct ls1b_cop_channel_regs chan[8][2];
  96. } ;
  97. #define __REG8(addr) *((volatile unsigned char *)(addr))
  98. #define __REG16(addr) *((volatile unsigned short *)(addr))
  99. #define __REG32(addr) *((volatile unsigned int *)(addr))
  100. #define GMAC0_BASE 0xBFE10000
  101. #define GMAC0_DMA_BASE 0xBFE11000
  102. #define GMAC1_BASE 0xBFE20000
  103. #define GMAC1_DMA_BASE 0xBFE21000
  104. #define I2C0_BASE 0xBFE58000
  105. #define PWM0_BASE 0xBFE5C000
  106. #define PWM1_BASE 0xBFE5C010
  107. #define PWM2_BASE 0xBFE5C020
  108. #define PWM3_BASE 0xBFE5C030
  109. #define WDT_BASE 0xBFE5C060
  110. #define RTC_BASE 0xBFE64000
  111. #define I2C1_BASE 0xBFE68000
  112. #define I2C2_BASE 0xBFE70000
  113. #define AC97_BASE 0xBFE74000
  114. #define NAND_BASE 0xBFE78000
  115. #define SPI_BASE 0xBFE80000
  116. #define CAN1_BASE 0xBF004300
  117. #define CAN0_BASE 0xBF004400
  118. /* Watch Dog registers */
  119. #define WDT_EN __REG32(WDT_BASE + 0x00)
  120. #define WDT_SET __REG32(WDT_BASE + 0x04)
  121. #define WDT_TIMER __REG32(WDT_BASE + 0x08)
  122. #define PLL_FREQ __REG32(0xbfe78030)
  123. #define PLL_DIV_PARAM __REG32(0xbfe78034)
  124. #endif