interrupts.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * (C) Copyright 2001
  3. * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /*
  8. * interrupts.c - just enough support for the decrementer/timer
  9. */
  10. #include <common.h>
  11. #include <mpc8xx.h>
  12. #include <mpc8xx_irq.h>
  13. #include <asm/processor.h>
  14. #include <commproc.h>
  15. #include <command.h>
  16. int interrupt_init_cpu (unsigned *decrementer_count)
  17. {
  18. debug("interrupt_init: GT main cause reg: %08x:%08x\n",
  19. GTREGREAD(LOW_INTERRUPT_CAUSE_REGISTER),
  20. GTREGREAD(HIGH_INTERRUPT_CAUSE_REGISTER));
  21. debug("interrupt_init: ethernet cause regs: %08x %08x %08x\n",
  22. GTREGREAD(ETHERNET0_INTERRUPT_CAUSE_REGISTER),
  23. GTREGREAD(ETHERNET1_INTERRUPT_CAUSE_REGISTER),
  24. GTREGREAD(ETHERNET2_INTERRUPT_CAUSE_REGISTER));
  25. debug("interrupt_init: ethernet mask regs: %08x %08x %08x\n",
  26. GTREGREAD(ETHERNET0_INTERRUPT_MASK_REGISTER),
  27. GTREGREAD(ETHERNET1_INTERRUPT_MASK_REGISTER),
  28. GTREGREAD(ETHERNET2_INTERRUPT_MASK_REGISTER));
  29. debug("interrupt_init: setting decrementer_count\n");
  30. *decrementer_count = get_tbclk() / CONFIG_SYS_HZ;
  31. return (0);
  32. }
  33. /****************************************************************************/
  34. /*
  35. * Handle external interrupts
  36. */
  37. void
  38. external_interrupt(struct pt_regs *regs)
  39. {
  40. puts("external_interrupt (oops!)\n");
  41. }
  42. volatile ulong timestamp = 0;
  43. /*
  44. * timer_interrupt - gets called when the decrementer overflows,
  45. * with interrupts disabled.
  46. * Trivial implementation - no need to be really accurate.
  47. */
  48. void
  49. timer_interrupt_cpu (struct pt_regs *regs)
  50. {
  51. /* nothing to do here */
  52. return;
  53. }
  54. /****************************************************************************/
  55. /*
  56. * Install and free a interrupt handler.
  57. */
  58. void
  59. irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
  60. {
  61. }
  62. void
  63. irq_free_handler(int vec)
  64. {
  65. }
  66. /****************************************************************************/
  67. void
  68. do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char * const argv[])
  69. {
  70. puts("IRQ related functions are unimplemented currently.\n");
  71. }