* [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
@ 2026-07-01 10:54 Christian Zigotzky
2026-07-01 11:14 ` Christian Zigotzky
2026-07-07 4:31 ` Christian Zigotzky
0 siblings, 2 replies; 8+ messages in thread
From: Christian Zigotzky @ 2026-07-01 10:54 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Christian Zigotzky,
Krzysztof Kozlowski,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list
"pas_pci_init" was before "nemo_init_IRQ".
Now "pas_pci_init" is after "nemo_init_IRQ" in the official kernel source
code.
I think "pas_pci_init" scans (discovers) the PCI(e) devices
and after that, "nemo_init_IRQ" assigns interrupt numbers
to these devices if required.
It's not possible to assigns interrupt numbers to PCI(e) devices
which have not been discovered yet.
Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
---
arch/powerpc/platforms/pasemi/pci.c | 7 +++++++
arch/powerpc/platforms/pasemi/setup.c | 7 ++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index 2df955274652..7208c325bfc5 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -25,6 +25,8 @@
#define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
+extern void nemo_init_IRQ(void);
+
static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
{
/* Device 0 Function 0 is special: It's config space spans function 1 as
@@ -265,6 +267,11 @@ static int __init pas_add_bridge(struct device_node *dev)
*/
isa_bridge_find_early(hose);
+ /*
+ * ISA bridge is now active, add the i8259 cascade (if needed)
+ */
+ nemo_init_IRQ();
+
return 0;
}
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index d03b41336901..eec74611be46 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
chip->irq_eoi(&desc->irq_data);
}
-static void __init nemo_init_IRQ(struct mpic *mpic)
+void nemo_init_IRQ(void)
{
struct device_node *np;
int gpio_virq;
+ struct mpic *mpic;
+
/* Connect the SB600's legacy i8259 controller */
np = of_find_node_by_path("/pxp@0,e0000000");
i8259_init(np, 0);
@@ -228,6 +230,7 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
mpic_unmask_irq(irq_get_irq_data(gpio_virq));
+ mpic = irq_get_chip_data(gpio_virq);
irq_set_default_domain(mpic->irqhost);
}
@@ -298,8 +301,6 @@ static __init void pas_init_IRQ(void)
mpic_unmask_irq(irq_get_irq_data(nmi_virq));
}
- nemo_init_IRQ(mpic);
-
of_node_put(mpic_node);
of_node_put(root);
}
--
2.55.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
2026-07-01 10:54 Christian Zigotzky
@ 2026-07-01 11:14 ` Christian Zigotzky
2026-07-07 4:31 ` Christian Zigotzky
1 sibling, 0 replies; 8+ messages in thread
From: Christian Zigotzky @ 2026-07-01 11:14 UTC (permalink / raw)
To: Christian Zigotzky, Krzysztof Kozlowski, Madhavan Srinivasan,
Michael Ellerman, linux-kernel, Nicholas Piggin, linuxppc-dev,
Christophe Leroy
Cc: Darren Stevens, R.T.Dickinson, hypexed
[-- Attachment #1: Type: text/plain, Size: 4024 bytes --]
The Nemo board [1] doesn’t boot without this patch. Darren explained it really well:
Originally we initialised the PCI-e ports in setup arch, this is quite early, and it seems uses some kernel functions that were not recommended (They changed a whole lot of different platforms at the same time for the same reason)
After this we added the ISA bridge, then the kernel would init the IRQ contollers.
The patch that broke booting on the X1000 moved the pas_pci_init to a node in the machine description, where it called later in the boot sequence. Unfortunately this is after we've tried to add the i8259 contoller from the pas_init_IRQ. Since our ISA bridge can't be found until we've connected the PCI-e ports the system tries to write to registers that aren't yet mapped - result a kernel panic, but before console I/O has been initialised so it appears to be a hang. We had a similar problem when they were introducing Radix support.
My patch changes our code so that it works with the new kernel code in place. Basically I moved the code that adds the i8259 cascade to after we've scanned for the ISA bridge where I know it will work.
Hopefully this makes sense, shout out if it doesn't
Regards
Darren
[1] https://en.wikipedia.org/wiki/AmigaOne_X1000
> On 01 July 2026 at 12:55 pm, Christian Zigotzky <chzigotzky@xenosoft.de> wrote :
>
> "pas_pci_init" was before "nemo_init_IRQ".
> Now "pas_pci_init" is after "nemo_init_IRQ" in the official kernel source
> code.
> I think "pas_pci_init" scans (discovers) the PCI(e) devices
> and after that, "nemo_init_IRQ" assigns interrupt numbers
> to these devices if required.
> It's not possible to assigns interrupt numbers to PCI(e) devices
> which have not been discovered yet.
>
> Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> ---
> arch/powerpc/platforms/pasemi/pci.c | 7 +++++++
> arch/powerpc/platforms/pasemi/setup.c | 7 ++++---
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
> index 2df955274652..7208c325bfc5 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -25,6 +25,8 @@
>
> #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
>
> +extern void nemo_init_IRQ(void);
> +
> static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
> {
> /* Device 0 Function 0 is special: It's config space spans function 1 as
> @@ -265,6 +267,11 @@ static int __init pas_add_bridge(struct device_node *dev)
> */
> isa_bridge_find_early(hose);
>
> + /*
> + * ISA bridge is now active, add the i8259 cascade (if needed)
> + */
> + nemo_init_IRQ();
> +
> return 0;
> }
>
> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
> index d03b41336901..eec74611be46 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
> chip->irq_eoi(&desc->irq_data);
> }
>
> -static void __init nemo_init_IRQ(struct mpic *mpic)
> +void nemo_init_IRQ(void)
> {
> struct device_node *np;
> int gpio_virq;
> + struct mpic *mpic;
> +
> /* Connect the SB600's legacy i8259 controller */
> np = of_find_node_by_path("/pxp@0,e0000000");
> i8259_init(np, 0);
> @@ -228,6 +230,7 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>
> + mpic = irq_get_chip_data(gpio_virq);
> irq_set_default_domain(mpic->irqhost);
> }
>
> @@ -298,8 +301,6 @@ static __init void pas_init_IRQ(void)
> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> }
>
> - nemo_init_IRQ(mpic);
> -
> of_node_put(mpic_node);
> of_node_put(root);
> }
> --
> 2.55.0.windows.1
>
[-- Attachment #2: Type: text/html, Size: 5950 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
@ 2026-07-01 12:59 Christian Zigotzky
2026-07-27 13:43 ` Christophe Leroy (CS GROUP)
0 siblings, 1 reply; 8+ messages in thread
From: Christian Zigotzky @ 2026-07-01 12:59 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Krzysztof Kozlowski,
Christian Zigotzky,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list
Hello,
Here is the email without HTML (Sorry):
The Nemo board [1] doesn’t boot without this patch. Darren explained it really well:
Originally we initialised the PCI-e ports in setup arch, this is quite early, and it seems uses some kernel functions that were not recommended (They changed a whole lot of different platforms at the same time for the same reason)
After this we added the ISA bridge, then the kernel would init the IRQ contollers.
The patch that broke booting on the X1000 moved the pas_pci_init to a node in the machine description, where it called later in the boot sequence. Unfortunately this is after we've tried to add the i8259 contoller from the pas_init_IRQ. Since our ISA bridge can't be found until we've connected the PCI-e ports the system tries to write to registers that aren't yet mapped - result a kernel panic, but before console I/O has been initialised so it appears to be a hang. We had a similar problem when they were introducing Radix support.
My patch changes our code so that it works with the new kernel code in place. Basically I moved the code that adds the i8259 cascade to after we've scanned for the ISA bridge where I know it will work.
Hopefully this makes sense, shout out if it doesn't.
Regards
Darren
[1] https://en.wikipedia.org/wiki/AmigaOne_X1000
Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
---
arch/powerpc/platforms/pasemi/pci.c | 7 +++++++
arch/powerpc/platforms/pasemi/setup.c | 7 ++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index 2df955274652..7208c325bfc5 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -25,6 +25,8 @@
#define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
+extern void nemo_init_IRQ(void);
+
static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
{
/* Device 0 Function 0 is special: It's config space spans function 1 as
@@ -265,6 +267,11 @@ static int __init pas_add_bridge(struct device_node *dev)
*/
isa_bridge_find_early(hose);
+ /*
+ * ISA brigde is now active, add the i8259 cascade (if needed)
+ */
+ nemo_init_IRQ();
+
return 0;
}
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index d03b41336901..eec74611be46 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
chip->irq_eoi(&desc->irq_data);
}
-static void __init nemo_init_IRQ(struct mpic *mpic)
+void nemo_init_IRQ(void)
{
struct device_node *np;
int gpio_virq;
+ struct mpic *mpic;
+
/* Connect the SB600's legacy i8259 controller */
np = of_find_node_by_path("/pxp@0,e0000000");
i8259_init(np, 0);
@@ -228,6 +230,7 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
mpic_unmask_irq(irq_get_irq_data(gpio_virq));
+ mpic = irq_get_chip_data(gpio_virq);
irq_set_default_domain(mpic->irqhost);
}
@@ -298,8 +301,6 @@ static __init void pas_init_IRQ(void)
mpic_unmask_irq(irq_get_irq_data(nmi_virq));
}
- nemo_init_IRQ(mpic);
-
of_node_put(mpic_node);
of_node_put(root);
}
--
2.55.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
2026-07-01 10:54 Christian Zigotzky
2026-07-01 11:14 ` Christian Zigotzky
@ 2026-07-07 4:31 ` Christian Zigotzky
2026-07-13 16:18 ` Christian Zigotzky
1 sibling, 1 reply; 8+ messages in thread
From: Christian Zigotzky @ 2026-07-07 4:31 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP),
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list,
R.T.Dickinson, Damien Stewart, Darren Stevens
Any comments about this patch?
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
-- Christian
On 01/07/26 12:54, Christian Zigotzky wrote:
> "pas_pci_init" was before "nemo_init_IRQ".
> Now "pas_pci_init" is after "nemo_init_IRQ" in the official kernel
source
> code.
> I think "pas_pci_init" scans (discovers) the PCI(e) devices
> and after that, "nemo_init_IRQ" assigns interrupt numbers
> to these devices if required.
> It's not possible to assigns interrupt numbers to PCI(e) devices
> which have not been discovered yet.
>
> Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> ---
> arch/powerpc/platforms/pasemi/pci.c | 7 +++++++
> arch/powerpc/platforms/pasemi/setup.c | 7 ++++---
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pasemi/pci.c
b/arch/powerpc/platforms/pasemi/pci.c
> index 2df955274652..7208c325bfc5 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -25,6 +25,8 @@
>
> #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12)
| (off))
>
> +extern void nemo_init_IRQ(void);
> +
> static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
> {
> /* Device 0 Function 0 is special: It's config space spans
function 1 as
> @@ -265,6 +267,11 @@ static int __init pas_add_bridge(struct
device_node *dev)
> */
> isa_bridge_find_early(hose);
>
> + /*
> + * ISA bridge is now active, add the i8259 cascade (if needed)
> + */
> + nemo_init_IRQ();
> +
> return 0;
> }
>
> diff --git a/arch/powerpc/platforms/pasemi/setup.c
b/arch/powerpc/platforms/pasemi/setup.c
> index d03b41336901..eec74611be46 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct irq_desc
*desc)
> chip->irq_eoi(&desc->irq_data);
> }
>
> -static void __init nemo_init_IRQ(struct mpic *mpic)
> +void nemo_init_IRQ(void)
> {
> struct device_node *np;
> int gpio_virq;
> + struct mpic *mpic;
> +
> /* Connect the SB600's legacy i8259 controller */
> np = of_find_node_by_path("/pxp@0,e0000000");
> i8259_init(np, 0);
> @@ -228,6 +230,7 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>
> + mpic = irq_get_chip_data(gpio_virq);
> irq_set_default_domain(mpic->irqhost);
> }
>
> @@ -298,8 +301,6 @@ static __init void pas_init_IRQ(void)
> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> }
>
> - nemo_init_IRQ(mpic);
> -
> of_node_put(mpic_node);
> of_node_put(root);
> }
--
Sent with BrassMonkey 34.2.2
(https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_34.2.2)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
2026-07-07 4:31 ` Christian Zigotzky
@ 2026-07-13 16:18 ` Christian Zigotzky
0 siblings, 0 replies; 8+ messages in thread
From: Christian Zigotzky @ 2026-07-13 16:18 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP),
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list
Cc: R.T.Dickinson, Damien Stewart, Darren Stevens, Christian Zigotzky
Is this patch OK? My P.A. Semi Nemo board boots with the patched kernel.
-- Christian
On 07/07/26 06:31, Christian Zigotzky wrote:
> Any comments about this patch?
>
> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
>
> -- Christian
>
>
> On 01/07/26 12:54, Christian Zigotzky wrote:
> > "pas_pci_init" was before "nemo_init_IRQ".
> > Now "pas_pci_init" is after "nemo_init_IRQ" in the official kernel
source
> > code.
> > I think "pas_pci_init" scans (discovers) the PCI(e) devices
> > and after that, "nemo_init_IRQ" assigns interrupt numbers
> > to these devices if required.
> > It's not possible to assigns interrupt numbers to PCI(e) devices
> > which have not been discovered yet.
> >
> > Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> > ---
> > arch/powerpc/platforms/pasemi/pci.c | 7 +++++++
> > arch/powerpc/platforms/pasemi/setup.c | 7 ++++---
> > 2 files changed, 11 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/pasemi/pci.c
b/arch/powerpc/platforms/pasemi/pci.c
> > index 2df955274652..7208c325bfc5 100644
> > --- a/arch/powerpc/platforms/pasemi/pci.c
> > +++ b/arch/powerpc/platforms/pasemi/pci.c
> > @@ -25,6 +25,8 @@
> >
> > #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) <<
12) | (off))
> >
> > +extern void nemo_init_IRQ(void);
> > +
> > static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
> > {
> > /* Device 0 Function 0 is special: It's config space spans
function 1 as
> > @@ -265,6 +267,11 @@ static int __init pas_add_bridge(struct
device_node *dev)
> > */
> > isa_bridge_find_early(hose);
> >
> > + /*
> > + * ISA bridge is now active, add the i8259 cascade (if needed)
> > + */
> > + nemo_init_IRQ();
> > +
> > return 0;
> > }
> >
> > diff --git a/arch/powerpc/platforms/pasemi/setup.c
b/arch/powerpc/platforms/pasemi/setup.c
> > index d03b41336901..eec74611be46 100644
> > --- a/arch/powerpc/platforms/pasemi/setup.c
> > +++ b/arch/powerpc/platforms/pasemi/setup.c
> > @@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct
irq_desc *desc)
> > chip->irq_eoi(&desc->irq_data);
> > }
> >
> > -static void __init nemo_init_IRQ(struct mpic *mpic)
> > +void nemo_init_IRQ(void)
> > {
> > struct device_node *np;
> > int gpio_virq;
> > + struct mpic *mpic;
> > +
> > /* Connect the SB600's legacy i8259 controller */
> > np = of_find_node_by_path("/pxp@0,e0000000");
> > i8259_init(np, 0);
> > @@ -228,6 +230,7 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
> > irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> > mpic_unmask_irq(irq_get_irq_data(gpio_virq));
> >
> > + mpic = irq_get_chip_data(gpio_virq);
> > irq_set_default_domain(mpic->irqhost);
> > }
> >
> > @@ -298,8 +301,6 @@ static __init void pas_init_IRQ(void)
> > mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> > }
> >
> > - nemo_init_IRQ(mpic);
> > -
> > of_node_put(mpic_node);
> > of_node_put(root);
> > }
>
>
--
Sent with BrassMonkey 34.2.2
(https://github.com/chzigotzky/Web-Browsers-and-Suites-for-Linux-PPC/releases/tag/BrassMonkey_34.2.2)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
2026-07-01 12:59 [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c Christian Zigotzky
@ 2026-07-27 13:43 ` Christophe Leroy (CS GROUP)
2026-07-28 12:50 ` Christian Zigotzky
0 siblings, 1 reply; 8+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-07-27 13:43 UTC (permalink / raw)
To: Christian Zigotzky, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Krzysztof Kozlowski,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list
Le 01/07/2026 à 14:59, Christian Zigotzky a écrit :
> Hello,
>
> Here is the email without HTML (Sorry):
>
> The Nemo board [1] doesn’t boot without this patch. Darren explained it really well:
>
> Originally we initialised the PCI-e ports in setup arch, this is quite early, and it seems uses some kernel functions that were not recommended (They changed a whole lot of different platforms at the same time for the same reason)
>
> After this we added the ISA bridge, then the kernel would init the IRQ contollers.
>
> The patch that broke booting on the X1000 moved the pas_pci_init to a node in the machine description, where it called later in the boot sequence. Unfortunately this is after we've tried to add the i8259 contoller from the pas_init_IRQ. Since our ISA bridge can't be found until we've connected the PCI-e ports the system tries to write to registers that aren't yet mapped - result a kernel panic, but before console I/O has been initialised so it appears to be a hang. We had a similar problem when they were introducing Radix support.
>
> My patch changes our code so that it works with the new kernel code in place. Basically I moved the code that adds the i8259 cascade to after we've scanned for the ISA bridge where I know it will work.
>
> Hopefully this makes sense, shout out if it doesn't.
>
> Regards
> Darren
>
> [1] https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FAmigaOne_X1000&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cb415e9e7a26c4d8e3c6b08ded770c1b7%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639185077045605675%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C60000%7C%7C%7C&sdata=EgGtT9Kj7aqkWWcIIxfPpYRulro8rUA%2F%2Bsp9bhy%2Bjqo%3D&reserved=0
>
> Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
The commit message will look strange when picking-up this email, you
should resend with a cleaned commit message.
> ---
> arch/powerpc/platforms/pasemi/pci.c | 7 +++++++
> arch/powerpc/platforms/pasemi/setup.c | 7 ++++---
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
> index 2df955274652..7208c325bfc5 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -25,6 +25,8 @@
>
> #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
>
> +extern void nemo_init_IRQ(void);
> +
Should be better in arch/powerpc/platforms/pasemi/pasemi.h
> static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
> {
> /* Device 0 Function 0 is special: It's config space spans function 1 as
> @@ -265,6 +267,11 @@ static int __init pas_add_bridge(struct device_node *dev)
> */
> isa_bridge_find_early(hose);
>
> + /*
> + * ISA brigde is now active, add the i8259 cascade (if needed)
> + */
> + nemo_init_IRQ();
> +
> return 0;
> }
>
> diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
> index d03b41336901..eec74611be46 100644
> --- a/arch/powerpc/platforms/pasemi/setup.c
> +++ b/arch/powerpc/platforms/pasemi/setup.c
> @@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct irq_desc *desc)
> chip->irq_eoi(&desc->irq_data);
> }
>
> -static void __init nemo_init_IRQ(struct mpic *mpic)
> +void nemo_init_IRQ(void)
> {
> struct device_node *np;
> int gpio_virq;
> + struct mpic *mpic;
> +
> /* Connect the SB600's legacy i8259 controller */
> np = of_find_node_by_path("/pxp@0,e0000000");
> i8259_init(np, 0);
> @@ -228,6 +230,7 @@ static void __init nemo_init_IRQ(struct mpic *mpic)
> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>
> + mpic = irq_get_chip_data(gpio_virq);
> irq_set_default_domain(mpic->irqhost);
> }
>
> @@ -298,8 +301,6 @@ static __init void pas_init_IRQ(void)
> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> }
>
> - nemo_init_IRQ(mpic);
> -
> of_node_put(mpic_node);
> of_node_put(root);
> }
Build fails:
CC arch/powerpc/platforms/pasemi/setup.o
arch/powerpc/platforms/pasemi/setup.c:217:6: error: no previous
prototype for 'nemo_init_IRQ' [-Werror=missing-prototypes]
217 | void nemo_init_IRQ(void)
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:289:
arch/powerpc/platforms/pasemi/setup.o] Error 1
make[4]: *** [scripts/Makefile.build:549: arch/powerpc/platforms/pasemi]
Error 2
make[3]: *** [scripts/Makefile.build:549: arch/powerpc/platforms] Error 2
make[2]: *** [scripts/Makefile.build:549: arch/powerpc] Error 2
make[1]: *** [/home/chleroy/linux-powerpc/Makefile:2184: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
2026-07-27 13:43 ` Christophe Leroy (CS GROUP)
@ 2026-07-28 12:50 ` Christian Zigotzky
2026-07-31 16:33 ` Christophe Leroy (CS GROUP)
0 siblings, 1 reply; 8+ messages in thread
From: Christian Zigotzky @ 2026-07-28 12:50 UTC (permalink / raw)
To: Christophe Leroy (CS GROUP), Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin, Krzysztof Kozlowski,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list
Cc: R.T.Dickinson, mad skateman, Damien Stewart, Darren Stevens,
Christian Zigotzky
On 27/07/26 15:43, Christophe Leroy (CS GROUP) wrote:
>
> Should be better in arch/powerpc/platforms/pasemi/pasemi.h
>
Hello Christophe,
Thank you for your answer. I modified the patch today. The Nemo board
boots without any problems if I compile the RC5 of kernel 7.2 with this
patch.
Could you please check the following modified patch?
Thanks,
Christian
---
powerpc/pasemi: Move Nemo i8259 initialization to pci.c
The Nemo board requires the PCIe ports to be initialized before the
SB600 ISA bridge can be accessed.
Since pas_pci_init() is now called later during boot, the i8259
initialization in pas_init_IRQ() happens too early and accesses
registers that are not yet mapped, preventing the board from booting.
Move the Nemo-specific i8259 initialization to pas_add_bridge(),
after the ISA bridge has been discovered.
Suggested-by: Darren Stevens <darren@stevens-zone.net>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
---
v2:
- Move Nemo i8259 initialization out of pas_init_IRQ() and into
pas_add_bridge() after the ISA bridge has been discovered.
- Change nemo_init_IRQ() to no longer depend on the MPIC instance passed
from the IRQ setup path.
- Move the nemo_init_IRQ() declaration to pasemi.h and add a no-op stub
for non-Nemo builds.
- Fix missing prototype warning reported by Christophe Leroy.
- Fix indentation and clean up the commit message.
diff -rupN a/arch/powerpc/platforms/pasemi/pasemi.h
b/arch/powerpc/platforms/pasemi/pasemi.h
--- a/arch/powerpc/platforms/pasemi/pasemi.h 2026-07-26
23:45:48.000000000 +0200
+++ b/arch/powerpc/platforms/pasemi/pasemi.h 2026-07-28
07:44:31.924168227 +0200
@@ -7,6 +7,12 @@ extern void pas_pci_init(void);
struct pci_dev;
extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
+#ifdef CONFIG_PPC_PASEMI_NEMO
+extern void __init nemo_init_IRQ(void);
+#else
+static inline void __init nemo_init_IRQ(void) { }
+#endif
+
void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int
offset);
extern void __init pasemi_map_registers(void);
diff -rupN a/arch/powerpc/platforms/pasemi/pci.c
b/arch/powerpc/platforms/pasemi/pci.c
--- a/arch/powerpc/platforms/pasemi/pci.c 2026-07-26
23:45:48.000000000 +0200
+++ b/arch/powerpc/platforms/pasemi/pci.c 2026-07-28
07:34:37.036634023 +0200
@@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct
*/
isa_bridge_find_early(hose);
+ /*
+ * ISA bridge is now active, add the i8259 cascade (if needed)
+ */
+ nemo_init_IRQ();
+
return 0;
}
diff -rupN a/arch/powerpc/platforms/pasemi/setup.c
b/arch/powerpc/platforms/pasemi/setup.c
--- a/arch/powerpc/platforms/pasemi/setup.c 2026-07-26
23:45:48.000000000 +0200
+++ b/arch/powerpc/platforms/pasemi/setup.c 2026-07-28
07:54:54.147863161 +0200
@@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct ir
chip->irq_eoi(&desc->irq_data);
}
-static void __init nemo_init_IRQ(struct mpic *mpic)
+void __init nemo_init_IRQ(void)
{
struct device_node *np;
int gpio_virq;
+ struct mpic *mpic;
+
/* Connect the SB600's legacy i8259 controller */
np = of_find_node_by_path("/pxp@0,e0000000");
i8259_init(np, 0);
@@ -228,14 +230,10 @@ static void __init nemo_init_IRQ(struct
irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
mpic_unmask_irq(irq_get_irq_data(gpio_virq));
+ mpic = irq_get_chip_data(gpio_virq);
irq_set_default_domain(mpic->irqhost);
}
-#else
-
-static inline void nemo_init_IRQ(struct mpic *mpic)
-{
-}
#endif
static __init void pas_init_IRQ(void)
@@ -297,9 +295,7 @@ static __init void pas_init_IRQ(void)
irq_set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING);
mpic_unmask_irq(irq_get_irq_data(nmi_virq));
}
-
- nemo_init_IRQ(mpic);
-
+
of_node_put(mpic_node);
of_node_put(root);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c.
2026-07-28 12:50 ` Christian Zigotzky
@ 2026-07-31 16:33 ` Christophe Leroy (CS GROUP)
0 siblings, 0 replies; 8+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-07-31 16:33 UTC (permalink / raw)
To: Christian Zigotzky, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Krzysztof Kozlowski,
open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list
Cc: R.T.Dickinson, mad skateman, Damien Stewart, Darren Stevens,
Christian Zigotzky
Le 28/07/2026 à 14:50, Christian Zigotzky a écrit :
> On 27/07/26 15:43, Christophe Leroy (CS GROUP) wrote:
> >
> > Should be better in arch/powerpc/platforms/pasemi/pasemi.h
> >
>
> Hello Christophe,
>
> Thank you for your answer. I modified the patch today. The Nemo board
> boots without any problems if I compile the RC5 of kernel 7.2 with this
> patch.
>
> Could you please check the following modified patch?
b4 doesn't see it as a patch. Can you resend as a regular patch ?
$ b4 shazam --single-message
f5ed5a79-4235-31b6-5bd9-c68d1a6b50cf@xenosoft.de
Single-message mode, ignoring any follow-ups
Grabbing thread from
lore.kernel.org/all/f5ed5a79-4235-31b6-5bd9-c68d1a6b50cf@xenosoft.de/t.mbox.gz
Analyzing 1 messages in the thread
No patches found.
Thanks
Christophe
>
> Thanks,
> Christian
>
> ---
>
> powerpc/pasemi: Move Nemo i8259 initialization to pci.c
>
> The Nemo board requires the PCIe ports to be initialized before the
> SB600 ISA bridge can be accessed.
>
> Since pas_pci_init() is now called later during boot, the i8259
> initialization in pas_init_IRQ() happens too early and accesses
> registers that are not yet mapped, preventing the board from booting.
>
> Move the Nemo-specific i8259 initialization to pas_add_bridge(),
> after the ISA bridge has been discovered.
>
> Suggested-by: Darren Stevens <darren@stevens-zone.net>
> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> Signed-off-by: Christian Zigotzky <chzigotzky@xenosoft.de>
>
> ---
> v2:
> - Move Nemo i8259 initialization out of pas_init_IRQ() and into
> pas_add_bridge() after the ISA bridge has been discovered.
> - Change nemo_init_IRQ() to no longer depend on the MPIC instance passed
> from the IRQ setup path.
> - Move the nemo_init_IRQ() declaration to pasemi.h and add a no-op stub
> for non-Nemo builds.
> - Fix missing prototype warning reported by Christophe Leroy.
> - Fix indentation and clean up the commit message.
>
> diff -rupN a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/
> platforms/pasemi/pasemi.h
> --- a/arch/powerpc/platforms/pasemi/pasemi.h 2026-07-26
> 23:45:48.000000000 +0200
> +++ b/arch/powerpc/platforms/pasemi/pasemi.h 2026-07-28
> 07:44:31.924168227 +0200
> @@ -7,6 +7,12 @@ extern void pas_pci_init(void);
> struct pci_dev;
> extern void pas_pci_dma_dev_setup(struct pci_dev *dev);
>
> +#ifdef CONFIG_PPC_PASEMI_NEMO
> +extern void __init nemo_init_IRQ(void);
> +#else
> +static inline void __init nemo_init_IRQ(void) { }
> +#endif
> +
> void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int
> offset);
>
> extern void __init pasemi_map_registers(void);
> diff -rupN a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/
> platforms/pasemi/pci.c
> --- a/arch/powerpc/platforms/pasemi/pci.c 2026-07-26
> 23:45:48.000000000 +0200
> +++ b/arch/powerpc/platforms/pasemi/pci.c 2026-07-28
> 07:34:37.036634023 +0200
> @@ -265,6 +265,11 @@ static int __init pas_add_bridge(struct
> */
> isa_bridge_find_early(hose);
>
> + /*
> + * ISA bridge is now active, add the i8259 cascade (if needed)
> + */
> + nemo_init_IRQ();
> +
> return 0;
> }
>
> diff -rupN a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/
> platforms/pasemi/setup.c
> --- a/arch/powerpc/platforms/pasemi/setup.c 2026-07-26
> 23:45:48.000000000 +0200
> +++ b/arch/powerpc/platforms/pasemi/setup.c 2026-07-28
> 07:54:54.147863161 +0200
> @@ -214,10 +214,12 @@ static void sb600_8259_cascade(struct ir
> chip->irq_eoi(&desc->irq_data);
> }
>
> -static void __init nemo_init_IRQ(struct mpic *mpic)
> +void __init nemo_init_IRQ(void)
> {
> struct device_node *np;
> int gpio_virq;
> + struct mpic *mpic;
> +
> /* Connect the SB600's legacy i8259 controller */
> np = of_find_node_by_path("/pxp@0,e0000000");
> i8259_init(np, 0);
> @@ -228,14 +230,10 @@ static void __init nemo_init_IRQ(struct
> irq_set_chained_handler(gpio_virq, sb600_8259_cascade);
> mpic_unmask_irq(irq_get_irq_data(gpio_virq));
>
> + mpic = irq_get_chip_data(gpio_virq);
> irq_set_default_domain(mpic->irqhost);
> }
>
> -#else
> -
> -static inline void nemo_init_IRQ(struct mpic *mpic)
> -{
> -}
> #endif
>
> static __init void pas_init_IRQ(void)
> @@ -297,9 +295,7 @@ static __init void pas_init_IRQ(void)
> irq_set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING);
> mpic_unmask_irq(irq_get_irq_data(nmi_virq));
> }
> -
> - nemo_init_IRQ(mpic);
> -
> +
> of_node_put(mpic_node);
> of_node_put(root);
> }
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-31 16:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 12:59 [PATCH] Connecting the SB600's i8259 controller rather in pasemi's pci.c than in pasemi's setup.c Christian Zigotzky
2026-07-27 13:43 ` Christophe Leroy (CS GROUP)
2026-07-28 12:50 ` Christian Zigotzky
2026-07-31 16:33 ` Christophe Leroy (CS GROUP)
-- strict thread matches above, loose matches on Subject: below --
2026-07-01 10:54 Christian Zigotzky
2026-07-01 11:14 ` Christian Zigotzky
2026-07-07 4:31 ` Christian Zigotzky
2026-07-13 16:18 ` Christian Zigotzky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox