Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261996AbUDHPM0 (ORCPT ); Thu, 8 Apr 2004 11:12:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262035AbUDHPM0 (ORCPT ); Thu, 8 Apr 2004 11:12:26 -0400 Received: from p062096.ppp.asahi-net.or.jp ([221.113.62.96]:50666 "EHLO mitou.ysato.dip.jp") by vger.kernel.org with ESMTP id S261996AbUDHPLa (ORCPT ); Thu, 8 Apr 2004 11:11:30 -0400 Date: Fri, 09 Apr 2004 00:11:03 +0900 Message-ID: From: Yoshinori Sato To: Linus Torvalds Cc: linux kernel Mailing List Subject: [PATCH] H8/300 support update User-Agent: Wanderlust/2.11.24 (Wonderwall) SEMI/1.14.6 (Maruoka) LIMIT/1.14.7 (Fujiidera) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9247 Lines: 294 - fix any error/warning - fix {request,freee}_irq interrupt control fix - add dump_stack - fix show_trace_task - fix typo -- Yoshinori Sato diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/Kconfig linux-2.6.5-h8300/arch/h8300/Kconfig --- linux-2.6.5/arch/h8300/Kconfig 2004-04-08 23:26:16.000000000 +0900 +++ linux-2.6.5-h8300/arch/h8300/Kconfig 2004-04-08 23:51:58.000000000 +0900 @@ -67,7 +67,7 @@ config H8300H_H8MAX bool "H8MAX" help - H8MAX Evaluation Board Suooprt + H8MAX Evaluation Board Support More Information. (Japanese Only) diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/kernel/ints.c linux-2.6.5-h8300/arch/h8300/kernel/ints.c --- linux-2.6.5/arch/h8300/kernel/ints.c 2004-04-06 17:11:10.000000000 +0900 +++ linux-2.6.5-h8300/arch/h8300/kernel/ints.c 2004-04-08 01:11:05.000000000 +0900 @@ -93,7 +93,7 @@ if (ramvec == NULL) panic("interrupt vector serup failed."); else - printk("virtual vector at 0x%08lx\n",(unsigned long)ramvec); + printk(KERN_INFO "virtual vector at 0x%08lx\n",(unsigned long)ramvec); /* create redirect table */ ramvec_p = ramvec; @@ -118,11 +118,11 @@ ramvec_p = ramvec; for (i = 0; i < NR_IRQS; i++) { if ((i % 8) == 0) - printk("\n%p: ",ramvec_p); - printk("%p ",*ramvec_p); + printk(KERN_DEBUG "\n%p: ",ramvec_p); + printk(KERN_DEBUG "%p ",*ramvec_p); ramvec_p++; } - printk("\n"); + printk(KERN_DEBUG "\n"); #endif #endif } @@ -133,9 +133,10 @@ { irq_handler_t *irq_handle; if (irq < 0 || irq >= NR_IRQS) { - printk("Incorrect IRQ %d from %s\n", irq, devname); + printk(KERN_ERR "Incorrect IRQ %d from %s\n", irq, devname); return -EINVAL; } + if (irq_list[irq] || (h8300_enable_irq_pin(irq) == -EBUSY)) return -EBUSY; @@ -156,6 +157,11 @@ irq_handle->dev_id = dev_id; irq_handle->devname = devname; irq_list[irq] = irq_handle; + + if (irq_handle->flags & SA_SAMPLE_RANDOM) + rand_initialize_irq(irq); + + enable_irq(irq); return 0; } @@ -163,12 +169,13 @@ void free_irq(unsigned int irq, void *dev_id) { - if (irq >= NR_IRQS) { + if (irq >= NR_IRQS) return; - } + if (!irq_list[irq] || irq_list[irq]->dev_id != dev_id) - printk("Removing probably wrong IRQ %d from %s\n", + printk(KERN_WARNING "Removing probably wrong IRQ %d from %s\n", irq, irq_list[irq]->devname); + disable_irq(irq); h8300_disable_irq_pin(irq); if (((unsigned long)irq_list[irq] & 0x80000000) == 0) { kfree(irq_list[irq]); diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/kernel/traps.c linux-2.6.5-h8300/arch/h8300/kernel/traps.c --- linux-2.6.5/arch/h8300/kernel/traps.c 2004-01-09 15:59:06.000000000 +0900 +++ linux-2.6.5-h8300/arch/h8300/kernel/traps.c 2004-04-08 01:11:05.000000000 +0900 @@ -16,9 +16,10 @@ #include #include -#include +#include #include #include +#include #include #include @@ -41,7 +42,7 @@ asmlinkage void set_esp0 (unsigned long ssp) { - current->thread.esp0 = ssp; + current->thread.esp0 = ssp; } /* @@ -55,14 +56,6 @@ int i; printk("\nCURRENT PROCESS:\n\n"); -#if 0 -{ - extern int swt_lastjiffies, swt_reference; - printk("WATCHDOG: jiffies=%d lastjiffies=%d [%d] reference=%d\n", - jiffies, swt_lastjiffies, (swt_lastjiffies - jiffies), - swt_reference); -} -#endif printk("COMM=%s PID=%d\n", current->comm, current->pid); if (current->mm) { printk("TEXT=%08x-%08x DATA=%08x-%08x BSS=%08x-%08x\n", @@ -76,13 +69,8 @@ (int) current->mm->start_stack, (int) PAGE_SIZE+(unsigned long)current); } - - printk("PC: %08lx\n", (long)fp->pc); - printk("CCR: %02x SP: %08lx\n", fp->ccr, (long) fp); - printk("ER0: %08lx ER1: %08lx ER2: %08lx ER3: %08lx\n", - fp->er0, fp->er1, fp->er2, fp->er3); - printk("ER4: %08lx ER5: %08lx ER6: %08lx\n", - fp->er4, fp->er5, fp->er6); + + show_regs(fp); printk("\nCODE:"); tp = ((unsigned char *) fp->pc) - 0x20; for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) { @@ -106,12 +94,6 @@ printk("\n\n"); } -void show_trace_task(struct task_struct *tsk) -{ - /* DAVIDM: we can do better, need a proper stack dump */ - printk("STACK ksp=0x%lx, usp=0x%lx\n", tsk->thread.ksp, tsk->thread.usp); -} - void die_if_kernel (char *str, struct pt_regs *fp, int nr) { extern int console_loglevel; @@ -174,3 +156,14 @@ printk("\n"); } +void show_trace_task(struct task_struct *tsk) +{ + show_stack(tsk,(unsigned long *)tsk->thread.esp0); +} + +void dump_stack(void) +{ + show_stack(NULL,NULL); +} + +EXPORT_SYMBOL(dump_stack); diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/platform/h8s/entry.S linux-2.6.5-h8300/arch/h8300/platform/h8s/entry.S --- linux-2.6.5/arch/h8300/platform/h8s/entry.S 2004-04-08 23:26:10.000000000 +0900 +++ linux-2.6.5-h8300/arch/h8300/platform/h8s/entry.S 2004-04-08 01:13:51.000000000 +0900 @@ -166,7 +166,7 @@ mov.l sp,er1 subs #4,er1 /* adjust ret_pc */ jsr @SYMBOL_NAME(process_int) - mov.l @SYMBOL_NAME(irq_stat)+CPU_SOFTIRQ_PENDING,er0 + mov.l @SYMBOL_NAME(irq_stat)+CPUSTAT_SOFTIRQ_PENDING,er0 beq 1f jsr @SYMBOL_NAME(do_softirq) 1: diff -ru -X .exclude-diff linux-2.6.5/arch/h8300/platform/h8s/ints_h8s.c linux-2.6.5-h8300/arch/h8300/platform/h8s/ints_h8s.c --- linux-2.6.5/arch/h8300/platform/h8s/ints_h8s.c 2004-04-08 23:26:16.000000000 +0900 +++ linux-2.6.5-h8300/arch/h8300/platform/h8s/ints_h8s.c 2004-04-08 01:13:51.000000000 +0900 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -80,12 +81,13 @@ if (irq >= EXT_IRQ0 && irq <= EXT_IRQ15) { unsigned short ptn = 1 << (irq - EXT_IRQ0); unsigned int port_no,bit_no; - IRQ_GPIO_MAP(ptn,irq,port_no,bit_no); + IRQ_GPIO_MAP(ptn, irq, port_no, bit_no); if (H8300_GPIO_RESERVE(port_no, bit_no) == 0) return -EBUSY; /* pin already use */ H8300_GPIO_DDR(port_no, bit_no, H8300_GPIO_INPUT); *(volatile unsigned short *)ISR &= ~ptn; /* ISR clear */ - } + } + return 0; } @@ -97,7 +99,7 @@ unsigned short port_no,bit_no; *(volatile unsigned short *)ISR &= ~ptn; *(volatile unsigned short *)IER &= ~ptn; - IRQ_GPIO_MAP(ptn,port_no,bit_no); + IRQ_GPIO_MAP(ptn, irq, port_no, bit_no); H8300_GPIO_FREE(port_no, bit_no); } } diff -ru -X .exclude-diff linux-2.6.5/include/asm-h8300/io.h linux-2.6.5-h8300/include/asm-h8300/io.h --- linux-2.6.5/include/asm-h8300/io.h 2004-04-06 17:10:58.000000000 +0900 +++ linux-2.6.5-h8300/include/asm-h8300/io.h 2004-04-08 01:09:30.000000000 +0900 @@ -9,7 +9,7 @@ #if defined(CONFIG_H83007) || defined(CONFIG_H83068) #include #elif defined(CONFIG_H8S2678) -#include +#include #else #error UNKNOWN CPU TYPE #endif @@ -73,7 +73,7 @@ static inline int h8300_buswidth(unsigned int addr) { - return (*(volatile unsigned char *)ABWCR & (1 << (addr >> 21) & 7)) == 0; + return (*(volatile unsigned char *)ABWCR & (1 << ((addr >> 21) & 7))) == 0; } static inline void io_outsb(unsigned int addr, void *buf, int len) @@ -145,10 +145,10 @@ #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) -#define inb(addr) ((h8300_buswidth(addr))?readb(addr ^ 1) & 0xff:readb(addr)) +#define inb(addr) ((h8300_buswidth(addr))?readb((addr) ^ 1) & 0xff:readb(addr)) #define inw(addr) _swapw(readw(addr)) #define inl(addr) _swapl(readl(addr)) -#define outb(x,addr) ((void)((h8300_buswidth(addr) && (addr & 1))?writew(x,addr):writeb(x,addr))) +#define outb(x,addr) ((void)((h8300_buswidth(addr) && ((addr) & 1))?writew(x,addr):writeb(x,addr))) #define outw(x,addr) ((void) writew(_swapw(x),addr)) #define outl(x,addr) ((void) writel(_swapl(x),addr)) diff -ru -X .exclude-diff linux-2.6.5/drivers/serial/sh-sci.c linux-2.6.5-h8300/drivers/serial/sh-sci.c --- linux-2.6.5/drivers/serial/sh-sci.c 2004-04-08 23:59:50.000000000 +0900 +++ linux-2.6.5-h8300/drivers/serial/sh-sci.c 2004-04-08 01:06:52.000000000 +0900 @@ -297,10 +297,10 @@ #if defined(__H8300S__) enum { sci_disable, sci_enable }; -static void h8300_sci_enable(struct sci_port* port, unsigned int ctrl) +static void h8300_sci_enable(struct uart_port* port, unsigned int ctrl) { volatile unsigned char *mstpcrl=(volatile unsigned char *)MSTPCRL; - int ch = (port->base - SMR0) >> 3; + int ch = (port->mapbase - SMR0) >> 3; unsigned char mask = 1 << (ch+1); if (ctrl == sci_disable) { @@ -1288,7 +1288,7 @@ .line = 1, }, .type = PORT_SCI, - .irqs = H8S_IRQS1, + .irqs = H8S_SCI_IRQS1, .init_pins = sci_init_pins_sci, }, { @@ -1302,7 +1302,7 @@ .line = 2, }, .type = PORT_SCI, - .irqs = H8S_IRQS2, + .irqs = H8S_SCI_IRQS2, .init_pins = sci_init_pins_sci, }, #else - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/