drivers/edac/synopsys_edac.c
Source file repositories/reference/linux-study-clean/drivers/edac/synopsys_edac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/edac/synopsys_edac.c- Extension
.c- Size
- 40087 bytes
- Lines
- 1494
- Domain
- Driver Families
- Bucket
- drivers/edac
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/edac.hlinux/module.hlinux/platform_device.hlinux/spinlock.hlinux/sizes.hlinux/interrupt.hlinux/of.hedac_module.h
Detected Declarations
struct ecc_error_infostruct synps_ecc_statusstruct synps_edac_privstruct synps_platform_dataenum synps_platform_typefunction zynq_get_error_infofunction zynqmp_get_mem_infofunction zynqmp_get_error_infofunction handle_errorfunction enable_intrfunction disable_intrfunction intr_handlerfunction check_errorsfunction zynq_get_dtypefunction zynqmp_get_dtypefunction get_ecc_statefunction get_memsizefunction zynq_get_mtypefunction zynqmp_get_mtypefunction init_csrowsfunction mc_initfunction setup_irqfunction ddr_poison_setupfunction inject_data_error_showfunction inject_data_error_storefunction inject_data_poison_showfunction inject_data_poison_storefunction edac_create_sysfs_attributesfunction edac_remove_sysfs_attributesfunction setup_row_address_mapfunction setup_column_address_mapfunction setup_bank_address_mapfunction setup_bg_address_mapfunction setup_rank_address_mapfunction setup_address_mapfunction mc_probefunction mc_remove
Annotated Snippet
struct ecc_error_info {
u32 row;
u32 col;
u32 bank;
u32 bitpos;
u32 data;
u32 bankgrpnr;
u32 blknr;
};
/**
* struct synps_ecc_status - ECC status information to report.
* @ce_cnt: Correctable error count.
* @ue_cnt: Uncorrectable error count.
* @ceinfo: Correctable error log information.
* @ueinfo: Uncorrectable error log information.
*/
struct synps_ecc_status {
u32 ce_cnt;
u32 ue_cnt;
struct ecc_error_info ceinfo;
struct ecc_error_info ueinfo;
};
/**
* struct synps_edac_priv - DDR memory controller private instance data.
* @baseaddr: Base address of the DDR controller.
* @reglock: Concurrent CSRs access lock.
* @message: Buffer for framing the event specific info.
* @stat: ECC status information.
* @p_data: Platform data.
* @ce_cnt: Correctable Error count.
* @ue_cnt: Uncorrectable Error count.
* @poison_addr: Data poison address.
* @row_shift: Bit shifts for row bit.
* @col_shift: Bit shifts for column bit.
* @bank_shift: Bit shifts for bank bit.
* @bankgrp_shift: Bit shifts for bank group bit.
* @rank_shift: Bit shifts for rank bit.
*/
struct synps_edac_priv {
void __iomem *baseaddr;
spinlock_t reglock;
char message[SYNPS_EDAC_MSG_SIZE];
struct synps_ecc_status stat;
const struct synps_platform_data *p_data;
u32 ce_cnt;
u32 ue_cnt;
#ifdef CONFIG_EDAC_DEBUG
ulong poison_addr;
u32 row_shift[18];
u32 col_shift[14];
u32 bank_shift[3];
u32 bankgrp_shift[2];
u32 rank_shift[1];
#endif
};
enum synps_platform_type {
ZYNQ,
ZYNQMP,
SYNPS,
};
/**
* struct synps_platform_data - synps platform data structure.
* @platform: Identifies the target hardware platform
* @get_error_info: Get EDAC error info.
* @get_mtype: Get mtype.
* @get_dtype: Get dtype.
* @get_mem_info: Get EDAC memory info
* @quirks: To differentiate IPs.
*/
struct synps_platform_data {
enum synps_platform_type platform;
int (*get_error_info)(struct synps_edac_priv *priv);
enum mem_type (*get_mtype)(const void __iomem *base);
enum dev_type (*get_dtype)(const void __iomem *base);
#ifdef CONFIG_EDAC_DEBUG
u64 (*get_mem_info)(struct synps_edac_priv *priv);
#endif
int quirks;
};
/**
* zynq_get_error_info - Get the current ECC error info.
* @priv: DDR memory controller private instance data.
*
* Return: one if there is no error, otherwise zero.
*/
Annotation
- Immediate include surface: `linux/edac.h`, `linux/module.h`, `linux/platform_device.h`, `linux/spinlock.h`, `linux/sizes.h`, `linux/interrupt.h`, `linux/of.h`, `edac_module.h`.
- Detected declarations: `struct ecc_error_info`, `struct synps_ecc_status`, `struct synps_edac_priv`, `struct synps_platform_data`, `enum synps_platform_type`, `function zynq_get_error_info`, `function zynqmp_get_mem_info`, `function zynqmp_get_error_info`, `function handle_error`, `function enable_intr`.
- Atlas domain: Driver Families / drivers/edac.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.