[V3,2/2] platforms/zz: Initialize PRD in skiboot

Submitted by Ananth N Mavinakayanahalli on Feb. 24, 2017, 10:30 a.m.

Details

Message ID 148793222707.29962.4238641156476223042.stgit@thinktux.in.ibm.com
State New
Headers show

Commit Message

Ananth N Mavinakayanahalli Feb. 24, 2017, 10:30 a.m.
... since PRD runs in host userspace on P9 FSP based systems.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
---
 hw/prd.c               |   10 +++-------
 platforms/ibm-fsp/zz.c |    3 +++
 2 files changed, 6 insertions(+), 7 deletions(-)

Comments

Vasant Hegde March 11, 2017, 5:27 p.m.
On 02/24/2017 04:00 PM, Ananth N Mavinakayanahalli wrote:
> ... since PRD runs in host userspace on P9 FSP based systems.
>
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
> ---
>   hw/prd.c               |   10 +++-------
>   platforms/ibm-fsp/zz.c |    3 +++
>   2 files changed, 6 insertions(+), 7 deletions(-)
>

.../...



> +	/* All P9 machines, even the FSP based ones run PRD in host userspace */
> +	queue_prd_msg = queue_prd_msg_hbrt;
> +	opal_register(OPAL_PRD_MSG, opal_prd_msg, 1);
>
>   	prd_node = dt_new(opal_node, "diagnostics");
>   	dt_add_property_strings(prd_node, "compatible", "ibm,opal-prd");
> diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
> index 89d87b4..5c0b3b1 100644
> --- a/platforms/ibm-fsp/zz.c
> +++ b/platforms/ibm-fsp/zz.c
> @@ -29,6 +29,9 @@
>
>   static bool zz_probe(void)
>   {
> +	/* PRD runs in host userspace in P9 */
> +	prd_init();
> +

At this stage we are not sure that its zz platform. Hence I think we should move 
this code inside below if condition..

   if (platform == zz ) {
   	  prd_init();
	return true;
}

-Vasant


>   	/* FIXME: make this neater when the dust settles */
>   	if (dt_node_is_compatible(dt_root, "ibm,zz-1s2u") ||
>   	    dt_node_is_compatible(dt_root, "ibm,zz-1s4u") ||
>
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
>
Ananth N Mavinakayanahalli March 13, 2017, 3:55 a.m.
On Sat, Mar 11, 2017 at 10:57:46PM +0530, Vasant Hegde wrote:
> On 02/24/2017 04:00 PM, Ananth N Mavinakayanahalli wrote:
> >... since PRD runs in host userspace on P9 FSP based systems.
> >
> >Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
> >---
> >  hw/prd.c               |   10 +++-------
> >  platforms/ibm-fsp/zz.c |    3 +++
> >  2 files changed, 6 insertions(+), 7 deletions(-)
> >
> 
> .../...
> 
> 
> 
> >+	/* All P9 machines, even the FSP based ones run PRD in host userspace */
> >+	queue_prd_msg = queue_prd_msg_hbrt;
> >+	opal_register(OPAL_PRD_MSG, opal_prd_msg, 1);
> >
> >  	prd_node = dt_new(opal_node, "diagnostics");
> >  	dt_add_property_strings(prd_node, "compatible", "ibm,opal-prd");
> >diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
> >index 89d87b4..5c0b3b1 100644
> >--- a/platforms/ibm-fsp/zz.c
> >+++ b/platforms/ibm-fsp/zz.c
> >@@ -29,6 +29,9 @@
> >
> >  static bool zz_probe(void)
> >  {
> >+	/* PRD runs in host userspace in P9 */
> >+	prd_init();
> >+
> 
> At this stage we are not sure that its zz platform. Hence I think we
> should move this code inside below if condition..
> 
>   if (platform == zz ) {
>   	  prd_init();
> 	return true;

We need to initialize PRD for all P9 platforms, so, maybe ok. I still
need to work on these patches once the i2c stuff goes in.
Oliver O'Halloran March 13, 2017, 11:07 p.m.
On Mon, Mar 13, 2017 at 2:55 PM, Ananth N Mavinakayanahalli
<ananth@linux.vnet.ibm.com> wrote:
> On Sat, Mar 11, 2017 at 10:57:46PM +0530, Vasant Hegde wrote:
>> On 02/24/2017 04:00 PM, Ananth N Mavinakayanahalli wrote:
>> >... since PRD runs in host userspace on P9 FSP based systems.
>> >
>> >Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
>> >---
>> >  hw/prd.c               |   10 +++-------
>> >  platforms/ibm-fsp/zz.c |    3 +++
>> >  2 files changed, 6 insertions(+), 7 deletions(-)
>> >
>>
>> .../...
>>
>>
>>
>> >+    /* All P9 machines, even the FSP based ones run PRD in host userspace */
>> >+    queue_prd_msg = queue_prd_msg_hbrt;
>> >+    opal_register(OPAL_PRD_MSG, opal_prd_msg, 1);
>> >
>> >     prd_node = dt_new(opal_node, "diagnostics");
>> >     dt_add_property_strings(prd_node, "compatible", "ibm,opal-prd");
>> >diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
>> >index 89d87b4..5c0b3b1 100644
>> >--- a/platforms/ibm-fsp/zz.c
>> >+++ b/platforms/ibm-fsp/zz.c
>> >@@ -29,6 +29,9 @@
>> >
>> >  static bool zz_probe(void)
>> >  {
>> >+    /* PRD runs in host userspace in P9 */
>> >+    prd_init();
>> >+
>>
>> At this stage we are not sure that its zz platform. Hence I think we
>> should move this code inside below if condition..
>>
>>   if (platform == zz ) {
>>         prd_init();
>>       return true;
>
> We need to initialize PRD for all P9 platforms, so, maybe ok. I still
> need to work on these patches once the i2c stuff goes in.

If it needs to be done for all P9 platforms then put it in the main
init path and add a check for proc_gen_p9. Having inits in a platform
probe function is mildly horrifying.

Oliver

Patch hide | download patch | download mbox

diff --git a/hw/prd.c b/hw/prd.c
index a5c8cc3..c8f2155 100644
--- a/hw/prd.c
+++ b/hw/prd.c
@@ -390,13 +390,9 @@  void prd_init(void)
 	}
 	unlock(&ipoll_lock);
 
-	if (fsp_present()) {
-		/* todo: FSP implementation */
-		queue_prd_msg = queue_prd_msg_nop;
-	} else {
-		queue_prd_msg = queue_prd_msg_hbrt;
-		opal_register(OPAL_PRD_MSG, opal_prd_msg, 1);
-	}
+	/* All P9 machines, even the FSP based ones run PRD in host userspace */
+	queue_prd_msg = queue_prd_msg_hbrt;
+	opal_register(OPAL_PRD_MSG, opal_prd_msg, 1);
 
 	prd_node = dt_new(opal_node, "diagnostics");
 	dt_add_property_strings(prd_node, "compatible", "ibm,opal-prd");
diff --git a/platforms/ibm-fsp/zz.c b/platforms/ibm-fsp/zz.c
index 89d87b4..5c0b3b1 100644
--- a/platforms/ibm-fsp/zz.c
+++ b/platforms/ibm-fsp/zz.c
@@ -29,6 +29,9 @@ 
 
 static bool zz_probe(void)
 {
+	/* PRD runs in host userspace in P9 */
+	prd_init();
+
 	/* FIXME: make this neater when the dust settles */
 	if (dt_node_is_compatible(dt_root, "ibm,zz-1s2u") ||
 	    dt_node_is_compatible(dt_root, "ibm,zz-1s4u") ||