unit-init.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* ASB2303 initialisation
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/param.h>
  13. #include <linux/init.h>
  14. #include <linux/device.h>
  15. #include <asm/io.h>
  16. #include <asm/setup.h>
  17. #include <asm/processor.h>
  18. #include <asm/irq.h>
  19. #include <asm/intctl-regs.h>
  20. /*
  21. * initialise some of the unit hardware before gdbstub is set up
  22. */
  23. asmlinkage void __init unit_init(void)
  24. {
  25. /* set up the external interrupts */
  26. SET_XIRQ_TRIGGER(0, XIRQ_TRIGGER_HILEVEL);
  27. SET_XIRQ_TRIGGER(2, XIRQ_TRIGGER_LOWLEVEL);
  28. SET_XIRQ_TRIGGER(3, XIRQ_TRIGGER_HILEVEL);
  29. SET_XIRQ_TRIGGER(4, XIRQ_TRIGGER_LOWLEVEL);
  30. SET_XIRQ_TRIGGER(5, XIRQ_TRIGGER_LOWLEVEL);
  31. }
  32. /*
  33. * initialise the rest of the unit hardware after gdbstub is ready
  34. */
  35. void __init unit_setup(void)
  36. {
  37. }
  38. /*
  39. * initialise the external interrupts used by a unit of this type
  40. */
  41. void __init unit_init_IRQ(void)
  42. {
  43. unsigned int extnum;
  44. for (extnum = 0; extnum < NR_XIRQS; extnum++) {
  45. switch (GET_XIRQ_TRIGGER(extnum)) {
  46. case XIRQ_TRIGGER_HILEVEL:
  47. case XIRQ_TRIGGER_LOWLEVEL:
  48. set_intr_postackable(XIRQ2IRQ(extnum));
  49. break;
  50. default:
  51. break;
  52. }
  53. }
  54. }