README.ppc440 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. PowerPC 440
  2. Last Update: September 11, 2002
  3. =======================================================================
  4. OVERVIEW
  5. ============
  6. Support for the ppc440 is contained in the cpu/ppc44x directory
  7. and enabled via the CONFIG_440 flag. It is largely based on the
  8. 405gp code. A sample board support implementation is contained
  9. in the board/ebony directory.
  10. All testing was performed using the AMCC Ebony board using both
  11. Rev B and Rev C silicon. However, since the Rev B. silicon has
  12. extensive errata, support for Rev B. is minimal (it boots, and
  13. features such as i2c, pci, tftpboot, etc. seem to work ok).
  14. The expectation is that all new board designs will be using
  15. Rev C or later parts -- if not, you may be in for a rough ride ;-)
  16. The ppc440 port does a fair job of keeping "board-specific" code
  17. out of the "cpu-specific" source. The goal of course was to
  18. provide mechanisms for each board to customize without having
  19. to clutter the cpu-specific source with a lot of ifdefs. Most
  20. of these mechanisms are described in the following sections.
  21. MEMORY MANAGEMENT
  22. =================
  23. The ppc440 doesn't run in "real mode". The MMU must be active
  24. at all times. Additionally, the 440 implements a 36-bit physical
  25. memory space that gets mapped into the PowerPC 32-bit virtual
  26. address space. So things like memory-mapped peripherals, etc must
  27. all be mapped in. Once this is done, the 32-bit virtual address
  28. space is then viewed as though it were physical memory.
  29. However, this means that memory, peripherals, etc can be configured
  30. to appear (mostly) anywhere in the virtual address space. Each board
  31. must define its own mappings using the tlbtab (see board/ebony/init.S).
  32. The actual TLB setup is performed by the cpu-specific code.
  33. Although each board is free to define its own mappings, there are
  34. several definitions to be aware of. These definitions may be used in
  35. the cpu-specific code (vs. board-specific code), so you should
  36. at least review these before deciding to make any changes ... it
  37. will probably save you some headaches ;-)
  38. CONFIG_SYS_SDRAM_BASE - The virtual address where SDRAM is mapped (always 0)
  39. CONFIG_SYS_FLASH_BASE - The virtual address where FLASH is mapped.
  40. CONFIG_SYS_PCI_MEMBASE - The virtual address where PCI-bus memory is mapped.
  41. This mapping provides access to PCI-bus memory.
  42. CONFIG_SYS_PERIPHERAL_BASE - The virtual address where the 440 memory-mapped
  43. peripherals are mapped. (e.g. -- UART registers, IIC registers, etc).
  44. CONFIG_SYS_ISRAM_BASE - The virtual address where the 440 internal SRAM is
  45. mapped. The internal SRAM is equivalent to 405gp OCM and is used
  46. for the initial stack.
  47. CONFIG_SYS_PCI_BASE - The virtual address where the 440 PCI-x bridge config
  48. registers are mapped.
  49. CONFIG_SYS_PCI_TARGBASE - The PCI address that is mapped to the virtual address
  50. defined by CONFIG_SYS_PCI_MEMBASE.
  51. UART / SERIAL
  52. =================
  53. The UART port works fine when an external serial clock is provided
  54. (like the one on the Ebony board) and when using internal clocking.
  55. This is controlled with the CONFIG_SYS_EXT_SERIAL_CLOCK flag. When using
  56. internal clocking, the "ideal baud rate" settings in the 440GP
  57. user manual are automatically calculated.
  58. CONFIG_SERIAL_SOFTWARE_FIFO enables interrupt-driven serial operation.
  59. But the last time I checked, interrupts were initialized after the
  60. serial port causing the interrupt handler to be removed from the
  61. handler table. This will probably be fixed soon ... or fix it
  62. yourself and submit a patch :-)
  63. I2C
  64. =================
  65. The i2c utilities have been tested on both Rev B. and Rev C. and
  66. look good. The iprobe command implementation has been updated to
  67. allow for 'skipped' addresses. Some i2c slaves are write only and
  68. cause problems when a probe (read) is performed (for example the
  69. CDCV850 clock controller at address 0x69 on the ebony board).
  70. To prevent probing certain addresses you can define the
  71. CONFIG_SYS_I2C_NOPROBES macro in your board-specific header file. When
  72. defined, all specified addresses are skipped during a probe.
  73. The addresses that are skipped will be displayed in the output
  74. of the iprobe command.
  75. For example, to prevent probing address 0x69, define the macro as
  76. follows:
  77. #define CONFIG_SYS_I2C_NOPROBES {0x69}
  78. Similarly, to prevent probing addresses 0x69 and 0x70, define the
  79. macro a:
  80. #define CONFIG_SYS_I2C_NOPROBES {0x69, 0x70}
  81. DDR SDRAM CONTROLLER
  82. ====================
  83. SDRAM controller intialization using Serial Presence Detect (SPD) is
  84. now supported (thanks Jun). It is enabled by defining CONFIG_SPD_EEPROM.
  85. The i2c eeprom addresses are controlled by the SPD_EEPROM_ADDRESS macro.
  86. NOTE: The SPD_EEPROM_ADDRESS macro is defined differently than for other
  87. processors. Traditionally, it defined a single address. For the 440 it
  88. defines an array of addresses to support multiple banks. Address order
  89. is significant: the addresses are used in order to program the BankN
  90. registers. For example, two banks with i2c addresses of 0x53 (bank 0)
  91. and 0x52 (bank 1) would be defined as follows:
  92. #define SPD_EEPROM_ADDRESS {0x53,0x52}
  93. PCI-X BRIDGE
  94. ====================
  95. PCI is an area that requires lots of flexibility since every board has
  96. its own set of constraints and configuration. This section describes the
  97. 440 implementation.
  98. CPC0_STRP1[PISE] -- if the PISE strap bit is not asserted, PCI init
  99. is aborted and an indication is printed. This is NOT considered an
  100. error -- only an indication that PCI shouldn't be initialized. This
  101. gives you a chance to edit the i2c bootstrap eeproms using the i2c
  102. utilities once you get to the U-Boot command prompt. NOTE: the default
  103. 440 bootstrap options (not using i2c eeprom) negates this bit.
  104. The cpu-specific code sets up a default pci_controller structure
  105. that maps in a single PCI I/O space and PCI memory space. The I/O
  106. space begins at PCI I/O address 0 and the PCI memory space is
  107. 256 MB starting at PCI address CONFIG_SYS_PCI_TARGBASE. After the
  108. pci_controller structure is initialized, the cpu-specific code will
  109. call the routine pci_pre_init(). This routine is implemented by
  110. board-specific code & is where the board can over-ride/extend the
  111. default pci_controller structure settings and exspecially provide
  112. a routine to map the PCI interrupts and do other pre-initialization
  113. tasks. If pci_pre_init() returns a value of zero, PCI initialization
  114. is aborted; otherwise the controller structure is registered and
  115. initialization continues.
  116. The default 440GP PCI target configuration is minimal -- it assumes that
  117. the strapping registers are set as necessary. Since the strapping bits
  118. provide very limited flexibility, you may want to customize the boards
  119. target configuration. If CONFIG_SYS_PCI_TARGET_INIT is defined, the cpu-specific
  120. code will call the routine pci_target_init() which you must implement
  121. in your board-specific code.
  122. Target initialization is completed by the cpu-specific code by
  123. initializing the subsystem id and subsystem vendor id, and then ensuring
  124. that the 'enable host configuration' bit in the PCIX0_BRDGOPT2 is set.
  125. The default PCI master initialization maps in 256 MB of pci memory
  126. starting at PCI address CONFIG_SYS_PCI_MEMBASE. To customize this, define
  127. PCI_MASTER_INIT. This will call the routine pci_master_init() in your
  128. board-specific code rather than performing the default master
  129. initialization.
  130. The decision to perform PCI host configuration must often be determined
  131. at run time. The ppc440 port differs from most other implementations in
  132. that it requires the board to determine its host configuration at run
  133. time rather than by using compile-time flags. This shouldn't create a
  134. large impact on the board-specific code since the board only needs to
  135. implement a single routine that returns a zero or non-zero value:
  136. is_pci_host().
  137. Justification for this becomes clear when considering systems running
  138. in a cPCI environment:
  139. 1. Arbiter strapping: Many cPCI boards provide an external arbiter (often
  140. part of the PCI-to-PCI bridge). Even though the arbiter is external (the
  141. arbiter strapping is negated), the CPU may still be required to perform
  142. local PCI bus configuration.
  143. 2. Host only: PPMC boards must sample the MONARCH# signal at run-time.
  144. Depending on the configuration of the carrier boar, the PPMC board must
  145. determine if it should configure the PCI bus at run-time. And in most
  146. cases, access to the MONARCH# signal is board-specific (e.g. via
  147. board-specific FPGA registers, etc).
  148. In any event, the is_pci_host() routine gives each board the opportunity
  149. to decide at run-time. If your board is always configured a certain way,
  150. then just hardcode a return of 1 or 0 as appropriate.
  151. Regards,
  152. --Scott
  153. <smcnutt@artesyncp.com>