teg.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * arch/v850/kernel/teg.c -- NB85E-TEG cpu chip
  3. *
  4. * Copyright (C) 2001,02,03 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/mm.h>
  16. #include <linux/swap.h>
  17. #include <linux/bootmem.h>
  18. #include <linux/irq.h>
  19. #include <asm/atomic.h>
  20. #include <asm/page.h>
  21. #include <asm/machdep.h>
  22. #include <asm/v850e_timer_d.h>
  23. #include "mach.h"
  24. void __init mach_sched_init (struct irqaction *timer_action)
  25. {
  26. /* Select timer interrupt instead of external pin. */
  27. TEG_ISS |= 0x1;
  28. /* Start hardware timer. */
  29. v850e_timer_d_configure (0, HZ);
  30. /* Install timer interrupt handler. */
  31. setup_irq (IRQ_INTCMD(0), timer_action);
  32. }
  33. static struct v850e_intc_irq_init irq_inits[] = {
  34. { "IRQ", 0, NUM_CPU_IRQS, 1, 7 },
  35. { "CMD", IRQ_INTCMD(0), IRQ_INTCMD_NUM, 1, 5 },
  36. { "SER", IRQ_INTSER(0), IRQ_INTSER_NUM, 1, 3 },
  37. { "SR", IRQ_INTSR(0), IRQ_INTSR_NUM, 1, 4 },
  38. { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 1, 5 },
  39. { 0 }
  40. };
  41. #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
  42. static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];
  43. /* Initialize MA chip interrupts. */
  44. void __init teg_init_irqs (void)
  45. {
  46. v850e_intc_init_irq_types (irq_inits, hw_itypes);
  47. }
  48. /* Called before configuring an on-chip UART. */
  49. void teg_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
  50. {
  51. /* Enable UART I/O pins instead of external interrupt pins, and
  52. UART interrupts instead of external pin interrupts. */
  53. TEG_ISS |= 0x4E;
  54. }