Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: SH-4A UBC support
sh: interrupt exception handling rework
sh: Default enable R7780RP IRQs.
sh: Zero-out coherent buffer in consistent_alloc().
sh: Convert IPR-IRQ to IRQ chip.
sh: Convert INTC2 IRQ handler to irq_chip.
sh: Fix pr_debug statements for sh4
sh: Convert r7780rp IRQ handler to IRQ chip.
sh: Updates for IRQ handler changes.
sh: Kill off timer_ops get_frequency().
sh: First step at generic timeofday support.

+250 -1101
+4
arch/sh/Kconfig
··· 45 config GENERIC_IOMAP 46 bool 47 48 config ARCH_MAY_HAVE_PC_FDC 49 bool 50 ··· 360 endmenu 361 362 menu "Timer support" 363 364 config SH_TMU 365 bool "TMU timer support"
··· 45 config GENERIC_IOMAP 46 bool 47 48 + config GENERIC_TIME 49 + def_bool n 50 + 51 config ARCH_MAY_HAVE_PC_FDC 52 bool 53 ··· 357 endmenu 358 359 menu "Timer support" 360 + depends on !GENERIC_TIME 361 362 config SH_TMU 363 bool "TMU timer support"
+2 -2
arch/sh/boards/hp6xx/hp6xx_apm.c
··· 83 return p - buf; 84 } 85 86 - static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev, struct pt_regs *regs) 87 { 88 if (!apm_suspended) 89 apm_queue_event(APM_USER_SUSPEND); ··· 96 int ret; 97 98 ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt, 99 - SA_INTERRUPT, MODNAME, 0); 100 if (unlikely(ret < 0)) { 101 printk(KERN_ERR MODNAME ": IRQ %d request failed\n", 102 HP680_BTN_IRQ);
··· 83 return p - buf; 84 } 85 86 + static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev) 87 { 88 if (!apm_suspended) 89 apm_queue_event(APM_USER_SUSPEND); ··· 96 int ret; 97 98 ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt, 99 + IRQF_DISABLED, MODNAME, 0); 100 if (unlikely(ret < 0)) { 101 printk(KERN_ERR MODNAME ": IRQ %d request failed\n", 102 HP680_BTN_IRQ);
+1 -1
arch/sh/boards/landisk/landisk_pwb.c
··· 135 return count; 136 } 137 138 - static irqreturn_t sw_interrupt(int irq, void *dev_id, struct pt_regs *regs) 139 { 140 landisk_btn = (0x0ff & (~ctrl_inb(PA_STATUS))); 141 disable_irq(IRQ_BUTTON);
··· 135 return count; 136 } 137 138 + static irqreturn_t sw_interrupt(int irq, void *dev_id) 139 { 140 landisk_btn = (0x0ff & (~ctrl_inb(PA_STATUS))); 141 disable_irq(IRQ_BUTTON);
+2 -3
arch/sh/boards/mpc1211/setup.c
··· 69 70 static unsigned char m_irq_mask = 0xfb; 71 static unsigned char s_irq_mask = 0xff; 72 - volatile unsigned long irq_err_count; 73 74 static void disable_mpc1211_irq(unsigned int irq) 75 { ··· 117 if(irq < 8) { 118 if(m_irq_mask & (1<<irq)){ 119 if(!mpc1211_irq_real(irq)){ 120 - irq_err_count++; 121 printk("spurious 8259A interrupt: IRQ %x\n",irq); 122 } 123 } else { ··· 130 } else { 131 if(s_irq_mask & (1<<(irq - 8))){ 132 if(!mpc1211_irq_real(irq)){ 133 - irq_err_count++; 134 printk("spurious 8259A interrupt: IRQ %x\n",irq); 135 } 136 } else {
··· 69 70 static unsigned char m_irq_mask = 0xfb; 71 static unsigned char s_irq_mask = 0xff; 72 73 static void disable_mpc1211_irq(unsigned int irq) 74 { ··· 118 if(irq < 8) { 119 if(m_irq_mask & (1<<irq)){ 120 if(!mpc1211_irq_real(irq)){ 121 + atomic_inc(&irq_err_count) 122 printk("spurious 8259A interrupt: IRQ %x\n",irq); 123 } 124 } else { ··· 131 } else { 132 if(s_irq_mask & (1<<(irq - 8))){ 133 if(!mpc1211_irq_real(irq)){ 134 + atomic_inc(&irq_err_count); 135 printk("spurious 8259A interrupt: IRQ %x\n",irq); 136 } 137 } else {
+22 -83
arch/sh/boards/renesas/r7780rp/irq.c
··· 1 /* 2 - * linux/arch/sh/boards/renesas/r7780rp/irq.c 3 - * 4 - * Copyright (C) 2000 Kazumoto Kojima 5 - * 6 * Renesas Solutions Highlander R7780RP-1 Support. 7 * 8 - * Modified for R7780RP-1 by 9 - * Atom Create Engineering Co., Ltd. 2002. 10 */ 11 #include <linux/init.h> 12 #include <linux/irq.h> 13 #include <asm/io.h> 14 - #include <asm/irq.h> 15 - #include <asm/r7780rp/r7780rp.h> 16 17 #ifdef CONFIG_SH_R7780MP 18 static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; ··· 18 static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; 19 #endif 20 21 - static void enable_r7780rp_irq(unsigned int irq); 22 - static void disable_r7780rp_irq(unsigned int irq); 23 - 24 - /* shutdown is same as "disable" */ 25 - #define shutdown_r7780rp_irq disable_r7780rp_irq 26 - 27 - static void ack_r7780rp_irq(unsigned int irq); 28 - static void end_r7780rp_irq(unsigned int irq); 29 - 30 - static unsigned int startup_r7780rp_irq(unsigned int irq) 31 { 32 - enable_r7780rp_irq(irq); 33 - return 0; /* never anything pending */ 34 } 35 36 static void disable_r7780rp_irq(unsigned int irq) 37 { 38 - unsigned short val; 39 - unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]); 40 - 41 /* Set the priority in IPR to 0 */ 42 - val = ctrl_inw(IRLCNTR1); 43 - val &= mask; 44 - ctrl_outw(val, IRLCNTR1); 45 } 46 47 - static void enable_r7780rp_irq(unsigned int irq) 48 - { 49 - unsigned short val; 50 - unsigned short value = (0x0001 << mask_pos[irq]); 51 - 52 - /* Set priority in IPR back to original value */ 53 - val = ctrl_inw(IRLCNTR1); 54 - val |= value; 55 - ctrl_outw(val, IRLCNTR1); 56 - } 57 - 58 - static void ack_r7780rp_irq(unsigned int irq) 59 - { 60 - disable_r7780rp_irq(irq); 61 - } 62 - 63 - static void end_r7780rp_irq(unsigned int irq) 64 - { 65 - if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 66 - enable_r7780rp_irq(irq); 67 - } 68 - 69 - static struct hw_interrupt_type r7780rp_irq_type = { 70 - .typename = "R7780RP-IRQ", 71 - .startup = startup_r7780rp_irq, 72 - .shutdown = shutdown_r7780rp_irq, 73 - .enable = enable_r7780rp_irq, 74 - .disable = disable_r7780rp_irq, 75 - .ack = ack_r7780rp_irq, 76 - .end = end_r7780rp_irq, 77 }; 78 - 79 - static void make_r7780rp_irq(unsigned int irq) 80 - { 81 - disable_irq_nosync(irq); 82 - irq_desc[irq].chip = &r7780rp_irq_type; 83 - disable_r7780rp_irq(irq); 84 - } 85 86 /* 87 * Initialize IRQ setting ··· 45 { 46 int i; 47 48 - /* IRL0=PCI Slot #A 49 - * IRL1=PCI Slot #B 50 - * IRL2=PCI Slot #C 51 - * IRL3=PCI Slot #D 52 - * IRL4=CF Card 53 - * IRL5=CF Card Insert 54 - * IRL6=M66596 55 - * IRL7=SD Card 56 - * IRL8=Touch Panel 57 - * IRL9=SCI 58 - * IRL10=Serial 59 - * IRL11=Extention #A 60 - * IRL11=Extention #B 61 - * IRL12=Debug LAN 62 - * IRL13=Push Switch 63 - * IRL14=ZiggBee IO 64 - */ 65 - 66 - for (i=0; i<15; i++) 67 - make_r7780rp_irq(i); 68 }
··· 1 /* 2 * Renesas Solutions Highlander R7780RP-1 Support. 3 * 4 + * Copyright (C) 2002 Atom Create Engineering Co., Ltd. 5 + * Copyright (C) 2006 Paul Mundt 6 + * 7 + * This file is subject to the terms and conditions of the GNU General Public 8 + * License. See the file "COPYING" in the main directory of this archive 9 + * for more details. 10 */ 11 #include <linux/init.h> 12 #include <linux/irq.h> 13 #include <asm/io.h> 14 15 #ifdef CONFIG_SH_R7780MP 16 static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; ··· 20 static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; 21 #endif 22 23 + static void enable_r7780rp_irq(unsigned int irq) 24 { 25 + /* Set priority in IPR back to original value */ 26 + ctrl_outw(ctrl_inw(IRLCNTR1) | (1 << mask_pos[irq]), IRLCNTR1); 27 } 28 29 static void disable_r7780rp_irq(unsigned int irq) 30 { 31 /* Set the priority in IPR to 0 */ 32 + ctrl_outw(ctrl_inw(IRLCNTR1) & (0xffff ^ (1 << mask_pos[irq])), 33 + IRLCNTR1); 34 } 35 36 + static struct irq_chip r7780rp_irq_chip __read_mostly = { 37 + .name = "r7780rp", 38 + .mask = disable_r7780rp_irq, 39 + .unmask = enable_r7780rp_irq, 40 + .mask_ack = disable_r7780rp_irq, 41 }; 42 43 /* 44 * Initialize IRQ setting ··· 92 { 93 int i; 94 95 + for (i = 0; i < 15; i++) { 96 + disable_irq_nosync(i); 97 + set_irq_chip_and_handler(i, &r7780rp_irq_chip, 98 + handle_level_irq); 99 + enable_r7780rp_irq(i); 100 + } 101 }
+1 -1
arch/sh/boards/snapgear/setup.c
··· 33 * EraseConfig handling functions 34 */ 35 36 - static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id, struct pt_regs *regs) 37 { 38 volatile char dummy __attribute__((unused)) = * (volatile char *) 0xb8000000; 39
··· 33 * EraseConfig handling functions 34 */ 35 36 + static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) 37 { 38 volatile char dummy __attribute__((unused)) = * (volatile char *) 0xb8000000; 39
+1 -1
arch/sh/cchips/hd6446x/hd64461/setup.c
··· 71 .end = end_hd64461_irq, 72 }; 73 74 - static irqreturn_t hd64461_interrupt(int irq, void *dev_id, struct pt_regs *regs) 75 { 76 printk(KERN_INFO 77 "HD64461: spurious interrupt, nirr: 0x%x nimr: 0x%x\n",
··· 71 .end = end_hd64461_irq, 72 }; 73 74 + static irqreturn_t hd64461_interrupt(int irq, void *dev_id) 75 { 76 printk(KERN_INFO 77 "HD64461: spurious interrupt, nirr: 0x%x nimr: 0x%x\n",
+1 -1
arch/sh/cchips/hd6446x/hd64465/gpio.c
··· 85 void *dev; 86 } handlers[GPIO_NPORTS * 8]; 87 88 - static irqreturn_t hd64465_gpio_interrupt(int irq, void *dev, struct pt_regs *regs) 89 { 90 unsigned short port, pin, isr, mask, portpin; 91
··· 85 void *dev; 86 } handlers[GPIO_NPORTS * 8]; 87 88 + static irqreturn_t hd64465_gpio_interrupt(int irq, void *dev) 89 { 90 unsigned short port, pin, isr, mask, portpin; 91
+1 -1
arch/sh/cchips/hd6446x/hd64465/setup.c
··· 84 }; 85 86 87 - static irqreturn_t hd64465_interrupt(int irq, void *dev_id, struct pt_regs *regs) 88 { 89 printk(KERN_INFO 90 "HD64465: spurious interrupt, nirr: 0x%x nimr: 0x%x\n",
··· 84 }; 85 86 87 + static irqreturn_t hd64465_interrupt(int irq, void *dev_id) 88 { 89 printk(KERN_INFO 90 "HD64465: spurious interrupt, nirr: 0x%x nimr: 0x%x\n",
+1 -2
arch/sh/cchips/voyagergx/irq.c
··· 88 .end = end_voyagergx_irq, 89 }; 90 91 - static irqreturn_t voyagergx_interrupt(int irq, void *dev_id, 92 - struct pt_regs *regs) 93 { 94 printk(KERN_INFO 95 "VoyagerGX: spurious interrupt, status: 0x%x\n",
··· 88 .end = end_voyagergx_irq, 89 }; 90 91 + static irqreturn_t voyagergx_interrupt(int irq, void *dev_id) 92 { 93 printk(KERN_INFO 94 "VoyagerGX: spurious interrupt, status: 0x%x\n",
+1 -1
arch/sh/drivers/dma/dma-g2.c
··· 51 ((g2_dma->channel[i].size - \ 52 g2_dma->status[i].size) & 0x0fffffff) 53 54 - static irqreturn_t g2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 55 { 56 int i; 57
··· 51 ((g2_dma->channel[i].size - \ 52 g2_dma->status[i].size) & 0x0fffffff) 53 54 + static irqreturn_t g2_dma_interrupt(int irq, void *dev_id) 55 { 56 int i; 57
+1 -1
arch/sh/drivers/dma/dma-pvr2.c
··· 21 static unsigned int xfer_complete; 22 static int count; 23 24 - static irqreturn_t pvr2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 25 { 26 if (get_dma_residue(PVR2_CASCADE_CHAN)) { 27 printk(KERN_WARNING "DMA: SH DMAC did not complete transfer "
··· 21 static unsigned int xfer_complete; 22 static int count; 23 24 + static irqreturn_t pvr2_dma_interrupt(int irq, void *dev_id) 25 { 26 if (get_dma_residue(PVR2_CASCADE_CHAN)) { 27 printk(KERN_WARNING "DMA: SH DMAC did not complete transfer "
+3 -3
arch/sh/drivers/dma/dma-sh.c
··· 60 * Besides that it needs to waken any waiting process, which should handle 61 * setting up the next transfer. 62 */ 63 - static irqreturn_t dma_tei(int irq, void *dev_id, struct pt_regs *regs) 64 { 65 - struct dma_channel *chan = (struct dma_channel *)dev_id; 66 u32 chcr; 67 68 chcr = ctrl_inl(CHCR[chan->chan]); ··· 228 } 229 230 #if defined(CONFIG_CPU_SH4) 231 - static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs) 232 { 233 dmaor_reset(); 234 disable_irq(irq);
··· 60 * Besides that it needs to waken any waiting process, which should handle 61 * setting up the next transfer. 62 */ 63 + static irqreturn_t dma_tei(int irq, void *dev_id) 64 { 65 + struct dma_channel *chan = dev_id; 66 u32 chcr; 67 68 chcr = ctrl_inl(CHCR[chan->chan]); ··· 228 } 229 230 #if defined(CONFIG_CPU_SH4) 231 + static irqreturn_t dma_err(int irq, void *dummy) 232 { 233 dmaor_reset(); 234 disable_irq(irq);
+2 -2
arch/sh/drivers/pci/pci-sh7751.c
··· 155 */ 156 pr_debug("PCI: Mapping IO address 0x%x - 0x%x to base 0x%x\n", 157 PCIBIOS_MIN_IO, (64 << 10), 158 - SH4_PCI_IO_BASE + PCIBIOS_MIN_IO); 159 160 /* 161 * XXX: For now, leave this board-specific. In the event we have other ··· 163 */ 164 #ifdef CONFIG_SH_BIGSUR 165 bigsur_port_map(PCIBIOS_MIN_IO, (64 << 10), 166 - SH4_PCI_IO_BASE + PCIBIOS_MIN_IO, 0); 167 #endif 168 169 /* Make sure the MSB's of IO window are set to access PCI space
··· 155 */ 156 pr_debug("PCI: Mapping IO address 0x%x - 0x%x to base 0x%x\n", 157 PCIBIOS_MIN_IO, (64 << 10), 158 + SH7751_PCI_IO_BASE + PCIBIOS_MIN_IO); 159 160 /* 161 * XXX: For now, leave this board-specific. In the event we have other ··· 163 */ 164 #ifdef CONFIG_SH_BIGSUR 165 bigsur_port_map(PCIBIOS_MIN_IO, (64 << 10), 166 + SH7751_PCI_IO_BASE + PCIBIOS_MIN_IO, 0); 167 #endif 168 169 /* Make sure the MSB's of IO window are set to access PCI space
+1 -1
arch/sh/drivers/pci/pci-st40.c
··· 161 "Memory Write-and-Invalidate" 162 }; 163 164 - static irqreturn_t st40_pci_irq(int irq, void *dev_instance, struct pt_regs *regs) 165 { 166 unsigned pci_int, pci_air, pci_cir, pci_aint; 167 static int count=0;
··· 161 "Memory Write-and-Invalidate" 162 }; 163 164 + static irqreturn_t st40_pci_irq(int irq, void *dev_instance) 165 { 166 unsigned pci_int, pci_air, pci_cir, pci_aint; 167 static int count=0;
+24 -114
arch/sh/kernel/cpu/irq/intc2.c
··· 10 * These are the "new Hitachi style" interrupts, as present on the 11 * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780. 12 */ 13 - 14 #include <linux/kernel.h> 15 #include <linux/init.h> 16 #include <linux/irq.h> 17 #include <asm/system.h> 18 #include <asm/io.h> 19 - #include <asm/machvec.h> 20 - 21 - struct intc2_data { 22 - unsigned char msk_offset; 23 - unsigned char msk_shift; 24 - 25 - int (*clear_irq) (int); 26 - }; 27 - 28 - static struct intc2_data intc2_data[NR_INTC2_IRQS]; 29 - 30 - static void enable_intc2_irq(unsigned int irq); 31 - static void disable_intc2_irq(unsigned int irq); 32 - 33 - /* shutdown is same as "disable" */ 34 - #define shutdown_intc2_irq disable_intc2_irq 35 - 36 - static void mask_and_ack_intc2(unsigned int); 37 - static void end_intc2_irq(unsigned int irq); 38 - 39 - static unsigned int startup_intc2_irq(unsigned int irq) 40 - { 41 - enable_intc2_irq(irq); 42 - return 0; /* never anything pending */ 43 - } 44 - 45 - static struct hw_interrupt_type intc2_irq_type = { 46 - .typename = "INTC2-IRQ", 47 - .startup = startup_intc2_irq, 48 - .shutdown = shutdown_intc2_irq, 49 - .enable = enable_intc2_irq, 50 - .disable = disable_intc2_irq, 51 - .ack = mask_and_ack_intc2, 52 - .end = end_intc2_irq 53 - }; 54 55 static void disable_intc2_irq(unsigned int irq) 56 { 57 - int irq_offset = irq - INTC2_FIRST_IRQ; 58 - int msk_shift, msk_offset; 59 - 60 - /* Sanity check */ 61 - if (unlikely(irq_offset < 0 || irq_offset >= NR_INTC2_IRQS)) 62 - return; 63 - 64 - msk_shift = intc2_data[irq_offset].msk_shift; 65 - msk_offset = intc2_data[irq_offset].msk_offset; 66 - 67 - ctrl_outl(1 << msk_shift, 68 - INTC2_BASE + INTC2_INTMSK_OFFSET + msk_offset); 69 } 70 71 static void enable_intc2_irq(unsigned int irq) 72 { 73 - int irq_offset = irq - INTC2_FIRST_IRQ; 74 - int msk_shift, msk_offset; 75 - 76 - /* Sanity check */ 77 - if (unlikely(irq_offset < 0 || irq_offset >= NR_INTC2_IRQS)) 78 - return; 79 - 80 - msk_shift = intc2_data[irq_offset].msk_shift; 81 - msk_offset = intc2_data[irq_offset].msk_offset; 82 - 83 - ctrl_outl(1 << msk_shift, 84 - INTC2_BASE + INTC2_INTMSKCLR_OFFSET + msk_offset); 85 } 86 87 - static void mask_and_ack_intc2(unsigned int irq) 88 - { 89 - disable_intc2_irq(irq); 90 - } 91 - 92 - static void end_intc2_irq(unsigned int irq) 93 - { 94 - if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 95 - enable_intc2_irq(irq); 96 - 97 - if (unlikely(intc2_data[irq - INTC2_FIRST_IRQ].clear_irq)) 98 - intc2_data[irq - INTC2_FIRST_IRQ].clear_irq(irq); 99 - } 100 101 /* 102 * Setup an INTC2 style interrupt. ··· 47 * | | | | 48 * make_intc2_irq(84, 0, 16, 0, 13); 49 */ 50 - void make_intc2_irq(unsigned int irq, 51 - unsigned int ipr_offset, unsigned int ipr_shift, 52 - unsigned int msk_offset, unsigned int msk_shift, 53 - unsigned int priority) 54 { 55 - int irq_offset = irq - INTC2_FIRST_IRQ; 56 unsigned int flags; 57 unsigned long ipr; 58 59 - if (unlikely(irq_offset < 0 || irq_offset >= NR_INTC2_IRQS)) 60 - return; 61 - 62 - disable_irq_nosync(irq); 63 - 64 - /* Fill the data we need */ 65 - intc2_data[irq_offset].msk_offset = msk_offset; 66 - intc2_data[irq_offset].msk_shift = msk_shift; 67 - intc2_data[irq_offset].clear_irq = NULL; 68 69 /* Set the priority level */ 70 local_irq_save(flags); 71 72 - ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET + ipr_offset); 73 - ipr &= ~(0xf << ipr_shift); 74 - ipr |= priority << ipr_shift; 75 - ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET + ipr_offset); 76 77 local_irq_restore(flags); 78 79 - irq_desc[irq].chip = &intc2_irq_type; 80 81 - disable_intc2_irq(irq); 82 } 83 84 - static struct intc2_init { 85 - unsigned short irq; 86 - unsigned char ipr_offset, ipr_shift; 87 - unsigned char msk_offset, msk_shift; 88 - unsigned char priority; 89 - } intc2_init_data[] __initdata = { 90 #if defined(CONFIG_CPU_SUBTYPE_ST40) 91 {64, 0, 0, 0, 0, 13}, /* PCI serr */ 92 {65, 0, 4, 0, 1, 13}, /* PCI err */ ··· 189 { 190 int i; 191 192 - for (i = 0; i < ARRAY_SIZE(intc2_init_data); i++) { 193 - struct intc2_init *p = intc2_init_data + i; 194 - make_intc2_irq(p->irq, p->ipr_offset, p->ipr_shift, 195 - p-> msk_offset, p->msk_shift, p->priority); 196 - } 197 } 198 - 199 - /* Adds a termination callback to the interrupt */ 200 - void intc2_add_clear_irq(int irq, int (*fn)(int)) 201 - { 202 - if (unlikely(irq < INTC2_FIRST_IRQ)) 203 - return; 204 - 205 - intc2_data[irq - INTC2_FIRST_IRQ].clear_irq = fn; 206 - } 207 -
··· 10 * These are the "new Hitachi style" interrupts, as present on the 11 * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780. 12 */ 13 #include <linux/kernel.h> 14 #include <linux/init.h> 15 #include <linux/irq.h> 16 #include <asm/system.h> 17 #include <asm/io.h> 18 19 static void disable_intc2_irq(unsigned int irq) 20 { 21 + struct intc2_data *p = get_irq_chip_data(irq); 22 + ctrl_outl(1 << p->msk_shift, 23 + INTC2_BASE + INTC2_INTMSK_OFFSET + p->msk_offset); 24 } 25 26 static void enable_intc2_irq(unsigned int irq) 27 { 28 + struct intc2_data *p = get_irq_chip_data(irq); 29 + ctrl_outl(1 << p->msk_shift, 30 + INTC2_BASE + INTC2_INTMSKCLR_OFFSET + p->msk_offset); 31 } 32 33 + static struct irq_chip intc2_irq_chip = { 34 + .typename = "intc2", 35 + .mask = disable_intc2_irq, 36 + .unmask = enable_intc2_irq, 37 + .mask_ack = disable_intc2_irq, 38 + }; 39 40 /* 41 * Setup an INTC2 style interrupt. ··· 108 * | | | | 109 * make_intc2_irq(84, 0, 16, 0, 13); 110 */ 111 + void make_intc2_irq(struct intc2_data *p) 112 { 113 unsigned int flags; 114 unsigned long ipr; 115 116 + disable_irq_nosync(p->irq); 117 118 /* Set the priority level */ 119 local_irq_save(flags); 120 121 + ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset); 122 + ipr &= ~(0xf << p->ipr_shift); 123 + ipr |= p->priority << p->ipr_shift; 124 + ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset); 125 126 local_irq_restore(flags); 127 128 + set_irq_chip_and_handler(p->irq, &intc2_irq_chip, handle_level_irq); 129 + set_irq_chip_data(p->irq, p); 130 131 + enable_intc2_irq(p->irq); 132 } 133 134 + static struct intc2_data intc2_irq_table[] = { 135 #if defined(CONFIG_CPU_SUBTYPE_ST40) 136 {64, 0, 0, 0, 0, 13}, /* PCI serr */ 137 {65, 0, 4, 0, 1, 13}, /* PCI err */ ··· 266 { 267 int i; 268 269 + for (i = 0; i < ARRAY_SIZE(intc2_irq_table); i++) 270 + make_intc2_irq(intc2_irq_table + i); 271 }
+28 -76
arch/sh/kernel/cpu/irq/ipr.c
··· 1 /* 2 - * arch/sh/kernel/cpu/irq/ipr.c 3 * 4 * Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi 5 * Copyright (C) 2000 Kazumoto Kojima 6 - * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp> 7 - * 8 - * Interrupt handling for IPR-based IRQ. 9 * 10 * Supported system: 11 * On-chip supporting modules (TMU, RTC, etc.). ··· 12 * Hitachi SolutionEngine external I/O: 13 * MS7709SE01, MS7709ASE01, and MS7750SE01 14 * 15 */ 16 - 17 #include <linux/init.h> 18 #include <linux/irq.h> 19 #include <linux/module.h> 20 - 21 #include <asm/system.h> 22 #include <asm/io.h> 23 #include <asm/machvec.h> ··· 28 int shift; /* Shifts of the 16-bit data */ 29 int priority; /* The priority */ 30 }; 31 - static struct ipr_data ipr_data[NR_IRQS]; 32 - 33 - static void enable_ipr_irq(unsigned int irq); 34 - static void disable_ipr_irq(unsigned int irq); 35 - 36 - /* shutdown is same as "disable" */ 37 - #define shutdown_ipr_irq disable_ipr_irq 38 - 39 - static void mask_and_ack_ipr(unsigned int); 40 - static void end_ipr_irq(unsigned int irq); 41 - 42 - static unsigned int startup_ipr_irq(unsigned int irq) 43 - { 44 - enable_ipr_irq(irq); 45 - return 0; /* never anything pending */ 46 - } 47 - 48 - static struct hw_interrupt_type ipr_irq_type = { 49 - .typename = "IPR-IRQ", 50 - .startup = startup_ipr_irq, 51 - .shutdown = shutdown_ipr_irq, 52 - .enable = enable_ipr_irq, 53 - .disable = disable_ipr_irq, 54 - .ack = mask_and_ack_ipr, 55 - .end = end_ipr_irq 56 - }; 57 58 static void disable_ipr_irq(unsigned int irq) 59 { 60 - unsigned long val; 61 - unsigned int addr = ipr_data[irq].addr; 62 - unsigned short mask = 0xffff ^ (0x0f << ipr_data[irq].shift); 63 - 64 /* Set the priority in IPR to 0 */ 65 - val = ctrl_inw(addr); 66 - val &= mask; 67 - ctrl_outw(val, addr); 68 } 69 70 static void enable_ipr_irq(unsigned int irq) 71 { 72 - unsigned long val; 73 - unsigned int addr = ipr_data[irq].addr; 74 - int priority = ipr_data[irq].priority; 75 - unsigned short value = (priority << ipr_data[irq].shift); 76 - 77 /* Set priority in IPR back to original value */ 78 - val = ctrl_inw(addr); 79 - val |= value; 80 - ctrl_outw(val, addr); 81 } 82 83 - static void mask_and_ack_ipr(unsigned int irq) 84 - { 85 - disable_ipr_irq(irq); 86 - 87 - #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ 88 - defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 89 - defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) 90 - /* This is needed when we use edge triggered setting */ 91 - /* XXX: Is it really needed? */ 92 - if (IRQ0_IRQ <= irq && irq <= IRQ5_IRQ) { 93 - /* Clear external interrupt request */ 94 - int a = ctrl_inb(INTC_IRR0); 95 - a &= ~(1 << (irq - IRQ0_IRQ)); 96 - ctrl_outb(a, INTC_IRR0); 97 - } 98 - #endif 99 - } 100 - 101 - static void end_ipr_irq(unsigned int irq) 102 - { 103 - if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) 104 - enable_ipr_irq(irq); 105 - } 106 107 void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority) 108 { 109 - disable_irq_nosync(irq); 110 - ipr_data[irq].addr = addr; 111 - ipr_data[irq].shift = pos*4; /* POSition (0-3) x 4 means shift */ 112 - ipr_data[irq].priority = priority; 113 114 - irq_desc[irq].chip = &ipr_irq_type; 115 - disable_ipr_irq(irq); 116 } 117 118 void __init init_IRQ(void) 119 { 120 #ifndef CONFIG_CPU_SUBTYPE_SH7780
··· 1 /* 2 + * Interrupt handling for IPR-based IRQ. 3 * 4 * Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi 5 * Copyright (C) 2000 Kazumoto Kojima 6 + * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp> 7 + * Copyright (C) 2006 Paul Mundt 8 * 9 * Supported system: 10 * On-chip supporting modules (TMU, RTC, etc.). ··· 13 * Hitachi SolutionEngine external I/O: 14 * MS7709SE01, MS7709ASE01, and MS7750SE01 15 * 16 + * This file is subject to the terms and conditions of the GNU General Public 17 + * License. See the file "COPYING" in the main directory of this archive 18 + * for more details. 19 */ 20 #include <linux/init.h> 21 #include <linux/irq.h> 22 #include <linux/module.h> 23 #include <asm/system.h> 24 #include <asm/io.h> 25 #include <asm/machvec.h> ··· 28 int shift; /* Shifts of the 16-bit data */ 29 int priority; /* The priority */ 30 }; 31 32 static void disable_ipr_irq(unsigned int irq) 33 { 34 + struct ipr_data *p = get_irq_chip_data(irq); 35 /* Set the priority in IPR to 0 */ 36 + ctrl_outw(ctrl_inw(p->addr) & (0xffff ^ (0xf << p->shift)), p->addr); 37 } 38 39 static void enable_ipr_irq(unsigned int irq) 40 { 41 + struct ipr_data *p = get_irq_chip_data(irq); 42 /* Set priority in IPR back to original value */ 43 + ctrl_outw(ctrl_inw(p->addr) | (p->priority << p->shift), p->addr); 44 } 45 46 + static struct irq_chip ipr_irq_chip = { 47 + .name = "ipr", 48 + .mask = disable_ipr_irq, 49 + .unmask = enable_ipr_irq, 50 + .mask_ack = disable_ipr_irq, 51 + }; 52 53 void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority) 54 { 55 + struct ipr_data ipr_data; 56 57 + disable_irq_nosync(irq); 58 + 59 + ipr_data.addr = addr; 60 + ipr_data.shift = pos*4; /* POSition (0-3) x 4 means shift */ 61 + ipr_data.priority = priority; 62 + 63 + set_irq_chip_and_handler(irq, &ipr_irq_chip, handle_level_irq); 64 + set_irq_chip_data(irq, &ipr_data); 65 + 66 + enable_ipr_irq(irq); 67 } 68 69 + /* XXX: This needs to die a horrible death.. */ 70 void __init init_IRQ(void) 71 { 72 #ifndef CONFIG_CPU_SUBTYPE_SH7780
-195
arch/sh/kernel/cpu/sh3/ex.S
··· 49 #endif 50 ENTRY(user_break_point_trap) 51 .long break_point_trap /* 1E0 */ 52 - ENTRY(interrupt_table) 53 - ! external hardware 54 - .long do_IRQ ! 0000 /* 200 */ 55 - .long do_IRQ ! 0001 56 - .long do_IRQ ! 0010 57 - .long do_IRQ ! 0011 58 - .long do_IRQ ! 0100 59 - .long do_IRQ ! 0101 60 - .long do_IRQ ! 0110 61 - .long do_IRQ ! 0111 62 - .long do_IRQ ! 1000 /* 300 */ 63 - .long do_IRQ ! 1001 64 - .long do_IRQ ! 1010 65 - .long do_IRQ ! 1011 66 - .long do_IRQ ! 1100 67 - .long do_IRQ ! 1101 68 - .long do_IRQ ! 1110 69 - .long exception_error 70 - ! Internal hardware 71 - .long do_IRQ ! TMU0 tuni0 /* 400 */ 72 - .long do_IRQ ! TMU1 tuni1 73 - .long do_IRQ ! TMU2 tuni2 74 - .long do_IRQ ! ticpi2 75 - .long do_IRQ ! RTC ati 76 - .long do_IRQ ! pri 77 - .long do_IRQ ! cui 78 - .long do_IRQ ! SCI eri 79 - .long do_IRQ ! rxi /* 500 */ 80 - .long do_IRQ ! txi 81 - .long do_IRQ ! tei 82 - .long do_IRQ ! WDT iti /* 560 */ 83 - .long do_IRQ ! REF rcmi 84 - .long do_IRQ ! rovi 85 - .long do_IRQ 86 - .long do_IRQ /* 5E0 */ 87 - #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 88 - defined(CONFIG_CPU_SUBTYPE_SH7709) || \ 89 - defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 90 - defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 91 - defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 92 - defined(CONFIG_CPU_SUBTYPE_SH7710) 93 - .long do_IRQ ! 32 IRQ irq0 /* 600 */ 94 - .long do_IRQ ! 33 irq1 95 - .long do_IRQ ! 34 irq2 96 - .long do_IRQ ! 35 irq3 97 - .long do_IRQ ! 36 irq4 98 - .long do_IRQ ! 37 irq5 99 - .long do_IRQ ! 38 100 - .long do_IRQ ! 39 101 - .long do_IRQ ! 40 PINT pint0-7 /* 700 */ 102 - .long do_IRQ ! 41 pint8-15 103 - .long do_IRQ ! 42 104 - .long do_IRQ ! 43 105 - .long do_IRQ ! 44 106 - .long do_IRQ ! 45 107 - .long do_IRQ ! 46 108 - .long do_IRQ ! 47 109 - .long do_IRQ ! 48 DMAC dei0 /* 800 */ 110 - .long do_IRQ ! 49 dei1 111 - .long do_IRQ ! 50 dei2 112 - .long do_IRQ ! 51 dei3 113 - .long do_IRQ ! 52 IrDA eri1 114 - .long do_IRQ ! 53 rxi1 115 - .long do_IRQ ! 54 bri1 116 - .long do_IRQ ! 55 txi1 117 - .long do_IRQ ! 56 SCIF eri2 118 - .long do_IRQ ! 57 rxi2 119 - .long do_IRQ ! 58 bri2 120 - .long do_IRQ ! 59 txi2 121 - .long do_IRQ ! 60 ADC adi /* 980 */ 122 - #if defined(CONFIG_CPU_SUBTYPE_SH7705) 123 - .long exception_none ! 61 /* 9A0 */ 124 - .long exception_none ! 62 125 - .long exception_none ! 63 126 - .long exception_none ! 64 /* A00 */ 127 - .long do_IRQ ! 65 USB usi0 128 - .long do_IRQ ! 66 usi1 129 - .long exception_none ! 67 130 - .long exception_none ! 68 131 - .long exception_none ! 69 132 - .long exception_none ! 70 133 - .long exception_none ! 71 134 - .long exception_none ! 72 /* B00 */ 135 - .long exception_none ! 73 136 - .long exception_none ! 74 137 - .long exception_none ! 75 138 - .long exception_none ! 76 139 - .long exception_none ! 77 140 - .long exception_none ! 78 141 - .long exception_none ! 79 142 - .long do_IRQ ! 80 TPU0 tpi0 /* C00 */ 143 - .long do_IRQ ! 81 TPU1 tpi1 144 - .long exception_none ! 82 145 - .long exception_none ! 83 146 - .long do_IRQ ! 84 TPU2 tpi2 147 - .long do_IRQ ! 85 TPU3 tpi3 /* CA0 */ 148 - #endif 149 - #if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7300) 150 - .long do_IRQ ! 61 LCDC lcdi /* 9A0 */ 151 - .long do_IRQ ! 62 PCC pcc0i 152 - .long do_IRQ ! 63 pcc1i /* 9E0 */ 153 - #endif 154 - #if defined(CONFIG_CPU_SUBTYPE_SH7710) 155 - .long exception_none ! 61 /* 9A0 */ 156 - .long exception_none ! 62 157 - .long exception_none ! 63 158 - .long exception_none ! 64 /* A00 */ 159 - .long exception_none ! 65 160 - .long exception_none ! 66 161 - .long exception_none ! 67 162 - .long exception_none ! 68 163 - .long exception_none ! 69 164 - .long exception_none ! 70 165 - .long exception_none ! 71 166 - .long exception_none ! 72 /* B00 */ 167 - .long exception_none ! 73 168 - .long exception_none ! 74 169 - .long exception_none ! 75 170 - .long do_IRQ ! 76 DMAC2 dei4 /* B80 */ 171 - .long do_IRQ ! 77 DMAC2 dei5 172 - .long exception_none ! 78 173 - .long do_IRQ ! 79 IPSEC ipseci /* BE0 */ 174 - .long do_IRQ ! 80 EDMAC eint0 /* C00 */ 175 - .long do_IRQ ! 81 EDMAC eint1 176 - .long do_IRQ ! 82 EDMAC eint2 177 - .long exception_none ! 83 /* C60 */ 178 - .long exception_none ! 84 179 - .long exception_none ! 85 180 - .long exception_none ! 86 181 - .long exception_none ! 87 182 - .long exception_none ! 88 /* D00 */ 183 - .long exception_none ! 89 184 - .long exception_none ! 90 185 - .long exception_none ! 91 186 - .long exception_none ! 92 187 - .long exception_none ! 93 188 - .long exception_none ! 94 189 - .long exception_none ! 95 190 - .long do_IRQ ! 96 SIOF eri0 /* E00 */ 191 - .long do_IRQ ! 97 txi0 192 - .long do_IRQ ! 98 rxi0 193 - .long do_IRQ ! 99 cci0 194 - .long do_IRQ ! 100 eri1 /* E80 */ 195 - .long do_IRQ ! 101 txi1 196 - .long do_IRQ ! 102 rxi2 197 - .long do_IRQ ! 103 cci3 198 - #endif 199 - #if defined(CONFIG_CPU_SUBTYPE_SH7300) 200 - .long do_IRQ ! 64 201 - .long do_IRQ ! 65 202 - .long do_IRQ ! 66 203 - .long do_IRQ ! 67 204 - .long do_IRQ ! 68 205 - .long do_IRQ ! 69 206 - .long do_IRQ ! 70 207 - .long do_IRQ ! 71 208 - .long do_IRQ ! 72 209 - .long do_IRQ ! 73 210 - .long do_IRQ ! 74 211 - .long do_IRQ ! 75 212 - .long do_IRQ ! 76 213 - .long do_IRQ ! 77 214 - .long do_IRQ ! 78 215 - .long do_IRQ ! 79 216 - .long do_IRQ ! 80 SCIF0(SH7300) 217 - .long do_IRQ ! 81 218 - .long do_IRQ ! 82 219 - .long do_IRQ ! 83 220 - .long do_IRQ ! 84 221 - .long do_IRQ ! 85 222 - .long do_IRQ ! 86 223 - .long do_IRQ ! 87 224 - .long do_IRQ ! 88 225 - .long do_IRQ ! 89 226 - .long do_IRQ ! 90 227 - .long do_IRQ ! 91 228 - .long do_IRQ ! 92 229 - .long do_IRQ ! 93 230 - .long do_IRQ ! 94 231 - .long do_IRQ ! 95 232 - .long do_IRQ ! 96 233 - .long do_IRQ ! 97 234 - .long do_IRQ ! 98 235 - .long do_IRQ ! 99 236 - .long do_IRQ ! 100 237 - .long do_IRQ ! 101 238 - .long do_IRQ ! 102 239 - .long do_IRQ ! 103 240 - .long do_IRQ ! 104 241 - .long do_IRQ ! 105 242 - .long do_IRQ ! 106 243 - .long do_IRQ ! 107 244 - .long do_IRQ ! 108 245 - #endif 246 - #endif
··· 49 #endif 50 ENTRY(user_break_point_trap) 51 .long break_point_trap /* 1E0 */
-500
arch/sh/kernel/cpu/sh4/ex.S
··· 53 #endif 54 ENTRY(user_break_point_trap) 55 .long break_point_trap /* 1E0 */ 56 - ENTRY(interrupt_table) 57 - ! external hardware 58 - .long do_IRQ ! 0000 /* 200 */ 59 - .long do_IRQ ! 0001 60 - .long do_IRQ ! 0010 61 - .long do_IRQ ! 0011 62 - .long do_IRQ ! 0100 63 - .long do_IRQ ! 0101 64 - .long do_IRQ ! 0110 65 - .long do_IRQ ! 0111 66 - .long do_IRQ ! 1000 /* 300 */ 67 - .long do_IRQ ! 1001 68 - .long do_IRQ ! 1010 69 - .long do_IRQ ! 1011 70 - .long do_IRQ ! 1100 71 - .long do_IRQ ! 1101 72 - .long do_IRQ ! 1110 73 - .long exception_error 74 - ! Internal hardware 75 - #ifndef CONFIG_CPU_SUBTYPE_SH7780 76 - .long do_IRQ ! TMU0 tuni0 /* 400 */ 77 - .long do_IRQ ! TMU1 tuni1 78 - .long do_IRQ ! TMU2 tuni2 79 - .long do_IRQ ! ticpi2 80 - #if defined(CONFIG_CPU_SUBTYPE_SH7760) 81 - .long exception_error 82 - .long exception_error 83 - .long exception_error 84 - .long exception_error 85 - .long exception_error /* 500 */ 86 - .long exception_error 87 - .long exception_error 88 - #else 89 - .long do_IRQ ! RTC ati 90 - .long do_IRQ ! pri 91 - .long do_IRQ ! cui 92 - .long do_IRQ ! SCI eri 93 - .long do_IRQ ! rxi /* 500 */ 94 - .long do_IRQ ! txi 95 - .long do_IRQ ! tei 96 - #endif 97 - .long do_IRQ ! WDT iti /* 560 */ 98 - .long do_IRQ ! REF rcmi 99 - .long do_IRQ ! rovi 100 - .long do_IRQ 101 - .long do_IRQ /* 5E0 */ 102 - .long do_IRQ ! 32 Hitachi UDI /* 600 */ 103 - .long do_IRQ ! 33 GPIO 104 - .long do_IRQ ! 34 DMAC dmte0 105 - .long do_IRQ ! 35 dmte1 106 - .long do_IRQ ! 36 dmte2 107 - .long do_IRQ ! 37 dmte3 108 - .long do_IRQ ! 38 dmae 109 - .long exception_error ! 39 /* 6E0 */ 110 - #if defined(CONFIG_CPU_SUBTYPE_SH7760) 111 - .long exception_error /* 700 */ 112 - .long exception_error 113 - .long exception_error 114 - .long exception_error /* 760 */ 115 - #else 116 - .long do_IRQ ! 40 SCIF eri /* 700 */ 117 - .long do_IRQ ! 41 rxi 118 - .long do_IRQ ! 42 bri 119 - .long do_IRQ ! 43 txi 120 - #endif 121 - #if CONFIG_NR_ONCHIP_DMA_CHANNELS == 8 122 - .long do_IRQ ! 44 DMAC dmte4 /* 780 */ 123 - .long do_IRQ ! 45 dmte5 124 - .long do_IRQ ! 46 dmte6 125 - .long do_IRQ ! 47 dmte7 /* 7E0 */ 126 - #elif defined(CONFIG_CPU_SUBTYPE_SH7343) 127 - .long do_IRQ ! 44 IIC1 ali /* 780 */ 128 - .long do_IRQ ! 45 tacki 129 - .long do_IRQ ! 46 waiti 130 - .long do_IRQ ! 47 dtei /* 7E0 */ 131 - .long do_IRQ ! 48 DMAC dei0 /* 800 */ 132 - .long do_IRQ ! 49 dei1 /* 820 */ 133 - #else 134 - .long exception_error ! 44 /* 780 */ 135 - .long exception_error ! 45 136 - .long exception_error ! 46 137 - .long exception_error ! 47 138 - #endif 139 - #if defined(CONFIG_SH_FPU) 140 - .long do_fpu_state_restore ! 48 /* 800 */ 141 - .long do_fpu_state_restore ! 49 /* 820 */ 142 - #elif !defined(CONFIG_CPU_SUBTYPE_SH7343) && \ 143 - !defined(CONFIG_CPU_SUBTYPE_SH73180) 144 - .long exception_error 145 - .long exception_error 146 - #endif 147 - #if defined(CONFIG_CPU_SUBTYPE_SH7751) 148 - .long exception_error /* 840 */ 149 - .long exception_error 150 - .long exception_error 151 - .long exception_error 152 - .long exception_error 153 - .long exception_error 154 - .long exception_error /* 900 */ 155 - .long exception_error 156 - .long exception_error 157 - .long exception_error 158 - .long exception_error 159 - .long exception_error 160 - .long exception_error 161 - .long exception_error 162 - .long do_IRQ ! PCI serr /* A00 */ 163 - .long do_IRQ ! dma3 164 - .long do_IRQ ! dma2 165 - .long do_IRQ ! dma1 166 - .long do_IRQ ! dma0 167 - .long do_IRQ ! pwon 168 - .long do_IRQ ! pwdwn 169 - .long do_IRQ ! err 170 - .long do_IRQ ! TMU3 tuni3 /* B00 */ 171 - .long exception_error 172 - .long exception_error 173 - .long exception_error 174 - .long do_IRQ ! TMU4 tuni4 /* B80 */ 175 - #elif defined(CONFIG_CPU_SUBTYPE_SH7760) 176 - .long do_IRQ ! IRQ irq6 /* 840 */ 177 - .long do_IRQ ! irq7 178 - .long do_IRQ ! SCIF eri0 179 - .long do_IRQ ! rxi0 180 - .long do_IRQ ! bri0 181 - .long do_IRQ ! txi0 182 - .long do_IRQ ! HCAN2 cani0 /* 900 */ 183 - .long do_IRQ ! cani1 184 - .long do_IRQ ! SSI ssii0 185 - .long do_IRQ ! ssii1 186 - .long do_IRQ ! HAC haci0 187 - .long do_IRQ ! haci1 188 - .long do_IRQ ! IIC iici0 189 - .long do_IRQ ! iici1 190 - .long do_IRQ ! USB usbi /* A00 */ 191 - .long do_IRQ ! LCDC vint 192 - .long exception_error 193 - .long exception_error 194 - .long do_IRQ ! DMABRG dmabrgi0 195 - .long do_IRQ ! dmabrgi1 196 - .long do_IRQ ! dmabrgi2 197 - .long exception_error 198 - .long do_IRQ ! SCIF eri1 /* B00 */ 199 - .long do_IRQ ! rxi1 200 - .long do_IRQ ! bri1 201 - .long do_IRQ ! txi1 202 - .long do_IRQ ! eri2 203 - .long do_IRQ ! rxi2 204 - .long do_IRQ ! bri2 205 - .long do_IRQ ! txi2 206 - .long do_IRQ ! SIM simeri /* C00 */ 207 - .long do_IRQ ! simrxi 208 - .long do_IRQ ! simtxi 209 - .long do_IRQ ! simtei 210 - .long do_IRQ ! HSPI spii 211 - .long exception_error 212 - .long exception_error 213 - .long exception_error 214 - .long do_IRQ ! MMCIF mmci0 /* D00 */ 215 - .long do_IRQ ! mmci1 216 - .long do_IRQ ! mmci2 217 - .long do_IRQ ! mmci3 218 - .long exception_error 219 - .long exception_error 220 - .long exception_error 221 - .long exception_error 222 - .long exception_error /* E00 */ 223 - .long exception_error 224 - .long exception_error 225 - .long exception_error 226 - .long do_IRQ ! MFI mfii 227 - .long exception_error 228 - .long exception_error 229 - .long exception_error 230 - .long exception_error /* F00 */ 231 - .long exception_error 232 - .long exception_error 233 - .long exception_error 234 - .long do_IRQ ! ADC adi 235 - .long do_IRQ ! CMT cmti /* FA0 */ 236 - #elif defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7343) 237 - .long do_IRQ ! 50 0x840 238 - .long do_IRQ ! 51 0x860 239 - .long do_IRQ ! 52 0x880 240 - .long do_IRQ ! 53 0x8a0 241 - .long do_IRQ ! 54 0x8c0 242 - .long do_IRQ ! 55 0x8e0 243 - .long do_IRQ ! 56 0x900 244 - .long do_IRQ ! 57 0x920 245 - .long do_IRQ ! 58 0x940 246 - .long do_IRQ ! 59 0x960 247 - .long do_IRQ ! 60 0x980 248 - .long do_IRQ ! 61 0x9a0 249 - .long do_IRQ ! 62 0x9c0 250 - .long do_IRQ ! 63 0x9e0 251 - .long do_IRQ ! 64 0xa00 252 - .long do_IRQ ! 65 0xa20 253 - .long do_IRQ ! 66 0xa40 254 - .long do_IRQ ! 67 0xa60 255 - .long do_IRQ ! 68 0xa80 256 - .long do_IRQ ! 69 0xaa0 257 - .long do_IRQ ! 70 0xac0 258 - .long do_IRQ ! 71 0xae0 259 - .long do_IRQ ! 72 0xb00 260 - .long do_IRQ ! 73 0xb20 261 - .long do_IRQ ! 74 0xb40 262 - .long do_IRQ ! 75 0xb60 263 - .long do_IRQ ! 76 0xb80 264 - .long do_IRQ ! 77 0xba0 265 - .long do_IRQ ! 78 0xbc0 266 - .long do_IRQ ! 79 0xbe0 267 - .long do_IRQ ! 80 0xc00 268 - .long do_IRQ ! 81 0xc20 269 - .long do_IRQ ! 82 0xc40 270 - .long do_IRQ ! 83 0xc60 271 - .long do_IRQ ! 84 0xc80 272 - .long do_IRQ ! 85 0xca0 273 - .long do_IRQ ! 86 0xcc0 274 - .long do_IRQ ! 87 0xce0 275 - .long do_IRQ ! 88 0xd00 276 - .long do_IRQ ! 89 0xd20 277 - .long do_IRQ ! 90 0xd40 278 - .long do_IRQ ! 91 0xd60 279 - .long do_IRQ ! 92 0xd80 280 - .long do_IRQ ! 93 0xda0 281 - .long do_IRQ ! 94 0xdc0 282 - .long do_IRQ ! 95 0xde0 283 - .long do_IRQ ! 96 0xe00 284 - .long do_IRQ ! 97 0xe20 285 - .long do_IRQ ! 98 0xe40 286 - .long do_IRQ ! 99 0xe60 287 - .long do_IRQ ! 100 0xe80 288 - .long do_IRQ ! 101 0xea0 289 - .long do_IRQ ! 102 0xec0 290 - .long do_IRQ ! 103 0xee0 291 - .long do_IRQ ! 104 0xf00 292 - .long do_IRQ ! 105 0xf20 293 - .long do_IRQ ! 106 0xf40 294 - .long do_IRQ ! 107 0xf60 295 - .long do_IRQ ! 108 0xf80 296 - #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) 297 - .long exception_error ! 50 0x840 298 - .long exception_error ! 51 0x860 299 - .long exception_error ! 52 0x880 300 - .long exception_error ! 53 0x8a0 301 - .long exception_error ! 54 0x8c0 302 - .long exception_error ! 55 0x8e0 303 - .long exception_error ! 56 0x900 304 - .long exception_error ! 57 0x920 305 - .long exception_error ! 58 0x940 306 - .long exception_error ! 59 0x960 307 - .long exception_error ! 60 0x980 308 - .long exception_error ! 61 0x9a0 309 - .long exception_error ! 62 0x9c0 310 - .long exception_error ! 63 0x9e0 311 - .long do_IRQ ! 64 0xa00 PCI serr 312 - .long do_IRQ ! 65 0xa20 err 313 - .long do_IRQ ! 66 0xa40 ad 314 - .long do_IRQ ! 67 0xa60 pwr_dwn 315 - .long exception_error ! 68 0xa80 316 - .long exception_error ! 69 0xaa0 317 - .long exception_error ! 70 0xac0 318 - .long exception_error ! 71 0xae0 319 - .long do_IRQ ! 72 0xb00 DMA INT0 320 - .long do_IRQ ! 73 0xb20 INT1 321 - .long do_IRQ ! 74 0xb40 INT2 322 - .long do_IRQ ! 75 0xb60 INT3 323 - .long do_IRQ ! 76 0xb80 INT4 324 - .long exception_error ! 77 0xba0 325 - .long do_IRQ ! 78 0xbc0 DMA ERR 326 - .long exception_error ! 79 0xbe0 327 - .long do_IRQ ! 80 0xc00 PIO0 328 - .long do_IRQ ! 81 0xc20 PIO1 329 - .long do_IRQ ! 82 0xc40 PIO2 330 - .long exception_error ! 83 0xc60 331 - .long exception_error ! 84 0xc80 332 - .long exception_error ! 85 0xca0 333 - .long exception_error ! 86 0xcc0 334 - .long exception_error ! 87 0xce0 335 - .long exception_error ! 88 0xd00 336 - .long exception_error ! 89 0xd20 337 - .long exception_error ! 90 0xd40 338 - .long exception_error ! 91 0xd60 339 - .long exception_error ! 92 0xd80 340 - .long exception_error ! 93 0xda0 341 - .long exception_error ! 94 0xdc0 342 - .long exception_error ! 95 0xde0 343 - .long exception_error ! 96 0xe00 344 - .long exception_error ! 97 0xe20 345 - .long exception_error ! 98 0xe40 346 - .long exception_error ! 99 0xe60 347 - .long exception_error ! 100 0xe80 348 - .long exception_error ! 101 0xea0 349 - .long exception_error ! 102 0xec0 350 - .long exception_error ! 103 0xee0 351 - .long exception_error ! 104 0xf00 352 - .long exception_error ! 105 0xf20 353 - .long exception_error ! 106 0xf40 354 - .long exception_error ! 107 0xf60 355 - .long exception_error ! 108 0xf80 356 - .long exception_error ! 109 0xfa0 357 - .long exception_error ! 110 0xfc0 358 - .long exception_error ! 111 0xfe0 359 - .long do_IRQ ! 112 0x1000 Mailbox 360 - .long exception_error ! 113 0x1020 361 - .long exception_error ! 114 0x1040 362 - .long exception_error ! 115 0x1060 363 - .long exception_error ! 116 0x1080 364 - .long exception_error ! 117 0x10a0 365 - .long exception_error ! 118 0x10c0 366 - .long exception_error ! 119 0x10e0 367 - .long exception_error ! 120 0x1100 368 - .long exception_error ! 121 0x1120 369 - .long exception_error ! 122 0x1140 370 - .long exception_error ! 123 0x1160 371 - .long exception_error ! 124 0x1180 372 - .long exception_error ! 125 0x11a0 373 - .long exception_error ! 126 0x11c0 374 - .long exception_error ! 127 0x11e0 375 - .long exception_error ! 128 0x1200 376 - .long exception_error ! 129 0x1220 377 - .long exception_error ! 130 0x1240 378 - .long exception_error ! 131 0x1260 379 - .long exception_error ! 132 0x1280 380 - .long exception_error ! 133 0x12a0 381 - .long exception_error ! 134 0x12c0 382 - .long exception_error ! 135 0x12e0 383 - .long exception_error ! 136 0x1300 384 - .long exception_error ! 137 0x1320 385 - .long exception_error ! 138 0x1340 386 - .long exception_error ! 139 0x1360 387 - .long do_IRQ ! 140 0x1380 EMPI INV_ADDR 388 - .long exception_error ! 141 0x13a0 389 - .long exception_error ! 142 0x13c0 390 - .long exception_error ! 143 0x13e0 391 - #elif defined(CONFIG_CPU_SUBTYPE_SH7770) 392 - .long do_IRQ ! 50 0x840 393 - .long do_IRQ ! 51 0x860 394 - .long do_IRQ ! 52 0x880 395 - .long do_IRQ ! 53 0x8a0 396 - .long do_IRQ ! 54 0x8c0 397 - .long do_IRQ ! 55 0x8e0 398 - .long do_IRQ ! 56 0x900 399 - .long do_IRQ ! 57 0x920 400 - .long do_IRQ ! 58 0x940 401 - .long do_IRQ ! 59 0x960 402 - .long do_IRQ ! 60 0x980 403 - .long do_IRQ ! 61 0x9a0 404 - .long do_IRQ ! 62 0x9c0 405 - .long do_IRQ ! 63 0x9e0 406 - .long do_IRQ ! 64 0xa00 407 - .long do_IRQ ! 65 0xa20 408 - .long do_IRQ ! 66 0xa4d 409 - .long do_IRQ ! 67 0xa60 410 - .long do_IRQ ! 68 0xa80 411 - .long do_IRQ ! 69 0xaa0 412 - .long do_IRQ ! 70 0xac0 413 - .long do_IRQ ! 71 0xae0 414 - .long do_IRQ ! 72 0xb00 415 - .long do_IRQ ! 73 0xb20 416 - .long do_IRQ ! 74 0xb40 417 - .long do_IRQ ! 75 0xb60 418 - .long do_IRQ ! 76 0xb80 419 - .long do_IRQ ! 77 0xba0 420 - .long do_IRQ ! 78 0xbc0 421 - .long do_IRQ ! 79 0xbe0 422 - .long do_IRQ ! 80 0xc00 423 - .long do_IRQ ! 81 0xc20 424 - .long do_IRQ ! 82 0xc40 425 - .long do_IRQ ! 83 0xc60 426 - .long do_IRQ ! 84 0xc80 427 - .long do_IRQ ! 85 0xca0 428 - .long do_IRQ ! 86 0xcc0 429 - .long do_IRQ ! 87 0xce0 430 - .long do_IRQ ! 88 0xd00 431 - .long do_IRQ ! 89 0xd20 432 - .long do_IRQ ! 90 0xd40 433 - .long do_IRQ ! 91 0xd60 434 - .long do_IRQ ! 92 0xd80 435 - .long do_IRQ ! 93 0xda0 436 - .long do_IRQ ! 94 0xdc0 437 - .long do_IRQ ! 95 0xde0 438 - .long do_IRQ ! 96 0xe00 439 - .long do_IRQ ! 97 0xe20 440 - .long do_IRQ ! 98 0xe40 441 - .long do_IRQ ! 99 0xe60 442 - .long do_IRQ ! 100 0xe80 443 - .long do_IRQ ! 101 0xea0 444 - .long do_IRQ ! 102 0xec0 445 - .long do_IRQ ! 103 0xee0 446 - .long do_IRQ ! 104 0xf00 447 - .long do_IRQ ! 105 0xf20 448 - .long do_IRQ ! 106 0xf40 449 - .long do_IRQ ! 107 0xf60 450 - .long do_IRQ ! 108 0xf80 451 - #endif 452 - #else 453 - .long exception_error /* 400 */ 454 - .long exception_error 455 - .long exception_error 456 - .long exception_error 457 - .long do_IRQ ! RTC ati 458 - .long do_IRQ ! pri 459 - .long do_IRQ ! cui 460 - .long exception_error 461 - .long exception_error /* 500 */ 462 - .long exception_error 463 - .long exception_error 464 - .long do_IRQ ! WDT iti /* 560 */ 465 - .long do_IRQ ! TMU-ch0 466 - .long do_IRQ ! TMU-ch1 467 - .long do_IRQ ! TMU-ch2 468 - .long do_IRQ ! ticpi2 /* 5E0 */ 469 - .long do_IRQ ! 32 Hitachi UDI /* 600 */ 470 - .long exception_error 471 - .long do_IRQ ! 34 DMAC dmte0 472 - .long do_IRQ ! 35 dmte1 473 - .long do_IRQ ! 36 dmte2 474 - .long do_IRQ ! 37 dmte3 475 - .long do_IRQ ! 38 dmae 476 - .long exception_error ! 39 /* 6E0 */ 477 - .long do_IRQ ! 40 SCIF-ch0 eri /* 700 */ 478 - .long do_IRQ ! 41 rxi 479 - .long do_IRQ ! 42 bri 480 - .long do_IRQ ! 43 txi 481 - .long do_IRQ ! 44 DMAC dmte4 /* 780 */ 482 - .long do_IRQ ! 45 dmte5 483 - .long do_IRQ ! 46 dmte6 484 - .long do_IRQ ! 47 dmte7 /* 7E0 */ 485 - #if defined(CONFIG_SH_FPU) 486 - .long do_fpu_state_restore ! 48 /* 800 */ 487 - .long do_fpu_state_restore ! 49 /* 820 */ 488 - #else 489 - .long exception_error 490 - .long exception_error 491 - #endif 492 - .long exception_error /* 840 */ 493 - .long exception_error 494 - .long exception_error 495 - .long exception_error 496 - .long exception_error 497 - .long exception_error 498 - .long do_IRQ ! 56 CMT /* 900 */ 499 - .long exception_error 500 - .long exception_error 501 - .long exception_error 502 - .long do_IRQ ! 60 HAC 503 - .long exception_error 504 - .long exception_error 505 - .long exception_error 506 - .long do_IRQ ! PCI serr /* A00 */ 507 - .long do_IRQ ! INTA 508 - .long do_IRQ ! INTB 509 - .long do_IRQ ! INTC 510 - .long do_IRQ ! INTD 511 - .long do_IRQ ! err 512 - .long do_IRQ ! pwd3 513 - .long do_IRQ ! pwd2 514 - .long do_IRQ ! pwd1 /* B00 */ 515 - .long do_IRQ ! pwd0 516 - .long exception_error 517 - .long exception_error 518 - .long do_IRQ ! SCIF-ch1 eri /* B80 */ 519 - .long do_IRQ ! rxi 520 - .long do_IRQ ! bri 521 - .long do_IRQ ! txi 522 - .long do_IRQ ! SIOF /* C00 */ 523 - .long exception_error 524 - .long exception_error 525 - .long exception_error 526 - .long do_IRQ ! HSPI /* C80 */ 527 - .long exception_error 528 - .long exception_error 529 - .long exception_error 530 - .long do_IRQ ! MMCIF fatat /* D00 */ 531 - .long do_IRQ ! tran 532 - .long do_IRQ ! err 533 - .long do_IRQ ! frdy 534 - .long do_IRQ ! DMAC dmint8 /* D80 */ 535 - .long do_IRQ ! dmint9 536 - .long do_IRQ ! dmint10 537 - .long do_IRQ ! dmint11 538 - .long do_IRQ ! TMU-ch3 /* E00 */ 539 - .long do_IRQ ! TMU-ch4 540 - .long do_IRQ ! TMU-ch5 541 - .long exception_error 542 - .long do_IRQ ! SSI 543 - .long exception_error 544 - .long exception_error 545 - .long exception_error 546 - .long do_IRQ ! FLCTL flste /* F00 */ 547 - .long do_IRQ ! fltend 548 - .long do_IRQ ! fltrq0 549 - .long do_IRQ ! fltrq1 550 - .long do_IRQ ! GPIO gpioi0 /* F80 */ 551 - .long do_IRQ ! gpioi1 552 - .long do_IRQ ! gpioi2 553 - .long do_IRQ ! gpioi3 554 - #endif 555 -
··· 53 #endif 54 ENTRY(user_break_point_trap) 55 .long break_point_trap /* 1E0 */
+33 -10
arch/sh/kernel/entry.S
··· 1 - /* $Id: entry.S,v 1.37 2004/06/11 13:02:46 doyu Exp $ 2 - * 3 * linux/arch/sh/entry.S 4 * 5 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 6 - * Copyright (C) 2003 Paul Mundt 7 * 8 * This file is subject to the terms and conditions of the GNU General Public 9 * License. See the file "COPYING" in the main directory of this archive ··· 77 #define k3 r3 78 #define k4 r4 79 80 - #define k_ex_code r2_bank /* r2_bank1 */ 81 #define g_imask r6 /* r6_bank1 */ 82 #define k_g_imask r6_bank /* r6_bank1 */ 83 #define current r7 /* r7_bank1 */ ··· 689 0: 690 #endif /* defined(CONFIG_KGDB_NMI) */ 691 bra handle_exception 692 - mov.l @k2, k2 693 694 .align 2 695 1: .long EXPEVT ··· 715 add current, k1 716 mov k1, r15 ! change to kernel stack 717 ! 718 - 1: mov #-1, k4 719 - mov.l 2f, k1 720 ! 721 #ifdef CONFIG_SH_DSP 722 mov.l r2, @-r15 ! Save r2, we need another reg ··· 760 #endif 761 ! Save the user registers on the stack. 762 mov.l k2, @-r15 ! EXPEVT 763 mov.l k4, @-r15 ! set TRA (default: -1) 764 ! 765 sts.l macl, @-r15 ··· 796 mov.l r2, @-r15 797 mov.l r1, @-r15 798 mov.l r0, @-r15 799 - ! Then, dispatch to the handler, according to the exception code. 800 - stc k_ex_code, r8 801 shlr2 r8 802 shlr r8 803 mov.l 4f, r9 804 add r8, r9 805 mov.l @r9, r9 806 jmp @r9 807 nop 808 809 .align 2 ··· 827 3: .long 0xcfffffff ! RB=0, BL=0 828 4: .long exception_handling_table 829 830 .align 2 831 ENTRY(exception_none) 832 rts 833 nop 834 -
··· 1 + /* 2 * linux/arch/sh/entry.S 3 * 4 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 5 + * Copyright (C) 2003 - 2006 Paul Mundt 6 * 7 * This file is subject to the terms and conditions of the GNU General Public 8 * License. See the file "COPYING" in the main directory of this archive ··· 78 #define k3 r3 79 #define k4 r4 80 81 #define g_imask r6 /* r6_bank1 */ 82 #define k_g_imask r6_bank /* r6_bank1 */ 83 #define current r7 /* r7_bank1 */ ··· 691 0: 692 #endif /* defined(CONFIG_KGDB_NMI) */ 693 bra handle_exception 694 + mov #-1, k2 ! interrupt exception marker 695 696 .align 2 697 1: .long EXPEVT ··· 717 add current, k1 718 mov k1, r15 ! change to kernel stack 719 ! 720 + 1: mov.l 2f, k1 721 ! 722 #ifdef CONFIG_SH_DSP 723 mov.l r2, @-r15 ! Save r2, we need another reg ··· 763 #endif 764 ! Save the user registers on the stack. 765 mov.l k2, @-r15 ! EXPEVT 766 + 767 + mov #-1, k4 768 mov.l k4, @-r15 ! set TRA (default: -1) 769 ! 770 sts.l macl, @-r15 ··· 797 mov.l r2, @-r15 798 mov.l r1, @-r15 799 mov.l r0, @-r15 800 + 801 + /* 802 + * This gets a bit tricky.. in the INTEVT case we don't want to use 803 + * the VBR offset as a destination in the jump call table, since all 804 + * of the destinations are the same. In this case, (interrupt) sets 805 + * a marker in r2 (now r2_bank since SR.RB changed), which we check 806 + * to determine the exception type. For all other exceptions, we 807 + * forcibly read EXPEVT from memory and fix up the jump address, in 808 + * the interrupt exception case we jump to do_IRQ() and defer the 809 + * INTEVT read until there. As a bonus, we can also clean up the SR.RB 810 + * checks that do_IRQ() was doing.. 811 + */ 812 + stc r2_bank, r8 813 + cmp/pz r8 814 + bf interrupt_exception 815 shlr2 r8 816 shlr r8 817 mov.l 4f, r9 818 add r8, r9 819 mov.l @r9, r9 820 jmp @r9 821 + nop 822 + rts 823 nop 824 825 .align 2 ··· 813 3: .long 0xcfffffff ! RB=0, BL=0 814 4: .long exception_handling_table 815 816 + interrupt_exception: 817 + mov.l 1f, r9 818 + jmp @r9 819 + nop 820 + rts 821 + nop 822 + 823 + .align 2 824 + 1: .long do_IRQ 825 + 826 .align 2 827 ENTRY(exception_none) 828 rts 829 nop
+20 -22
arch/sh/kernel/irq.c
··· 11 #include <linux/module.h> 12 #include <linux/kernel_stat.h> 13 #include <linux/seq_file.h> 14 #include <asm/irq.h> 15 #include <asm/processor.h> 16 #include <asm/uaccess.h> 17 #include <asm/thread_info.h> 18 #include <asm/cpu/mmu_context.h> 19 20 /* 21 * 'what should we do if we get a hw irq event on an illegal vector'. ··· 27 */ 28 void ack_bad_irq(unsigned int irq) 29 { 30 printk("unexpected IRQ trap at vector %02x\n", irq); 31 } 32 ··· 51 if (!action) 52 goto unlock; 53 seq_printf(p, "%3d: ",i); 54 - seq_printf(p, "%10u ", kstat_irqs(i)); 55 - seq_printf(p, " %14s", irq_desc[i].chip->typename); 56 seq_printf(p, " %s", action->name); 57 58 for (action=action->next; action; action = action->next) ··· 62 seq_putc(p, '\n'); 63 unlock: 64 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 65 - } 66 return 0; 67 } 68 #endif ··· 86 unsigned long r6, unsigned long r7, 87 struct pt_regs regs) 88 { 89 - int irq = r4; 90 #ifdef CONFIG_4KSTACKS 91 union irq_ctx *curctx, *irqctx; 92 #endif ··· 111 #endif 112 113 #ifdef CONFIG_CPU_HAS_INTEVT 114 - __asm__ __volatile__ ( 115 - #ifdef CONFIG_CPU_HAS_SR_RB 116 - "stc r2_bank, %0\n\t" 117 #else 118 - "mov.l @%1, %0\n\t" 119 - #endif 120 - "shlr2 %0\n\t" 121 - "shlr2 %0\n\t" 122 - "shlr %0\n\t" 123 - "add #-16, %0\n\t" 124 - : "=z" (irq), "=r" (r4) 125 - : "1" (INTEVT) 126 - : "memory" 127 - ); 128 #endif 129 130 irq = irq_demux(irq); ··· 137 138 __asm__ __volatile__ ( 139 "mov %0, r4 \n" 140 - "mov %1, r5 \n" 141 "mov r15, r9 \n" 142 - "jsr @%2 \n" 143 /* swith to the irq stack */ 144 - " mov %3, r15 \n" 145 /* restore the stack (ring zero) */ 146 "mov r9, r15 \n" 147 : /* no outputs */ 148 - : "r" (irq), "r" (&regs), "r" (__do_IRQ), "r" (isp) 149 /* XXX: A somewhat excessive clobber list? -PFM */ 150 : "memory", "r0", "r1", "r2", "r3", "r4", 151 "r5", "r6", "r7", "r8", "t", "pr" 152 ); 153 } else 154 #endif 155 - __do_IRQ(irq, &regs); 156 157 irq_exit(); 158 159 return 1; 160 } 161
··· 11 #include <linux/module.h> 12 #include <linux/kernel_stat.h> 13 #include <linux/seq_file.h> 14 + #include <linux/io.h> 15 #include <asm/irq.h> 16 #include <asm/processor.h> 17 #include <asm/uaccess.h> 18 #include <asm/thread_info.h> 19 #include <asm/cpu/mmu_context.h> 20 + 21 + atomic_t irq_err_count; 22 23 /* 24 * 'what should we do if we get a hw irq event on an illegal vector'. ··· 24 */ 25 void ack_bad_irq(unsigned int irq) 26 { 27 + atomic_inc(&irq_err_count); 28 printk("unexpected IRQ trap at vector %02x\n", irq); 29 } 30 ··· 47 if (!action) 48 goto unlock; 49 seq_printf(p, "%3d: ",i); 50 + for_each_online_cpu(j) 51 + seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 52 + seq_printf(p, " %14s", irq_desc[i].chip->name); 53 + seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq)); 54 seq_printf(p, " %s", action->name); 55 56 for (action=action->next; action; action = action->next) ··· 56 seq_putc(p, '\n'); 57 unlock: 58 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 59 + } else if (i == NR_IRQS) 60 + seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count)); 61 + 62 return 0; 63 } 64 #endif ··· 78 unsigned long r6, unsigned long r7, 79 struct pt_regs regs) 80 { 81 + struct pt_regs *old_regs = set_irq_regs(&regs); 82 + int irq; 83 #ifdef CONFIG_4KSTACKS 84 union irq_ctx *curctx, *irqctx; 85 #endif ··· 102 #endif 103 104 #ifdef CONFIG_CPU_HAS_INTEVT 105 + irq = (ctrl_inl(INTEVT) >> 5) - 16; 106 #else 107 + irq = r4; 108 #endif 109 110 irq = irq_demux(irq); ··· 139 140 __asm__ __volatile__ ( 141 "mov %0, r4 \n" 142 "mov r15, r9 \n" 143 + "jsr @%1 \n" 144 /* swith to the irq stack */ 145 + " mov %2, r15 \n" 146 /* restore the stack (ring zero) */ 147 "mov r9, r15 \n" 148 : /* no outputs */ 149 + : "r" (irq), "r" (generic_handle_irq), "r" (isp) 150 /* XXX: A somewhat excessive clobber list? -PFM */ 151 : "memory", "r0", "r1", "r2", "r3", "r4", 152 "r5", "r6", "r7", "r8", "t", "pr" 153 ); 154 } else 155 #endif 156 + generic_handle_irq(irq); 157 158 irq_exit(); 159 160 + set_irq_regs(old_regs); 161 return 1; 162 } 163
+30
arch/sh/kernel/process.c
··· 5 * Copyright (C) 1995 Linus Torvalds 6 * 7 * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima 8 */ 9 10 /* ··· 291 static void 292 ubc_set_tracing(int asid, unsigned long pc) 293 { 294 ctrl_outl(pc, UBC_BARA); 295 296 #ifdef CONFIG_MMU ··· 326 ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA); 327 ctrl_outw(BRCR_PCBA, UBC_BRCR); 328 } 329 } 330 331 /* ··· 379 #endif 380 ubc_set_tracing(asid, next->thread.ubc_pc); 381 } else { 382 ctrl_outw(0, UBC_BBRA); 383 ctrl_outw(0, UBC_BBRB); 384 } 385 386 return prev; ··· 485 struct pt_regs regs) 486 { 487 /* Clear tracing. */ 488 ctrl_outw(0, UBC_BBRA); 489 ctrl_outw(0, UBC_BBRB); 490 current->thread.ubc_pc = 0; 491 ubc_usercnt -= 1; 492
··· 5 * Copyright (C) 1995 Linus Torvalds 6 * 7 * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima 8 + * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC 9 */ 10 11 /* ··· 290 static void 291 ubc_set_tracing(int asid, unsigned long pc) 292 { 293 + #if defined(CONFIG_CPU_SH4A) 294 + unsigned long val; 295 + 296 + val = (UBC_CBR_ID_INST | UBC_CBR_RW_READ | UBC_CBR_CE); 297 + val |= (UBC_CBR_AIE | UBC_CBR_AIV_SET(asid)); 298 + 299 + ctrl_outl(val, UBC_CBR0); 300 + ctrl_outl(pc, UBC_CAR0); 301 + ctrl_outl(0x0, UBC_CAMR0); 302 + ctrl_outl(0x0, UBC_CBCR); 303 + 304 + val = (UBC_CRR_RES | UBC_CRR_PCB | UBC_CRR_BIE); 305 + ctrl_outl(val, UBC_CRR0); 306 + 307 + /* Read UBC register that we writed last. For chekking UBC Register changed */ 308 + val = ctrl_inl(UBC_CRR0); 309 + 310 + #else /* CONFIG_CPU_SH4A */ 311 ctrl_outl(pc, UBC_BARA); 312 313 #ifdef CONFIG_MMU ··· 307 ctrl_outw(BBR_INST | BBR_READ, UBC_BBRA); 308 ctrl_outw(BRCR_PCBA, UBC_BRCR); 309 } 310 + #endif /* CONFIG_CPU_SH4A */ 311 } 312 313 /* ··· 359 #endif 360 ubc_set_tracing(asid, next->thread.ubc_pc); 361 } else { 362 + #if defined(CONFIG_CPU_SH4A) 363 + ctrl_outl(UBC_CBR_INIT, UBC_CBR0); 364 + ctrl_outl(UBC_CRR_INIT, UBC_CRR0); 365 + #else 366 ctrl_outw(0, UBC_BBRA); 367 ctrl_outw(0, UBC_BBRB); 368 + #endif 369 } 370 371 return prev; ··· 460 struct pt_regs regs) 461 { 462 /* Clear tracing. */ 463 + #if defined(CONFIG_CPU_SH4A) 464 + ctrl_outl(UBC_CBR_INIT, UBC_CBR0); 465 + ctrl_outl(UBC_CRR_INIT, UBC_CRR0); 466 + #else 467 ctrl_outw(0, UBC_BBRA); 468 ctrl_outw(0, UBC_BBRB); 469 + #endif 470 current->thread.ubc_pc = 0; 471 ubc_usercnt -= 1; 472
+6 -3
arch/sh/kernel/time.c
··· 47 return (unsigned long long)jiffies * (1000000000 / HZ); 48 } 49 50 void do_gettimeofday(struct timeval *tv) 51 { 52 unsigned long seq; ··· 100 return 0; 101 } 102 EXPORT_SYMBOL(do_settimeofday); 103 104 /* last time the RTC clock got updated */ 105 static long last_rtc_update; ··· 109 * handle_timer_tick() needs to keep up the real-time clock, 110 * as well as call the "do_timer()" routine every clocktick 111 */ 112 - void handle_timer_tick(struct pt_regs *regs) 113 { 114 do_timer(1); 115 #ifndef CONFIG_SMP 116 - update_process_times(user_mode(regs)); 117 #endif 118 - profile_tick(CPU_PROFILING, regs); 119 120 #ifdef CONFIG_HEARTBEAT 121 if (sh_mv.mv_heartbeat != NULL)
··· 47 return (unsigned long long)jiffies * (1000000000 / HZ); 48 } 49 50 + #ifndef CONFIG_GENERIC_TIME 51 void do_gettimeofday(struct timeval *tv) 52 { 53 unsigned long seq; ··· 99 return 0; 100 } 101 EXPORT_SYMBOL(do_settimeofday); 102 + #endif /* !CONFIG_GENERIC_TIME */ 103 104 /* last time the RTC clock got updated */ 105 static long last_rtc_update; ··· 107 * handle_timer_tick() needs to keep up the real-time clock, 108 * as well as call the "do_timer()" routine every clocktick 109 */ 110 + void handle_timer_tick(void) 111 { 112 do_timer(1); 113 #ifndef CONFIG_SMP 114 + update_process_times(user_mode(get_irq_regs())); 115 #endif 116 + if (current->pid) 117 + profile_tick(CPU_PROFILING); 118 119 #ifdef CONFIG_HEARTBEAT 120 if (sh_mv.mv_heartbeat != NULL)
+4 -59
arch/sh/kernel/timers/timer-tmu.c
··· 80 return count; 81 } 82 83 - static irqreturn_t tmu_timer_interrupt(int irq, void *dev_id, 84 - struct pt_regs *regs) 85 { 86 unsigned long timer_status; 87 ··· 97 * locally disabled. -arca 98 */ 99 write_seqlock(&xtime_lock); 100 - handle_timer_tick(regs); 101 write_sequnlock(&xtime_lock); 102 103 return IRQ_HANDLED; ··· 109 .flags = IRQF_DISABLED, 110 .mask = CPU_MASK_NONE, 111 }; 112 - 113 - /* 114 - * Hah! We'll see if this works (switching from usecs to nsecs). 115 - */ 116 - static unsigned long tmu_timer_get_frequency(void) 117 - { 118 - u32 freq; 119 - struct timespec ts1, ts2; 120 - unsigned long diff_nsec; 121 - unsigned long factor; 122 - 123 - /* Setup the timer: We don't want to generate interrupts, just 124 - * have it count down at its natural rate. 125 - */ 126 - ctrl_outb(0, TMU_TSTR); 127 - #if !defined(CONFIG_CPU_SUBTYPE_SH7300) && !defined(CONFIG_CPU_SUBTYPE_SH7760) 128 - ctrl_outb(TMU_TOCR_INIT, TMU_TOCR); 129 - #endif 130 - ctrl_outw(TMU0_TCR_CALIB, TMU0_TCR); 131 - ctrl_outl(0xffffffff, TMU0_TCOR); 132 - ctrl_outl(0xffffffff, TMU0_TCNT); 133 - 134 - rtc_sh_get_time(&ts2); 135 - 136 - do { 137 - rtc_sh_get_time(&ts1); 138 - } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec); 139 - 140 - /* actually start the timer */ 141 - ctrl_outb(TMU_TSTR_INIT, TMU_TSTR); 142 - 143 - do { 144 - rtc_sh_get_time(&ts2); 145 - } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec); 146 - 147 - freq = 0xffffffff - ctrl_inl(TMU0_TCNT); 148 - if (ts2.tv_nsec < ts1.tv_nsec) { 149 - ts2.tv_nsec += 1000000000; 150 - ts2.tv_sec--; 151 - } 152 - 153 - diff_nsec = (ts2.tv_sec - ts1.tv_sec) * 1000000000 + (ts2.tv_nsec - ts1.tv_nsec); 154 - 155 - /* this should work well if the RTC has a precision of n Hz, where 156 - * n is an integer. I don't think we have to worry about the other 157 - * cases. */ 158 - factor = (1000000000 + diff_nsec/2) / diff_nsec; 159 - 160 - if (factor * diff_nsec > 1100000000 || 161 - factor * diff_nsec < 900000000) 162 - panic("weird RTC (diff_nsec %ld)", diff_nsec); 163 - 164 - return freq * factor; 165 - } 166 167 static void tmu_clk_init(struct clk *clk) 168 { ··· 177 .init = tmu_timer_init, 178 .start = tmu_timer_start, 179 .stop = tmu_timer_stop, 180 - .get_frequency = tmu_timer_get_frequency, 181 .get_offset = tmu_timer_get_offset, 182 }; 183 184 struct sys_timer tmu_timer = { 185 .name = "tmu", 186 .ops = &tmu_timer_ops, 187 }; 188 -
··· 80 return count; 81 } 82 83 + static irqreturn_t tmu_timer_interrupt(int irq, void *dummy) 84 { 85 unsigned long timer_status; 86 ··· 98 * locally disabled. -arca 99 */ 100 write_seqlock(&xtime_lock); 101 + handle_timer_tick(); 102 write_sequnlock(&xtime_lock); 103 104 return IRQ_HANDLED; ··· 110 .flags = IRQF_DISABLED, 111 .mask = CPU_MASK_NONE, 112 }; 113 114 static void tmu_clk_init(struct clk *clk) 115 { ··· 232 .init = tmu_timer_init, 233 .start = tmu_timer_start, 234 .stop = tmu_timer_stop, 235 + #ifndef CONFIG_GENERIC_TIME 236 .get_offset = tmu_timer_get_offset, 237 + #endif 238 }; 239 240 struct sys_timer tmu_timer = { 241 .name = "tmu", 242 .ops = &tmu_timer_ops, 243 };
+1
arch/sh/mm/consistent.c
··· 28 split_page(page, order); 29 30 ret = page_address(page); 31 *handle = virt_to_phys(ret); 32 33 /*
··· 28 split_page(page, order); 29 30 ret = page_address(page); 31 + memset(ret, 0, size); 32 *handle = virt_to_phys(ret); 33 34 /*
+3 -3
drivers/rtc/rtc-sh.c
··· 160 tmp |= RCR1_CIE; 161 writeb(tmp, rtc->regbase + RCR1); 162 163 - ret = request_irq(rtc->periodic_irq, sh_rtc_periodic, SA_INTERRUPT, 164 "sh-rtc period", dev); 165 if (unlikely(ret)) { 166 dev_err(dev, "request period IRQ failed with %d, IRQ %d\n", ··· 168 return ret; 169 } 170 171 - ret = request_irq(rtc->carry_irq, sh_rtc_interrupt, SA_INTERRUPT, 172 "sh-rtc carry", dev); 173 if (unlikely(ret)) { 174 dev_err(dev, "request carry IRQ failed with %d, IRQ %d\n", ··· 177 goto err_bad_carry; 178 } 179 180 - ret = request_irq(rtc->alarm_irq, sh_rtc_interrupt, SA_INTERRUPT, 181 "sh-rtc alarm", dev); 182 if (unlikely(ret)) { 183 dev_err(dev, "request alarm IRQ failed with %d, IRQ %d\n",
··· 160 tmp |= RCR1_CIE; 161 writeb(tmp, rtc->regbase + RCR1); 162 163 + ret = request_irq(rtc->periodic_irq, sh_rtc_periodic, IRQF_DISABLED, 164 "sh-rtc period", dev); 165 if (unlikely(ret)) { 166 dev_err(dev, "request period IRQ failed with %d, IRQ %d\n", ··· 168 return ret; 169 } 170 171 + ret = request_irq(rtc->carry_irq, sh_rtc_interrupt, IRQF_DISABLED, 172 "sh-rtc carry", dev); 173 if (unlikely(ret)) { 174 dev_err(dev, "request carry IRQ failed with %d, IRQ %d\n", ··· 177 goto err_bad_carry; 178 } 179 180 + ret = request_irq(rtc->alarm_irq, sh_rtc_interrupt, IRQF_DISABLED, 181 "sh-rtc alarm", dev); 182 if (unlikely(ret)) { 183 dev_err(dev, "request alarm IRQ failed with %d, IRQ %d\n",
+2 -2
drivers/serial/sh-sci.c
··· 808 } 809 810 if (request_irq(port->irqs[0], sci_mpxed_interrupt, 811 - SA_INTERRUPT, "sci", port)) { 812 printk(KERN_ERR "sci: Cannot allocate irq.\n"); 813 return -ENODEV; 814 } ··· 817 if (!port->irqs[i]) 818 continue; 819 if (request_irq(port->irqs[i], handlers[i], 820 - SA_INTERRUPT, desc[i], port)) { 821 printk(KERN_ERR "sci: Cannot allocate irq.\n"); 822 return -ENODEV; 823 }
··· 808 } 809 810 if (request_irq(port->irqs[0], sci_mpxed_interrupt, 811 + IRQF_DISABLED, "sci", port)) { 812 printk(KERN_ERR "sci: Cannot allocate irq.\n"); 813 return -ENODEV; 814 } ··· 817 if (!port->irqs[i]) 818 continue; 819 if (request_irq(port->irqs[i], handlers[i], 820 + IRQF_DISABLED, desc[i], port)) { 821 printk(KERN_ERR "sci: Cannot allocate irq.\n"); 822 return -ENODEV; 823 }
+37
include/asm-sh/cpu-sh4/ubc.h
··· 3 * 4 * Copyright (C) 1999 Niibe Yutaka 5 * Copyright (C) 2003 Paul Mundt 6 * 7 * This file is subject to the terms and conditions of the GNU General Public 8 * License. See the file "COPYING" in the main directory of this archive ··· 12 #ifndef __ASM_CPU_SH4_UBC_H 13 #define __ASM_CPU_SH4_UBC_H 14 15 #define UBC_BARA 0xff200000 16 #define UBC_BAMRA 0xff200004 17 #define UBC_BBRA 0xff200008 ··· 58 #define UBC_BDRB 0xff200018 59 #define UBC_BDMRB 0xff20001c 60 #define UBC_BRCR 0xff200020 61 62 #endif /* __ASM_CPU_SH4_UBC_H */ 63
··· 3 * 4 * Copyright (C) 1999 Niibe Yutaka 5 * Copyright (C) 2003 Paul Mundt 6 + * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC 7 * 8 * This file is subject to the terms and conditions of the GNU General Public 9 * License. See the file "COPYING" in the main directory of this archive ··· 11 #ifndef __ASM_CPU_SH4_UBC_H 12 #define __ASM_CPU_SH4_UBC_H 13 14 + #if defined(CONFIG_CPU_SH4A) 15 + #define UBC_CBR0 0xff200000 16 + #define UBC_CRR0 0xff200004 17 + #define UBC_CAR0 0xff200008 18 + #define UBC_CAMR0 0xff20000c 19 + #define UBC_CBR1 0xff200020 20 + #define UBC_CRR1 0xff200024 21 + #define UBC_CAR1 0xff200028 22 + #define UBC_CAMR1 0xff20002c 23 + #define UBC_CDR1 0xff200030 24 + #define UBC_CDMR1 0xff200034 25 + #define UBC_CETR1 0xff200038 26 + #define UBC_CCMFR 0xff200600 27 + #define UBC_CBCR 0xff200620 28 + 29 + /* CBR */ 30 + #define UBC_CBR_AIE (0x01<<30) 31 + #define UBC_CBR_ID_INST (0x01<<4) 32 + #define UBC_CBR_RW_READ (0x01<<1) 33 + #define UBC_CBR_CE (0x01) 34 + 35 + #define UBC_CBR_AIV_MASK (0x00FF0000) 36 + #define UBC_CBR_AIV_SHIFT (16) 37 + #define UBC_CBR_AIV_SET(asid) (((asid)<<UBC_CBR_AIV_SHIFT) & UBC_CBR_AIV_MASK) 38 + 39 + #define UBC_CBR_INIT 0x20000000 40 + 41 + /* CRR */ 42 + #define UBC_CRR_RES (0x01<<13) 43 + #define UBC_CRR_PCB (0x01<<1) 44 + #define UBC_CRR_BIE (0x01) 45 + 46 + #define UBC_CRR_INIT 0x00002000 47 + 48 + #else /* CONFIG_CPU_SH4 */ 49 #define UBC_BARA 0xff200000 50 #define UBC_BAMRA 0xff200004 51 #define UBC_BBRA 0xff200008 ··· 22 #define UBC_BDRB 0xff200018 23 #define UBC_BDMRB 0xff20001c 24 #define UBC_BRCR 0xff200020 25 + #endif /* CONFIG_CPU_SH4 */ 26 27 #endif /* __ASM_CPU_SH4_UBC_H */ 28
+4
include/asm-sh/hw_irq.h
··· 1 #ifndef __ASM_SH_HW_IRQ_H 2 #define __ASM_SH_HW_IRQ_H 3 4 #endif /* __ASM_SH_HW_IRQ_H */
··· 1 #ifndef __ASM_SH_HW_IRQ_H 2 #define __ASM_SH_HW_IRQ_H 3 4 + #include <asm/atomic.h> 5 + 6 + extern atomic_t irq_err_count; 7 + 8 #endif /* __ASM_SH_HW_IRQ_H */
+8 -6
include/asm-sh/irq.h
··· 697 698 #define INTC2_INTPRI_OFFSET 0x00 699 700 - void make_intc2_irq(unsigned int irq, 701 - unsigned int ipr_offset, unsigned int ipr_shift, 702 - unsigned int msk_offset, unsigned int msk_shift, 703 - unsigned int priority); 704 - void init_IRQ_intc2(void); 705 - void intc2_add_clear_irq(int irq, int (*fn)(int)); 706 707 #endif 708 709 extern int shmse_irq_demux(int irq);
··· 697 698 #define INTC2_INTPRI_OFFSET 0x00 699 700 + struct intc2_data { 701 + unsigned short irq; 702 + unsigned char ipr_offset, ipr_shift; 703 + unsigned char msk_offset, msk_shift; 704 + unsigned char priority; 705 + }; 706 707 + void make_intc2_irq(struct intc2_data *); 708 + void init_IRQ_intc2(void); 709 #endif 710 711 extern int shmse_irq_demux(int irq);
+1
include/asm-sh/irq_regs.h
···
··· 1 + #include <asm-generic/irq_regs.h>
+5 -8
include/asm-sh/timer.h
··· 8 int (*init)(void); 9 int (*start)(void); 10 int (*stop)(void); 11 unsigned long (*get_offset)(void); 12 - unsigned long (*get_frequency)(void); 13 }; 14 15 struct sys_timer { ··· 25 extern struct sys_timer tmu_timer; 26 extern struct sys_timer *sys_timer; 27 28 static inline unsigned long get_timer_offset(void) 29 { 30 return sys_timer->ops->get_offset(); 31 } 32 - 33 - static inline unsigned long get_timer_frequency(void) 34 - { 35 - return sys_timer->ops->get_frequency(); 36 - } 37 38 /* arch/sh/kernel/timers/timer.c */ 39 struct sys_timer *get_sys_timer(void); 40 41 /* arch/sh/kernel/time.c */ 42 - void handle_timer_tick(struct pt_regs *); 43 44 #endif /* __ASM_SH_TIMER_H */ 45 -
··· 8 int (*init)(void); 9 int (*start)(void); 10 int (*stop)(void); 11 + #ifndef CONFIG_GENERIC_TIME 12 unsigned long (*get_offset)(void); 13 + #endif 14 }; 15 16 struct sys_timer { ··· 24 extern struct sys_timer tmu_timer; 25 extern struct sys_timer *sys_timer; 26 27 + #ifndef CONFIG_GENERIC_TIME 28 static inline unsigned long get_timer_offset(void) 29 { 30 return sys_timer->ops->get_offset(); 31 } 32 + #endif 33 34 /* arch/sh/kernel/timers/timer.c */ 35 struct sys_timer *get_sys_timer(void); 36 37 /* arch/sh/kernel/time.c */ 38 + void handle_timer_tick(void); 39 40 #endif /* __ASM_SH_TIMER_H */