Commit 8d94c528 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] H8/300 support update

From: Yoshinori Sato <ysato@users.sourceforge.jp>

- fix any error/warning
- fix {request,freee}_irq interrupt control fix
- add dump_stack
- fix show_trace_task
- fix typo
parent 092ed951
......@@ -93,7 +93,7 @@ void __init init_IRQ(void)
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 @@ void __init init_IRQ(void)
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 @@ int request_irq(unsigned int irq,
{
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 @@ int request_irq(unsigned int irq,
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 @@ EXPORT_SYMBOL(request_irq);
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]);
......
......@@ -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>
......@@ -55,14 +56,6 @@ static void dump(struct pt_regs *fp)
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",
......@@ -77,12 +70,7 @@ static void dump(struct pt_regs *fp)
(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 @@ static void dump(struct pt_regs *fp)
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 @@ void show_stack(struct task_struct *task, unsigned long *esp)
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);
......@@ -166,7 +166,7 @@ SYMBOL_NAME_LABEL(interrupt_entry)
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:
......
......@@ -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 @@ int h8300_enable_irq_pin(unsigned int irq)
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 @@ void h8300_disable_irq_pin(unsigned int irq)
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);
}
}
......@@ -297,10 +297,10 @@ static void kgdb_break_interrupt(int irq, void *ptr, struct pt_regs *regs)
#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) {
......@@ -1276,7 +1276,7 @@ static struct sci_port sci_ports[SCI_NPORTS] = {
.line = 1,
},
.type = PORT_SCI,
.irqs = H8S_IRQS1,
.irqs = H8S_SCI_IRQS1,
.init_pins = sci_init_pins_sci,
},
{
......@@ -1290,7 +1290,7 @@ static struct sci_port sci_ports[SCI_NPORTS] = {
.line = 2,
},
.type = PORT_SCI,
.irqs = H8S_IRQS2,
.irqs = H8S_SCI_IRQS2,
.init_pins = sci_init_pins_sci,
},
#else
......
......@@ -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 unsigned int _swapl(volatile unsigned long v)
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 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
#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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment