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