ADEOS IPIPE PPC patches upgrade
Subsystems (9)
PATCH 1/1 ADEOS IPIPE PPC patches upgrade
Hallo,
attached is patch for Xenomai upgrading the ADEOS IPIPE patches for the PPC tree. Here is the ChangeLog entry:
2006-12-18 Wolfgang Grandegger <[email protected]>
* ksrc/arch/powerpc/patches: Upgrade to 2.6.14-ppc-1.5-02, 2.6.18-ppc-1.5-01 and 2.6.19-ppc-1.5-01. These patches fix the problems with PIC for Galileo's GT64260 reported by Antonio Barbalace and add support for 2.6.19.
Wolfgang.
Quoted 11 lines · On Mon, 18 Dec 2006 13:12:54 +0100 Wolfgang Grandegger <[email protected]> wrote:
Hallo,
attached is patch for Xenomai upgrading the ADEOS IPIPE patches for the PPC tree. Here is the ChangeLog entry:
2006-12-18 Wolfgang Grandegger <[email protected]>
* ksrc/arch/powerpc/patches: Upgrade to 2.6.14-ppc-1.5-02, 2.6.18-ppc-1.5-01 and 2.6.19-ppc-1.5-01. These patches fix the problems with PIC for Galileo's GT64260 reported by Antonio Barbalace and add support for 2.6.19.
Hi,
Got the same for 2.6.19 on powerpc arch ?
Or should I try to port it as I did for 2.6.18 ?
Ben
Quoted 14 lines · Benjamin Zores
Quoted 10 lines · On Mon, 18 Dec 2006 13:12:54 +0100 Wolfgang Grandegger <[email protected]> wrote:
Hallo,
attached is patch for Xenomai upgrading the ADEOS IPIPE patches for the PPC tree. Here is the ChangeLog entry:
2006-12-18 Wolfgang Grandegger <[email protected]>
* ksrc/arch/powerpc/patches: Upgrade to 2.6.14-ppc-1.5-02, 2.6.18-ppc-1.5-01 and 2.6.19-ppc-1.5-01. These patches fix the problems with PIC for Galileo's GT64260 reported by Antonio Barbalace and add support for 2.6.19.
Quoted 4 lines
Hi,
Got the same for 2.6.19 on powerpc arch ?
Or should I try to port it as I did for 2.6.18 ?
I don't understand your questions. These patches are for the PPC tree. The POWERPC is still not supported. Do you already have a working port for the PowerPC tree 2.6.18?
Wolfgang.
Quoted 3 lines · On Mon, 18 Dec 2006 14:06:15 +0100 Wolfgang Grandegger <[email protected]> wrote:
I don't understand your questions. These patches are for the PPC tree. The POWERPC is still not supported. Do you already have a working port for the PowerPC tree 2.6.18?
I send one a month ago but which wasn't 100% complete.
Now, here's an updated one for both ppc and powerpc arch.
It based on your patch + the equivalent functions ported to merged powerpc architecture. This time it should compile fine but i haven't tested if ppc arch still works (i can't do so).
I just remove the xenomai parts from your patch (which obviously had nothing to do in adeos patch itself).
With ipipe enabled on my card, the kernels boots up
but still hangs due to IRQ problems has it used to do in 2.6.18.
It seems to hang at SATA driver load (does the same for USB/I2C and so on after all)
but if I had printk() in each function from ipipe-root.c it goes in an endless
loop of:
...
__ipipe_handle_irq:226
__ipipe_do_timer:404
__ipipe_grab_timer:357
__ipipe_handle_irq:226
__ipipe_do_timer:404
__ipipe_grab_timer:357
...
and seems to never go further :-(
Do you have an idea where and why this might come from ?
FYI, the vanilla 2.6.19 kernel boots up my card fine and goes to userspace but seems to also hang a few time later (but at least it boots up to user space).
Anyhow, please consider this patch for review and if possible test it/apply it.
Ben
arch/powerpc/Kconfig +2 -0
@@ -613,6 +613,8 @@ menu "Kernel options" +source "kernel/ipipe/Kconfig" + config HIGHMEM bool "High memory support" depends on PPC32
arch/powerpc/kernel/entry_32.S +92 -0
140 lines not on this page · raw message
arch/powerpc/kernel/head_32.S +15 -1
@@ -329,6 +329,12 @@ EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ + #define EXC_XFER_LITE(n, hdlr) \ EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -418,8 +424,12 @@ EXC_XFER_EE_LITE(0x400, handle_page_fault) /* External interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) - +#endif /* CONFIG_IPIPE */ + /* Alignment exception */ . = 0x600 Alignment:
@@ -443,7 +453,11 @@ EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception) /* Decrementer */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x900, Decrementer, __ipipe_grab_timer, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE) EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
arch/powerpc/kernel/head_44x.S +5 -1
@@ -427,8 +427,12 @@ INSTRUCTION_STORAGE_EXCEPTION /* External Input Interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x0500, ExternalInput, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) - +#endif /* CONFIG_IPIPE */ + /* Alignment Interrupt */ ALIGNMENT_EXCEPTION
arch/powerpc/kernel/head_4xx.S +16 -2
@@ -228,6 +228,12 @@ EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE(n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ + #define EXC_XFER_LITE(n, hdlr) \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -396,8 +402,12 @@ EXC_XFER_EE_LITE(0x400, handle_page_fault) /* 0x0500 - External Interrupt Exception */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x0500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x0500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) - +#endif /* CONFIG_IPIPE */ + /* 0x0600 - Alignment Exception */ START_EXCEPTION(0x0600, Alignment) NORMAL_EXCEPTION_PROLOG
@@ -434,8 +444,12 @@ lis r0,TSR_PIS@h mtspr SPRN_TSR,r0 /* Clear the PIT exception */ addi r3,r1,STACK_FRAME_OVERHEAD +#ifdef CONFIG_IPIPE + EXC_XFER_IPIPE(0x1000, __ipipe_grab_timer) +#else /* !CONFIG_IPIPE */ EXC_XFER_LITE(0x1000, timer_interrupt) - +#endif /* CONFIG_IPIPE */ + #if 0 /* NOTE: * FIT and WDT handlers are not implemented yet.
arch/powerpc/kernel/head_8xx.S +16 -2
@@ -187,6 +187,12 @@ EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ + #define EXC_XFER_LITE(n, hdlr) \ EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -238,8 +244,12 @@ EXC_XFER_EE_LITE(0x400, handle_page_fault) /* External interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) - +#endif /* CONFIG_IPIPE */ + /* Alignment exception */ . = 0x600 Alignment:
@@ -259,8 +269,12 @@ EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD) /* Decrementer */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x900, Decrementer, __ipipe_grab_timer, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) - +#endif /* CONFIG_IPIPE */ + EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE) EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
arch/powerpc/kernel/head_booke.h +16 -0
@@ -187,6 +187,12 @@EXC_XFER_TEMPLATE (hdlr, n,MSR_KERNEL ,NOCOPY , transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE (n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ +#define EXC_XFER_LITE (n, hdlr) \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -345,6 +351,15 @@addi r3,r1,STACK_FRAME_OVERHEAD ; \ EXC_XFER_STD(0x0700, program_check_exception) +#ifdef CONFIG_IPIPE +#define DECREMENTER_EXCEPTION \ + START_EXCEPTION(Decrementer) \ + NORMAL_EXCEPTION_PROLOG; \ + lis r0,TSR_DIS@h;/* Setup the DEC interrupt mask */ \ +mtspr SPRN_TSR ,r0;/* Clear the DEC interrupt */ \ +addi r3,r1,STACK_FRAME_OVERHEAD ; \ + EXC_XFER_IPIPE(0x0900, __ipipe_grab_timer) +#else /* !CONFIG_IPIPE */ #define DECREMENTER_EXCEPTION \ START_EXCEPTION(Decrementer) \ NORMAL_EXCEPTION_PROLOG; \
@@ -352,6 +367,7 @@mtspr SPRN_TSR ,r0;/* Clear the DEC interrupt */ \addi r3,r1,STACK_FRAME_OVERHEAD ; \ EXC_XFER_LITE(0x0900, timer_interrupt) +#endif /* CONFIG_IPIPE */ #define FP_UNAVAILABLE_EXCEPTION \ START_EXCEPTION(FloatingPointUnavailable) \
arch/powerpc/kernel/head_fsl_booke.S +5 -1
@@ -526,8 +526,12 @@ INSTRUCTION_STORAGE_EXCEPTION /* External Input Interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x0500, ExternalInput, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) - +#endif /* CONFIG_IPIPE */ + /* Alignment Interrupt */ ALIGNMENT_EXCEPTION
arch/powerpc/kernel/idle.c +9 -0
@@ -51,6 +51,7 @@while (1 ) {while (!need_resched () && !cpu_should_die ()) {ppc64_runlatch_off (); +ipipe_suspend_domain ();if (ppc_md.power_save) {clear_thread_flag (TIF_POLLING_NRFLAG );
@@ -59,13 +60,21 @@* is ordered w.r.t. need_resched() test. */ smp_mb (); +#ifdef CONFIG_IPIPE +local_irq_disable_hw (); +#else /* !CONFIG_IPIPE */ local_irq_disable (); +#endif /* CONFIG_IPIPE */ /* check again after disabling irqs */ if (!need_resched () && !cpu_should_die ()) ppc_md.power_save (); +#ifdef CONFIG_IPIPE +local_irq_enable_hw (); +#else /* !CONFIG_IPIPE */ local_irq_enable (); +#endif /* CONFIG_IPIPE */ set_thread_flag (TIF_POLLING_NRFLAG ); }else {
arch/powerpc/kernel/ipipe-core.c +263 -0
263 lines not on this page · raw message
arch/powerpc/kernel/ipipe-mcount.S +76 -0
76 lines not on this page · raw message
arch/powerpc/kernel/ipipe-root.c +490 -0
490 lines not on this page · raw message
arch/powerpc/kernel/irq.c +4 -0
@@ -69,7 +69,11 @@#endif int __irq_offset_value; +#ifdef CONFIG_IPIPE +int ppc_spurious_interrupts; +#else /* !CONFIG_IPIPE */ static int ppc_spurious_interrupts; +#endif /* CONFIG_IPIPE */ #ifdef CONFIG_PPC32 EXPORT_SYMBOL (__irq_offset_value);
arch/powerpc/kernel/Makefile +2 -0
@@ -57,6 +57,8 @@ obj-$(CONFIG_MODULES) += ppc_ksyms.o obj-$(CONFIG_BOOTX_TEXT) += btext.o obj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_IPIPE) += ipipe-core.o ipipe-root.o +obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += ipipe-mcount.o obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o module-$(CONFIG_PPC64) += module_64.o
arch/powerpc/kernel/setup_32.c +1 -1
@@ -88,7 +88,7 @@* from the address that it was linked at, so we must use RELOC/PTRRELOC * to access static data (including strings). -- paulus */ -unsigned long __init early_init (unsigned long dt_ptr) +notrace unsigned long __init early_init (unsigned long dt_ptr) {unsigned long offset =reloc_offset ();struct cpu_spec *spec;
arch/powerpc/kernel/time.c +13 -2
@@ -296,7 +296,11 @@#else /* ! CONFIG_VIRT_CPU_ACCOUNTING */ #define calc_cputime_factors () +#ifdef CONFIG_IPIPE +#define account_process_time (regs) update_process_times(user_mode(__ipipe_tick_regs + smp_processor_id())) +#else #define account_process_time (regs) update_process_times(user_mode(regs)) +#endif /* CONFIG_IPIPE */ #define calculate_steal_time () do { } while (0)#endif
@@ -669,10 +673,17 @@ }write_sequnlock (&xtime_lock); } - + +#ifdef CONFIG_IPIPE +if (__ipipe_decr_ticks == tb_ticks_per_jiffy) { + next_dec = tb_ticks_per_jiffy - ticks; +set_dec (next_dec); + } +#else /* !CONFIG_IPIPE */ next_dec = tb_ticks_per_jiffy - ticks;set_dec (next_dec); - +#endif /* CONFIG_IPIPE */ +#ifdef CONFIG_PPC_ISERIES if (hvlpevent_is_pending ())process_hvlpevents ();
arch/powerpc/kernel/traps.c +38 -2
@@ -324,6 +324,9 @@int recover =0 ;unsigned long reason =get_mc_reason (regs); +if (ipipe_trap_notify (IPIPE_TRAP_MCE ,regs)) +return ; +/* See if any machine dependent calls */ if (ppc_md.machine_check_exception) recover = ppc_md.machine_check_exception (regs);
@@ -490,6 +493,10 @@void unknown_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_IABR ,regs)) +return ; +if (ipipe_trap_notify (IPIPE_TRAP_UNKNOWN ,regs)) +return ;printk ("Bad trap at PC: %lx, SR: %lx, vector=%lx\n" , regs->nip, regs->msr, regs->trap);
@@ -508,13 +515,17 @@void RunModeException (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_RM ,regs)) +return ;_exception (SIGTRAP , regs,0 ,0 ); }void __kprobes single_step_exception (struct pt_regs *regs) { regs->msr &= ~(MSR_SE |MSR_BE );/* Turn off 'trace' bits */ - +if (ipipe_trap_notify (IPIPE_TRAP_SSTEP ,regs)) +return ; +if (notify_die (DIE_SSTEP ,"single_step" , regs,5 ,5 ,SIGTRAP ) ==NOTIFY_STOP )return ;
@@ -534,7 +545,9 @@ {if (single_stepping (regs)) {clear_single_step (regs); -_exception (SIGTRAP , regs,TRAP_TRACE ,0 ); +if (ipipe_trap_notify (IPIPE_TRAP_SSTEP ,regs)) +return ; +_exception (SIGTRAP , regs,TRAP_TRACE ,0 ); } }
@@ -786,6 +799,9 @@unsigned int reason =get_reason (regs);extern int do_mathemu (struct pt_regs *regs); +if (ipipe_trap_notify (IPIPE_TRAP_PCE ,regs)) +return ; +#ifdef CONFIG_MATH_EMULATION /* (reason & REASON_ILLEGAL) would be the obvious thing here, * but there seems to be a hardware bug on the 405GP (RevD)
@@ -855,6 +871,9 @@return ; } +if (ipipe_trap_notify (IPIPE_TRAP_ALIGNMENT ,regs)) +return ; +/* Operand address was bad */ if (fixed == -EFAULT ) { sig =SIGSEGV ;
@@ -880,6 +899,8 @@void nonrecoverable_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_NREC ,regs)) +return ;printk (KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n" , regs->nip, regs->msr);debugger (regs);
@@ -902,6 +923,9 @@void altivec_unavailable_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_ALTUNAVAIL ,regs)) +return ; +if (user_mode (regs)) {/* A user program has executed an altivec instruction, but this kernel doesn't support altivec. */
@@ -926,6 +950,9 @@extern int Soft_emulate_8xx (struct pt_regs *);int errcode; +if (ipipe_trap_notify (IPIPE_TRAP_SOFTEMU ,regs)) +return ; +CHECK_FULL_REGS (regs);if (!user_mode (regs)) {
@@ -954,6 +981,9 @@void DebugException (struct pt_regs *regs,unsigned long debug_status) { +if (ipipe_trap_notify (IPIPE_TRAP_DEBUG ,regs)) +return ; +if (debug_status &DBSR_IC ) {/* instruction completion */ regs->msr &= ~MSR_DE ;if (user_mode (regs)) {
@@ -984,6 +1014,9 @@ {int err; +if (ipipe_trap_notify (IPIPE_TRAP_ALTASSIST ,regs)) +return ; +if (!user_mode (regs)) {printk (KERN_EMERG "VMX/Altivec assist exception in kernel mode" " at %lx\n" , regs->nip);
@@ -1034,6 +1067,9 @@int fpexc_mode;int code =0 ; +if (ipipe_trap_notify (IPIPE_TRAP_SPE ,regs)) +return ; + spefscr = current->thread.spefscr; fpexc_mode = current->thread.fpexc_mode;
arch/powerpc/mm/fault.c +3 -0
@@ -175,6 +175,9 @@ is_write = error_code &ESR_DST ;#endif /* CONFIG_4xx || CONFIG_BOOKE */ +if (ipipe_trap_notify (IPIPE_TRAP_ACCESS ,regs)) +return 0 ; +if (notify_page_fault (DIE_PAGE_FAULT ,"page_fault" , regs, error_code,11 ,SIGSEGV ) ==NOTIFY_STOP )return 0 ;
arch/ppc/boot/Makefile +8 -0
@@ -16,6 +16,14 @@ CFLAGS += -fno-builtin -D__BOOTER__ -Iarch/$(ARCH)/boot/include HOSTCFLAGS += -Iarch/$(ARCH)/boot/include +ifdef CONFIG_IPIPE_TRACE +# do not trace the boot loader +nullstring := +space := $(nullstring) # end of the line +pg_flag = $(nullstring) -pg # end of the line +CFLAGS := $(subst ${pg_flag},${space},${CFLAGS}) +endif + BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd bootdir-y := simple
arch/ppc/Kconfig +2 -0
@@ -950,6 +950,8 @@ depends on SMP default "4" +source "kernel/ipipe/Kconfig" + config HIGHMEM bool "High memory support"
arch/ppc/kernel/entry.S +92 -0
137 lines not on this page · raw message
arch/ppc/kernel/head_44x.S +5 -1
@@ -427,7 +427,11 @@ INSTRUCTION_STORAGE_EXCEPTION /* External Input Interrupt */ - EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) +#ifdef CONFIG_IPIPE + EXCEPTION(0x0500, ExternalInput, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ + EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ /* Alignment Interrupt */ ALIGNMENT_EXCEPTION
arch/ppc/kernel/head_4xx.S +14 -0
@@ -228,6 +228,12 @@ EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE(n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ + #define EXC_XFER_LITE(n, hdlr) \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -396,7 +402,11 @@ EXC_XFER_EE_LITE(0x400, handle_page_fault) /* 0x0500 - External Interrupt Exception */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x0500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x0500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ /* 0x0600 - Alignment Exception */ START_EXCEPTION(0x0600, Alignment)
@@ -434,7 +444,11 @@ lis r0,TSR_PIS@h mtspr SPRN_TSR,r0 /* Clear the PIT exception */ addi r3,r1,STACK_FRAME_OVERHEAD +#ifdef CONFIG_IPIPE + EXC_XFER_IPIPE(0x1000, __ipipe_grab_timer) +#else /* !CONFIG_IPIPE */ EXC_XFER_LITE(0x1000, timer_interrupt) +#endif /* CONFIG_IPIPE */ #if 0 /* NOTE:
arch/ppc/kernel/head_8xx.S +13 -0
@@ -186,6 +186,11 @@ #define EXC_XFER_STD(n, hdlr) \ EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ #define EXC_XFER_LITE(n, hdlr) \ EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \
@@ -238,7 +243,11 @@ EXC_XFER_EE_LITE(0x400, handle_page_fault) /* External interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ /* Alignment exception */ . = 0x600
@@ -259,7 +268,11 @@ EXCEPTION(0x800, FPUnavailable, unknown_exception, EXC_XFER_STD) /* Decrementer */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x900, Decrementer, __ipipe_grab_timer, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE) EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
arch/ppc/kernel/head_booke.h +16 -0
@@ -187,6 +187,12 @@EXC_XFER_TEMPLATE (hdlr, n,MSR_KERNEL ,NOCOPY , transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE (n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ +#define EXC_XFER_LITE (n, hdlr) \ EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -345,6 +351,15 @@addi r3,r1,STACK_FRAME_OVERHEAD ; \ EXC_XFER_STD(0x0700, program_check_exception) +#ifdef CONFIG_IPIPE +#define DECREMENTER_EXCEPTION \ + START_EXCEPTION(Decrementer) \ + NORMAL_EXCEPTION_PROLOG; \ + lis r0,TSR_DIS@h;/* Setup the DEC interrupt mask */ \ +mtspr SPRN_TSR ,r0;/* Clear the DEC interrupt */ \ +addi r3,r1,STACK_FRAME_OVERHEAD ; \ + EXC_XFER_IPIPE(0x0900, __ipipe_grab_timer) +#else /* !CONFIG_IPIPE */ #define DECREMENTER_EXCEPTION \ START_EXCEPTION(Decrementer) \ NORMAL_EXCEPTION_PROLOG; \
@@ -352,6 +367,7 @@mtspr SPRN_TSR ,r0;/* Clear the DEC interrupt */ \addi r3,r1,STACK_FRAME_OVERHEAD ; \ EXC_XFER_LITE(0x0900, timer_interrupt) +#endif /* CONFIG_IPIPE */ #define FP_UNAVAILABLE_EXCEPTION \ START_EXCEPTION(FloatingPointUnavailable) \
arch/ppc/kernel/head_fsl_booke.S +4 -0
@@ -526,7 +526,11 @@ INSTRUCTION_STORAGE_EXCEPTION /* External Input Interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x0500, ExternalInput, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ /* Alignment Interrupt */ ALIGNMENT_EXCEPTION
arch/ppc/kernel/head.S +14 -0
@@ -295,6 +295,12 @@ EXC_XFER_TEMPLATE(n, hdlr, n, NOCOPY, transfer_to_handler_full, \ ret_from_except_full) +#ifdef CONFIG_IPIPE +#define EXC_XFER_IPIPE(n, hdlr) \ + EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ + __ipipe_ret_from_except) +#endif /* CONFIG_IPIPE */ + #define EXC_XFER_LITE(n, hdlr) \ EXC_XFER_TEMPLATE(n, hdlr, n+1, NOCOPY, transfer_to_handler, \ ret_from_except)
@@ -356,7 +362,11 @@ EXC_XFER_EE_LITE(0x400, handle_page_fault) /* External interrupt */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x500, HardwareInterrupt, __ipipe_grab_irq, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ /* Alignment exception */ . = 0x600
@@ -381,7 +391,11 @@ EXC_XFER_EE_LITE(0x800, kernel_fp_unavailable_exception) /* Decrementer */ +#ifdef CONFIG_IPIPE + EXCEPTION(0x900, Decrementer, __ipipe_grab_timer, EXC_XFER_IPIPE) +#else /* !CONFIG_IPIPE */ EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) +#endif /* CONFIG_IPIPE */ EXCEPTION(0xa00, Trap_0a, unknown_exception, EXC_XFER_EE) EXCEPTION(0xb00, Trap_0b, unknown_exception, EXC_XFER_EE)
arch/ppc/kernel/ipipe-core.c +264 -0
264 lines not on this page · raw message
arch/ppc/kernel/ipipe-mcount.S +76 -0
76 lines not on this page · raw message
arch/ppc/kernel/ipipe-root.c +488 -0
488 lines not on this page · raw message
arch/ppc/kernel/Makefile +2 -0
@@ -17,6 +17,8 @@ obj-$(CONFIG_RAPIDIO) += rio.o obj-$(CONFIG_KGDB) += ppc-stub.o obj-$(CONFIG_SMP) += smp.o smp-tbsync.o +obj-$(CONFIG_IPIPE) += ipipe-core.o ipipe-root.o +obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += ipipe-mcount.o obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o ifndef CONFIG_MATH_EMULATION
arch/ppc/kernel/setup.c +1 -1
@@ -295,7 +295,7 @@* to access static data (including strings). -- paulus */ __init -unsigned long +notrace unsigned long early_init (int r3,int r4,int r5) {unsigned long phys;
arch/ppc/kernel/time.c +4 -0
@@ -146,7 +146,11 @@ jiffy_stamp += tb_ticks_per_jiffy;profile_tick (CPU_PROFILING ); +#ifdef CONFIG_IPIPE +update_process_times (user_mode (__ipipe_tick_regs +smp_processor_id ())); +#else update_process_times (user_mode (regs)); +#endif if (smp_processor_id ())continue ;
arch/ppc/kernel/traps.c +33 -0
@@ -233,6 +233,9 @@ {unsigned long reason =get_mc_reason (regs); +if (ipipe_trap_notify (IPIPE_TRAP_MCE ,regs)) +return ; +if (user_mode (regs)) { regs->msr |=MSR_RI ;_exception (SIGBUS , regs,BUS_ADRERR , regs->nip);
@@ -392,6 +395,8 @@void unknown_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_UNKNOWN ,regs)) +return ;printk ("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n" , regs->nip, regs->msr, regs->trap,print_tainted ());_exception (SIGTRAP , regs,0 ,0 );
@@ -399,6 +404,8 @@void instruction_breakpoint_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_IABR ,regs)) +return ;if (debugger_iabr_match (regs))return ;_exception (SIGTRAP , regs,TRAP_BRKPT ,0 );
@@ -406,6 +413,8 @@void RunModeException (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_RM ,regs)) +return ;_exception (SIGTRAP , regs,0 ,0 ); }
@@ -555,6 +564,8 @@ {if (single_stepping (regs)) {clear_single_step (regs); +if (ipipe_trap_notify (IPIPE_TRAP_SSTEP ,regs)) +return ;_exception (SIGTRAP , regs,TRAP_TRACE ,0 ); } }
@@ -624,6 +635,9 @@unsigned int reason =get_reason (regs);extern int do_mathemu (struct pt_regs *regs); +if (ipipe_trap_notify (IPIPE_TRAP_PCE ,regs)) +return ; +#ifdef CONFIG_MATH_EMULATION /* (reason & REASON_ILLEGAL) would be the obvious thing here, * but there seems to be a hardware bug on the 405GP (RevD)
@@ -701,6 +715,8 @@void single_step_exception (struct pt_regs *regs) { regs->msr &= ~(MSR_SE |MSR_BE );/* Turn off 'trace' bits */ +if (ipipe_trap_notify (IPIPE_TRAP_SSTEP ,regs)) +return ;if (debugger_sstep (regs))return ;_exception (SIGTRAP , regs,TRAP_TRACE ,0 );
@@ -716,6 +732,8 @@emulate_single_step (regs);return ; } +if (ipipe_trap_notify (IPIPE_TRAP_ALIGNMENT ,regs)) +return ;if (fixed == -EFAULT ) { sig =SIGSEGV ; code =SEGV_ACCERR ;
@@ -740,6 +758,8 @@void nonrecoverable_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_NREC ,regs)) +return ;printk (KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n" , regs->nip, regs->msr);debugger (regs);
@@ -760,6 +780,9 @@extern int Soft_emulate_8xx (struct pt_regs *);int errcode; +if (ipipe_trap_notify (IPIPE_TRAP_SOFTEMU ,regs)) +return ; +CHECK_FULL_REGS (regs);if (!user_mode (regs)) {
@@ -788,6 +811,8 @@void DebugException (struct pt_regs *regs,unsigned long debug_status) { +if (ipipe_trap_notify (IPIPE_TRAP_DEBUG ,regs)) +return ;if (debug_status &DBSR_IC ) {/* instruction completion */ regs->msr &= ~MSR_DE ;if (user_mode (regs)) {
@@ -828,6 +853,9 @@ {static int kernel_altivec_count; +if (ipipe_trap_notify (IPIPE_TRAP_ALTUNAVAIL ,regs)) +return ; +#ifndef CONFIG_ALTIVEC if (user_mode (regs)) {/* A user program has executed an altivec instruction,
@@ -849,6 +877,8 @@ {int err; +if (ipipe_trap_notify (IPIPE_TRAP_ALTASSIST ,regs)) +return ;preempt_disable ();if (regs->msr &MSR_VEC )giveup_altivec (current);
@@ -909,6 +939,9 @@int fpexc_mode;int code =0 ; +if (ipipe_trap_notify (IPIPE_TRAP_SPE ,regs)) +return ; + spefscr = current->thread.spefscr; fpexc_mode = current->thread.fpexc_mode;
arch/ppc/mm/fault.c +3 -0
@@ -113,6 +113,9 @@ is_write = error_code &0x02000000 ;#endif /* CONFIG_4xx || CONFIG_BOOKE */ +if (ipipe_trap_notify (IPIPE_TRAP_ACCESS ,regs)) +return 0 ; +#if defined(CONFIG_XMON ) || defined(CONFIG_KGDB )if (debugger_fault_handler &&TRAP (regs) ==0x300 ) {debugger_fault_handler (regs);
arch/ppc/platforms/85xx/sbc85xx.h +0 -1
@@ -15,7 +15,6 @@#define __PLATFORMS_85XX_SBC85XX_H__#include <linux/init.h> -#include <linux/seq_file.h> #include <asm/ppcboot.h> #define BOARD_CCSRBAR ((uint)0xff700000)
arch/ppc/syslib/open_pic.c +2 -2
@@ -821,7 +821,7 @@*/ static void openpic_ack_irq (unsigned int irq_nr) { -#ifdef __SLOW_VERSION__ +#if defined(__SLOW_VERSION__) || defined(CONFIG_IPIPE )openpic_disable_irq (irq_nr);openpic_eoi ();#else
@@ -832,7 +832,7 @@static void openpic_end_irq (unsigned int irq_nr) { -#ifdef __SLOW_VERSION__ +#if defined(__SLOW_VERSION__) || defined(CONFIG_IPIPE )if (!(irq_desc[irq_nr].status & (IRQ_DISABLED |IRQ_INPROGRESS )) && irq_desc[irq_nr].action)openpic_enable_irq (irq_nr);
include/asm-powerpc/hw_irq.h +162 -0
174 lines not on this page · raw message
include/asm-powerpc/ipipe.h +216 -0
144 lines not on this page · raw message
include/asm-ppc/ipipe.h +220 -0
220 lines not on this page · raw message
include/linux/ipipe.h +769 -0
769 lines not on this page · raw message
kernel/ipipe/core.c +1049 -0
1,049 lines not on this page · raw message
kernel/ipipe/generic.c +424 -0
424 lines not on this page · raw message
kernel/ipipe/Kconfig.debug +69 -0
69 lines not on this page · raw message
kernel/ipipe/tracer.c +1245 -0
1,245 lines not on this page · raw message
kernel/printk.c +73 -0
73 lines not on this page · raw message
kernel/sched.c +69 -3
72 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 29 lines · Benjamin Zores
Quoted 1 line · On Mon, 18 Dec 2006 14:06:15 +0100 Wolfgang Grandegger <[email protected]> wrote:
I don't understand your questions. These patches are for the PPC tree. The POWERPC is still not supported. Do you already have a working port for the PowerPC tree 2.6.18?
I send one a month ago but which wasn't 100% complete.
Now, here's an updated one for both ppc and powerpc arch.
It based on your patch + the equivalent functions ported to merged powerpc architecture. This time it should compile fine but i haven't tested if ppc arch still works (i can't do so).I just remove the xenomai parts from your patch (which obviously had nothing to do in adeos patch itself).
With ipipe enabled on my card, the kernels boots up
but still hangs due to IRQ problems has it used to do in 2.6.18.
It seems to hang at SATA driver load (does the same for USB/I2C and so on after all)
but if I hadprintk()in each function fromipipe-root.cit goes in an endless
loop of:...
__ipipe_handle_irq:226
__ipipe_do_timer:404
__ipipe_grab_timer:357
__ipipe_handle_irq:226
__ipipe_do_timer:404
__ipipe_grab_timer:357
...
Quoted 1 line
and seems to never go further :-(
Well, in the meantime I started the porting of IPIPE v1.6 over the PowerPC tree on my Icecube-MPC5200 board ... and it seems to hang at the same location :-(.
Quoted 1 line
Do you have an idea where and why this might come from ?
No yet but it seems not to be related with interrupts.
Quoted 2 lines
FYI, the vanilla 2.6.19 kernel boots up my card fine and goes to userspace but seems to also hang a few time later (but at least it boots up to user space).
The PowerPC tree is highly experimental, ... not really a good setup to do the porting.
Quoted 1 line
Anyhow, please consider this patch for review and if possible test it/apply it.
OK, I will have a closer look when time permits.
Wolfgang.