interrupts.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #include <common.h>
  25. #include <mpc824x.h>
  26. #include <asm/processor.h>
  27. #include <asm/pci_io.h>
  28. #include <commproc.h>
  29. #include "drivers/epic.h"
  30. int interrupt_init_cpu (unsigned *decrementer_count)
  31. {
  32. *decrementer_count = (get_bus_freq (0) / 4) / CONFIG_SYS_HZ;
  33. /*
  34. * It's all broken at the moment and I currently don't need
  35. * interrupts. If you want to fix it, have a look at the epic
  36. * drivers in dink32 v12. They do everthing and Motorola said
  37. * I could use the dink source in this project as long as
  38. * copyright notices remain intact.
  39. */
  40. epicInit (EPIC_DIRECT_IRQ, 0);
  41. /* EPIC won't generate INT unless Current Task Pri < 15 */
  42. epicCurTaskPrioSet(0);
  43. return (0);
  44. }
  45. /****************************************************************************/
  46. /*
  47. * Handle external interrupts
  48. */
  49. void external_interrupt (struct pt_regs *regs)
  50. {
  51. register unsigned long temp;
  52. pci_readl (CONFIG_SYS_EUMB_ADDR + EPIC_PROC_INT_ACK_REG, temp);
  53. sync (); /* i'm not convinced this is needed, but dink source has it */
  54. temp &= 0xff; /*get vector */
  55. /*TODO: handle them -... */
  56. epicEOI ();
  57. }
  58. /****************************************************************************/
  59. /*
  60. * blank int handlers.
  61. */
  62. void
  63. irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
  64. {
  65. }
  66. void irq_free_handler (int vec)
  67. {
  68. }
  69. /*TODO: some handlers for winbond and 87308 interrupts
  70. and what about generic pci inteerupts?
  71. vga?
  72. */
  73. void timer_interrupt_cpu (struct pt_regs *regs)
  74. {
  75. /* nothing to do here */
  76. return;
  77. }