pip405.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /****************************************************************************
  8. * Global routines used for PIP405
  9. *****************************************************************************/
  10. #ifndef __ASSEMBLY__
  11. extern int mem_test(unsigned long start, unsigned long ramsize,int mode);
  12. void print_pip405_info(void);
  13. void user_led0(unsigned char on);
  14. void user_led1(unsigned char on);
  15. #define PLD_BASE_ADDRESS CONFIG_SYS_ISA_IO_BASE_ADDRESS + 0x800
  16. #define PLD_PART_REG PLD_BASE_ADDRESS + 0
  17. #define PLD_VERS_REG PLD_BASE_ADDRESS + 1
  18. #define PLD_BOARD_CFG_REG PLD_BASE_ADDRESS + 2
  19. #define PLD_LED_USER_REG PLD_BASE_ADDRESS + 3
  20. #define PLD_SYS_MAN_REG PLD_BASE_ADDRESS + 4
  21. #define PLD_FLASH_COM_REG PLD_BASE_ADDRESS + 5
  22. #define PLD_CAN_REG PLD_BASE_ADDRESS + 6
  23. #define PLD_SER_PWR_REG PLD_BASE_ADDRESS + 7
  24. #define PLD_COM_PWR_REG PLD_BASE_ADDRESS + 8
  25. #define PLD_NIC_VGA_REG PLD_BASE_ADDRESS + 9
  26. #define PLD_SCSI_RST_REG PLD_BASE_ADDRESS + 0xA
  27. #define PIIX4_VENDOR_ID 0x8086
  28. #define PIIX4_IDE_DEV_ID 0x7111
  29. #endif
  30. /* timings */
  31. /* CS Config register (CS7) */
  32. #define CONFIG_PORT_BME 0 /* Burst disable */
  33. #define CONFIG_PORT_TWE 255 /* 255 * 30ns 120ns Waitstates (access=TWT+1+TH) */
  34. #define CONFIG_PORT_CSN 1 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
  35. #define CONFIG_PORT_OEN 1 /* Cycles from CS low to OE low */
  36. #define CONFIG_PORT_WBN 1 /* Cycles from CS low to WE low */
  37. #define CONFIG_PORT_WBF 1 /* Cycles from WE high to CS high */
  38. #define CONFIG_PORT_TH 2 /* Number of hold cycles after transfer */
  39. #define CONFIG_PORT_RE 0 /* Ready disabled */
  40. #define CONFIG_PORT_SOR 1 /* Sample on Ready disabled */
  41. #define CONFIG_PORT_BEM 0 /* Byte Write only active on Write cycles */
  42. #define CONFIG_PORT_PEN 0 /* Parity disable */
  43. #define CONFIG_PORT_AP ((CONFIG_PORT_BME << 31) + (CONFIG_PORT_TWE << 23) + (CONFIG_PORT_CSN << 18) + (CONFIG_PORT_OEN << 16) + (CONFIG_PORT_WBN << 14) + \
  44. (CONFIG_PORT_WBF << 12) + (CONFIG_PORT_TH << 9) + (CONFIG_PORT_RE << 8) + (CONFIG_PORT_SOR << 7) + (CONFIG_PORT_BEM << 6) + (CONFIG_PORT_PEN << 5))
  45. /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
  46. #define CONFIG_PORT_BS 0 /* 1 MByte */
  47. /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
  48. #define CONFIG_PORT_BU 3 /* R/W */
  49. /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
  50. #define CONFIG_PORT_BW 0 /* 16Bit */
  51. #define CONFIG_PORT_CR ((CONFIG_PORT_ADDR & 0xfff00000) + (CONFIG_PORT_BS << 17) + (CONFIG_PORT_BU << 15) + (CONFIG_PORT_BW << 13))
  52. /* Flash CS0 or CS 1 */
  53. /* 0x7F8FFE80 slowest timing at all... */
  54. #define FLASH_BME_B 1 /* Burst enable */
  55. #define FLASH_FWT_B 0x6 /* 6 * 30ns 210ns First Wait Access */
  56. #define FLASH_BWT_B 0x6 /* 6 * 30ns 210ns Burst Wait Access */
  57. #define FLASH_BME 0 /* Burst disable */
  58. #define FLASH_TWE 0xb/* 11 * 30ns 330ns Waitstates (access=TWT+1+TH) */
  59. #define FLASH_CSN 0 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
  60. #define FLASH_OEN 1 /* Cycles from CS low to OE low */
  61. #define FLASH_WBN 1 /* Cycles from CS low to WE low */
  62. #define FLASH_WBF 1 /* Cycles from WE high to CS high */
  63. #define FLASH_TH 2 /* Number of hold cycles after transfer */
  64. #define FLASH_RE 0 /* Ready disabled */
  65. #define FLASH_SOR 1 /* Sample on Ready disabled */
  66. #define FLASH_BEM 0 /* Byte Write only active on Write cycles */
  67. #define FLASH_PEN 0 /* Parity disable */
  68. /* Access Parameter Register for non Boot */
  69. #define FLASH_AP ((FLASH_BME << 31) + (FLASH_TWE << 23) + (FLASH_CSN << 18) + (FLASH_OEN << 16) + (FLASH_WBN << 14) + \
  70. (FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
  71. /* Access Parameter Register for Boot */
  72. #define FLASH_AP_B ((FLASH_BME_B << 31) + (FLASH_FWT_B << 26) + (FLASH_BWT_B << 23) + (FLASH_CSN << 18) + (FLASH_OEN << 16) + (FLASH_WBN << 14) + \
  73. (FLASH_WBF << 12) + (FLASH_TH << 9) + (FLASH_RE << 8) + (FLASH_SOR << 7) + (FLASH_BEM << 6) + (FLASH_PEN << 5))
  74. /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
  75. #define FLASH_BS FLASH_SIZE_PRELIM /* 4 MByte */
  76. /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
  77. #define FLASH_BU 3 /* R/W */
  78. /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
  79. #define FLASH_BW 1 /* 16Bit */
  80. /* CR register for Boot */
  81. #define FLASH_CR_B ((FLASH_BASE_PRELIM & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
  82. /* CR register for non Boot */
  83. #define FLASH_CR ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (FLASH_BS << 17) + (FLASH_BU << 15) + (FLASH_BW << 13))
  84. /* MPS CS1 or CS0 */
  85. /* Boot CS: */
  86. #define MPS_BME_B 1 /* Burst enable */
  87. #define MPS_FWT_B 0x6/* 6 * 30ns 210ns First Wait Access */
  88. #define MPS_BWT_B 0x6 /* 6 * 30ns 210ns Burst Wait Access */
  89. #define MPS_BME 0 /* Burst disable */
  90. #define MPS_TWE 0xb/* 11 * 30ns 330ns Waitstates (access=TWT+1+TH) */
  91. #define MPS_CSN 0 /* Chipselect is driven inactive for 1 Cycle BTW transfers */
  92. #define MPS_OEN 1 /* Cycles from CS low to OE low */
  93. #define MPS_WBN 1 /* Cycles from CS low to WE low */
  94. #define MPS_WBF 1 /* Cycles from WE high to CS high */
  95. #define MPS_TH 2 /* Number of hold cycles after transfer */
  96. #define MPS_RE 0 /* Ready disabled */
  97. #define MPS_SOR 1 /* Sample on Ready disabled */
  98. #define MPS_BEM 0 /* Byte Write only active on Write cycles */
  99. #define MPS_PEN 0 /* Parity disable */
  100. /* Access Parameter Register for non Boot */
  101. #define MPS_AP ((MPS_BME << 31) + (MPS_TWE << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
  102. (MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
  103. /* Access Parameter Register for Boot */
  104. #define MPS_AP_B ((MPS_BME_B << 31) + (MPS_FWT_B << 26) + (MPS_BWT_B << 23) + (MPS_CSN << 18) + (MPS_OEN << 16) + (MPS_WBN << 14) + \
  105. (MPS_WBF << 12) + (MPS_TH << 9) + (MPS_RE << 8) + (MPS_SOR << 7) + (MPS_BEM << 6) + (MPS_PEN << 5))
  106. /* Size: 0=1MB, 1=2MB, 2=4MB, 3=8MB, 4=16MB, 5=32MB, 6=64MB, 7=128MB */
  107. #define MPS_BS 2 /* 4 MByte */
  108. #define MPS_BS_B FLASH_SIZE_PRELIM /* 1 MByte */
  109. /* Usage: 0=disabled, 1=Read only, 2=Write Only, 3=R/W */
  110. #define MPS_BU 3 /* R/W */
  111. /* Bus width: 0=8Bit, 1=16Bit, 2=32Bit, 3=Reserved */
  112. #define MPS_BW 0 /* 8Bit */
  113. /* CR register for Boot */
  114. #define MPS_CR_B ((FLASH_BASE_PRELIM & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))
  115. /* CR register for non Boot */
  116. #define MPS_CR ((MULTI_PURPOSE_SOCKET_ADDR & 0xfff00000) + (MPS_BS << 17) + (MPS_BU << 15) + (MPS_BW << 13))