Lines Matching refs:nfit_mem
186 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in xlat_nvdimm_status() local
194 if (nfit_mem->has_lsr) in xlat_nvdimm_status()
201 if (nfit_mem->has_lsr && status == ACPI_LABELS_LOCKED) in xlat_nvdimm_status()
205 if (nfit_mem->has_lsw && status == ACPI_LABELS_LOCKED) in xlat_nvdimm_status()
398 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in acpi_nfit_ctl() local
424 struct acpi_device *adev = nfit_mem->adev; in acpi_nfit_ctl()
428 if (call_pkg && nfit_mem->family != call_pkg->nd_family) in acpi_nfit_ctl()
434 dsm_mask = nfit_mem->dsm_mask; in acpi_nfit_ctl()
436 guid = to_nfit_uuid(nfit_mem->family); in acpi_nfit_ctl()
483 if (nvdimm && cmd == ND_CMD_GET_CONFIG_SIZE && nfit_mem->has_lsr) in acpi_nfit_ctl()
485 else if (nvdimm && cmd == ND_CMD_GET_CONFIG_DATA && nfit_mem->has_lsr) { in acpi_nfit_ctl()
490 && nfit_mem->has_lsw) { in acpi_nfit_ctl()
499 revid = nfit_dsm_revid(nfit_mem->family, func); in acpi_nfit_ctl()
695 struct nfit_mem *nfit_mem; in nfit_get_smbios_id() local
700 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { in nfit_get_smbios_id()
701 memdev = __to_nfit_memdev(nfit_mem); in nfit_get_smbios_id()
935 struct nfit_mem *nfit_mem) in nfit_mem_find_spa_bdw() argument
937 u32 device_handle = __to_nfit_memdev(nfit_mem)->device_handle; in nfit_mem_find_spa_bdw()
938 u16 dcr = nfit_mem->dcr->region_index; in nfit_mem_find_spa_bdw()
957 nfit_mem->spa_bdw = nfit_spa->spa; in nfit_mem_find_spa_bdw()
963 nfit_mem->spa_dcr->range_index); in nfit_mem_find_spa_bdw()
964 nfit_mem->bdw = NULL; in nfit_mem_find_spa_bdw()
968 struct nfit_mem *nfit_mem, struct acpi_nfit_system_address *spa) in nfit_mem_init_bdw() argument
970 u16 dcr = __to_nfit_memdev(nfit_mem)->region_index; in nfit_mem_init_bdw()
979 nfit_mem->bdw = nfit_bdw->bdw; in nfit_mem_init_bdw()
983 if (!nfit_mem->bdw) in nfit_mem_init_bdw()
986 nfit_mem_find_spa_bdw(acpi_desc, nfit_mem); in nfit_mem_init_bdw()
988 if (!nfit_mem->spa_bdw) in nfit_mem_init_bdw()
991 range_index = nfit_mem->spa_bdw->range_index; in nfit_mem_init_bdw()
996 nfit_mem->memdev_bdw = nfit_memdev->memdev; in nfit_mem_init_bdw()
1001 nfit_mem->idt_bdw = nfit_idt->idt; in nfit_mem_init_bdw()
1011 struct nfit_mem *nfit_mem, *found; in __nfit_mem_init() local
1044 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) in __nfit_mem_init()
1045 if (__to_nfit_memdev(nfit_mem)->device_handle in __nfit_mem_init()
1047 found = nfit_mem; in __nfit_mem_init()
1052 nfit_mem = found; in __nfit_mem_init()
1054 nfit_mem = devm_kzalloc(acpi_desc->dev, in __nfit_mem_init()
1055 sizeof(*nfit_mem), GFP_KERNEL); in __nfit_mem_init()
1056 if (!nfit_mem) in __nfit_mem_init()
1058 INIT_LIST_HEAD(&nfit_mem->list); in __nfit_mem_init()
1059 nfit_mem->acpi_desc = acpi_desc; in __nfit_mem_init()
1060 list_add(&nfit_mem->list, &acpi_desc->dimms); in __nfit_mem_init()
1073 if (!nfit_mem->dcr) in __nfit_mem_init()
1074 nfit_mem->dcr = nfit_dcr->dcr; in __nfit_mem_init()
1075 else if (nfit_mem->dcr->windows == 0 in __nfit_mem_init()
1077 nfit_mem->dcr = nfit_dcr->dcr; in __nfit_mem_init()
1087 nfit_mem->nfit_flush = nfit_flush; in __nfit_mem_init()
1089 nfit_mem->flush_wpq = devm_kcalloc(acpi_desc->dev, in __nfit_mem_init()
1093 if (!nfit_mem->flush_wpq) in __nfit_mem_init()
1096 struct resource *res = &nfit_mem->flush_wpq[i]; in __nfit_mem_init()
1104 if (dcr && !nfit_mem->dcr) { in __nfit_mem_init()
1115 nfit_mem->spa_dcr = spa; in __nfit_mem_init()
1116 nfit_mem->memdev_dcr = nfit_memdev->memdev; in __nfit_mem_init()
1121 nfit_mem->idt_dcr = nfit_idt->idt; in __nfit_mem_init()
1124 nfit_mem_init_bdw(acpi_desc, nfit_mem, spa); in __nfit_mem_init()
1131 nfit_mem->memdev_pmem = nfit_memdev->memdev; in __nfit_mem_init()
1133 nfit_mem->memdev_dcr = nfit_memdev->memdev; in __nfit_mem_init()
1141 struct nfit_mem *a = container_of(_a, typeof(*a), list); in nfit_mem_cmp()
1142 struct nfit_mem *b = container_of(_b, typeof(*b), list); in nfit_mem_cmp()
1357 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in to_nfit_memdev() local
1359 return __to_nfit_memdev(nfit_mem); in to_nfit_memdev()
1365 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in to_nfit_dcr() local
1367 return nfit_mem->dcr; in to_nfit_dcr()
1445 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in num_nvdimm_formats() local
1448 if (nfit_mem->memdev_pmem) in num_nvdimm_formats()
1450 if (nfit_mem->memdev_bdw) in num_nvdimm_formats()
1469 struct nfit_mem *nfit_mem; in format1_show() local
1475 nfit_mem = nvdimm_provider_data(nvdimm); in format1_show()
1476 acpi_desc = nfit_mem->acpi_desc; in format1_show()
1527 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in family_show() local
1529 if (nfit_mem->family < 0) in family_show()
1531 return sprintf(buf, "%d\n", nfit_mem->family); in family_show()
1539 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in dsm_mask_show() local
1541 if (nfit_mem->family < 0) in dsm_mask_show()
1543 return sprintf(buf, "%#lx\n", nfit_mem->dsm_mask); in dsm_mask_show()
1638 struct nfit_mem *nfit_mem; in acpi_nfit_dimm_by_handle() local
1640 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) in acpi_nfit_dimm_by_handle()
1641 if (__to_nfit_memdev(nfit_mem)->device_handle == device_handle) in acpi_nfit_dimm_by_handle()
1642 return nfit_mem->nvdimm; in acpi_nfit_dimm_by_handle()
1649 struct nfit_mem *nfit_mem; in __acpi_nvdimm_notify() local
1669 nfit_mem = dev_get_drvdata(dev); in __acpi_nvdimm_notify()
1670 if (nfit_mem && nfit_mem->flags_attr) in __acpi_nvdimm_notify()
1671 sysfs_notify_dirent(nfit_mem->flags_attr); in __acpi_nvdimm_notify()
1698 struct nfit_mem *nfit_mem, u32 device_handle) in acpi_nfit_add_dimm() argument
1708 nfit_mem->dsm_mask = acpi_desc->dimm_cmd_force_en; in acpi_nfit_add_dimm()
1709 nfit_mem->family = NVDIMM_FAMILY_INTEL; in acpi_nfit_add_dimm()
1715 nfit_mem->adev = adev_dimm; in acpi_nfit_add_dimm()
1732 dev_set_drvdata(&adev_dimm->dev, nfit_mem); in acpi_nfit_add_dimm()
1745 nfit_mem->family = family; in acpi_nfit_add_dimm()
1748 else if (nfit_mem->family == NVDIMM_FAMILY_INTEL) { in acpi_nfit_add_dimm()
1752 } else if (nfit_mem->family == NVDIMM_FAMILY_HPE1) { in acpi_nfit_add_dimm()
1754 } else if (nfit_mem->family == NVDIMM_FAMILY_HPE2) { in acpi_nfit_add_dimm()
1758 } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT) { in acpi_nfit_add_dimm()
1762 nfit_mem->family = -1; in acpi_nfit_add_dimm()
1767 guid = to_nfit_uuid(nfit_mem->family); in acpi_nfit_add_dimm()
1770 nfit_dsm_revid(nfit_mem->family, i), in acpi_nfit_add_dimm()
1772 set_bit(i, &nfit_mem->dsm_mask); in acpi_nfit_add_dimm()
1787 nfit_mem->has_lsr = true; in acpi_nfit_add_dimm()
1790 if (nfit_mem->has_lsr && acpi_nvdimm_has_method(adev_dimm, "_LSW")) { in acpi_nfit_add_dimm()
1792 nfit_mem->has_lsw = true; in acpi_nfit_add_dimm()
1801 struct nfit_mem *nfit_mem; in shutdown_dimm_notify() local
1808 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { in shutdown_dimm_notify()
1809 struct acpi_device *adev_dimm = nfit_mem->adev; in shutdown_dimm_notify()
1811 if (nfit_mem->flags_attr) { in shutdown_dimm_notify()
1812 sysfs_put(nfit_mem->flags_attr); in shutdown_dimm_notify()
1813 nfit_mem->flags_attr = NULL; in shutdown_dimm_notify()
1826 struct nfit_mem *nfit_mem; in acpi_nfit_register_dimms() local
1830 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { in acpi_nfit_register_dimms()
1837 device_handle = __to_nfit_memdev(nfit_mem)->device_handle; in acpi_nfit_register_dimms()
1844 if (nfit_mem->bdw && nfit_mem->memdev_pmem) in acpi_nfit_register_dimms()
1851 dimm_memdev = __to_nfit_memdev(nfit_mem); in acpi_nfit_register_dimms()
1858 mem_flags = __to_nfit_memdev(nfit_mem)->flags; in acpi_nfit_register_dimms()
1862 rc = acpi_nfit_add_dimm(acpi_desc, nfit_mem, device_handle); in acpi_nfit_register_dimms()
1872 if (nfit_mem->family == NVDIMM_FAMILY_INTEL) { in acpi_nfit_register_dimms()
1878 cmd_mask |= nfit_mem->dsm_mask & NVDIMM_STANDARD_CMDMASK; in acpi_nfit_register_dimms()
1881 if (nfit_mem->has_lsr) { in acpi_nfit_register_dimms()
1885 if (nfit_mem->has_lsw) in acpi_nfit_register_dimms()
1888 flush = nfit_mem->nfit_flush ? nfit_mem->nfit_flush->flush in acpi_nfit_register_dimms()
1890 nvdimm = nvdimm_create(acpi_desc->nvdimm_bus, nfit_mem, in acpi_nfit_register_dimms()
1893 nfit_mem->flush_wpq); in acpi_nfit_register_dimms()
1897 nfit_mem->nvdimm = nvdimm; in acpi_nfit_register_dimms()
1921 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { in acpi_nfit_register_dimms()
1924 nvdimm = nfit_mem->nvdimm; in acpi_nfit_register_dimms()
1930 nfit_mem->flags_attr = sysfs_get_dirent(nfit_kernfs, in acpi_nfit_register_dimms()
1933 if (!nfit_mem->flags_attr) in acpi_nfit_register_dimms()
2123 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in acpi_nfit_init_interleave_set() local
2126 struct acpi_nfit_control_region *dcr = nfit_mem->dcr; in acpi_nfit_init_interleave_set()
2128 if (!memdev || !nfit_mem->dcr) { in acpi_nfit_init_interleave_set()
2166 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); in acpi_nfit_init_interleave_set() local
2167 struct acpi_nfit_control_region *dcr = nfit_mem->dcr; in acpi_nfit_init_interleave_set()
2362 struct nfit_mem *nfit_mem; in acpi_nfit_blk_region_enable() local
2367 nfit_mem = nvdimm_provider_data(nvdimm); in acpi_nfit_blk_region_enable()
2368 if (!nfit_mem || !nfit_mem->dcr || !nfit_mem->bdw) { in acpi_nfit_blk_region_enable()
2370 nfit_mem ? "" : " nfit_mem", in acpi_nfit_blk_region_enable()
2371 (nfit_mem && nfit_mem->dcr) ? "" : " dcr", in acpi_nfit_blk_region_enable()
2372 (nfit_mem && nfit_mem->bdw) ? "" : " bdw"); in acpi_nfit_blk_region_enable()
2383 nfit_blk->bdw_offset = nfit_mem->bdw->offset; in acpi_nfit_blk_region_enable()
2385 mmio->addr.base = devm_nvdimm_memremap(dev, nfit_mem->spa_bdw->address, in acpi_nfit_blk_region_enable()
2386 nfit_mem->spa_bdw->length, nd_blk_memremap_flags(ndbr)); in acpi_nfit_blk_region_enable()
2392 mmio->size = nfit_mem->bdw->size; in acpi_nfit_blk_region_enable()
2393 mmio->base_offset = nfit_mem->memdev_bdw->region_offset; in acpi_nfit_blk_region_enable()
2394 mmio->idt = nfit_mem->idt_bdw; in acpi_nfit_blk_region_enable()
2395 mmio->spa = nfit_mem->spa_bdw; in acpi_nfit_blk_region_enable()
2396 rc = nfit_blk_init_interleave(mmio, nfit_mem->idt_bdw, in acpi_nfit_blk_region_enable()
2397 nfit_mem->memdev_bdw->interleave_ways); in acpi_nfit_blk_region_enable()
2405 nfit_blk->cmd_offset = nfit_mem->dcr->command_offset; in acpi_nfit_blk_region_enable()
2406 nfit_blk->stat_offset = nfit_mem->dcr->status_offset; in acpi_nfit_blk_region_enable()
2408 mmio->addr.base = devm_nvdimm_ioremap(dev, nfit_mem->spa_dcr->address, in acpi_nfit_blk_region_enable()
2409 nfit_mem->spa_dcr->length); in acpi_nfit_blk_region_enable()
2415 mmio->size = nfit_mem->dcr->window_size; in acpi_nfit_blk_region_enable()
2416 mmio->base_offset = nfit_mem->memdev_dcr->region_offset; in acpi_nfit_blk_region_enable()
2417 mmio->idt = nfit_mem->idt_dcr; in acpi_nfit_blk_region_enable()
2418 mmio->spa = nfit_mem->spa_dcr; in acpi_nfit_blk_region_enable()
2419 rc = nfit_blk_init_interleave(mmio, nfit_mem->idt_dcr, in acpi_nfit_blk_region_enable()
2420 nfit_mem->memdev_dcr->interleave_ways); in acpi_nfit_blk_region_enable()
2661 struct nfit_mem *nfit_mem; in acpi_nfit_init_mapping() local
2678 nfit_mem = nvdimm_provider_data(nvdimm); in acpi_nfit_init_mapping()
2679 if (!nfit_mem || !nfit_mem->bdw) { in acpi_nfit_init_mapping()
2685 mapping->size = nfit_mem->bdw->capacity; in acpi_nfit_init_mapping()
2686 mapping->start = nfit_mem->bdw->start_address; in acpi_nfit_init_mapping()
2687 ndr_desc->num_lanes = nfit_mem->bdw->windows; in acpi_nfit_init_mapping()