pcmcia.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2000-2004
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. */
  6. #ifndef _PCMCIA_H
  7. #define _PCMCIA_H
  8. #include <common.h>
  9. #include <config.h>
  10. /*
  11. * Allow configuration to select PCMCIA slot,
  12. * or try to generate a useful default
  13. */
  14. #if defined(CONFIG_CMD_PCMCIA)
  15. #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B)
  16. # error "PCMCIA Slot not configured"
  17. #endif /* !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B) */
  18. /* Make sure exactly one slot is defined - we support only one for now */
  19. #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B)
  20. #error Neither CONFIG_PCMCIA_SLOT_A nor CONFIG_PCMCIA_SLOT_B configured
  21. #endif
  22. #if defined(CONFIG_PCMCIA_SLOT_A) && defined(CONFIG_PCMCIA_SLOT_B)
  23. #error Both CONFIG_PCMCIA_SLOT_A and CONFIG_PCMCIA_SLOT_B configured
  24. #endif
  25. #ifndef PCMCIA_SOCKETS_NO
  26. #define PCMCIA_SOCKETS_NO 1
  27. #endif
  28. #ifndef PCMCIA_MEM_WIN_NO
  29. #define PCMCIA_MEM_WIN_NO 4
  30. #endif
  31. #define PCMCIA_IO_WIN_NO 2
  32. /* define _slot_ to be able to optimize macros */
  33. #ifdef CONFIG_PCMCIA_SLOT_A
  34. # define _slot_ 0
  35. # define PCMCIA_SLOT_MSG "slot A"
  36. # define PCMCIA_SLOT_x PCMCIA_PSLOT_A
  37. #else
  38. # define _slot_ 1
  39. # define PCMCIA_SLOT_MSG "slot B"
  40. # define PCMCIA_SLOT_x PCMCIA_PSLOT_B
  41. #endif
  42. /*
  43. * This structure is used to address each window in the PCMCIA controller.
  44. *
  45. * Keep in mind that we assume that pcmcia_win_t[n+1] is mapped directly
  46. * after pcmcia_win_t[n]...
  47. */
  48. typedef struct {
  49. ulong br;
  50. ulong or;
  51. } pcmcia_win_t;
  52. /**********************************************************************/
  53. /*
  54. * CIS Tupel codes
  55. */
  56. #define CISTPL_NULL 0x00
  57. #define CISTPL_DEVICE 0x01
  58. #define CISTPL_LONGLINK_CB 0x02
  59. #define CISTPL_INDIRECT 0x03
  60. #define CISTPL_CONFIG_CB 0x04
  61. #define CISTPL_CFTABLE_ENTRY_CB 0x05
  62. #define CISTPL_LONGLINK_MFC 0x06
  63. #define CISTPL_BAR 0x07
  64. #define CISTPL_PWR_MGMNT 0x08
  65. #define CISTPL_EXTDEVICE 0x09
  66. #define CISTPL_CHECKSUM 0x10
  67. #define CISTPL_LONGLINK_A 0x11
  68. #define CISTPL_LONGLINK_C 0x12
  69. #define CISTPL_LINKTARGET 0x13
  70. #define CISTPL_NO_LINK 0x14
  71. #define CISTPL_VERS_1 0x15
  72. #define CISTPL_ALTSTR 0x16
  73. #define CISTPL_DEVICE_A 0x17
  74. #define CISTPL_JEDEC_C 0x18
  75. #define CISTPL_JEDEC_A 0x19
  76. #define CISTPL_CONFIG 0x1a
  77. #define CISTPL_CFTABLE_ENTRY 0x1b
  78. #define CISTPL_DEVICE_OC 0x1c
  79. #define CISTPL_DEVICE_OA 0x1d
  80. #define CISTPL_DEVICE_GEO 0x1e
  81. #define CISTPL_DEVICE_GEO_A 0x1f
  82. #define CISTPL_MANFID 0x20
  83. #define CISTPL_FUNCID 0x21
  84. #define CISTPL_FUNCE 0x22
  85. #define CISTPL_SWIL 0x23
  86. #define CISTPL_END 0xff
  87. /*
  88. * CIS Function ID codes
  89. */
  90. #define CISTPL_FUNCID_MULTI 0x00
  91. #define CISTPL_FUNCID_MEMORY 0x01
  92. #define CISTPL_FUNCID_SERIAL 0x02
  93. #define CISTPL_FUNCID_PARALLEL 0x03
  94. #define CISTPL_FUNCID_FIXED 0x04
  95. #define CISTPL_FUNCID_VIDEO 0x05
  96. #define CISTPL_FUNCID_NETWORK 0x06
  97. #define CISTPL_FUNCID_AIMS 0x07
  98. #define CISTPL_FUNCID_SCSI 0x08
  99. /*
  100. * Fixed Disk FUNCE codes
  101. */
  102. #define CISTPL_IDE_INTERFACE 0x01
  103. #define CISTPL_FUNCE_IDE_IFACE 0x01
  104. #define CISTPL_FUNCE_IDE_MASTER 0x02
  105. #define CISTPL_FUNCE_IDE_SLAVE 0x03
  106. /* First feature byte */
  107. #define CISTPL_IDE_SILICON 0x04
  108. #define CISTPL_IDE_UNIQUE 0x08
  109. #define CISTPL_IDE_DUAL 0x10
  110. /* Second feature byte */
  111. #define CISTPL_IDE_HAS_SLEEP 0x01
  112. #define CISTPL_IDE_HAS_STANDBY 0x02
  113. #define CISTPL_IDE_HAS_IDLE 0x04
  114. #define CISTPL_IDE_LOW_POWER 0x08
  115. #define CISTPL_IDE_REG_INHIBIT 0x10
  116. #define CISTPL_IDE_HAS_INDEX 0x20
  117. #define CISTPL_IDE_IOIS16 0x40
  118. #endif
  119. #endif /* _PCMCIA_H */