apollohw.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* apollohw.h : some structures to access apollo HW */
  2. #ifndef _ASMm68k_APOLLOHW_H_
  3. #define _ASMm68k_APOLLOHW_H_
  4. #include <linux/types.h>
  5. /*
  6. apollo models
  7. */
  8. extern u_long apollo_model;
  9. #define APOLLO_UNKNOWN (0)
  10. #define APOLLO_DN3000 (1)
  11. #define APOLLO_DN3010 (2)
  12. #define APOLLO_DN3500 (3)
  13. #define APOLLO_DN4000 (4)
  14. #define APOLLO_DN4500 (5)
  15. /*
  16. see scn2681 data sheet for more info.
  17. member names are read_write.
  18. */
  19. #define DECLARE_2681_FIELD(x) unsigned char x; unsigned char dummy##x
  20. struct SCN2681 {
  21. DECLARE_2681_FIELD(mra);
  22. DECLARE_2681_FIELD(sra_csra);
  23. DECLARE_2681_FIELD(BRGtest_cra);
  24. DECLARE_2681_FIELD(rhra_thra);
  25. DECLARE_2681_FIELD(ipcr_acr);
  26. DECLARE_2681_FIELD(isr_imr);
  27. DECLARE_2681_FIELD(ctu_ctur);
  28. DECLARE_2681_FIELD(ctl_ctlr);
  29. DECLARE_2681_FIELD(mrb);
  30. DECLARE_2681_FIELD(srb_csrb);
  31. DECLARE_2681_FIELD(tst_crb);
  32. DECLARE_2681_FIELD(rhrb_thrb);
  33. DECLARE_2681_FIELD(reserved);
  34. DECLARE_2681_FIELD(ip_opcr);
  35. DECLARE_2681_FIELD(startCnt_setOutBit);
  36. DECLARE_2681_FIELD(stopCnt_resetOutBit);
  37. };
  38. struct mc146818 {
  39. unsigned char second, alarm_second;
  40. unsigned char minute, alarm_minute;
  41. unsigned char hours, alarm_hours;
  42. unsigned char day_of_week, day_of_month;
  43. unsigned char month, year;
  44. };
  45. #define IO_BASE 0x80000000
  46. extern u_long sio01_physaddr;
  47. extern u_long sio23_physaddr;
  48. extern u_long rtc_physaddr;
  49. extern u_long pica_physaddr;
  50. extern u_long picb_physaddr;
  51. extern u_long cpuctrl_physaddr;
  52. extern u_long timer_physaddr;
  53. #define SAU7_SIO01_PHYSADDR 0x10400
  54. #define SAU7_SIO23_PHYSADDR 0x10500
  55. #define SAU7_RTC_PHYSADDR 0x10900
  56. #define SAU7_PICA 0x11000
  57. #define SAU7_PICB 0x11100
  58. #define SAU7_CPUCTRL 0x10100
  59. #define SAU7_TIMER 0x010800
  60. #define SAU8_SIO01_PHYSADDR 0x8400
  61. #define SAU8_RTC_PHYSADDR 0x8900
  62. #define SAU8_PICA 0x9400
  63. #define SAU8_PICB 0x9500
  64. #define SAU8_CPUCTRL 0x8100
  65. #define SAU8_TIMER 0x8800
  66. #define sio01 ((*(volatile struct SCN2681 *)(IO_BASE + sio01_physaddr)))
  67. #define sio23 ((*(volatile struct SCN2681 *)(IO_BASE + sio23_physaddr)))
  68. #define rtc (((volatile struct mc146818 *)(IO_BASE + rtc_physaddr)))
  69. #define cpuctrl (*(volatile unsigned int *)(IO_BASE + cpuctrl_physaddr))
  70. #define pica (IO_BASE + pica_physaddr)
  71. #define picb (IO_BASE + picb_physaddr)
  72. #define apollo_timer (IO_BASE + timer_physaddr)
  73. #define addr_xlat_map ((unsigned short *)(IO_BASE + 0x17000))
  74. #define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE)
  75. #define IRQ_APOLLO IRQ_USER
  76. #endif