me2.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * arch/v850/kernel/me2.c -- V850E/ME2 chip-specific support
  3. *
  4. * Copyright (C) 2003 NEC Corporation
  5. * Copyright (C) 2003 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. /* Start hardware timer. */
  27. v850e_timer_d_configure (0, HZ);
  28. /* Install timer interrupt handler. */
  29. setup_irq (IRQ_INTCMD(0), timer_action);
  30. }
  31. static struct v850e_intc_irq_init irq_inits[] = {
  32. { "IRQ", 0, NUM_CPU_IRQS, 1, 7 },
  33. { "INTP", IRQ_INTP(0), IRQ_INTP_NUM, 1, 5 },
  34. { "CMD", IRQ_INTCMD(0), IRQ_INTCMD_NUM, 1, 3 },
  35. { "UBTIRE", IRQ_INTUBTIRE(0), IRQ_INTUBTIRE_NUM, 5, 4 },
  36. { "UBTIR", IRQ_INTUBTIR(0), IRQ_INTUBTIR_NUM, 5, 4 },
  37. { "UBTIT", IRQ_INTUBTIT(0), IRQ_INTUBTIT_NUM, 5, 4 },
  38. { "UBTIF", IRQ_INTUBTIF(0), IRQ_INTUBTIF_NUM, 5, 4 },
  39. { "UBTITO", IRQ_INTUBTITO(0), IRQ_INTUBTITO_NUM, 5, 4 },
  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 V850E/ME2 chip interrupts. */
  45. void __init me2_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 me2_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
  51. {
  52. if (chan == 0) {
  53. /* Specify that the relevent pins on the chip should do
  54. serial I/O, not direct I/O. */
  55. ME2_PORT1_PMC |= 0xC;
  56. /* Specify that we're using the UART, not the CSI device. */
  57. ME2_PORT1_PFC |= 0xC;
  58. } else if (chan == 1) {
  59. /* Specify that the relevent pins on the chip should do
  60. serial I/O, not direct I/O. */
  61. ME2_PORT2_PMC |= 0x6;
  62. /* Specify that we're using the UART, not the CSI device. */
  63. ME2_PORT2_PFC |= 0x6;
  64. }
  65. }