mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
* Add NVDIMM support to EDAC (Tony Luck)
* misc fixes -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAlrDZ6EACgkQEsHwGGHe VUpWWA//RG9WqqdXxPa05TxiRFWMiNSH/HSGJQZsc3K7xm2TEGVdDv5thYsxXCaW kA0oiUJA3zd62HeUIWMeGypm+hLM8T73836aIKcfxMduxQ6DR9nk51IV4RmHsLvT rd4bUsrjCov6spapqS265LOxZVnpKvxZv0NVTj6pIk0pkeghWMZh63vZtrxVkLsS 6dHsdIDBr0fMhcFBVQ67SEDpMIyMAqziPOP9sv6NNElG4Q93RnZr6KYvQdE32Iev Z6lIUU/sjVJEuhgp6FjJrhvjc+FmGJGERsFqo3Z8RT9P26Cj3wq0ov8IY/KSBazG mfJFGbL+O3lppGKjjuAwMGr4R3fZMLQpgLxdYe7VNvOHB9ea7732q9MDGiNkN/u7 z8o+dtvmPWr0Y1ir8te+7LnSQXIAwxMkKP/lMStzzuFUETQDd0RWr7GAKlbrgPOU +DhiQRPBFS7qpslA7BdqV6Ybr3nhDVZciDYWsvNpDMwdem05TxlFwC5l/BzP9NtM FmQ3B0rQ5we6gib6UZWUjW3BH9wUgFUpu/WXKJl1unMHwYNe3CvdM8yD5W7mUylh 6SVYAmkZyuJ1Du40+YMeimroe77XV60IqoUFNEzMSFeB4/GxMG6+u2gUqNuTpHpZ aMmCRj9DxWGxZyDsTc49An0X/JbVyIE/Aq6heMTYScgBvCaD1VE= =K89j -----END PGP SIGNATURE----- Merge tag 'edac_for_4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp Pull EDAC updates from Borislav Petkov: "Noteworthy is the NVDIMM support: - NVDIMM support to EDAC (Tony Luck) - misc fixes" * tag 'edac_for_4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC, sb_edac: Remove variable length array usage EDAC, skx_edac: Detect non-volatile DIMMs firmware, DMI: Add function to look up a handle and return DIMM size acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle EDAC: Add new memory type for non-volatile DIMMs EDAC: Drop duplicated array of strings for memory type names EDAC, layerscape: Allow building for LS1021A
This commit is contained in:
commit
dd972f924d
10 changed files with 175 additions and 59 deletions
|
|
@ -32,6 +32,7 @@ static char dmi_ids_string[128] __initdata;
|
|||
static struct dmi_memdev_info {
|
||||
const char *device;
|
||||
const char *bank;
|
||||
u64 size; /* bytes */
|
||||
u16 handle;
|
||||
} *dmi_memdev;
|
||||
static int dmi_memdev_nr;
|
||||
|
|
@ -386,6 +387,8 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v)
|
|||
{
|
||||
const char *d = (const char *)dm;
|
||||
static int nr;
|
||||
u64 bytes;
|
||||
u16 size;
|
||||
|
||||
if (dm->type != DMI_ENTRY_MEM_DEVICE || dm->length < 0x12)
|
||||
return;
|
||||
|
|
@ -396,6 +399,20 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v)
|
|||
dmi_memdev[nr].handle = get_unaligned(&dm->handle);
|
||||
dmi_memdev[nr].device = dmi_string(dm, d[0x10]);
|
||||
dmi_memdev[nr].bank = dmi_string(dm, d[0x11]);
|
||||
|
||||
size = get_unaligned((u16 *)&d[0xC]);
|
||||
if (size == 0)
|
||||
bytes = 0;
|
||||
else if (size == 0xffff)
|
||||
bytes = ~0ull;
|
||||
else if (size & 0x8000)
|
||||
bytes = (u64)(size & 0x7fff) << 10;
|
||||
else if (size != 0x7fff)
|
||||
bytes = (u64)size << 20;
|
||||
else
|
||||
bytes = (u64)get_unaligned((u32 *)&d[0x1C]) << 20;
|
||||
|
||||
dmi_memdev[nr].size = bytes;
|
||||
nr++;
|
||||
}
|
||||
|
||||
|
|
@ -1085,3 +1102,17 @@ void dmi_memdev_name(u16 handle, const char **bank, const char **device)
|
|||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dmi_memdev_name);
|
||||
|
||||
u64 dmi_memdev_size(u16 handle)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (dmi_memdev) {
|
||||
for (n = 0; n < dmi_memdev_nr; n++) {
|
||||
if (handle == dmi_memdev[n].handle)
|
||||
return dmi_memdev[n].size;
|
||||
}
|
||||
}
|
||||
return ~0ull;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dmi_memdev_size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue