ma.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * arch/v850/kernel/ma.c -- V850E/MA series of cpu chips
  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/config.h>
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/mm.h>
  17. #include <linux/swap.h>
  18. #include <linux/bootmem.h>
  19. #include <linux/irq.h>
  20. #include <asm/atomic.h>
  21. #include <asm/page.h>
  22. #include <asm/machdep.h>
  23. #include <asm/v850e_timer_d.h>
  24. #include "mach.h"
  25. void __init mach_sched_init (struct irqaction *timer_action)
  26. {
  27. /* Start hardware timer. */
  28. v850e_timer_d_configure (0, HZ);
  29. /* Install timer interrupt handler. */
  30. setup_irq (IRQ_INTCMD(0), timer_action);
  31. }
  32. static struct v850e_intc_irq_init irq_inits[] = {
  33. { "IRQ", 0, NUM_MACH_IRQS, 1, 7 },
  34. { "CMD", IRQ_INTCMD(0), IRQ_INTCMD_NUM, 1, 5 },
  35. { "DMA", IRQ_INTDMA(0), IRQ_INTDMA_NUM, 1, 2 },
  36. { "CSI", IRQ_INTCSI(0), IRQ_INTCSI_NUM, 4, 4 },
  37. { "SER", IRQ_INTSER(0), IRQ_INTSER_NUM, 4, 3 },
  38. { "SR", IRQ_INTSR(0), IRQ_INTSR_NUM, 4, 4 },
  39. { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 4, 5 },
  40. { 0 }
  41. };
  42. #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
  43. static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];
  44. /* Initialize MA chip interrupts. */
  45. void __init ma_init_irqs (void)
  46. {
  47. v850e_intc_init_irq_types (irq_inits, hw_itypes);
  48. }
  49. /* Called before configuring an on-chip UART. */
  50. void ma_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
  51. {
  52. /* We only know about the first two UART channels (though
  53. specific chips may have more). */
  54. if (chan < 2) {
  55. unsigned bits = 0x3 << (chan * 3);
  56. /* Specify that the relevant pins on the chip should do
  57. serial I/O, not direct I/O. */
  58. MA_PORT4_PMC |= bits;
  59. /* Specify that we're using the UART, not the CSI device. */
  60. MA_PORT4_PFC |= bits;
  61. }
  62. }