core.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. /*
  2. * arch/arm/mach-ixp2000/core.c
  3. *
  4. * Common routines used by all IXP2400/2800 based platforms.
  5. *
  6. * Author: Deepak Saxena <dsaxena@plexity.net>
  7. *
  8. * Copyright 2004 (C) MontaVista Software, Inc.
  9. *
  10. * Based on work Copyright (C) 2002-2003 Intel Corporation
  11. *
  12. * This file is licensed under the terms of the GNU General Public
  13. * License version 2. This program is licensed "as is" without any
  14. * warranty of any kind, whether express or implied.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/spinlock.h>
  19. #include <linux/sched.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/serial.h>
  22. #include <linux/tty.h>
  23. #include <linux/bitops.h>
  24. #include <linux/serial_8250.h>
  25. #include <linux/mm.h>
  26. #include <asm/types.h>
  27. #include <asm/setup.h>
  28. #include <asm/memory.h>
  29. #include <asm/hardware.h>
  30. #include <asm/irq.h>
  31. #include <asm/system.h>
  32. #include <asm/tlbflush.h>
  33. #include <asm/pgtable.h>
  34. #include <asm/mach/map.h>
  35. #include <asm/mach/time.h>
  36. #include <asm/mach/irq.h>
  37. #include <asm/arch/gpio.h>
  38. static DEFINE_SPINLOCK(ixp2000_slowport_lock);
  39. static unsigned long ixp2000_slowport_irq_flags;
  40. /*************************************************************************
  41. * Slowport access routines
  42. *************************************************************************/
  43. void ixp2000_acquire_slowport(struct slowport_cfg *new_cfg, struct slowport_cfg *old_cfg)
  44. {
  45. spin_lock_irqsave(&ixp2000_slowport_lock, ixp2000_slowport_irq_flags);
  46. old_cfg->CCR = *IXP2000_SLOWPORT_CCR;
  47. old_cfg->WTC = *IXP2000_SLOWPORT_WTC2;
  48. old_cfg->RTC = *IXP2000_SLOWPORT_RTC2;
  49. old_cfg->PCR = *IXP2000_SLOWPORT_PCR;
  50. old_cfg->ADC = *IXP2000_SLOWPORT_ADC;
  51. ixp2000_reg_write(IXP2000_SLOWPORT_CCR, new_cfg->CCR);
  52. ixp2000_reg_write(IXP2000_SLOWPORT_WTC2, new_cfg->WTC);
  53. ixp2000_reg_write(IXP2000_SLOWPORT_RTC2, new_cfg->RTC);
  54. ixp2000_reg_write(IXP2000_SLOWPORT_PCR, new_cfg->PCR);
  55. ixp2000_reg_wrb(IXP2000_SLOWPORT_ADC, new_cfg->ADC);
  56. }
  57. void ixp2000_release_slowport(struct slowport_cfg *old_cfg)
  58. {
  59. ixp2000_reg_write(IXP2000_SLOWPORT_CCR, old_cfg->CCR);
  60. ixp2000_reg_write(IXP2000_SLOWPORT_WTC2, old_cfg->WTC);
  61. ixp2000_reg_write(IXP2000_SLOWPORT_RTC2, old_cfg->RTC);
  62. ixp2000_reg_write(IXP2000_SLOWPORT_PCR, old_cfg->PCR);
  63. ixp2000_reg_wrb(IXP2000_SLOWPORT_ADC, old_cfg->ADC);
  64. spin_unlock_irqrestore(&ixp2000_slowport_lock,
  65. ixp2000_slowport_irq_flags);
  66. }
  67. /*************************************************************************
  68. * Chip specific mappings shared by all IXP2000 systems
  69. *************************************************************************/
  70. static struct map_desc ixp2000_io_desc[] __initdata = {
  71. {
  72. .virtual = IXP2000_CAP_VIRT_BASE,
  73. .pfn = __phys_to_pfn(IXP2000_CAP_PHYS_BASE),
  74. .length = IXP2000_CAP_SIZE,
  75. .type = MT_IXP2000_DEVICE,
  76. }, {
  77. .virtual = IXP2000_INTCTL_VIRT_BASE,
  78. .pfn = __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE),
  79. .length = IXP2000_INTCTL_SIZE,
  80. .type = MT_IXP2000_DEVICE,
  81. }, {
  82. .virtual = IXP2000_PCI_CREG_VIRT_BASE,
  83. .pfn = __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE),
  84. .length = IXP2000_PCI_CREG_SIZE,
  85. .type = MT_IXP2000_DEVICE,
  86. }, {
  87. .virtual = IXP2000_PCI_CSR_VIRT_BASE,
  88. .pfn = __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE),
  89. .length = IXP2000_PCI_CSR_SIZE,
  90. .type = MT_IXP2000_DEVICE,
  91. }, {
  92. .virtual = IXP2000_MSF_VIRT_BASE,
  93. .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE),
  94. .length = IXP2000_MSF_SIZE,
  95. .type = MT_IXP2000_DEVICE,
  96. }, {
  97. .virtual = IXP2000_SCRATCH_RING_VIRT_BASE,
  98. .pfn = __phys_to_pfn(IXP2000_SCRATCH_RING_PHYS_BASE),
  99. .length = IXP2000_SCRATCH_RING_SIZE,
  100. .type = MT_IXP2000_DEVICE,
  101. }, {
  102. .virtual = IXP2000_SRAM0_VIRT_BASE,
  103. .pfn = __phys_to_pfn(IXP2000_SRAM0_PHYS_BASE),
  104. .length = IXP2000_SRAM0_SIZE,
  105. .type = MT_IXP2000_DEVICE,
  106. }, {
  107. .virtual = IXP2000_PCI_IO_VIRT_BASE,
  108. .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE),
  109. .length = IXP2000_PCI_IO_SIZE,
  110. .type = MT_IXP2000_DEVICE,
  111. }, {
  112. .virtual = IXP2000_PCI_CFG0_VIRT_BASE,
  113. .pfn = __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE),
  114. .length = IXP2000_PCI_CFG0_SIZE,
  115. .type = MT_IXP2000_DEVICE,
  116. }, {
  117. .virtual = IXP2000_PCI_CFG1_VIRT_BASE,
  118. .pfn = __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE),
  119. .length = IXP2000_PCI_CFG1_SIZE,
  120. .type = MT_IXP2000_DEVICE,
  121. }
  122. };
  123. void __init ixp2000_map_io(void)
  124. {
  125. /*
  126. * On IXP2400 CPUs we need to use MT_IXP2000_DEVICE so that
  127. * XCB=101 (to avoid triggering erratum #66), and given that
  128. * this mode speeds up I/O accesses and we have write buffer
  129. * flushes in the right places anyway, it doesn't hurt to use
  130. * XCB=101 for all IXP2000s.
  131. */
  132. iotable_init(ixp2000_io_desc, ARRAY_SIZE(ixp2000_io_desc));
  133. /* Set slowport to 8-bit mode. */
  134. ixp2000_reg_wrb(IXP2000_SLOWPORT_FRM, 1);
  135. }
  136. /*************************************************************************
  137. * Serial port support for IXP2000
  138. *************************************************************************/
  139. static struct plat_serial8250_port ixp2000_serial_port[] = {
  140. {
  141. .mapbase = IXP2000_UART_PHYS_BASE,
  142. .membase = (char *)(IXP2000_UART_VIRT_BASE + 3),
  143. .irq = IRQ_IXP2000_UART,
  144. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  145. .iotype = UPIO_MEM,
  146. .regshift = 2,
  147. .uartclk = 50000000,
  148. },
  149. { },
  150. };
  151. static struct resource ixp2000_uart_resource = {
  152. .start = IXP2000_UART_PHYS_BASE,
  153. .end = IXP2000_UART_PHYS_BASE + 0x1f,
  154. .flags = IORESOURCE_MEM,
  155. };
  156. static struct platform_device ixp2000_serial_device = {
  157. .name = "serial8250",
  158. .id = PLAT8250_DEV_PLATFORM,
  159. .dev = {
  160. .platform_data = ixp2000_serial_port,
  161. },
  162. .num_resources = 1,
  163. .resource = &ixp2000_uart_resource,
  164. };
  165. void __init ixp2000_uart_init(void)
  166. {
  167. platform_device_register(&ixp2000_serial_device);
  168. }
  169. /*************************************************************************
  170. * Timer-tick functions for IXP2000
  171. *************************************************************************/
  172. static unsigned ticks_per_jiffy;
  173. static unsigned ticks_per_usec;
  174. static unsigned next_jiffy_time;
  175. static volatile unsigned long *missing_jiffy_timer_csr;
  176. unsigned long ixp2000_gettimeoffset (void)
  177. {
  178. unsigned long offset;
  179. offset = next_jiffy_time - *missing_jiffy_timer_csr;
  180. return offset / ticks_per_usec;
  181. }
  182. static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  183. {
  184. write_seqlock(&xtime_lock);
  185. /* clear timer 1 */
  186. ixp2000_reg_wrb(IXP2000_T1_CLR, 1);
  187. while ((signed long)(next_jiffy_time - *missing_jiffy_timer_csr)
  188. >= ticks_per_jiffy) {
  189. timer_tick(regs);
  190. next_jiffy_time -= ticks_per_jiffy;
  191. }
  192. write_sequnlock(&xtime_lock);
  193. return IRQ_HANDLED;
  194. }
  195. static struct irqaction ixp2000_timer_irq = {
  196. .name = "IXP2000 Timer Tick",
  197. .flags = SA_INTERRUPT | SA_TIMER,
  198. .handler = ixp2000_timer_interrupt,
  199. };
  200. void __init ixp2000_init_time(unsigned long tick_rate)
  201. {
  202. ticks_per_jiffy = (tick_rate + HZ/2) / HZ;
  203. ticks_per_usec = tick_rate / 1000000;
  204. /*
  205. * We use timer 1 as our timer interrupt.
  206. */
  207. ixp2000_reg_write(IXP2000_T1_CLR, 0);
  208. ixp2000_reg_write(IXP2000_T1_CLD, ticks_per_jiffy - 1);
  209. ixp2000_reg_write(IXP2000_T1_CTL, (1 << 7));
  210. /*
  211. * We use a second timer as a monotonic counter for tracking
  212. * missed jiffies. The IXP2000 has four timers, but if we're
  213. * on an A-step IXP2800, timer 2 and 3 don't work, so on those
  214. * chips we use timer 4. Timer 4 is the only timer that can
  215. * be used for the watchdog, so we use timer 2 if we're on a
  216. * non-buggy chip.
  217. */
  218. if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) {
  219. printk(KERN_INFO "Enabling IXP2800 erratum #25 workaround\n");
  220. ixp2000_reg_write(IXP2000_T4_CLR, 0);
  221. ixp2000_reg_write(IXP2000_T4_CLD, -1);
  222. ixp2000_reg_wrb(IXP2000_T4_CTL, (1 << 7));
  223. missing_jiffy_timer_csr = IXP2000_T4_CSR;
  224. } else {
  225. ixp2000_reg_write(IXP2000_T2_CLR, 0);
  226. ixp2000_reg_write(IXP2000_T2_CLD, -1);
  227. ixp2000_reg_wrb(IXP2000_T2_CTL, (1 << 7));
  228. missing_jiffy_timer_csr = IXP2000_T2_CSR;
  229. }
  230. next_jiffy_time = 0xffffffff;
  231. /* register for interrupt */
  232. setup_irq(IRQ_IXP2000_TIMER1, &ixp2000_timer_irq);
  233. }
  234. /*************************************************************************
  235. * GPIO helpers
  236. *************************************************************************/
  237. static unsigned long GPIO_IRQ_falling_edge;
  238. static unsigned long GPIO_IRQ_rising_edge;
  239. static unsigned long GPIO_IRQ_level_low;
  240. static unsigned long GPIO_IRQ_level_high;
  241. static void update_gpio_int_csrs(void)
  242. {
  243. ixp2000_reg_write(IXP2000_GPIO_FEDR, GPIO_IRQ_falling_edge);
  244. ixp2000_reg_write(IXP2000_GPIO_REDR, GPIO_IRQ_rising_edge);
  245. ixp2000_reg_write(IXP2000_GPIO_LSLR, GPIO_IRQ_level_low);
  246. ixp2000_reg_wrb(IXP2000_GPIO_LSHR, GPIO_IRQ_level_high);
  247. }
  248. void gpio_line_config(int line, int direction)
  249. {
  250. unsigned long flags;
  251. local_irq_save(flags);
  252. if (direction == GPIO_OUT) {
  253. /* if it's an output, it ain't an interrupt anymore */
  254. GPIO_IRQ_falling_edge &= ~(1 << line);
  255. GPIO_IRQ_rising_edge &= ~(1 << line);
  256. GPIO_IRQ_level_low &= ~(1 << line);
  257. GPIO_IRQ_level_high &= ~(1 << line);
  258. update_gpio_int_csrs();
  259. ixp2000_reg_wrb(IXP2000_GPIO_PDSR, 1 << line);
  260. } else if (direction == GPIO_IN) {
  261. ixp2000_reg_wrb(IXP2000_GPIO_PDCR, 1 << line);
  262. }
  263. local_irq_restore(flags);
  264. }
  265. EXPORT_SYMBOL(gpio_line_config);
  266. /*************************************************************************
  267. * IRQ handling IXP2000
  268. *************************************************************************/
  269. static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
  270. {
  271. int i;
  272. unsigned long status = *IXP2000_GPIO_INST;
  273. for (i = 0; i <= 7; i++) {
  274. if (status & (1<<i)) {
  275. desc = irq_desc + i + IRQ_IXP2000_GPIO0;
  276. desc_handle_irq(i + IRQ_IXP2000_GPIO0, desc, regs);
  277. }
  278. }
  279. }
  280. static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type)
  281. {
  282. int line = irq - IRQ_IXP2000_GPIO0;
  283. /*
  284. * First, configure this GPIO line as an input.
  285. */
  286. ixp2000_reg_write(IXP2000_GPIO_PDCR, 1 << line);
  287. /*
  288. * Then, set the proper trigger type.
  289. */
  290. if (type & IRQT_FALLING)
  291. GPIO_IRQ_falling_edge |= 1 << line;
  292. else
  293. GPIO_IRQ_falling_edge &= ~(1 << line);
  294. if (type & IRQT_RISING)
  295. GPIO_IRQ_rising_edge |= 1 << line;
  296. else
  297. GPIO_IRQ_rising_edge &= ~(1 << line);
  298. if (type & IRQT_LOW)
  299. GPIO_IRQ_level_low |= 1 << line;
  300. else
  301. GPIO_IRQ_level_low &= ~(1 << line);
  302. if (type & IRQT_HIGH)
  303. GPIO_IRQ_level_high |= 1 << line;
  304. else
  305. GPIO_IRQ_level_high &= ~(1 << line);
  306. update_gpio_int_csrs();
  307. return 0;
  308. }
  309. static void ixp2000_GPIO_irq_mask_ack(unsigned int irq)
  310. {
  311. ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0)));
  312. ixp2000_reg_write(IXP2000_GPIO_EDSR, (1 << (irq - IRQ_IXP2000_GPIO0)));
  313. ixp2000_reg_write(IXP2000_GPIO_LDSR, (1 << (irq - IRQ_IXP2000_GPIO0)));
  314. ixp2000_reg_wrb(IXP2000_GPIO_INST, (1 << (irq - IRQ_IXP2000_GPIO0)));
  315. }
  316. static void ixp2000_GPIO_irq_mask(unsigned int irq)
  317. {
  318. ixp2000_reg_wrb(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0)));
  319. }
  320. static void ixp2000_GPIO_irq_unmask(unsigned int irq)
  321. {
  322. ixp2000_reg_write(IXP2000_GPIO_INSR, (1 << (irq - IRQ_IXP2000_GPIO0)));
  323. }
  324. static struct irqchip ixp2000_GPIO_irq_chip = {
  325. .ack = ixp2000_GPIO_irq_mask_ack,
  326. .mask = ixp2000_GPIO_irq_mask,
  327. .unmask = ixp2000_GPIO_irq_unmask,
  328. .set_type = ixp2000_GPIO_irq_type,
  329. };
  330. static void ixp2000_pci_irq_mask(unsigned int irq)
  331. {
  332. unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE;
  333. if (irq == IRQ_IXP2000_PCIA)
  334. ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 26)));
  335. else if (irq == IRQ_IXP2000_PCIB)
  336. ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 27)));
  337. }
  338. static void ixp2000_pci_irq_unmask(unsigned int irq)
  339. {
  340. unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE;
  341. if (irq == IRQ_IXP2000_PCIA)
  342. ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 26)));
  343. else if (irq == IRQ_IXP2000_PCIB)
  344. ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27)));
  345. }
  346. /*
  347. * Error interrupts. These are used extensively by the microengine drivers
  348. */
  349. static void ixp2000_err_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
  350. {
  351. int i;
  352. unsigned long status = *IXP2000_IRQ_ERR_STATUS;
  353. for(i = 31; i >= 0; i--) {
  354. if(status & (1 << i)) {
  355. desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i;
  356. desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs);
  357. }
  358. }
  359. }
  360. static void ixp2000_err_irq_mask(unsigned int irq)
  361. {
  362. ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR,
  363. (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)));
  364. }
  365. static void ixp2000_err_irq_unmask(unsigned int irq)
  366. {
  367. ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET,
  368. (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)));
  369. }
  370. static struct irqchip ixp2000_err_irq_chip = {
  371. .ack = ixp2000_err_irq_mask,
  372. .mask = ixp2000_err_irq_mask,
  373. .unmask = ixp2000_err_irq_unmask
  374. };
  375. static struct irqchip ixp2000_pci_irq_chip = {
  376. .ack = ixp2000_pci_irq_mask,
  377. .mask = ixp2000_pci_irq_mask,
  378. .unmask = ixp2000_pci_irq_unmask
  379. };
  380. static void ixp2000_irq_mask(unsigned int irq)
  381. {
  382. ixp2000_reg_wrb(IXP2000_IRQ_ENABLE_CLR, (1 << irq));
  383. }
  384. static void ixp2000_irq_unmask(unsigned int irq)
  385. {
  386. ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << irq));
  387. }
  388. static struct irqchip ixp2000_irq_chip = {
  389. .ack = ixp2000_irq_mask,
  390. .mask = ixp2000_irq_mask,
  391. .unmask = ixp2000_irq_unmask
  392. };
  393. void __init ixp2000_init_irq(void)
  394. {
  395. int irq;
  396. /*
  397. * Mask all sources
  398. */
  399. ixp2000_reg_write(IXP2000_IRQ_ENABLE_CLR, 0xffffffff);
  400. ixp2000_reg_write(IXP2000_FIQ_ENABLE_CLR, 0xffffffff);
  401. /* clear all GPIO edge/level detects */
  402. ixp2000_reg_write(IXP2000_GPIO_REDR, 0);
  403. ixp2000_reg_write(IXP2000_GPIO_FEDR, 0);
  404. ixp2000_reg_write(IXP2000_GPIO_LSHR, 0);
  405. ixp2000_reg_write(IXP2000_GPIO_LSLR, 0);
  406. ixp2000_reg_write(IXP2000_GPIO_INCR, -1);
  407. /* clear PCI interrupt sources */
  408. ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, 0);
  409. /*
  410. * Certain bits in the IRQ status register of the
  411. * IXP2000 are reserved. Instead of trying to map
  412. * things non 1:1 from bit position to IRQ number,
  413. * we mark the reserved IRQs as invalid. This makes
  414. * our mask/unmask code much simpler.
  415. */
  416. for (irq = IRQ_IXP2000_SOFT_INT; irq <= IRQ_IXP2000_THDB3; irq++) {
  417. if ((1 << irq) & IXP2000_VALID_IRQ_MASK) {
  418. set_irq_chip(irq, &ixp2000_irq_chip);
  419. set_irq_handler(irq, do_level_IRQ);
  420. set_irq_flags(irq, IRQF_VALID);
  421. } else set_irq_flags(irq, 0);
  422. }
  423. for (irq = IRQ_IXP2000_DRAM0_MIN_ERR; irq <= IRQ_IXP2000_SP_INT; irq++) {
  424. if((1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)) &
  425. IXP2000_VALID_ERR_IRQ_MASK) {
  426. set_irq_chip(irq, &ixp2000_err_irq_chip);
  427. set_irq_handler(irq, do_level_IRQ);
  428. set_irq_flags(irq, IRQF_VALID);
  429. }
  430. else
  431. set_irq_flags(irq, 0);
  432. }
  433. set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler);
  434. for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) {
  435. set_irq_chip(irq, &ixp2000_GPIO_irq_chip);
  436. set_irq_handler(irq, do_level_IRQ);
  437. set_irq_flags(irq, IRQF_VALID);
  438. }
  439. set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler);
  440. /*
  441. * Enable PCI irqs. The actual PCI[AB] decoding is done in
  442. * entry-macro.S, so we don't need a chained handler for the
  443. * PCI interrupt source.
  444. */
  445. ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << IRQ_IXP2000_PCI));
  446. for (irq = IRQ_IXP2000_PCIA; irq <= IRQ_IXP2000_PCIB; irq++) {
  447. set_irq_chip(irq, &ixp2000_pci_irq_chip);
  448. set_irq_handler(irq, do_level_IRQ);
  449. set_irq_flags(irq, IRQF_VALID);
  450. }
  451. }