diff options
| author | Oliver O'Halloran <oohall@gmail.com> | 2018-12-06 10:17:10 -0500 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-12-09 05:32:16 -0500 |
| commit | 683ec0e04ab7e2d86d2656c71322dfb2ebf063fc (patch) | |
| tree | de470325d8658aebe7fd4f09bcc95bfdca2e6deb | |
| parent | 59613526117b0595cb7b04835390ecd5175f9cd4 (diff) | |
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: b5beae5e224f ("powerpc/pseries: Add driver for PAPR SCM regions")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[mpe: Use kernel types (u32/u64)]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
| -rw-r--r-- | arch/powerpc/platforms/pseries/papr_scm.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index 390badd33547..de47e3719c8d 100644 --- a/arch/powerpc/platforms/pseries/papr_scm.c +++ b/arch/powerpc/platforms/pseries/papr_scm.c | |||
| @@ -257,8 +257,9 @@ err: nvdimm_bus_unregister(p->bus); | |||
| 257 | 257 | ||
| 258 | static int papr_scm_probe(struct platform_device *pdev) | 258 | static int papr_scm_probe(struct platform_device *pdev) |
| 259 | { | 259 | { |
| 260 | uint32_t drc_index, metadata_size, unit_cap[2]; | ||
| 261 | struct device_node *dn = pdev->dev.of_node; | 260 | struct device_node *dn = pdev->dev.of_node; |
| 261 | u32 drc_index, metadata_size; | ||
| 262 | u64 blocks, block_size; | ||
| 262 | struct papr_scm_priv *p; | 263 | struct papr_scm_priv *p; |
| 263 | int rc; | 264 | int rc; |
| 264 | 265 | ||
| @@ -268,8 +269,13 @@ static int papr_scm_probe(struct platform_device *pdev) | |||
| 268 | return -ENODEV; | 269 | return -ENODEV; |
| 269 | } | 270 | } |
| 270 | 271 | ||
| 271 | if (of_property_read_u32_array(dn, "ibm,unit-capacity", unit_cap, 2)) { | 272 | if (of_property_read_u64(dn, "ibm,block-size", &block_size)) { |
| 272 | dev_err(&pdev->dev, "%pOF: missing unit-capacity!\n", dn); | 273 | dev_err(&pdev->dev, "%pOF: missing block-size!\n", dn); |
| 274 | return -ENODEV; | ||
| 275 | } | ||
| 276 | |||
| 277 | if (of_property_read_u64(dn, "ibm,number-of-blocks", &blocks)) { | ||
| 278 | dev_err(&pdev->dev, "%pOF: missing number-of-blocks!\n", dn); | ||
| 273 | return -ENODEV; | 279 | return -ENODEV; |
| 274 | } | 280 | } |
| 275 | 281 | ||
| @@ -282,8 +288,8 @@ static int papr_scm_probe(struct platform_device *pdev) | |||
| 282 | 288 | ||
| 283 | p->dn = dn; | 289 | p->dn = dn; |
| 284 | p->drc_index = drc_index; | 290 | p->drc_index = drc_index; |
| 285 | p->block_size = unit_cap[0]; | 291 | p->block_size = block_size; |
| 286 | p->blocks = unit_cap[1]; | 292 | p->blocks = blocks; |
| 287 | 293 | ||
| 288 | /* might be zero */ | 294 | /* might be zero */ |
| 289 | p->metadata_size = metadata_size; | 295 | p->metadata_size = metadata_size; |
