aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/cchips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/cchips')
-rw-r--r--arch/sh/cchips/voyagergx/irq.c70
-rw-r--r--arch/sh/cchips/voyagergx/setup.c4
2 files changed, 34 insertions, 40 deletions
diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c
index f7ea700d05ae..70f12907647f 100644
--- a/arch/sh/cchips/voyagergx/irq.c
+++ b/arch/sh/cchips/voyagergx/irq.c
@@ -28,21 +28,21 @@ static void disable_voyagergx_irq(unsigned int irq)
28 unsigned long val; 28 unsigned long val;
29 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); 29 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
30 30
31 pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask); 31 pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
32 val = inl(VOYAGER_INT_MASK); 32 val = readl((void __iomem *)VOYAGER_INT_MASK);
33 val &= ~mask; 33 val &= ~mask;
34 outl(val, VOYAGER_INT_MASK); 34 writel(val, (void __iomem *)VOYAGER_INT_MASK);
35} 35}
36 36
37static void enable_voyagergx_irq(unsigned int irq) 37static void enable_voyagergx_irq(unsigned int irq)
38{ 38{
39 unsigned long val; 39 unsigned long val;
40 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); 40 unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
41 41
42 pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask); 42 pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
43 val = inl(VOYAGER_INT_MASK); 43 val = readl((void __iomem *)VOYAGER_INT_MASK);
44 val |= mask; 44 val |= mask;
45 outl(val, VOYAGER_INT_MASK); 45 writel(val, (void __iomem *)VOYAGER_INT_MASK);
46} 46}
47 47
48static void mask_and_ack_voyagergx(unsigned int irq) 48static void mask_and_ack_voyagergx(unsigned int irq)
@@ -68,20 +68,20 @@ static void shutdown_voyagergx_irq(unsigned int irq)
68} 68}
69 69
70static struct hw_interrupt_type voyagergx_irq_type = { 70static struct hw_interrupt_type voyagergx_irq_type = {
71 .typename = "VOYAGERGX-IRQ", 71 .typename = "VOYAGERGX-IRQ",
72 .startup = startup_voyagergx_irq, 72 .startup = startup_voyagergx_irq,
73 .shutdown = shutdown_voyagergx_irq, 73 .shutdown = shutdown_voyagergx_irq,
74 .enable = enable_voyagergx_irq, 74 .enable = enable_voyagergx_irq,
75 .disable = disable_voyagergx_irq, 75 .disable = disable_voyagergx_irq,
76 .ack = mask_and_ack_voyagergx, 76 .ack = mask_and_ack_voyagergx,
77 .end = end_voyagergx_irq, 77 .end = end_voyagergx_irq,
78}; 78};
79 79
80static irqreturn_t voyagergx_interrupt(int irq, void *dev_id) 80static irqreturn_t voyagergx_interrupt(int irq, void *dev_id)
81{ 81{
82 printk(KERN_INFO 82 printk(KERN_INFO
83 "VoyagerGX: spurious interrupt, status: 0x%x\n", 83 "VoyagerGX: spurious interrupt, status: 0x%x\n",
84 inl(INT_STATUS)); 84 (unsigned int)readl((void __iomem *)INT_STATUS));
85 return IRQ_HANDLED; 85 return IRQ_HANDLED;
86} 86}
87 87
@@ -93,13 +93,13 @@ static struct {
93void voyagergx_register_irq_demux(int irq, 93void voyagergx_register_irq_demux(int irq,
94 int (*demux)(int irq, void *dev), void *dev) 94 int (*demux)(int irq, void *dev), void *dev)
95{ 95{
96 voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = demux; 96 voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = demux;
97 voyagergx_demux[irq - VOYAGER_IRQ_BASE].dev = dev; 97 voyagergx_demux[irq - VOYAGER_IRQ_BASE].dev = dev;
98} 98}
99 99
100void voyagergx_unregister_irq_demux(int irq) 100void voyagergx_unregister_irq_demux(int irq)
101{ 101{
102 voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = 0; 102 voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = 0;
103} 103}
104 104
105int voyagergx_irq_demux(int irq) 105int voyagergx_irq_demux(int irq)
@@ -107,31 +107,25 @@ int voyagergx_irq_demux(int irq)
107 107
108 if (irq == IRQ_VOYAGER ) { 108 if (irq == IRQ_VOYAGER ) {
109 unsigned long i = 0, bit __attribute__ ((unused)); 109 unsigned long i = 0, bit __attribute__ ((unused));
110 unsigned long val = inl(INT_STATUS); 110 unsigned long val = readl((void __iomem *)INT_STATUS);
111#if 1 111
112 if ( val & ( 1 << 1 )){ 112 if (val & (1 << 1))
113 i = 1; 113 i = 1;
114 } else if ( val & ( 1 << 2 )){ 114 else if (val & (1 << 2))
115 i = 2; 115 i = 2;
116 } else if ( val & ( 1 << 6 )){ 116 else if (val & (1 << 6))
117 i = 6; 117 i = 6;
118 } else if( val & ( 1 << 10 )){ 118 else if (val & (1 << 10))
119 i = 10; 119 i = 10;
120 } else if( val & ( 1 << 11 )){ 120 else if (val & (1 << 11))
121 i = 11; 121 i = 11;
122 } else if( val & ( 1 << 12 )){ 122 else if (val & (1 << 12))
123 i = 12; 123 i = 12;
124 } else if( val & ( 1 << 17 )){ 124 else if (val & (1 << 17))
125 i = 17; 125 i = 17;
126 } else { 126 else
127 printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val); 127 printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val);
128 } 128 pr_debug("voyagergx_irq_demux %d \n", i);
129 pr_debug("voyagergx_irq_demux %ld\n", i);
130#else
131 for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++)
132 if (val & bit)
133 break;
134#endif
135 if (i < VOYAGER_IRQ_NUM) { 129 if (i < VOYAGER_IRQ_NUM) {
136 irq = VOYAGER_IRQ_BASE + i; 130 irq = VOYAGER_IRQ_BASE + i;
137 if (voyagergx_demux[i].func != 0) 131 if (voyagergx_demux[i].func != 0)
diff --git a/arch/sh/cchips/voyagergx/setup.c b/arch/sh/cchips/voyagergx/setup.c
index 66b2fedd7ad9..33f03027c193 100644
--- a/arch/sh/cchips/voyagergx/setup.c
+++ b/arch/sh/cchips/voyagergx/setup.c
@@ -19,7 +19,7 @@ static int __init setup_voyagergx(void)
19{ 19{
20 unsigned long val; 20 unsigned long val;
21 21
22 val = inl(DRAM_CTRL); 22 val = readl((void __iomem *)DRAM_CTRL);
23 val |= (DRAM_CTRL_CPU_COLUMN_SIZE_256 | 23 val |= (DRAM_CTRL_CPU_COLUMN_SIZE_256 |
24 DRAM_CTRL_CPU_ACTIVE_PRECHARGE | 24 DRAM_CTRL_CPU_ACTIVE_PRECHARGE |
25 DRAM_CTRL_CPU_RESET | 25 DRAM_CTRL_CPU_RESET |
@@ -29,7 +29,7 @@ static int __init setup_voyagergx(void)
29 DRAM_CTRL_ACTIVE_PRECHARGE | 29 DRAM_CTRL_ACTIVE_PRECHARGE |
30 DRAM_CTRL_RESET | 30 DRAM_CTRL_RESET |
31 DRAM_CTRL_REMAIN_ACTIVE); 31 DRAM_CTRL_REMAIN_ACTIVE);
32 outl(val, DRAM_CTRL); 32 writel(val, (void __iomem *)DRAM_CTRL);
33 33
34 return 0; 34 return 0;
35} 35}