gs232.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Misc define for GS232
  3. *
  4. * Copyright (c) 2006-2021, RT-Thread Development Team
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. *
  8. * Change Logs:
  9. * Date Author Notes
  10. * 2019-12-04 Jiaxun Yang Initial version
  11. */
  12. #ifndef __GS232_H__
  13. #define __GS232_H__
  14. #include <mips.h>
  15. #define INTC_BASE 0xBFD01040
  16. #ifdef SOC_LS1B
  17. #define GS232_INTC_CELLS 4
  18. #endif
  19. #ifdef SOC_LS1C300
  20. #define GS232_INTC_CELLS 5
  21. #endif
  22. #define GS232_NR_IRQS (32 * GS232_INTC_CELLS)
  23. #define GMAC0_BASE 0xBFE10000
  24. #define GMAC0_DMA_BASE 0xBFE11000
  25. #define GMAC1_BASE 0xBFE20000
  26. #define GMAC1_DMA_BASE 0xBFE21000
  27. #define I2C0_BASE 0xBFE58000
  28. #define PWM0_BASE 0xBFE5C000
  29. #define PWM1_BASE 0xBFE5C010
  30. #define PWM2_BASE 0xBFE5C020
  31. #define PWM3_BASE 0xBFE5C030
  32. #define WDT_BASE 0xBFE5C060
  33. #define RTC_BASE 0xBFE64000
  34. #define I2C1_BASE 0xBFE68000
  35. #define I2C2_BASE 0xBFE70000
  36. #define AC97_BASE 0xBFE74000
  37. #define NAND_BASE 0xBFE78000
  38. #define SPI_BASE 0xBFE80000
  39. #define CAN1_BASE 0xBF004300
  40. #define CAN0_BASE 0xBF004400
  41. #ifndef __ASSEMBLY__
  42. #include <rthw.h>
  43. /* Watch Dog registers */
  44. #define WDT_EN HWREG32(WDT_BASE + 0x00)
  45. #define WDT_SET HWREG32(WDT_BASE + 0x08)
  46. #define WDT_TIMER HWREG32(WDT_BASE + 0x04)
  47. #define PLL_FREQ HWREG32(0xbfe78030)
  48. #define PLL_DIV_PARAM HWREG32(0xbfe78034)
  49. struct gs232_intc_regs
  50. {
  51. volatile unsigned int int_isr;
  52. volatile unsigned int int_en;
  53. volatile unsigned int int_set;
  54. volatile unsigned int int_clr; /* offset 0x10*/
  55. volatile unsigned int int_pol;
  56. volatile unsigned int int_edge; /* offset 0 */
  57. };
  58. extern void rt_hw_timer_init(void);
  59. #endif
  60. #endif