pn62.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * (C) Copyright 2002 Wolfgang Grandegger <wg@denx.de>
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef _PN62_H_
  23. #define _PN62_H_
  24. /*
  25. * Definitions for the Intel Bridge 21554 or 21555.
  26. */
  27. #define I2155X_VPD_ADDR 0xe6
  28. #define I2155X_VPD_DATA 0xe8
  29. #define I2155X_VPD_START 0x80
  30. #define I2155X_VPD_SN_START 0x80
  31. #define I2155X_VPD_SN_SIZE 0x10
  32. #define I2155X_VPD_MAC0_START 0x90
  33. #define I2155X_VPD_MAC1_START 0x96
  34. #define I2155X_SCRAPAD_ADDR 0xa8
  35. #define I2155X_SCRAPAD_MAX 8
  36. #define I2155X_BAR2_BASE 0x98
  37. #define I2155X_BAR3_BASE 0x9c
  38. #define I2155X_BAR4_BASE 0xa0
  39. #define I2155X_BAR2_SETUP 0xb0
  40. #define I2155X_BAR3_SETUP 0xb4
  41. #define I2155X_BAR4_SETUP 0xb8
  42. /*
  43. * Interrupt request numbers
  44. */
  45. #define PN62_IRQ_HOST 0x0
  46. #define PN62_IRQ_PLX9054 0x1
  47. #define PN62_IRQ_ETH0 0x2
  48. #define PN62_IRQ_ETH1 0x3
  49. #define PN62_IRQ_COM1 0x4
  50. #define PN62_IRQ_COM2 0x4
  51. /*
  52. * Miscellaneous definitons.
  53. */
  54. #define PN62_SMEM_DEFAULT 0x1f00000
  55. /*
  56. * Definitions for boot protocol using Scratchpad registers.
  57. */
  58. #define BOOT_DONE 0
  59. #define BOOT_DONE_CLEAR 0x00dead00
  60. #define BOOT_DONE_ERROR 0xbad0dead
  61. #define BOOT_DONE_U_BOOT 0x12345678
  62. #define BOOT_DONE_LINUX 0x87654321
  63. #define BOOT_CMD 1
  64. #define BOOT_CMD_MOVE 0x1
  65. #define BOOT_CMD_BOOT 0x2
  66. #define BOOT_DATA 2
  67. #define BOOT_PROTO 3
  68. #define BOOT_PROTO_READY 0x23456789
  69. #define BOOT_PROTO_CLEAR 0x00000000
  70. #define BOOT_STATUS 4
  71. /*
  72. * LED Definitions:
  73. */
  74. #define PN62_LED_BASE 0xff800300
  75. #define PN62_LED_MAX 12
  76. /*
  77. * LED0 - 7 mounted on top of board, D1 - D8
  78. * LED8 - 11 upper four LEDs on the front panel of the board.
  79. */
  80. #define LED_0 0x00 /* OFF */
  81. #define LED_1 0x01 /* ON */
  82. #define LED_SLOW_CLOCK 0x02 /* SLOW 1Hz ish */
  83. #define LED_nSLOW_CLOCK 0x03 /* inverse of above */
  84. #define LED_WATCHDOG_OUT 0x06 /* Reset Watchdog level */
  85. #define LED_WATCHDOG_CLOCK 0x07 /* clock to watchdog */
  86. /*
  87. * LED's currently setup in AMD79C973 device as the following:
  88. * LED0 100Mbit
  89. * LED1 LNKSE
  90. * LED2 TX Activity
  91. * LED3 RX Activity
  92. */
  93. #define LED_E0_LED0 0x08 /* Ethernet Port 0 LED 0 */
  94. #define LED_E0_LED1 0x09 /* Ethernet Port 0 LED 1 */
  95. #define LED_E0_LED2 0x0A /* Ethernet Port 0 LED 2 */
  96. #define LED_E0_LED3 0x0B /* Ethernet Port 0 LED 3 */
  97. #define LED_E1_LED0 0x0C /* Ethernet Port 1 LED 0 */
  98. #define LED_E1_LED1 0x0D /* Ethernet Port 1 LED 1 */
  99. #define LED_E1_LED2 0x0E /* Ethernet Port 1 LED 2 */
  100. #define LED_E1_LED3 0x0F /* Ethernet Port 1 LED 3 */
  101. #define LED_STROBE0 0x10 /* Processor Strobe 0 */
  102. #define LED_STROBE1 0x11 /* Processor Strobe 1 */
  103. #define LED_STROBE2 0x12 /* Processor Strobe 2 */
  104. #define LED_STROBE3 0x13 /* Processor Strobe 3 */
  105. #define LED_STROBE4 0x14 /* Processor Strobe 4 */
  106. #define LED_STROBE5 0x15 /* Processor Strobe 5 */
  107. #define LED_STROBE6 0x16 /* Processor Strobe 6 */
  108. #define LED_STROBE7 0x17 /* Processor Strobe 7 */
  109. #define LED_HOST_STROBE0 0x18 /* Host strobe 0 */
  110. #define LED_HOST_STROBE1 0x19 /* Host strobe 1 */
  111. #define LED_HOST_STROBE2 0x1A /* Host strobe 2 */
  112. #define LED_HOST_STROBE3 0x1B /* Host strobe 3 */
  113. #define LED_HOST_STROBE4 0x1C /* Host strobe 4 */
  114. #define LED_HOST_STROBE5 0x1D /* Host strobe 5 */
  115. #define LED_HOST_STROBE6 0x1E /* Host strobe 6 */
  116. #define LED_HOST_STROBE7 0x1F /* Host strobe 7 */
  117. #define LED_MPC_INT0 0x20 /* MPC8240 INT 0 */
  118. #define LED_MPC_INT1 0x21 /* MPC8240 INT 1 */
  119. #define LED_MPC_INT2 0x22 /* MPC8240 INT 2 */
  120. #define LED_MPC_INT3 0x23 /* MPC8240 INT 3 */
  121. #define LED_MPC_INT4 0x24 /* MPC8240 INT 4 */
  122. #define LED_UART0_CS 0x25 /* UART 0 Chip Select */
  123. #define LED_UART1_CS 0x26 /* UART 1 Chip Select */
  124. #define LED_SRAM_CS 0x27 /* SRAM Chip Select */
  125. #define LED_SRAM_WR 0x28 /* SRAM WR Signal */
  126. #define LED_SRAM_RD 0x29 /* SRAM RD Signal */
  127. #define LED_MPC_RCS0 0x2A /* MPC8240 RCS0 Signal */
  128. #define LED_S_PCI_FRAME 0x2B /* Secondary PCI Frame Signal */
  129. #define LED_MPC_CS0 0x2C /* MPC8240 CS0 Signal */
  130. #define LED_HOST_INT 0x2D /* MPC8240 to Host Interrupt signal */
  131. #define LED_LAST_FUNCTION LED_HOST_INT /* last function */
  132. /*
  133. * Forward declarations
  134. */
  135. int i2155x_init (void);
  136. void i2155x_write_scrapad(int idx, u32 val);
  137. u32 i2155x_read_scrapad (int idx);
  138. void i2155x_set_bar_base (int bar, u32 addr);
  139. int i2155x_read_vpd (int offset, int size, unsigned char *data);
  140. int am79c95x_init (void);
  141. void set_led (unsigned int number, unsigned int function);
  142. void fatal_error (unsigned int error_code);
  143. void show_startup_phase (int phase);
  144. #endif /* _PN62_H_ */