BCM1250/BCM1125/BCM1125H
User Manual
10/21/02
B r o a d c o m C o r p o r a t i o n
Page
30
Section 3: System Overview
Document
1250_1125-UM100CB-R
A controlled reset of a running CPU can be done in a safe way. First the data cache must be flushed by doing
indexed-writeback-invalidate cache ops on all entries in the cache. Secondly, it must be ensured that the data
for all evicts has been sent to the bus (rather than just being visible). After these steps, the CPU will not be
involved in any coherent operations and can be safely reset. The sequence of operations can be summarised:
The first
sync
will ensure all the index-writeback-invalidate operations have completed and the CPU will not
hit for any future snoops, but up to two writebacks may still be in transit in the bus interface buffers. The
uncached stores will queue behind the writebacks, and the second
sync
ensures they have reached the bus
buffers and therefore the writebacks have completed. At this point it is safe for the CPU to write to its reset bit.
The data cache state is not affected by reset, so when the CPU comes out of reset the cache (and duplicate
tags used by snoops) will still have all entries invalid. If the CPU has been shutdown using this sequence it is
therefore safe to release it from reset in a system that is already running with coherent accesses.
The different actions of the resets may be used to identify which reset happened. A sequence similar to the
following could be used (this assumes that the device uses a UART on port 0 for the console but the IO_AD[12]
is set for synchronous port).
index wb invalidate over whole Dcache
sync
uncached store to somewhere that does not matter
uncached store to somewhere that does not matter
sync
uncached store to reset bit
// First check the sw_flag. It is only cleared by coldreset
If system_cgf.sw_flag == 0
resetType = Coldreset
// Next check for the software initiated full reset, this resamples
// the configuration bits so will set the synchronous port
else if system_cfg.ser0_enable == 1
resetType = SoftwareSystemReset
// Next check for a soft reset, since the bit is not self-clearing
// it will still be set
else if system_cfg.sb_softres == 1
resetType = SoftwareSbSoftReset
// No internal way to tell between an external RESET_L
// and a Watchdog timeout
else
resetType = ResetLOrWatchdog
// later BCM1250 have a flag for watchdog reset
if BCM1250 stepping C0 or later
if watchdog wd_has_reset bit set
resetType = Watchdog
else
resetType = Reset
// Now set conditions for the next time
// And allow use of the UART, set not-coldreset flag, clear softres
system_cfg.ser0_enable = 0
system_cfg.sw_flag = 1
system_cfg.sb_softres = 0