cogent_common.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /*
  2. * (C) Copyright 2000
  3. * Murray Jensen, CSIRO-MST
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _CONFIG_COGENT_COMMON_H
  24. #define _CONFIG_COGENT_COMMON_H
  25. /*
  26. * Cogent Motherboard Capabilities
  27. */
  28. #define CMA_MB_CAP_SERPAR 0x0001 /* has dual serial+parallel (16C552) */
  29. #define CMA_MB_CAP_LCD 0x0002 /* has LCD display (HD44780) */
  30. #define CMA_MB_CAP_FLASH 0x0004 /* has flash (E28F800B or AM29F800BB) */
  31. #define CMA_MB_CAP_RTC 0x0008 /* has RTC+NVRAM (MK48T02) */
  32. #define CMA_MB_CAP_ETHER 0x0010 /* has Ethernet (MB86964) */
  33. #define CMA_MB_CAP_SLOT1 0x0020 /* has CMABus slot 1 */
  34. #define CMA_MB_CAP_SLOT2 0x0040 /* has CMABus slot 2 */
  35. #define CMA_MB_CAP_SLOT3 0x0080 /* has CMABus slot 3 */
  36. #define CMA_MB_CAP_KBM 0x0100 /* has PS/2 keyboard+mouse (HT6542B) */
  37. #define CMA_MB_CAP_SER2 0x0200 /* has 2nd dual serial (16C2552) */
  38. #define CMA_MB_CAP_PCI 0x0400 /* has pci bridge (V360EPC) */
  39. #define CMA_MB_CAP_PCI_EXT 0x0800 /* can access extended pci space */
  40. #define CMA_MB_CAP_PCI_ETHER 0x1000 /* has 10/100 ether on PCI (GD82559) */
  41. #define CMA_MB_CAP_PCI_VIDEO 0x2000 /* has video int'face on PCI (B69000) */
  42. #define CMA_MB_CAP_PCI_CARDBUS 0x4000 /* has Cardbus Ctlr on PCI (PD6832) */
  43. /*
  44. * Cogent option sanity checking
  45. */
  46. #if defined(CONFIG_MPC821) || defined(CONFIG_MPC823) || \
  47. defined(CONFIG_MPC850) || defined(CONFIG_MPC860)
  48. /*
  49. * check a PowerPC 8xx cpu module has been selected
  50. */
  51. # if defined(CONFIG_CMA286_21)
  52. # define COGENT_CPU_MODULE "CMA286-21"
  53. # elif defined(CONFIG_CMA286_60_OLD)
  54. # define COGENT_CPU_MODULE "CMA286-60 (old)"
  55. # elif defined(CONFIG_CMA286_60)
  56. # define COGENT_CPU_MODULE "CMA286-60"
  57. # elif defined(CONFIG_CMA286_60P)
  58. # define COGENT_CPU_MODULE "CMA286-60P"
  59. # elif defined(CONFIG_CMA287_21)
  60. # define COGENT_CPU_MODULE "CMA287-21"
  61. # elif defined(CONFIG_CMA287_50)
  62. # define COGENT_CPU_MODULE "CMA287-50"
  63. # else
  64. # error Cogent CPU Module must be a PowerPC MPC8xx module
  65. # endif
  66. #elif defined(CONFIG_MPC8260)
  67. /*
  68. * check a PowerPC 8260 cpu module has been selected
  69. */
  70. # if defined(CONFIG_CMA282)
  71. # define COGENT_CPU_MODULE "CMA282"
  72. # else
  73. # error Cogent CPU Module must be a PowerPC MPC8260 module
  74. # endif
  75. #else
  76. # error CPU type must be PowerPC 8xx or 8260
  77. #endif
  78. /*
  79. * check a motherboard has been selected
  80. * define the motherboard capabilities while we're at it
  81. */
  82. #if defined(CONFIG_CMA101)
  83. # define COGENT_MOTHERBOARD "CMA101"
  84. # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
  85. CMA_MB_CAP_RTC | CMA_MB_CAP_ETHER | \
  86. CMA_MB_CAP_SLOT1 | CMA_MB_CAP_SLOT2 | \
  87. CMA_MB_CAP_SLOT3)
  88. # define CMA_MB_NSLOTS 3
  89. #elif defined(CONFIG_CMA102)
  90. # define COGENT_MOTHERBOARD "CMA102"
  91. # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
  92. CMA_MB_CAP_RTC | CMA_MB_CAP_SLOT1 | \
  93. CMA_MB_CAP_SLOT2 | CMA_MB_CAP_SLOT3)
  94. # define CMA_MB_NSLOTS 3
  95. #elif defined(CONFIG_CMA110)
  96. # define COGENT_MOTHERBOARD "CMA110"
  97. # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
  98. CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
  99. CMA_MB_CAP_KBM | CMA_MB_CAP_PCI)
  100. # define CMA_MB_NSLOTS 0
  101. #elif defined(CONFIG_CMA111)
  102. # define COGENT_MOTHERBOARD "CMA111"
  103. # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
  104. CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
  105. CMA_MB_CAP_SLOT1 | CMA_MB_CAP_KBM | \
  106. CMA_MB_CAP_PCI | CMA_MB_CAP_PCI_EXT | \
  107. CMA_MB_CAP_PCI_ETHER)
  108. # define CMA_MB_NSLOTS 1
  109. #elif defined(CONFIG_CMA120)
  110. # define COGENT_MOTHERBOARD "CMA120"
  111. # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
  112. CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
  113. CMA_MB_CAP_SLOT1 | CMA_MB_CAP_KBM | \
  114. CMA_MB_CAP_SER2 | CMA_MB_CAP_PCI | \
  115. CMA_MB_CAP_PCI_EXT | CMA_MB_CAP_PCI_ETHER | \
  116. CMA_MB_CAP_PCI_VIDEO | CMA_MB_CAP_PCI_CARDBUS)
  117. # define CMA_MB_NSLOTS 1
  118. #elif defined(CONFIG_CMA150)
  119. # define COGENT_MOTHERBOARD "CMA150"
  120. # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
  121. CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
  122. CMA_MB_CAP_KBM)
  123. # define CMA_MB_NSLOTS 0
  124. #else
  125. # error Cogent Motherboard either unsupported or undefined
  126. #endif
  127. /*
  128. * check a flash i/o module has been selected if no flash on m/b
  129. */
  130. #if defined(CONFIG_CMA302)
  131. # define COGENT_FLASH_MODULE "CMA302"
  132. #elif (CMA_MB_CAPS & CMA_MB_CAP_FLASH) == 0
  133. # error Cogent Flash I/O module (e.g. CMA302) is required with this Motherboard
  134. #endif
  135. /*
  136. * some further sanity checks
  137. */
  138. #if (CMA_MB_CAPS & CMA_MB_CAP_PCI) && (CMA_MB_CAPS & CMA_MB_CAP_SLOT2)
  139. #error Cogent Sanity Check: Both Slot2 and PCI are defined
  140. #endif
  141. #if (CMA_MB_CAPS & CMA_MB_CAP_PCI_EXT) && !(CMA_MB_CAPS & CMA_MB_CAP_PCI)
  142. #error Extended PCI capability defined without PCI capability
  143. #endif
  144. #if (CMA_MB_CAPS & CMA_MB_CAP_PCI_ETHER) && !(CMA_MB_CAPS & CMA_MB_CAP_PCI)
  145. #error Motherboard ethernet capability defined without PCI capability
  146. #endif
  147. #if (CMA_MB_CAPS & CMA_MB_CAP_SER2) && !(CMA_MB_CAPS & CMA_MB_CAP_SERPAR)
  148. #error 2nd dual serial capability defined without serial/parallel capability
  149. #endif
  150. #include "../board/cogent/mb.h"
  151. #endif /* _CONFIG_COGENT_COMMON_H */