amccs5933.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /***************************************************************************
  2. nec7210/amccs5933.h
  3. -------------------
  4. Registers and bits for amccs5933 pci chip
  5. begin : Jan 2002
  6. copyright : (C) 2002 by Frank Mori Hess
  7. email : fmhess@users.sourceforge.net
  8. ***************************************************************************/
  9. /***************************************************************************
  10. * *
  11. * This program is free software; you can redistribute it and/or modify *
  12. * it under the terms of the GNU General Public License as published by *
  13. * the Free Software Foundation; either version 2 of the License, or *
  14. * (at your option) any later version. *
  15. * *
  16. ***************************************************************************/
  17. #ifndef _AMCCS5933_H
  18. #define _AMCCS5933_H
  19. // register offsets
  20. enum
  21. {
  22. MBEF_REG = 0x34, // mailbux empty/full
  23. INTCSR_REG = 0x38, // interrupt control and status
  24. BMCSR_REG = 0x3c, // bus master control and status
  25. };
  26. // incoming mailbox 0-3 register offsets
  27. extern inline int INCOMING_MAILBOX_REG(unsigned int mailbox)
  28. {
  29. return (0x10 + 4 * mailbox);
  30. };
  31. // bit definitions
  32. // INTCSR bits
  33. enum
  34. {
  35. OUTBOX_EMPTY_INTR_BIT = 0x10, // enable outbox empty interrupt
  36. INBOX_FULL_INTR_BIT = 0x1000, // enable inbox full interrupt
  37. INBOX_INTR_CS_BIT = 0x20000, // read, or write clear inbox full interrupt
  38. INTR_ASSERTED_BIT = 0x800000, // read only, interrupt asserted
  39. };
  40. // select byte 0 to 3 of incoming mailbox
  41. extern inline int INBOX_BYTE_BITS(unsigned int byte)
  42. {
  43. return (byte & 0x3) << 8;
  44. };
  45. // select incoming mailbox 0 to 3
  46. extern inline int INBOX_SELECT_BITS(unsigned int mailbox)
  47. {
  48. return (mailbox & 0x3) << 10;
  49. };
  50. // select byte 0 to 3 of outgoing mailbox
  51. extern inline int OUTBOX_BYTE_BITS(unsigned int byte)
  52. {
  53. return (byte & 0x3);
  54. };
  55. // select outgoing mailbox 0 to 3
  56. extern inline int OUTBOX_SELECT_BITS(unsigned int mailbox)
  57. {
  58. return (mailbox & 0x3) << 2;
  59. };
  60. //BMCSR bits
  61. enum
  62. {
  63. MBOX_FLAGS_RESET_BIT = 0x08000000, // resets mailbox empty/full flags
  64. };
  65. #endif // _AMCCS5933_H