From: Jack Miller <hidden> Date: 2016-08-01 20:50:45
Skiboot will place the flash device tree node at ibm,opal/flash/flash@0
on P9 and later systems, so Linux needs to search for it there as well
as ibm,opal/flash@0 for backwards compatibility.
Signed-off-by: Jack Miller <redacted>
---
arch/powerpc/platforms/powernv/opal.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-08-03 07:16:35
Quoting Jack Miller (2016-08-02 06:50:35)
Skiboot will place the flash device tree node at ibm,opal/flash/flash@0
on P9 and later systems, so Linux needs to search for it there as well
as ibm,opal/flash@0 for backwards compatibility.
=
Signed-off-by: Jack Miller <redacted>
---
arch/powerpc/platforms/powernv/opal.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
=
+ /* New >=3D P9 flash location */
+ np =3D of_get_child_by_name(opal_node, "flash");
+ if (np)
+ opal_pdev_init(np, "ibm,opal-flash");
We could instead just search for all nodes that are compatible with
"ibm,opal-flash". We do that for i2c, see opal_i2c_create_devs().
Is there a particular reason not to do that?
cheers
From: Jack Miller <hidden> Date: 2016-08-03 16:44:37
On Wed, Aug 03, 2016 at 05:16:34PM +1000, Michael Ellerman wrote:
We could instead just search for all nodes that are compatible with
"ibm,opal-flash". We do that for i2c, see opal_i2c_create_devs().
Is there a particular reason not to do that?
I'm actually surprised that this is preferred. Jeremy mentioned something
similar, but I guess I just don't like the idea of finding devices in weird
places in the tree. Then again, if we can't trust the DT we're in bigger
trouble than erroneous flash nodes =).
If we really just want to find compatible nodes anywhere, let's simplify i2c
and pdev_init into one function and make that behavior consistent with this
new patch.
- Jack
From: Jack Miller <hidden> Date: 2016-08-03 16:44:39
This condenses the opal node searching into a single function that finds
all compatible nodes, instead of just searching the ibm,opal children,
for ipmi, flash, and prd similar to how opal-i2c nodes are found.
Signed-off-by: Jack Miller <redacted>
---
arch/powerpc/platforms/powernv/opal.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
From: Jack Miller <hidden> Date: 2016-08-03 17:18:50
(rebased on powerpc/next)
This condenses the opal node searching into a single function that finds
all compatible nodes, instead of just searching the ibm,opal children,
for ipmi, flash, and prd similar to how opal-i2c nodes are found.
Signed-off-by: Jack Miller <redacted>
---
arch/powerpc/platforms/powernv/opal.c | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-08-04 03:28:05
Jack Miller [off-list ref] writes:
On Wed, Aug 03, 2016 at 05:16:34PM +1000, Michael Ellerman wrote:
quoted
We could instead just search for all nodes that are compatible with
"ibm,opal-flash". We do that for i2c, see opal_i2c_create_devs().
Is there a particular reason not to do that?
I'm actually surprised that this is preferred. Jeremy mentioned something
similar, but I guess I just don't like the idea of finding devices in weird
places in the tree.
But where is "weird". Arguably "/opal/flash" is weird. What does it
mean? There's a bus called "opal" and a device on it called "flash"? No.
Point being the structure is fairly arbitrary, or at least debatable, so
tying the code 100% to the structure is inflexible. As we have discovered.
Our other option is to tell skiboot to get stuffed, and leave the flash
node where it was on P8.
Then again, if we can't trust the DT we're in bigger
trouble than erroneous flash nodes =).
Quite :)
If we really just want to find compatible nodes anywhere, let's simplify i2c
and pdev_init into one function and make that behavior consistent with this
new patch.
That seems OK to me.
We should get an ack from Stewart though for the other node types.
cheers
On Wed, 3 Aug 2016 12:18:00 -0500
Jack Miller [off-list ref] wrote:
(rebased on powerpc/next)
This condenses the opal node searching into a single function that finds
all compatible nodes, instead of just searching the ibm,opal children,
for ipmi, flash, and prd similar to how opal-i2c nodes are found.
Signed-off-by: Jack Miller <redacted>
Using a version of the related skiboot patch that may not be the final one:
Tested-by: Cyril Bur <redacted>
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-08-04 08:39:25
Cyril Bur [off-list ref] writes:
On Wed, 3 Aug 2016 12:18:00 -0500
Jack Miller [off-list ref] wrote:
quoted
(rebased on powerpc/next)
This condenses the opal node searching into a single function that finds
all compatible nodes, instead of just searching the ibm,opal children,
for ipmi, flash, and prd similar to how opal-i2c nodes are found.
Signed-off-by: Jack Miller <redacted>
Using a version of the related skiboot patch that may not be the final one:
Tested-by: Cyril Bur <redacted>
Thanks. The part I'm still not clear on is *why* we're moving them in
skiboot?
cheers
From: Jack Miller <hidden> Date: 2016-08-04 16:03:18
On Thu, Aug 04, 2016 at 06:39:24PM +1000, Michael Ellerman wrote:
Cyril Bur [off-list ref] writes:
quoted
On Wed, 3 Aug 2016 12:18:00 -0500
Jack Miller [off-list ref] wrote:
quoted
(rebased on powerpc/next)
This condenses the opal node searching into a single function that finds
all compatible nodes, instead of just searching the ibm,opal children,
for ipmi, flash, and prd similar to how opal-i2c nodes are found.
Signed-off-by: Jack Miller <redacted>
Using a version of the related skiboot patch that may not be the final one:
Tested-by: Cyril Bur <redacted>
Thanks. The part I'm still not clear on is *why* we're moving them in
skiboot?
Ostensibly so the actual flash device nodes can inherit the #size-cells /
#address-cells properties properly set in the flash parent node instead of
the ibm,opal node (which has them set to 0). This would be more correct if
anything actually started to honor these settings.
The only concrete effect though is stopping dtc (and thus fwts) from whinging
when you run skiboot's output DT through it.
- Jack
From: Stewart Smith <hidden> Date: 2016-09-27 04:44:40
Michael Ellerman [off-list ref] writes:
Jack Miller [off-list ref] writes:
quoted
On Wed, Aug 03, 2016 at 05:16:34PM +1000, Michael Ellerman wrote:
quoted
We could instead just search for all nodes that are compatible with
"ibm,opal-flash". We do that for i2c, see opal_i2c_create_devs().
Is there a particular reason not to do that?
I'm actually surprised that this is preferred. Jeremy mentioned something
similar, but I guess I just don't like the idea of finding devices in weird
places in the tree.
But where is "weird". Arguably "/opal/flash" is weird. What does it
mean? There's a bus called "opal" and a device on it called "flash"? No.
Point being the structure is fairly arbitrary, or at least debatable, so
tying the code 100% to the structure is inflexible. As we have discovered.
Our other option is to tell skiboot to get stuffed, and leave the flash
node where it was on P8.
quoted
Then again, if we can't trust the DT we're in bigger
trouble than erroneous flash nodes =).
Quite :)
quoted
If we really just want to find compatible nodes anywhere, let's simplify i2c
and pdev_init into one function and make that behavior consistent with this
new patch.
That seems OK to me.
We should get an ack from Stewart though for the other node types.
For finding nodes based on compatible no matter where they are in the tree,
Acked-by: Stewart Smith <redacted>
(and yes, includes other nodes too)
The exact location then isn't too important, and having a /flash that's
ibm,opal-flash and allows for some other driver to bind to it I think is
also something we shouldn't rule out.
--
Stewart Smith
OPAL Architect, IBM.