linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] H8/300 support update
Date: Fri, 09 Apr 2004 00:11:03 +0900	[thread overview]
Message-ID: <m2brm2tshk.wl%ysato@users.sourceforge.jp> (raw)

- fix any error/warning
- fix {request,freee}_irq interrupt control fix
- add dump_stack 
- fix show_trace_task
- fix typo

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

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)
 	  <http://strawberry-linux.com/h8/index.html>
 
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 <linux/types.h>
 #include <linux/sched.h>
-#include <linux/kernel_stat.h>
+#include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
+#include <linux/module.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
@@ -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 <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
+#include <linux/kernel.h>
 
 #include <asm/ptrace.h>
 #include <asm/traps.h>
@@ -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 <asm/regs306x.h>
 #elif defined(CONFIG_H8S2678)
-#include <asm/regs2678.h>
+#include <asm/regs267x.h>
 #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

             reply	other threads:[~2004-04-08 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-08 15:11 Yoshinori Sato [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-26 14:27 [PATCH] h8/300 support update Yoshinori Sato
2003-10-26 17:23 ` Sam Ravnborg
2003-10-19 15:53 [PATCH] H8/300 " Yoshinori Sato
2003-10-16 16:42 Yoshinori Sato

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=m2brm2tshk.wl%ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).