From: Heikki Lindholm <holindho@domain.hid>
To: rtai@domain.hid
Cc: adeos-main@gna.org
Subject: [Adeos-main] PATCH: Adeos ppc g5 support
Date: Wed, 25 May 2005 23:42:19 +0300 [thread overview]
Message-ID: <4294E32B.6010203@domain.hid> (raw)
[-- Attachment #1: Type: text/plain, Size: 450 bytes --]
Hello,
Current adeos ppc has (at least) two problems with Apple G5 hardware:
* the PowerPC 970 decrementer does not work the same way as most ppc32
decrementers: it can't be turned off and it's level-sensitive
* cascading interrupts aren't handled correctly
Attached is patch against fusion 0.7.4 included adeos to fix these
problems (not the cleanest possible implementation, but the ppc32 kernel
for g5 isn't either)
Regards,
Heikki Lindholm
[-- Attachment #2: adeos-ppc-r7c1-g5.patch --]
[-- Type: text/plain, Size: 2346 bytes --]
diff -Nru linux-2.6.10-adeos-orig/arch/ppc/kernel/adeos.c linux-2.6.10-adeos-work/arch/ppc/kernel/adeos.c
--- linux-2.6.10-adeos-orig/arch/ppc/kernel/adeos.c 2005-05-25 21:22:41.289901000 +0300
+++ linux-2.6.10-adeos-work/arch/ppc/kernel/adeos.c 2005-05-25 23:23:17.954761000 +0300
@@ -65,6 +65,11 @@
struct pt_regs __adeos_irq_regs;
+#ifdef CONFIG_POWER4
+extern struct irqaction k2u3_cascade_action;
+extern int openpic2_get_irq(struct pt_regs *regs);
+#endif
+
/* Current reload value for the decrementer. */
unsigned long __adeos_decr_ticks;
@@ -346,7 +351,7 @@
{
irq_desc_t *desc = irq_desc + irq;
-
+
if (desc->handler->ack != NULL)
{
unsigned long adflags;
@@ -364,7 +369,19 @@
preempt_disable();
#endif /* CONFIG_PREEMPT */
spin_lock(&desc->lock);
- desc->handler->ack(irq);
+ desc->handler->ack(irq);
+#ifdef CONFIG_POWER4
+ /* if it is a k2u3 cascaded irq, acknowledge it, also */
+ if (desc->action == &k2u3_cascade_action) {
+ struct pt_regs regs;
+ int irq2 = openpic2_get_irq(®s);
+ if (irq2 != -1) {
+ irq_desc_t *desc2 = irq_desc + irq2;
+ if (desc2->handler->ack)
+ desc2->handler->ack(irq2);
+ }
+ }
+#endif
spin_unlock(&desc->lock);
#ifdef CONFIG_PREEMPT
preempt_enable_no_resched();
@@ -565,6 +582,14 @@
return 1;
}
+#ifdef CONFIG_POWER4
+ /* On 970 CPUs DEC cannot be disabled, and without setting DEC
+ * here, DEC interrupt would be triggered as soon as interrupts are
+ * enabled in __adeos_sync_stage
+ */
+ set_dec(0x7fffffff);
+#endif
+
__adeos_irq_regs.msr = regs->msr; /* for do_timer() */
__adeos_handle_irq(ADEOS_TIMER_VIRQ,regs);
diff -Nru linux-2.6.10-adeos-orig/arch/ppc/platforms/pmac_pic.c linux-2.6.10-adeos-work/arch/ppc/platforms/pmac_pic.c
--- linux-2.6.10-adeos-orig/arch/ppc/platforms/pmac_pic.c 2004-12-24 23:35:28.000000000 +0200
+++ linux-2.6.10-adeos-work/arch/ppc/platforms/pmac_pic.c 2005-05-25 23:09:37.535483000 +0300
@@ -387,7 +387,12 @@
return IRQ_HANDLED;
}
+#ifdef CONFIG_ADEOS_CORE
+/* this is used in kernel/adeos.c adeos_acknowledge_irq */
+struct irqaction k2u3_cascade_action = {
+#else /* !CONFIG_ADEOS_CORE */
static struct irqaction k2u3_cascade_action = {
+#endif /* CONFIG_ADEOS_CORE */
.handler = k2u3_action,
.flags = 0,
.mask = CPU_MASK_NONE,
next reply other threads:[~2005-05-25 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-25 20:42 Heikki Lindholm [this message]
2005-05-25 21:58 ` [Adeos-main] Re: PATCH: Adeos ppc g5 support Philippe Gerum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4294E32B.6010203@domain.hid \
--to=holindho@domain.hid \
--cc=adeos-main@gna.org \
--cc=rtai@domain.hid \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.