summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/firmware.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2017-07-25 19:26:23 +0200
committerHelge Deller <deller@gmx.de>2017-07-25 19:28:37 +0200
commit25a9b76597fafbbf688dd4473cb910568deb2b0c (patch)
tree0e7b0b216bf0ecdd115ec882bf62213f97cf9352 /arch/parisc/kernel/firmware.c
parentf520e55241e1cf0c10d308ccf47513f28533f60a (diff)
downloadop-kernel-dev-25a9b76597fafbbf688dd4473cb910568deb2b0c.zip
op-kernel-dev-25a9b76597fafbbf688dd4473cb910568deb2b0c.tar.gz
parisc: Add function to return DIMM slot of physical address
Add a firmware wrapper function, which asks PDC firmware for the DIMM slot of a physical address. This is needed to show users which DIMM module needs replacement in case a broken DIMM was encountered. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/kernel/firmware.c')
-rw-r--r--arch/parisc/kernel/firmware.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index 526ed90..f622a31 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -1498,6 +1498,31 @@ int pdc_pat_mem_read_pd_pdt(struct pdc_pat_mem_read_pd_retinfo *pret,
return retval;
}
+
+/**
+ * pdc_pat_mem_get_dimm_phys_location - Get physical DIMM slot via PAT firmware
+ * @pret: ptr to hold returned information
+ * @phys_addr: physical address to examine
+ *
+ */
+int pdc_pat_mem_get_dimm_phys_location(
+ struct pdc_pat_mem_phys_mem_location *pret,
+ unsigned long phys_addr)
+{
+ int retval;
+ unsigned long flags;
+
+ spin_lock_irqsave(&pdc_lock, flags);
+ retval = mem_pdc_call(PDC_PAT_MEM, PDC_PAT_MEM_ADDRESS,
+ __pa(&pdc_result), phys_addr);
+
+ if (retval == PDC_OK)
+ memcpy(pret, &pdc_result, sizeof(*pret));
+
+ spin_unlock_irqrestore(&pdc_lock, flags);
+
+ return retval;
+}
#endif /* CONFIG_64BIT */
OpenPOWER on IntegriCloud