mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-02 01:20:47 +09:00
Blackfin: handle new anomalies with reset
Workaround fun new anomalies related to software reset of the processor. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
b1e9435b64
commit
cf8f2efb5f
@ -29,26 +29,35 @@ void bfin_reset(void)
|
|||||||
*/
|
*/
|
||||||
__builtin_bfin_ssync();
|
__builtin_bfin_ssync();
|
||||||
|
|
||||||
while (1) {
|
/* The bootrom checks to see how it was reset and will
|
||||||
|
* automatically perform a software reset for us when
|
||||||
|
* it starts executing after the core reset.
|
||||||
|
*/
|
||||||
|
if (ANOMALY_05000353 || ANOMALY_05000386) {
|
||||||
/* Initiate System software reset. */
|
/* Initiate System software reset. */
|
||||||
bfin_write_SWRST(0x7);
|
bfin_write_SWRST(0x7);
|
||||||
|
|
||||||
/* Due to the way reset is handled in the hardware, we need
|
/* Due to the way reset is handled in the hardware, we need
|
||||||
* to delay for 7 SCLKS. The only reliable way to do this is
|
* to delay for 10 SCLKS. The only reliable way to do this is
|
||||||
* to calculate the CCLK/SCLK ratio and multiply 7. For now,
|
* to calculate the CCLK/SCLK ratio and multiply 10. For now,
|
||||||
* we'll assume worse case which is a 1:15 ratio.
|
* we'll assume worse case which is a 1:15 ratio.
|
||||||
*/
|
*/
|
||||||
asm(
|
asm(
|
||||||
"LSETUP (1f, 1f) LC0 = %0\n"
|
"LSETUP (1f, 1f) LC0 = %0\n"
|
||||||
"1: nop;"
|
"1: nop;"
|
||||||
:
|
:
|
||||||
: "a" (15 * 7)
|
: "a" (15 * 10)
|
||||||
: "LC0", "LB0", "LT0"
|
: "LC0", "LB0", "LT0"
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Clear System software reset */
|
/* Clear System software reset */
|
||||||
bfin_write_SWRST(0);
|
bfin_write_SWRST(0);
|
||||||
|
|
||||||
|
/* The BF526 ROM will crash during reset */
|
||||||
|
#if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__)
|
||||||
|
bfin_read_SWRST();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Wait for the SWRST write to complete. Cannot rely on SSYNC
|
/* Wait for the SWRST write to complete. Cannot rely on SSYNC
|
||||||
* though as the System state is all reset now.
|
* though as the System state is all reset now.
|
||||||
*/
|
*/
|
||||||
@ -59,10 +68,11 @@ void bfin_reset(void)
|
|||||||
: "a" (15 * 1)
|
: "a" (15 * 1)
|
||||||
: "LC1", "LB1", "LT1"
|
: "LC1", "LB1", "LT1"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (1)
|
||||||
/* Issue core reset */
|
/* Issue core reset */
|
||||||
asm("raise 1");
|
asm("raise 1");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We need to trampoline ourselves up into L1 since our linker
|
/* We need to trampoline ourselves up into L1 since our linker
|
||||||
|
Loading…
Reference in New Issue
Block a user