Skip to content

EDAC/synopsys: Add generic DDRC info and address mapping

Serge Semin linux-arm-kernel linux-edac linux-media lkml oe-kbuild oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest18 patches 3 repliesIn review

Changes in v4 from the cover letter

- Get syndrome from the ECCSTAT.ecc_corrected_bit_num field rather than from ECCCSYN2. The later CSR in fact contains ECC.
- On correctable and uncorrectable errors retrieve ECC aside with the erroneous data.
- Rebase onto the kernel v6.6-rcX.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18EDAC/synopsys: Convert sysfs nodes to debugfs onesdrivers/edac/synopsys_edac.c+122 -990 replies
2/18EDAC/mc: Extend memtypes with LPDDR(mDDR) and LPDDR2drivers/edac/edac_mc.c include/linux/edac.h+8 -00 replies
3/18EDAC/synopsys: Extend memtypes supported by controllerdrivers/edac/synopsys_edac.c+27 -140 replies
4/18EDAC/synopsys: Detach private data from mci instancedrivers/edac/synopsys_edac.c+90 -470 replies
5/18EDAC/synopsys: Add DDRC basic parameters infrastructuredrivers/edac/synopsys_edac.c+211 -572 replies
6/18EDAC/synopsys: Convert plat-data to plat-init functiondrivers/edac/synopsys_edac.c+35 -330 replies
7/18EDAC/synopsys: Parse ADDRMAP[7-8] CSRs for (LP)DDR4 onlydrivers/edac/synopsys_edac.c+13 -60 replies
8/18EDAC/synopsys: Parse ADDRMAP[0] CSR for multi-ranks case onlydrivers/edac/synopsys_edac.c+6 -30 replies
9/18EDAC/synopsys: Set actual DIMM ECC errors graindrivers/edac/synopsys_edac.c+5 -50 replies
10/18EDAC/synopsys: Get corrected bit positiondrivers/edac/synopsys_edac.c+27 -10 replies
11/18EDAC/synopsys: Pass syndrome to EDAC error handlerdrivers/edac/synopsys_edac.c+1 -10 replies
12/18EDAC/synopsys: Read full data+ecc pattern on errorsdrivers/edac/synopsys_edac.c+16 -80 replies
13/18EDAC/synopsys: Introduce System/SDRAM address translation interfacedrivers/edac/synopsys_edac.c+453 -2971 reply
14/18EDAC/synopsys: Simplify HIF/SDRAM column mapping get proceduredrivers/edac/synopsys_edac.c+27 -560 replies
15/18EDAC/synopsys: Add HIF/SDRAM mapping debugfs nodedrivers/edac/synopsys_edac.c+82 -00 replies
16/18EDAC/synopsys: Add erroneous page-frame/offset reportingdrivers/edac/synopsys_edac.c+118 -250 replies
17/18EDAC/synopsys: Add system address regions supportdrivers/edac/synopsys_edac.c+188 -30 replies
18/18EDAC/synopsys: Add mapping-based memory size calculationdrivers/edac/synopsys_edac.c+49 -170 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 00/18] EDAC/synopsys: Add generic DDRC info and address mapping

This patchset is a second one in the series created in the framework of my Synopsys DW uMCTL2 DDRC-related work:

[1: In-progress v4] EDAC/mc/synopsys: Various fixes and cleanups

[2: In-progress v4] EDAC/synopsys: Add generic DDRC info and address mapping
Link: ---you are looking at it---
[3: In-progress v4] EDAC/synopsys: Add generic resources and Scrub support
Link: ---to be submitted---

Note the patchsets above must be merged in the same order as they are placed in the list in order to prevent conflicts. Nothing prevents them from being reviewed synchronously though. Any tests are very welcome. Thanks in advance.

The second patchset mainly concerns converting the DW uMCTL2 DDRC driver to being more generic, supporting wider range of the DW uMCTL2 DDRC IP-core compilations and thus being utilized with more versions of the Synopsys DDR controllers.

The series starts with the Error-injection functionality movement to DebugFS. Indeed the Debug-parts should be in the dedicated DebugFS. SysFS is not a place for it. Moreover a bit later here some more debug nodes will be added.

Afterwards even though it isn't advertised but even at this stage the DW uMCTL2 DDRC driver supports a bit more DDR protocols than it is actually specified in the mem_ctrl_info.mtype_cap field. So first the EDAC MCI core memory types enumeration is extended with LPDDR (mDDR) and LPDDR2, which support can be enabled in the DW uMCTL2 DDR controller. Second the driver is fixed to properly detected the new and older DDR protocol types during the DW uMCTL DDRC probe procedure.

Then a bit painful patch goes. Alas we have to deviate the driver from the EDAC standard private data allocation/initialization pattern. Since we are going to add the DW uMCTL2 IP-core specific parameters detection procedure and later on implement additional platform resources requests, there is no other choice but to allocate the driver private data at the early stage of the device probe procedure, even before it's possible to allocate the MCI descriptor. The DW uMCTL2 DDRC platform resources and configuration info will be then utilized to properly allocate and initialize the mem_ctrl_info structure instance.

Fifth patch in the series is very important. It provides the DW uMCTL2 DDRC parameters detection procedure. The DDRC and ECC parameters detected at this stage will be then utilized to make the driver working with much wider set of the DW uMCTL2 revisions and configurations. In particular from now the driver will retrieve the next DDRC info at the probe stage:
ECC type, SDRAM protocol (DDR type), Full and actual DQ-bus width, SDRAM and HIF burst length, Core/SDRAM frequency ration, number of SDRAM ranks. The DDRC parameters structure will be extended with some more fields later in this and the next patchset. The provided private DDRC parameters infrastructure can be utilized to implement the platform-specific capabilities so the platform data and its quirks are replaced with it.

The detected at the probe stage DW uMCTL2 DDRC parameters can be now used to implement the configuration specific functionality. In particular first we introduce the conditional ADDRMAP* CSRs parsing since some of these CSRs and their fields are left unused by the controller in some cases. Secondly actual DIMM ECC errors grain, ECC corrected bit, syndrome and full data+ecc pattern are determined based on the DDRC parameters.

Afterwards goes a series of the patches which introduce an interface to generically determine the system address based on the SDRAM address and vice-versa. Thus we'll be able to report actual PFN and offset in case of the corrected and uncorrected errors. So first we get to convert the currently available HIF/SDRAM mapping table utilized for the errors-injection functionality into a more generic Sys<->SDRAM address translation interface. Secondly we suggest to conform the SDRAM column address mapping detection algorithm with what is defined in the DW uMCTL2 DDRC hw reference manual thus simplifying the ADDRMAP* CSRs parsing procedure. After adding a handy DebugFS node to read the HIF/SDRAM mapping and the system address regions support, we finally introduce the erroneous page-frame/offset reporting to the MCI core. Since the full SDRAM address mapping is now always available we suggest to use it for the attached memory size calculation, which is a more correct approach rather than the si_meminfo()-based one.

Changelog v2:
- Rebase onto the latest version of the patchset:
[PATCH v2 00/19] EDAC/mc/synopsys: Various fixes and cleanups
- Just resend.

Changelog v3:
- Just resend.

Changelog v4:
- Get syndrome from the ECCSTAT.ecc_corrected_bit_num field rather than from ECCCSYN2. The later CSR in fact contains ECC.
- On correctable and uncorrectable errors retrieve ECC aside with the erroneous data.
- Rebase onto the kernel v6.6-rcX.

Cc Punnaiah Choudary Kalluri <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

Serge Semin (18):
EDAC/synopsys: Convert sysfs nodes to debugfs ones EDAC/mc: Extend memtypes with LPDDR(mDDR) and LPDDR2 EDAC/synopsys: Extend memtypes supported by controller EDAC/synopsys: Detach private data from mci instance EDAC/synopsys: Add DDRC basic parameters infrastructure EDAC/synopsys: Convert plat-data to plat-init function EDAC/synopsys: Parse ADDRMAP[7-8] CSRs for (LP)DDR4 only EDAC/synopsys: Parse ADDRMAP[0] CSR for multi-ranks case only EDAC/synopsys: Set actual DIMM ECC errors grain EDAC/synopsys: Get corrected bit position
EDAC/synopsys: Pass syndrome to EDAC error handler EDAC/synopsys: Read full data+ecc pattern on errors EDAC/synopsys: Introduce System/SDRAM address translation interface EDAC/synopsys: Simplify HIF/SDRAM column mapping get procedure EDAC/synopsys: Add HIF/SDRAM mapping debugfs node EDAC/synopsys: Add erroneous page-frame/offset reporting EDAC/synopsys: Add system address regions support EDAC/synopsys: Add mapping-based memory size calculation

 drivers/edac/edac_mc.c       |    2 +
 drivers/edac/synopsys_edac.c | 1828 ++++++++++++++++++++++++----------
 include/linux/edac.h         |    6 +
 3 files changed, 1321 insertions(+), 515 deletions(-)
Signature · 1 line
2.41.0