Commit 683ec0e0 authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman

powerpc/papr_scm: Update DT properties

The ibm,unit-sizes property was originally specified as an array of two
u32s corresponding to the memory block size, and the number of blocks
available in that region. A fairly last-minute change to the SCM DT
specification was splitting that into two seperate u64 properties:
ibm,block-sizes and ibm,number-of-blocks that convey the same
information. No firmware / hypervisor that emitted the ibm,unit-size
property ever appeared in the wild.

Fixes: b5beae5e ("powerpc/pseries: Add driver for PAPR SCM regions")
Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
[mpe: Use kernel types (u32/u64)]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 59613526
...@@ -257,8 +257,9 @@ err: nvdimm_bus_unregister(p->bus); ...@@ -257,8 +257,9 @@ err: nvdimm_bus_unregister(p->bus);
static int papr_scm_probe(struct platform_device *pdev) static int papr_scm_probe(struct platform_device *pdev)
{ {
uint32_t drc_index, metadata_size, unit_cap[2];
struct device_node *dn = pdev->dev.of_node; struct device_node *dn = pdev->dev.of_node;
u32 drc_index, metadata_size;
u64 blocks, block_size;
struct papr_scm_priv *p; struct papr_scm_priv *p;
int rc; int rc;
...@@ -268,8 +269,13 @@ static int papr_scm_probe(struct platform_device *pdev) ...@@ -268,8 +269,13 @@ static int papr_scm_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
if (of_property_read_u32_array(dn, "ibm,unit-capacity", unit_cap, 2)) { if (of_property_read_u64(dn, "ibm,block-size", &block_size)) {
dev_err(&pdev->dev, "%pOF: missing unit-capacity!\n", dn); dev_err(&pdev->dev, "%pOF: missing block-size!\n", dn);
return -ENODEV;
}
if (of_property_read_u64(dn, "ibm,number-of-blocks", &blocks)) {
dev_err(&pdev->dev, "%pOF: missing number-of-blocks!\n", dn);
return -ENODEV; return -ENODEV;
} }
...@@ -282,8 +288,8 @@ static int papr_scm_probe(struct platform_device *pdev) ...@@ -282,8 +288,8 @@ static int papr_scm_probe(struct platform_device *pdev)
p->dn = dn; p->dn = dn;
p->drc_index = drc_index; p->drc_index = drc_index;
p->block_size = unit_cap[0]; p->block_size = block_size;
p->blocks = unit_cap[1]; p->blocks = blocks;
/* might be zero */ /* might be zero */
p->metadata_size = metadata_size; p->metadata_size = metadata_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment