interrupts.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * (C) Copyright 2000-2002
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. * Rob Taylor, Flying Pig Systems. robt@flyingpig.com
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <common.h>
  9. #include <mpc824x.h>
  10. #include <asm/processor.h>
  11. #include <asm/pci_io.h>
  12. #include <commproc.h>
  13. #include "drivers/epic.h"
  14. int interrupt_init_cpu (unsigned *decrementer_count)
  15. {
  16. *decrementer_count = (get_bus_freq (0) / 4) / CONFIG_SYS_HZ;
  17. /*
  18. * It's all broken at the moment and I currently don't need
  19. * interrupts. If you want to fix it, have a look at the epic
  20. * drivers in dink32 v12. They do everthing and Motorola said
  21. * I could use the dink source in this project as long as
  22. * copyright notices remain intact.
  23. */
  24. epicInit (EPIC_DIRECT_IRQ, 0);
  25. /* EPIC won't generate INT unless Current Task Pri < 15 */
  26. epicCurTaskPrioSet(0);
  27. return (0);
  28. }
  29. /****************************************************************************/
  30. /*
  31. * Handle external interrupts
  32. */
  33. void external_interrupt (struct pt_regs *regs)
  34. {
  35. register unsigned long temp;
  36. pci_readl (CONFIG_SYS_EUMB_ADDR + EPIC_PROC_INT_ACK_REG, temp);
  37. sync (); /* i'm not convinced this is needed, but dink source has it */
  38. temp &= 0xff; /*get vector */
  39. /*TODO: handle them -... */
  40. epicEOI ();
  41. }
  42. /****************************************************************************/
  43. /*
  44. * blank int handlers.
  45. */
  46. void
  47. irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
  48. {
  49. }
  50. void irq_free_handler (int vec)
  51. {
  52. }
  53. /*TODO: some handlers for winbond and 87308 interrupts
  54. and what about generic pci inteerupts?
  55. vga?
  56. */
  57. void timer_interrupt_cpu (struct pt_regs *regs)
  58. {
  59. /* nothing to do here */
  60. return;
  61. }