ppc/pnv: minor XSCOM fixes
cover ppc/pnv: minor XSCOM fixes
Hello,
Here are a couple of fixes/cleanups for the PowerNV XSCOM bus.
Thanks,
C.
Cédric Le Goater (2):
ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM
nodes
ppc/pnv: populate the DT with realized XSCOM devices
hw/ppc/pnv_xscom.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.0
PATCH 1/2 ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than the first layer, so we need to loop on the whole object hierarchy to catch them.
--- hw/ppc/pnv_xscom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
hw/ppc/pnv_xscom.c +6 -1
@@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) args.fdt = fdt; args.xscom_offset = xscom_offset; -object_child_foreach (OBJECT (chip), xscom_dt_child, &args); +/* +* Loop on the whole object hierarchy to catch all +* PnvXScomInterface objects which can lie a bit deeper the first +* layer. +*/ +object_child_foreach_recursive (OBJECT (chip), xscom_dt_child, &args);return 0 ; }
Signature · 1 line
2.21.0
Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
Quoted 1 line · On Tue, 10 Dec 2019 14:58:44 +0100 Cédric Le Goater <[email protected]> wrote:
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
I didn't find any trace of PnvPBCQState in the code... what is it ?
Quoted 13 lines
the first layer, so we need to loop on the whole object hierarchy to catch them.
Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_xscom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +0
-0
hw/ppc/pnv_xscom.c int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) · line 331
Quoted 7 lines
hw/ppc/pnv_xscom.c +3
-1@@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) args.fdt = fdt; args.xscom_offset = xscom_offset; -object_child_foreach (OBJECT (chip), xscom_dt_child, &args); +/* +* Loop on the whole object hierarchy to catch all +* PnvXScomInterface objects which can lie a bit deeper the first
s/deeper the first/deeper than the first/
Quoted 6 lines
hw/ppc/pnv_xscom.c +3
-0+* layer. +*/ +object_child_foreach_recursive (OBJECT (chip), xscom_dt_child, &args);return 0 ; }
Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
Quoted 6 lines · Greg Kurz
Quoted 1 line · On Tue, 10 Dec 2019 14:58:44 +0100 Cédric Le Goater <[email protected]> wrote:
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
I didn't find any trace of PnvPBCQState in the code... what is it ?
PHB4, which is not merged yet.
C.
Quoted 31 lines
Quoted 14 lines
the first layer, so we need to loop on the whole object hierarchy to catch them.
Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_xscom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +0
-0hw/ppc/pnv_xscom.c int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) · line 331
Quoted 7 lines
hw/ppc/pnv_xscom.c +3
-1@@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) args.fdt = fdt; args.xscom_offset = xscom_offset; -object_child_foreach (OBJECT (chip), xscom_dt_child, &args); +/* +* Loop on the whole object hierarchy to catch all +* PnvXScomInterface objects which can lie a bit deeper the first s/deeper the first/deeper than the first/
Quoted 6 lines
hw/ppc/pnv_xscom.c +3
-0+* layer. +*/ +object_child_foreach_recursive (OBJECT (chip), xscom_dt_child, &args);return 0 ; }
Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
Quoted 9 lines · Cédric Le Goater
Quoted 6 lines · Greg Kurz
Quoted 1 line · On Tue, 10 Dec 2019 14:58:44 +0100 Cédric Le Goater <[email protected]> wrote:
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
I didn't find any trace of PnvPBCQState in the code... what is it ?
PHB4, which is not merged yet.
In fact, PnvPBCQState is for PHB3. But we have a similar need for PHB4.
C.
Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
In reply to Greg KurzQuoted 23 lines · Greg Kurz
Quoted 1 line · On Tue, 10 Dec 2019 14:58:44 +0100 Cédric Le Goater <[email protected]> wrote:
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
I didn't find any trace of PnvPBCQState in the code... what is it ?
Quoted 16 lines
the first layer, so we need to loop on the whole object hierarchy to catch them.
Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_xscom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +0
-0@@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) args.fdt = fdt; args.xscom_offset = xscom_offset;
Quoted 6 lines
hw/ppc/pnv_xscom.c int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) · line 331
Quoted 4 lines
hw/ppc/pnv_xscom.c +3
-1-object_child_foreach (OBJECT (chip), xscom_dt_child, &args); +/* +* Loop on the whole object hierarchy to catch all +* PnvXScomInterface objects which can lie a bit deeper the first s/deeper the first/deeper than the first/
Fixed during commit.
Quoted 8 lines
Quoted 7 lines
hw/ppc/pnv_xscom.c +3
-0+* layer. +*/ +object_child_foreach_recursive (OBJECT (chip), xscom_dt_child, &args);return 0 ; }
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
In reply to Cédric Le GoaterQuoted 6 lines · On Tue, 10 Dec 2019 14:58:44 +0100 Cédric Le Goater <[email protected]> wrote:
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than the first layer, so we need to loop on the whole object hierarchy to catch them.
Signed-off-by Cédric Le Goater <[email protected]>---
Quoted 21 lines
hw/ppc/pnv_xscom.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +6
-1@@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) args.fdt = fdt; args.xscom_offset = xscom_offset; -object_child_foreach (OBJECT (chip), xscom_dt_child, &args); +/* +* Loop on the whole object hierarchy to catch all +* PnvXScomInterface objects which can lie a bit deeper the first +* layer. +*/ +object_child_foreach_recursive (OBJECT (chip), xscom_dt_child, &args);return 0 ; }
PATCH 2/2 ppc/pnv: populate the DT with realized XSCOM devices
In reply to Cédric Le GoaterSome devices could be initialized in the instance_init handler but not realized for configuration reasons. Nodes should not be added in the DT for such devices.
--- hw/ppc/pnv_xscom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/ppc/pnv_xscom.c +4 -1
@@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)PnvXScomInterface *xd =PNV_XSCOM_INTERFACE (child);PnvXScomInterfaceClass *xc =PNV_XSCOM_INTERFACE_GET_CLASS (xd); -if (xc->dt_xscom) { +/* +* Only "realized" devices should be configured in the DT +*/ +if (xc->dt_xscom &&DEVICE (child)->realized) {_FDT ((xc->dt_xscom (xd, args->fdt, args->xscom_offset))); } }
Signature · 1 line
2.21.0
Re: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
Quoted 4 lines · On Tue, 10 Dec 2019 14:58:45 +0100 Cédric Le Goater <[email protected]> wrote:
Some devices could be initialized in the
instance_inithandler but not realized for configuration reasons. Nodes should not be added in the DT for such devices.
Do you have examples of such devices to share ?
Quoted 21 lines
Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_xscom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +4
-1@@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)PnvXScomInterface *xd =PNV_XSCOM_INTERFACE (child);PnvXScomInterfaceClass *xc =PNV_XSCOM_INTERFACE_GET_CLASS (xd); -if (xc->dt_xscom) { +/* +* Only "realized" devices should be configured in the DT +*/ +if (xc->dt_xscom &&DEVICE (child)->realized) {_FDT ((xc->dt_xscom (xd, args->fdt, args->xscom_offset))); } }
Re: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
Quoted 9 lines · Greg Kurz
Quoted 4 lines · On Tue, 10 Dec 2019 14:58:45 +0100 Cédric Le Goater <[email protected]> wrote:
Some devices could be initialized in the
instance_inithandler but not realized for configuration reasons. Nodes should not be added in the DT for such devices.Do you have examples of such devices to share ?
PHB4 again.
C.
Quoted 23 lines
Quoted 22 lines
Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_xscom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +4
-1@@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)PnvXScomInterface *xd =PNV_XSCOM_INTERFACE (child);PnvXScomInterfaceClass *xc =PNV_XSCOM_INTERFACE_GET_CLASS (xd); -if (xc->dt_xscom) { +/* +* Only "realized" devices should be configured in the DT +*/ +if (xc->dt_xscom &&DEVICE (child)->realized) {_FDT ((xc->dt_xscom (xd, args->fdt, args->xscom_offset))); } }
Re: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
In reply to Cédric Le GoaterQuoted 6 lines · On Tue, 10 Dec 2019 14:58:45 +0100 Cédric Le Goater <[email protected]> wrote:
Some devices could be initialized in the
instance_inithandler but not realized for configuration reasons. Nodes should not be added in the DT for such devices.Signed-off-by Cédric Le Goater <[email protected]>---
Quoted 19 lines
hw/ppc/pnv_xscom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)hw/ppc/pnv_xscom.c +4
-1@@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)PnvXScomInterface *xd =PNV_XSCOM_INTERFACE (child);PnvXScomInterfaceClass *xc =PNV_XSCOM_INTERFACE_GET_CLASS (xd); -if (xc->dt_xscom) { +/* +* Only "realized" devices should be configured in the DT +*/ +if (xc->dt_xscom &&DEVICE (child)->realized) {_FDT ((xc->dt_xscom (xd, args->fdt, args->xscom_offset))); } }
David Gibson
AppliedQuoted 3 lines · Cédric Le Goater
Hello,
Here are a couple of fixes/cleanups for the PowerNV XSCOM bus.
Applied to ppc-for-5.0, thanks.
Quoted 13 lines
Thanks,
C.
Cédric Le Goater (2):
ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM
nodes
ppc/pnv: populate the DT with realized XSCOM deviceshw/ppc/pnv_xscom.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson