Skip to content

Commit 2b7778a

Browse files
committed
SoC/evalsoc: enable SMP ENB after L2 Cache enable for SMP/IOCP consistency
Write 0xFFFFFFFF to SMPCC SMP_ENB register (offset 0xC) after L2 Cache enable in both __sync_harts() and _premain_init() to ensure SMP and IOCP consistency across cluster cores before other SMP operations. Signed-off-by: Huaqi Fang <578567190@qq.com>
1 parent d9f9044 commit 2b7778a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

SoC/evalsoc/Common/Source/system_evalsoc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ void __sync_harts(void)
13441344
SMP_CTRLREG(smp_base, 0x10) |= 0x1;
13451345
SMP_CTRLREG(smp_base, 0xd8) = 0x0;
13461346
}
1347-
// Enable SMP
1347+
// Enable SMP and IOCP consistency
13481348
SMP_CTRLREG(smp_base, 0xc) = 0xFFFFFFFF;
13491349
__SMP_RWMB();
13501350
// L1 I/D Cache Enable is done in _premain_init
@@ -1571,14 +1571,15 @@ void _premain_init(void)
15711571
// Enable L2, disable cluster local memory
15721572
SMP_CTRLREG(__SMPCC_BASEADDR, 0x10) |= 0x1;
15731573
SMP_CTRLREG(__SMPCC_BASEADDR, 0xd8) = 0x0;
1574-
__SMP_RWMB();
15751574
#else
15761575
// Disable L2, enable cluster local memory
15771576
SMP_CTRLREG(__SMPCC_BASEADDR, 0x10) &= ~0x1;
15781577
// use as clm or cache, when l2 disable, the affect to ddr is the same, l2 is really disabled
15791578
SMP_CTRLREG(__SMPCC_BASEADDR, 0xd8) = 0;//0xFFFFFFFF;
1580-
__SMP_RWMB();
15811579
#endif
1580+
// Enable SMP and IOCP consistency
1581+
SMP_CTRLREG(__SMPCC_BASEADDR, 0xC) = 0xFFFFFFFF;
1582+
__SMP_RWMB();
15821583
}
15831584

15841585
#if defined(RUNMODE_BPU_EN)

doc/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This is release version of ``1.0.0`` of Nuclei SDK, which is still under develop
1212

1313
- Warn when ``CFG_IREGION_BASE_ADDR`` is defined as ``0`` and document the required compiler option.
1414
- Fix EvalSoC UART stop-bit and FIFO watermark configuration to update the intended control-register fields.
15+
- Enable SMP_ENB register of SMPCC with ``0xFFFFFFFF`` after L2 Cache enable to ensure SMP and IOCP consistency across cluster cores in ``system_evalsoc.c``.
1516

1617
V0.9.0
1718
------

0 commit comments

Comments
 (0)