me2.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/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_CPU_IRQS, 1, 7 },
  34. { "INTP", IRQ_INTP(0), IRQ_INTP_NUM, 1, 5 },
  35. { "CMD", IRQ_INTCMD(0), IRQ_INTCMD_NUM, 1, 3 },
  36. { "UBTIRE", IRQ_INTUBTIRE(0), IRQ_INTUBTIRE_NUM, 5, 4 },
  37. { "UBTIR", IRQ_INTUBTIR(0), IRQ_INTUBTIR_NUM, 5, 4 },
  38. { "UBTIT", IRQ_INTUBTIT(0), IRQ_INTUBTIT_NUM, 5, 4 },
  39. { "UBTIF", IRQ_INTUBTIF(0), IRQ_INTUBTIF_NUM, 5, 4 },
  40. { "UBTITO", IRQ_INTUBTITO(0), IRQ_INTUBTITO_NUM, 5, 4 },
  41. { 0 }
  42. };
  43. #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
  44. static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];
  45. /* Initialize V850E/ME2 chip interrupts. */
  46. void __init me2_init_irqs (void)
  47. {
  48. v850e_intc_init_irq_types (irq_inits, hw_itypes);
  49. }
  50. /* Called before configuring an on-chip UART. */
  51. void me2_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
  52. {
  53. if (chan == 0) {
  54. /* Specify that the relevent pins on the chip should do
  55. serial I/O, not direct I/O. */
  56. ME2_PORT1_PMC |= 0xC;
  57. /* Specify that we're using the UART, not the CSI device. */
  58. ME2_PORT1_PFC |= 0xC;
  59. } else if (chan == 1) {
  60. /* Specify that the relevent pins on the chip should do
  61. serial I/O, not direct I/O. */
  62. ME2_PORT2_PMC |= 0x6;
  63. /* Specify that we're using the UART, not the CSI device. */
  64. ME2_PORT2_PFC |= 0x6;
  65. }
  66. }