Skip to contentSkip to conversation

RFC Patch: Use x86 init_hwif in the alim15x3 for x86-like PowerPC systems

PATCH In review Roderick Colenbrander 5 participants 14 messages Apr 15, 2009 – Apr 30, 2009 2 messages not in the archive libata

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

---
 drivers/ide/alim15x3.c |    9 +++++----

 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +0 -0
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)

     return cbl;
 }

-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
 /**
  *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff *    @hwif: interface to configure
  *
  *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510. */

 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif) }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */ +#endif /* !defined(CONFIG_SPARC64) */

 /**
  *    init_dma_ali15x3    -    set up DMA on ALi15x3 --
1.5.6.3

#2 lore raw

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below? [I don't see your ACK here]

Quoted 9 lines

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

Roderick, please add your "Signed-off-by:" line
(per Documentation/SubmittingPatches).

Thanks.

Quoted 38 lines
---
 drivers/ide/alim15x3.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +5 -5
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
     return cbl;
 }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
 /**
  *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff
  *    @hwif: interface to configure
  *
  *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510.
  */
 
 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* !defined(CONFIG_SPARC64) */
 
 /**
  *    init_dma_ali15x3    -    set up DMA on ALi15x3
--

1.5.6.3

#3 lore raw

Hi Roderick,

Since this patch is Xilinx virtex related, it is a good idea to cc:
both the linuxppc-dev mailing list and me when posting. That way I'd have the opportunity to reply with an 'acked-by' or 'reviewed-by' line.

g.

Quoted 77 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below?  [I don't see your ACK here]

Quoted 9 lines

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

Roderick, please add your "Signed-off-by:" line
(per Documentation/SubmittingPatches).

Thanks.

Quoted 37 lines

---
 drivers/ide/alim15x3.c |    9 +++++----

 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +5 -5
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
      return cbl;
  }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
  /**
   *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff
   *    @hwif: interface to configure
   *
   *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510.
   */
 
  static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
  }
  #else
  #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* !defined(CONFIG_SPARC64) */
 
  /**
   *    init_dma_ali15x3    -    set up DMA on ALi15x3
--
Quoted 1 line

1.5.6.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#4 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 16 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Quoted 2 lines

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below? [I don't see your ACK here]

I'd like to nak this patch. It'll break MPC8610HPCD boards.

See commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3

I'm not sure how should we handle this for Xilinx PPC, MPC8610 PPC and Sparc all at the same time, but it's obvious that #ifdef isn't enough any longer...

Quoted 53 lines
Quoted 9 lines

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

Roderick, please add your "Signed-off-by:" line
(per Documentation/SubmittingPatches).

Thanks.

Quoted 38 lines
---
 drivers/ide/alim15x3.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +5 -5
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
     return cbl;
 }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
 /**
  *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff
  *    @hwif: interface to configure
  *
  *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510.
  */
 
 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* !defined(CONFIG_SPARC64) */
 
 /**
  *    init_dma_ali15x3    -    set up DMA on ALi15x3
--

1.5.6.3

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#5 lore raw
Quoted 20 lines · Anton Vorontsov
Quoted 16 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Quoted 2 lines

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below?  [I don't see your ACK here]

Quoted 10 lines

I'd like to nak this patch. It'll break MPC8610HPCD boards.

See commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3

I'm not sure how should we handle this for Xilinx PPC, MPC8610 PPC and Sparc all at the same time, but it's obvious that #ifdef isn't enough any longer...

If it is really a board specific issue (in case of powerpc it appears to be one) we could also use the default_irq override in ppc_md. What do you think?

Roderick

#6 lore raw
Quoted 33 lines · Roderick Colenbrander
Quoted 20 lines · Anton Vorontsov
Quoted 16 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Quoted 2 lines

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below?  [I don't see your ACK here]

Quoted 10 lines

I'd like to nak this patch. It'll break MPC8610HPCD boards.

See commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3

I'm not sure how should we handle this for Xilinx PPC, MPC8610 PPC and Sparc all at the same time, but it's obvious that #ifdef isn't enough any longer...

Quoted 3 lines

If it is really a board specific issue (in case of powerpc it appears to be one) we could also use the default_irq override in ppc_md. What do you think?

Um, I don't see "default_irq" in the ppc_md. Do you want to add one?

I wonder if DECLARE_PCI_FIXUP_*() mechanism will work... see arch/powerpc/platforms/fsl_uli1575.c as an example for board-specific PCI fixups.

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#7 lore raw
Quoted 38 lines · Anton Vorontsov
Quoted 33 lines · Roderick Colenbrander
Quoted 20 lines · Anton Vorontsov
Quoted 16 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Quoted 2 lines

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below?  [I don't see your ACK here]

Quoted 10 lines

I'd like to nak this patch. It'll break MPC8610HPCD boards.

See commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3

I'm not sure how should we handle this for Xilinx PPC, MPC8610 PPC and Sparc all at the same time, but it's obvious that #ifdef isn't enough any longer...

Quoted 3 lines

If it is really a board specific issue (in case of powerpc it appears to be one) we could also use the default_irq override in ppc_md. What do you think?

Quoted 5 lines

Um, I don't see "default_irq" in the ppc_md. Do you want to add one?

I wonder if DECLARE_PCI_FIXUP_*() mechanism will work... see arch/powerpc/platforms/fsl_uli1575.c as an example for board-specific PCI fixups.

It seems default_irq was the name on old kernels. These days it is called pci_get_legacy_ide_irq.

Roderick

#8 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 15 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Quoted 2 lines

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below? [I don't see your ACK here]

Yup. I don't see a case where the hack would be of any use, so I'm happy to remove us from the test. Whenever a 8259 is present we assign it the legacy interrupts 1...15 with a virtual==physical mapping so all those x86-ish things should run just fine.

Quoted 53 lines
Quoted 9 lines

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

Roderick, please add your "Signed-off-by:" line
(per Documentation/SubmittingPatches).

Thanks.

Quoted 38 lines
---
 drivers/ide/alim15x3.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +5 -5
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
     return cbl;
 }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
 /**
  *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff
  *    @hwif: interface to configure
  *
  *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510.
  */
 
 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* !defined(CONFIG_SPARC64) */
 
 /**
  *    init_dma_ali15x3    -    set up DMA on ALi15x3
--

1.5.6.3

#9 lore raw
Quoted 16 lines · Benjamin Herrenschmidt
Quoted 15 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 11 lines · On Wednesday 15 April 2009 16:34:22 Roderick Colenbrander wrote:

Hi,

I'm using a Xilinx ML510 it features a PowerPC 440 cpu inside a Virtex-5 FPGA. The board also contains a ALI M1533 south bridge for IDE, USB and Audio. I did a lot of work to get the pci bus working on this board and it works correctly but the default init code of the alim15x3 driver doesn't work for me. The driver explicitly disabled some initialization code for powerpc after uncommenting this code it works properly. Benjamin Herrenschmidt and I think this !CONFIG_PPC check should be removed because the system behaves like a real 'x86' system (also the i8259 interrupt controller is used).

Quoted 7 lines
Quoted 2 lines

Ben, I guess you are OK with the change and there are no longer other platforms requiring CONFIG_PPC check below? [I don't see your ACK here]

Yup. I don't see a case where the hack would be of any use, so I'm happy to remove us from the test. Whenever a 8259 is present we assign it the legacy interrupts 1...15 with a virtual==physical mapping so all those x86-ish things should run just fine.

But they don't. On MPC8610HPCD we have IDE interrupt directly connected to the MPIC line (through PCI sideband interrupt), and i8259 is _completely_ disabled in the bridge.

See this commit:

commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3
Author: Anton Vorontsov <[email protected]>
Date: Tue Apr 29 22:57:38 2008 +0200

alim15x3: disable init_hwif_ali15x3 for PowerPC

Quoted 1 line

If the patch applied, MPC8610HPCD will be broken.

We need at least some machine_is() check.

Quoted 58 lines
Quoted 49 lines
Quoted 9 lines

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

Roderick, please add your "Signed-off-by:" line
(per Documentation/SubmittingPatches).

Thanks.

Quoted 34 lines
---
 drivers/ide/alim15x3.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +5 -4
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
     return cbl;
 }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
 /**
  *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff
  *    @hwif: interface to configure
  *
  *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510.
  */
 
 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* !defined(CONFIG_SPARC64) */
 
Quoted 4 lines
Quoted 4 lines
drivers/ide/alim15x3.c +0 -1
 /**
  *    init_dma_ali15x3    -    set up DMA on ALi15x3
--

1.5.6.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#10 lore raw
Quoted 3 lines

But they don't. On MPC8610HPCD we have IDE interrupt directly connected to the MPIC line (through PCI sideband interrupt), and i8259 is _completely_ disabled in the bridge.

Hrm why did you do that ? :-)

Just kidding... if what you want is the PCI interrupt, then it should be in native mode, not legacy mode... Maybe the driver can figure out how the chip is configured by reading said configuration and use either the legacy interrupts or the PCI one...

Quoted 6 lines

See this commit:

commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3
Author: Anton Vorontsov <[email protected]>
Date: Tue Apr 29 22:57:38 2008 +0200

Quoted 7 lines

alim15x3: disable init_hwif_ali15x3 for PowerPC

Quoted 1 line

If the patch applied, MPC8610HPCD will be broken.

We need at least some machine_is() check.

That sucks. That's an endless problems with IDE and those on-board chipsets though. The interrupts should pretty much -always- be provided by the arch code, but for some reason, that got removed in favor of various hacks in the drivers themselves...

Ben.

Quoted 59 lines
Quoted 58 lines
Quoted 49 lines
Quoted 9 lines

Regards,
Roderick Colenbrander

From 1c40c2f1485ecd3bc5ad7a3af537cb94de0877c3 Mon Sep 17 00:00:00 2001
From: Roderick Colenbrander <[email protected]>
Date: Wed, 15 Apr 2009 10:45:17 +0200
Subject: [PATCH] Use the 'x86' init_hwif code in the alim15x3 for x86-like PowerPC boards like Xilinx ML310/410/510.

Roderick, please add your "Signed-off-by:" line
(per Documentation/SubmittingPatches).

Thanks.

Quoted 34 lines
---
 drivers/ide/alim15x3.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/ide/alim15x3.c +5 -4
index 537da1c..9176c0f 100644
@@ -402,14 +402,15 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
     return cbl;
 }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#if !defined(CONFIG_SPARC64)
 /**
  *    init_hwif_ali15x3    -    Initialize the ALI IDE x86 stuff
  *    @hwif: interface to configure
  *
  *    Obtain the IRQ tables for an ALi based IDE solution on the PC
- *    class platforms. This part of the code isn't applicable to the
- *    Sparc and PowerPC systems.
+ *    class platforms. This part of the code isn't applicable to
+ *    Sparc systems. It is usable on 'x86-like' PowerPC systems
+ *      which use a Ali M15x3 south bridge like e.g. Xilinx ML310/410/510.
  */
 
 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
@@ -455,7 +456,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* !defined(CONFIG_SPARC64) */
 
Quoted 4 lines
Quoted 4 lines
drivers/ide/alim15x3.c +0 -1
 /**
  *    init_dma_ali15x3    -    set up DMA on ALi15x3
--

1.5.6.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

#11 lore raw
Quoted 21 lines · On Friday 17 April 2009 18:49:44 Benjamin Herrenschmidt wrote:
Quoted 3 lines

But they don't. On MPC8610HPCD we have IDE interrupt directly connected to the MPIC line (through PCI sideband interrupt), and i8259 is _completely_ disabled in the bridge.

Hrm why did you do that ? :-)

Just kidding... if what you want is the PCI interrupt, then it should be in native mode, not legacy mode... Maybe the driver can figure out how the chip is configured by reading said configuration and use either the legacy interrupts or the PCI one...

Quoted 10 lines

See this commit:

commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3
Author: Anton Vorontsov <[email protected]>
Date: Tue Apr 29 22:57:38 2008 +0200

alim15x3: disable init_hwif_ali15x3 for PowerPC

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

If the patch applied, MPC8610HPCD will be broken.

We need at least some machine_is() check.

That sucks. That's an endless problems with IDE and those on-board chipsets though. The interrupts should pretty much -always- be provided by the arch code, but for some reason, that got removed in favor of various hacks in the drivers themselves...

Previous PPC IRQ hacks combined with IDE IRQ hacks were a real nightmare from maintenance perspective -- one could just never tell what is going on and whether it is correct.

IDE host driver specific hacks were just a necessary temporary step into solving this problem and most of them got removed in this merge window during more general rework of IRQ setup code.

Nowadays IDE PCI layer just consistently uses arch specific (+ non-IDE specific so libata gets benefits too) pci_get_legacy_ide_irq() helper for legacy IRQs, please see ide_pci_init_one():

...

        /* fixup IRQ */
        if (ide_pci_is_in_compatibility_mode(dev)) {
                hw[0].irq = pci_get_legacy_ide_irq(dev, 0);
                hw[1].irq = pci_get_legacy_ide_irq(dev, 1);
        } else
                hw[1].irq = hw[0].irq = ret;

...

That's all! No PPC-specific IRQ overrides, IDE-specific IRQ overrides and IDE host driver ones needed! :)

There is still some legacy code (like the one in alim15x3 host driver) needing fixing but the infrastructure allowing it should be all there.

Hmm, it looks like this historical IRQ override in init_hwif_ali15x3():

        if (dev->device == PCI_DEVICE_ID_AL_M5229)
                hwif->irq = hwif->channel ? 15 : 14;

should be just removed nowadays.

Seems like this should allow MPC8610HPCD to work with Roderick's patch if the IDE controller is set to native mode and ALI south-bridge SIRQ tables are correctly set (or if this is not ALI's south-bridge). Anton?

Thanks,
Bart

#12 lore raw
Quoted 60 lines · Bartlomiej Zolnierkiewicz
Quoted 21 lines · On Friday 17 April 2009 18:49:44 Benjamin Herrenschmidt wrote:
Quoted 3 lines

But they don't. On MPC8610HPCD we have IDE interrupt directly connected to the MPIC line (through PCI sideband interrupt), and i8259 is _completely_ disabled in the bridge.

Hrm why did you do that ? :-)

Just kidding... if what you want is the PCI interrupt, then it should be in native mode, not legacy mode... Maybe the driver can figure out how the chip is configured by reading said configuration and use either the legacy interrupts or the PCI one...

Quoted 10 lines

See this commit:

commit 6d1cee44361b8d06ccd1812e80448d86ae60dfe3
Author: Anton Vorontsov <[email protected]>
Date: Tue Apr 29 22:57:38 2008 +0200

alim15x3: disable init_hwif_ali15x3 for PowerPC

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

If the patch applied, MPC8610HPCD will be broken.

We need at least some machine_is() check.

That sucks. That's an endless problems with IDE and those on-board chipsets though. The interrupts should pretty much -always- be provided by the arch code, but for some reason, that got removed in favor of various hacks in the drivers themselves...

Previous PPC IRQ hacks combined with IDE IRQ hacks were a real nightmare from maintenance perspective -- one could just never tell what is going on and whether it is correct.

IDE host driver specific hacks were just a necessary temporary step into solving this problem and most of them got removed in this merge window during more general rework of IRQ setup code.

Nowadays IDE PCI layer just consistently uses arch specific (+ non-IDE specific so libata gets benefits too) pci_get_legacy_ide_irq() helper for legacy IRQs, please see ide_pci_init_one():

...

        /* fixup IRQ */
        if (ide_pci_is_in_compatibility_mode(dev)) {
                hw[0].irq = pci_get_legacy_ide_irq(dev, 0);
                hw[1].irq = pci_get_legacy_ide_irq(dev, 1);
        } else
                hw[1].irq = hw[0].irq = ret;

...

That's all! No PPC-specific IRQ overrides, IDE-specific IRQ overrides and IDE host driver ones needed! :)

There is still some legacy code (like the one in alim15x3 host driver) needing fixing but the infrastructure allowing it should be all there.

Hmm, it looks like this historical IRQ override in init_hwif_ali15x3():

Quoted 8 lines
        if (dev->device == PCI_DEVICE_ID_AL_M5229)
                hwif->irq = hwif->channel ? 15 : 14;

should be just removed nowadays.

Seems like this should allow MPC8610HPCD to work with Roderick's patch if the IDE controller is set to native mode and ALI south-bridge SIRQ tables are correctly set (or if this is not ALI's south-bridge). Anton?

OK, I'll test this approach.

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

PATCH 1/1 alim15x3: Remove historical hacks, re-enable init_hwif for PowerPC

Some time ago we had to disable init_hwif callback for PowerPC builds. That was because of a historical IRQ overwrite in the driver, which was causing IDE malfunction on the MPC8610HPCD PowerPC boards.

It's unclear whether this overwrite is still useful, but it is proven to cause a bit of harm, and today some PowerPC targets (Xilinx ML510, as reported by Roderick Colenbrander) need the init_hwif, so we have to re-enable it and remove the overwrite.

---

Quoted 8 lines · Roderick Colenbrander
Quoted 6 lines
Quoted 3 lines

Seems like this should allow MPC8610HPCD to work with Roderick's patch if the IDE controller is set to native mode and ALI south-bridge SIRQ tables are correctly set (or if this is not ALI's south-bridge).  Anton?

OK, I'll test this approach.

Did this approach work for you?

I'm sorry for the delay. Yes, it seem to work.

 drivers/ide/alim15x3.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
drivers/ide/alim15x3.c +3 -7
index 537da1c..e59b6de 100644
@@ -402,27 +402,23 @@ static u8 ali_cable_detect(ide_hwif_t *hwif)
 	return cbl;
 }
 
-#if !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC)
+#ifndef CONFIG_SPARC64
 /**
  *	init_hwif_ali15x3	-	Initialize the ALI IDE x86 stuff
  *	@hwif: interface to configure
  *
  *	Obtain the IRQ tables for an ALi based IDE solution on the PC
  *	class platforms. This part of the code isn't applicable to the
- *	Sparc and PowerPC systems.
+ *	Sparc systems.
  */
 
 static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 {
-	struct pci_dev *dev = to_pci_dev(hwif->dev);
 	u8 ideic, inmir;
 	s8 irq_routing_table[] = { -1,  9, 3, 10, 4,  5, 7,  6,
 				      1, 11, 0, 12, 0, 14, 0, 15 };
 	int irq = -1;
 
-	if (dev->device == PCI_DEVICE_ID_AL_M5229)
-		hwif->irq = hwif->channel ? 15 : 14;
-
 	if (isa_dev) {
 		/*
 		 * read IDE interface control
@@ -455,7 +451,7 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
 }
 #else
 #define init_hwif_ali15x3 NULL
-#endif /* !defined(CONFIG_SPARC64) && !defined(CONFIG_PPC) */
+#endif /* CONFIG_SPARC64 */
 
 /**
  *	init_dma_ali15x3	-	set up DMA on ALi15x3
Signature · 6 lines
1.6.2.2

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
#15 lore raw

Re: [PATCH] alim15x3: Remove historical hacks, re-enable init_hwif for PowerPC

Quoted 4 lines · On Monday 27 April 2009 20:47:42 Anton Vorontsov wrote:

Some time ago we had to disable init_hwif callback for PowerPC builds. That was because of a historical IRQ overwrite in the driver, which was causing IDE malfunction on the MPC8610HPCD PowerPC boards.

Quoted 8 lines

It's unclear whether this overwrite is still useful, but it is proven to cause a bit of harm, and today some PowerPC targets (Xilinx ML510, as reported by Roderick Colenbrander) need the init_hwif, so we have to re-enable it and remove the overwrite.

thanks, I applied it to ide-2.6.git/for-next