core.c 15 KB

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