User Manual
BCM1250/BCM1125/BCM1125H
10/21/02
B r o a d c o m C o r p o r a t i o n
Document
1250_1125-UM100CB-R
Section 3: System Overview
Page
13
Blocks with main memory addresses should be marked coherent in the CPU. If these blocks are not shared
there is no difference in performance between marking them cacheable coherent and cacheable non-coherent,
but there is a much higher chance of unexpected behavior if the block is marked non-coherent (for example
due to false sharing or missing cache flushes before DMA operations). When these blocks are used for DMA
operations the system performance will generally be better if the blocks are marked coherent and the
coherence protocol is used to fetch modified data from the CPU cache when it is needed by the DMA engine.
Having the blocks marked non-coherent and using CACHE operations to flush the cache prior to initiating
DMAs will give a lower system performance as well as being prone to programming errors.
Lines in the L2 cache are in one of three states: Invalid, Clean or Dirty. All cacheable accesses to the address
range controlled by the memory controller check the L2 cache.
The coherence mechanism will be circumvented by doing uncached or cacheable non-coherent accesses into
memory that has previously been cacheable and coherent. If this is done the results are UNPREDICTABLE.
If areas of memory are never cacheable and coherent then it is the responsibility of software to track
ownership. The coherence mechanism can also be circumvented if software uses the Invalidate CACHE
operation on a block that is held exclusive in the L1 cache. If a snoop request is received on the bus at the
same time this instruction executes, the snoop will hit on the line in the L1 but the line is invalidated before it
can be evicted. The CPU will respond by returning UNPREDICTABLE data marked with a fatal bus error. There
is no problem with using the Writeback&Invalidate CACHE operation.
The generic bus section of memory may be mapped cacheable coherent. The I/O bridge will act as default
owner in the MESI protocol (it behaves as the L2/Memory does for memory addresses). The CPUs are able
to take exclusive ownership of cache blocks from memory on the generic bus, if ownership is transferred the
new owner will acquire the block clean and if needed a writeback will be done to the generic bus. This allows
the cache attribute for kseg0 to be set to cacheable coherent to cover both main memory and the Boot ROM
and allows for RAMs on the generic bus with no special software management.
The PCI/HyperTransport space should not be mapped cacheable coherent. The I/O bridge will respect an
ownership assertion by one of the CPUs (so there will not be two replies to a read request) but it will not act
as default owner and will not copy back dirty data on ownership changes. Changes to data may therefore be
lost leading to UNPREDICTABLE behavior. In error cases the behavior of cacheable coherent accesses
through I/O Bridge 0 is UNDEFINED.
The I/O bridges provide the entry point into the coherent domain for any DMA traffic (from the on-chip network
interfaces or PCI/HyperTransport master devices). The bridges will check the address being accessed. For
any memory address cacheable coherent accesses will be used, and partial line writes will cause a read
(exclusive)-modify-write cycle. For any address that is not to memory uncacheable accesses are done and
partial line accesses will result in only some of the byte enables being set.