22 #include <linux/kernel.h>
28 #include <asm/setup.h>
33 static int mips_cpu_timer_irq;
74 #if defined(CONFIG_SOC_PNX8335)
99 static void pnx833x_timer_dispatch(
void)
101 do_IRQ(mips_cpu_timer_irq);
104 static void pic_dispatch(
void)
115 while ((pin =
ffs(mask & 0xffff))) {
142 static inline void pnx833x_hard_enable_pic_irq(
unsigned int irq)
150 static inline void pnx833x_hard_disable_pic_irq(
unsigned int irq)
158 static unsigned int pnx833x_startup_pic_irq(
unsigned int irq)
164 pnx833x_hard_enable_pic_irq(pic_irq);
169 static void pnx833x_enable_pic_irq(
struct irq_data *
d)
175 pnx833x_hard_enable_pic_irq(pic_irq);
179 static void pnx833x_disable_pic_irq(
struct irq_data *
d)
185 pnx833x_hard_disable_pic_irq(pic_irq);
191 static void pnx833x_enable_gpio_irq(
struct irq_data *
d)
196 pnx833x_gpio_enable_irq(pin);
200 static void pnx833x_disable_gpio_irq(
struct irq_data *
d)
205 pnx833x_gpio_disable_irq(pin);
209 static int pnx833x_set_type_gpio_irq(
struct irq_data *
d,
unsigned int flow_type)
235 pnx833x_gpio_setup_irq(gpio_mode, pin);
240 static struct irq_chip pnx833x_pic_irq_type = {
242 .irq_enable = pnx833x_enable_pic_irq,
243 .irq_disable = pnx833x_disable_pic_irq,
246 static struct irq_chip pnx833x_gpio_irq_type = {
248 .irq_enable = pnx833x_enable_gpio_irq,
249 .irq_disable = pnx833x_disable_gpio_irq,
250 .irq_set_type = pnx833x_set_type_gpio_irq,
262 pnx833x_hard_disable_pic_irq(irq);
263 irq_set_chip_and_handler(irq, &pnx833x_pic_irq_type,
268 irq_set_chip_and_handler(irq, &pnx833x_gpio_irq_type,
290 return mips_cpu_timer_irq;
300 if (!(
PNX833X_BIT(reg, CLOCK_CPUCP_CTL, EXIT_RESET))) {
302 mips_hpt_frequency = 25;
304 #if defined(CONFIG_SOC_PNX8335)
308 static const unsigned long int freq[4] = {240, 160, 120, 80};
309 mips_hpt_frequency = freq[
PNX833X_FIELD(reg, CLOCK_CPUCP_CTL, DIV_CLOCK)];
315 mips_hpt_frequency *= 500000;