diff mbox

[08/14] hdat: add radix-AP-encodings

Message ID 1484193253-25307-8-git-send-email-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran Jan. 12, 2017, 3:54 a.m. UTC
The the P9 Radix TLB management instructions use an arbitrary "AP" field
that specifies the actual page size. The values used in the AP field are
processor dependent and needs to be passed in via the devicetree by
firmware. This patch adds the property for P9 based systems that boot
via the HDAT path.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hdata/cpu-common.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Balbir Singh Jan. 13, 2017, 3:09 a.m. UTC | #1
On Thu, Jan 12, 2017 at 02:54:07PM +1100, Oliver O'Halloran wrote:
> The the P9 Radix TLB management instructions use an arbitrary "AP" field
> that specifies the actual page size. The values used in the AP field are
> processor dependent and needs to be passed in via the devicetree by
> firmware. This patch adds the property for P9 based systems that boot
> via the HDAT path.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>  hdata/cpu-common.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hdata/cpu-common.c b/hdata/cpu-common.c
> index 491eab84a91c..528f008251f4 100644
> --- a/hdata/cpu-common.c
> +++ b/hdata/cpu-common.c
> @@ -78,6 +78,10 @@ struct dt_node * add_core_common(struct dt_node *cpus,
>  	dt_add_property_cells(cpu, "ibm,processor-page-sizes",
>  			      0xc, 0x10, 0x18, 0x22);
>  
> +	if (proc_gen == proc_gen_p9)
> +		dt_add_property_cells(cpu, "ibm,processor-radix-AP-encodings",
> +			0x0000000c, 0xa0000010, 0x20000015, 0x4000001e);
> +

Should this addition be ibm,pa-features dependent? That way we don't have to
worry about proc_gen and in the future? But that might be too much complexity
for this patchset

Balbir Singh.
Oliver O'Halloran Jan. 13, 2017, 3:37 a.m. UTC | #2
On Fri, Jan 13, 2017 at 2:09 PM, Balbir Singh <bsingharora@gmail.com> wrote:
> On Thu, Jan 12, 2017 at 02:54:07PM +1100, Oliver O'Halloran wrote:
>> The the P9 Radix TLB management instructions use an arbitrary "AP" field
>> that specifies the actual page size. The values used in the AP field are
>> processor dependent and needs to be passed in via the devicetree by
>> firmware. This patch adds the property for P9 based systems that boot
>> via the HDAT path.
>>
>> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
>> ---
>>  hdata/cpu-common.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/hdata/cpu-common.c b/hdata/cpu-common.c
>> index 491eab84a91c..528f008251f4 100644
>> --- a/hdata/cpu-common.c
>> +++ b/hdata/cpu-common.c
>> @@ -78,6 +78,10 @@ struct dt_node * add_core_common(struct dt_node *cpus,
>>       dt_add_property_cells(cpu, "ibm,processor-page-sizes",
>>                             0xc, 0x10, 0x18, 0x22);
>>
>> +     if (proc_gen == proc_gen_p9)
>> +             dt_add_property_cells(cpu, "ibm,processor-radix-AP-encodings",
>> +                     0x0000000c, 0xa0000010, 0x20000015, 0x4000001e);
>> +
>
> Should this addition be ibm,pa-features dependent? That way we don't have to
> worry about proc_gen and in the future? But that might be too much complexity
> for this patchset

It probably should depend on pa-features. A more general cleanup of
cpu-common.c is going to happen at some point in the future, but for
now I think we should just keep it simple and use proc_gen.
Stewart Smith Jan. 15, 2017, 1:46 a.m. UTC | #3
Oliver O'Halloran <oohall@gmail.com> writes:
> The the P9 Radix TLB management instructions use an arbitrary "AP" field
> that specifies the actual page size. The values used in the AP field are
> processor dependent and needs to be passed in via the devicetree by
> firmware. This patch adds the property for P9 based systems that boot
> via the HDAT path.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

It'd be good to patch doc/device-tree/ to document this.

I'll take this patch as is though... but by reading this email you are
bound by the agreement to send documentation patches. :D
Oliver O'Halloran Jan. 15, 2017, 7:13 a.m. UTC | #4
On Sun, Jan 15, 2017 at 12:46 PM, Stewart Smith
<stewart@linux.vnet.ibm.com> wrote:
> Oliver O'Halloran <oohall@gmail.com> writes:
>> The the P9 Radix TLB management instructions use an arbitrary "AP" field
>> that specifies the actual page size. The values used in the AP field are
>> processor dependent and needs to be passed in via the devicetree by
>> firmware. This patch adds the property for P9 based systems that boot
>> via the HDAT path.
>>
>> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
>
> It'd be good to patch doc/device-tree/ to document this.
>
> I'll take this patch as is though... but by reading this email you are
> bound by the agreement to send documentation patches. :D

I think it's in PAPR, but documenting it in skiboot would probably be
a good idea.

>
> --
> Stewart Smith
> OPAL Architect, IBM.
>
diff mbox

Patch

diff --git a/hdata/cpu-common.c b/hdata/cpu-common.c
index 491eab84a91c..528f008251f4 100644
--- a/hdata/cpu-common.c
+++ b/hdata/cpu-common.c
@@ -78,6 +78,10 @@  struct dt_node * add_core_common(struct dt_node *cpus,
 	dt_add_property_cells(cpu, "ibm,processor-page-sizes",
 			      0xc, 0x10, 0x18, 0x22);
 
+	if (proc_gen == proc_gen_p9)
+		dt_add_property_cells(cpu, "ibm,processor-radix-AP-encodings",
+			0x0000000c, 0xa0000010, 0x20000015, 0x4000001e);
+
 	/* Page size encodings appear to be the same for P7 and P8 */
 	dt_add_property_cells(cpu, "ibm,segment-page-sizes",
 		0x0c, 0x000, 3, 0x0c, 0x0000,  /*  4K seg  4k pages */