diff mbox series

[2/3] p9_fapi_targets: Make P9 chiplet address translation match FAPI

Message ID 20200312012507.9052-2-alistair@popple.id.au
State Accepted
Headers show
Series [1/3] libpdbg: Move P9 chiplet definition into FAPI targets | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch master (8b4611b5d8e7e2279fe4aa80c892fcfe10aa398d)
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Alistair Popple March 12, 2020, 1:25 a.m. UTC
This patch makes the P9 chiplet address translation match the rest of
the translation for FAPI targets.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 libpdbg/p9_fapi_targets.c | 6 +++---
 p9.dts                    | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

Comments

Amitay Isaacs March 12, 2020, 1:37 a.m. UTC | #1
On Thu, 2020-03-12 at 12:25 +1100, Alistair Popple wrote:
> This patch makes the P9 chiplet address translation match the rest of
> the translation for FAPI targets.
> 
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> ---
>  libpdbg/p9_fapi_targets.c | 6 +++---
>  p9.dts                    | 4 +++-
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/libpdbg/p9_fapi_targets.c b/libpdbg/p9_fapi_targets.c
> index 9ff35d9..d38ecdb 100644
> --- a/libpdbg/p9_fapi_targets.c
> +++ b/libpdbg/p9_fapi_targets.c
> @@ -690,9 +690,9 @@ static int p9_chiplet_probe(struct pdbg_target
> *target)
>          return 0;
>  }
>  
> -static uint64_t p9_chiplet_translate(struct pdbg_target *target,
> uint64_t addr)
> +static uint64_t p9_chiplet_translate(struct chiplet *chiplet,
> uint64_t addr)
>  {
> -	return (addr & 0xffffffffc0ffffffULL) +
> pdbg_target_address(target, NULL);
> +	return set_chiplet_id(addr, pdbg_target_index(t(chiplet)));
>  }
>  
>  static struct chiplet p9_chiplet = {
> @@ -701,7 +701,7 @@ static struct chiplet p9_chiplet = {
>                  .compatible = "ibm,power9-chiplet",
>                  .class = "chiplet",
>                  .probe = p9_chiplet_probe,
> -		.translate = p9_chiplet_translate,
> +		.translate = translate_cast(p9_chiplet_translate),
>          },
>  	.getring = p9_chiplet_getring,
>  };
> diff --git a/p9.dts b/p9.dts
> index 8a35d75..1051e3e 100644
> --- a/p9.dts
> +++ b/p9.dts
> @@ -281,7 +281,7 @@
>  							index = < 0x20
> >;
>  							reg = < 0x00
> 0x20000000 0xfffff >;
>  
> -							core@0 {
> +							s0_n0_p0_eq0_ex
> 0_c0: core@0 {
>  								#addres
> s-cells = < 0x01 >;
>  								#size-
> cells = < 0x00 >;
>  								compati
> ble = "ibm,power9-core";
> @@ -3004,3 +3004,5 @@
>  		};
>  	};
>  };
> +
> +/include/ "p9-attributes.dts"

Both the dts changes are not meant for this patch, right?

Amitay.
Alistair Popple March 12, 2020, 1:42 a.m. UTC | #2
On Thursday, 12 March 2020 12:37:57 PM AEDT Amitay Isaacs wrote:
> On Thu, 2020-03-12 at 12:25 +1100, Alistair Popple wrote:
> > This patch makes the P9 chiplet address translation match the rest of
> > the translation for FAPI targets.
> > 
> > Signed-off-by: Alistair Popple <alistair@popple.id.au>
> > ---
> > 
> >  libpdbg/p9_fapi_targets.c | 6 +++---
> >  p9.dts                    | 4 +++-
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/libpdbg/p9_fapi_targets.c b/libpdbg/p9_fapi_targets.c
> > index 9ff35d9..d38ecdb 100644
> > --- a/libpdbg/p9_fapi_targets.c
> > +++ b/libpdbg/p9_fapi_targets.c
> > @@ -690,9 +690,9 @@ static int p9_chiplet_probe(struct pdbg_target
> > *target)
> > 
> >          return 0;
> >  
> >  }
> > 
> > -static uint64_t p9_chiplet_translate(struct pdbg_target *target,
> > uint64_t addr)
> > +static uint64_t p9_chiplet_translate(struct chiplet *chiplet,
> > uint64_t addr)
> > 
> >  {
> > 
> > -	return (addr & 0xffffffffc0ffffffULL) +
> > pdbg_target_address(target, NULL);
> > +	return set_chiplet_id(addr, pdbg_target_index(t(chiplet)));
> > 
> >  }
> >  
> >  static struct chiplet p9_chiplet = {
> > 
> > @@ -701,7 +701,7 @@ static struct chiplet p9_chiplet = {
> > 
> >                  .compatible = "ibm,power9-chiplet",
> >                  .class = "chiplet",
> >                  .probe = p9_chiplet_probe,
> > 
> > -		.translate = p9_chiplet_translate,
> > +		.translate = translate_cast(p9_chiplet_translate),
> > 
> >          },
> >  	
> >  	.getring = p9_chiplet_getring,
> >  
> >  };
> > 
> > diff --git a/p9.dts b/p9.dts
> > index 8a35d75..1051e3e 100644
> > --- a/p9.dts
> > +++ b/p9.dts
> > @@ -281,7 +281,7 @@
> > 
> >  							index = < 0x20
> > >
> > >;
> > >
> >  							reg = < 0x00
> > 
> > 0x20000000 0xfffff >;
> > 
> > -							core@0 {
> > +							s0_n0_p0_eq0_ex
> > 0_c0: core@0 {
> > 
> >  								#addres
> > 
> > s-cells = < 0x01 >;
> > 
> >  								#size-
> > 
> > cells = < 0x00 >;
> > 
> >  								compati
> > 
> > ble = "ibm,power9-core";
> > @@ -3004,3 +3004,5 @@
> > 
> >  		};
> >  	
> >  	};
> >  
> >  };
> > 
> > +
> > +/include/ "p9-attributes.dts"
> 
> Both the dts changes are not meant for this patch, right?

Correct. That's what I get for rushing to push things out before yet another 
meeting. Will fix.

- Alistair

> Amitay.
diff mbox series

Patch

diff --git a/libpdbg/p9_fapi_targets.c b/libpdbg/p9_fapi_targets.c
index 9ff35d9..d38ecdb 100644
--- a/libpdbg/p9_fapi_targets.c
+++ b/libpdbg/p9_fapi_targets.c
@@ -690,9 +690,9 @@  static int p9_chiplet_probe(struct pdbg_target *target)
         return 0;
 }
 
-static uint64_t p9_chiplet_translate(struct pdbg_target *target, uint64_t addr)
+static uint64_t p9_chiplet_translate(struct chiplet *chiplet, uint64_t addr)
 {
-	return (addr & 0xffffffffc0ffffffULL) + pdbg_target_address(target, NULL);
+	return set_chiplet_id(addr, pdbg_target_index(t(chiplet)));
 }
 
 static struct chiplet p9_chiplet = {
@@ -701,7 +701,7 @@  static struct chiplet p9_chiplet = {
                 .compatible = "ibm,power9-chiplet",
                 .class = "chiplet",
                 .probe = p9_chiplet_probe,
-		.translate = p9_chiplet_translate,
+		.translate = translate_cast(p9_chiplet_translate),
         },
 	.getring = p9_chiplet_getring,
 };
diff --git a/p9.dts b/p9.dts
index 8a35d75..1051e3e 100644
--- a/p9.dts
+++ b/p9.dts
@@ -281,7 +281,7 @@ 
 							index = < 0x20 >;
 							reg = < 0x00 0x20000000 0xfffff >;
 
-							core@0 {
+							s0_n0_p0_eq0_ex0_c0: core@0 {
 								#address-cells = < 0x01 >;
 								#size-cells = < 0x00 >;
 								compatible = "ibm,power9-core";
@@ -3004,3 +3004,5 @@ 
 		};
 	};
 };
+
+/include/ "p9-attributes.dts"