diff mbox

[6/7] astbmc: Don't do P8 PSI or DT fixups on P9

Message ID 1484290582-5863-6-git-send-email-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran Jan. 13, 2017, 6:56 a.m. UTC
We do some P8 specific hacks on BMC platforms to work around Hostboot
not initialising the PSI BAR and to fix some problems in the hostboot
provided device tree. These shouldn't be done on P9.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Ben, I'm guessing the we need the PSI BAR setup on P8 for interrupts.
Do we need to do anything similar on P9?
---
 platforms/astbmc/common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Benjamin Herrenschmidt Jan. 13, 2017, 3:53 p.m. UTC | #1
On Fri, 2017-01-13 at 17:56 +1100, Oliver O'Halloran wrote:
> Do we need to do anything similar on P9?

On P9, the psi.c code will fixup the BAR itself.

I plan to collect all that BAR fixup stuff (PHB, XIVE, PSI ...), or at
least the values into a file that controls the address map for a given
chip generation. For now it was bringup hacks but it looks like the
plan will be to configure a bunch that our stuff ourselves even with
hostboot (which I don't mind at all).

Cheers,
Ben.
Michael Neuling Jan. 14, 2017, 8:06 p.m. UTC | #2
On Fri, 2017-01-13 at 17:56 +1100, Oliver O'Halloran wrote:
> We do some P8 specific hacks on BMC platforms to work around Hostboot
> not initialising the PSI BAR and to fix some problems in the hostboot
> provided device tree. These shouldn't be done on P9.

I think we may need to do some of the fixups on p9.  astbmc_fixup_dt_mbox() adds
the mbox stuff that cyrils mbox code keys off later. 

I'm not sure the best way to fix it. 

Mikey

> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> Ben, I'm guessing the we need the PSI BAR setup on P8 for interrupts.
> Do we need to do anything similar on P9?
> ---
>  platforms/astbmc/common.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
> index ce8edeac043c..e78b5fa39ab7 100644
> --- a/platforms/astbmc/common.c
> +++ b/platforms/astbmc/common.c
> @@ -321,11 +321,17 @@ static void astbmc_fixup_psi_bar(void)
>  
>  void astbmc_early_init(void)
>  {
> -	/* Hostboot's device-tree isn't quite right yet */
> -	astbmc_fixup_dt();
> +	/*
> +	 * On P9 we don't have a HB supplied devicetree and we have a
> +	 * different PSI BAR hack here is P8 specific.
> +	 */
> +	if (proc_gen == proc_gen_p8) {
> +		/* Hostboot's device-tree isn't quite right yet */
> +		astbmc_fixup_dt();
>  
> -	/* Hostboot forgets to populate the PSI BAR */
> -	astbmc_fixup_psi_bar();
> +		/* Hostboot forgets to populate the PSI BAR */
> +		astbmc_fixup_psi_bar();
> +	}
>  
>  	/* Send external interrupts to me */
>  	psi_set_external_irq_policy(EXTERNAL_IRQ_POLICY_SKIBOOT);
diff mbox

Patch

diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
index ce8edeac043c..e78b5fa39ab7 100644
--- a/platforms/astbmc/common.c
+++ b/platforms/astbmc/common.c
@@ -321,11 +321,17 @@  static void astbmc_fixup_psi_bar(void)
 
 void astbmc_early_init(void)
 {
-	/* Hostboot's device-tree isn't quite right yet */
-	astbmc_fixup_dt();
+	/*
+	 * On P9 we don't have a HB supplied devicetree and we have a
+	 * different PSI BAR hack here is P8 specific.
+	 */
+	if (proc_gen == proc_gen_p8) {
+		/* Hostboot's device-tree isn't quite right yet */
+		astbmc_fixup_dt();
 
-	/* Hostboot forgets to populate the PSI BAR */
-	astbmc_fixup_psi_bar();
+		/* Hostboot forgets to populate the PSI BAR */
+		astbmc_fixup_psi_bar();
+	}
 
 	/* Send external interrupts to me */
 	psi_set_external_irq_policy(EXTERNAL_IRQ_POLICY_SKIBOOT);