unit-init.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* ASB2305 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/pci.h>
  15. #include <asm/io.h>
  16. #include <asm/setup.h>
  17. #include <asm/processor.h>
  18. #include <asm/cpu/intctl-regs.h>
  19. #include <asm/cpu/rtc-regs.h>
  20. #include <asm/cpu/serial-regs.h>
  21. #include <asm/unit/serial.h>
  22. /*
  23. * initialise some of the unit hardware before gdbstub is set up
  24. */
  25. asmlinkage void __init unit_init(void)
  26. {
  27. #ifndef CONFIG_GDBSTUB_ON_TTYSx
  28. /* set the 16550 interrupt line to level 3 if not being used for GDB */
  29. set_intr_level(XIRQ0, GxICR_LEVEL_3);
  30. #endif
  31. }
  32. /*
  33. * initialise the rest of the unit hardware after gdbstub is ready
  34. */
  35. void __init unit_setup(void)
  36. {
  37. #ifdef CONFIG_PCI
  38. unit_pci_init();
  39. #endif
  40. }
  41. /*
  42. * initialise the external interrupts used by a unit of this type
  43. */
  44. void __init unit_init_IRQ(void)
  45. {
  46. unsigned int extnum;
  47. for (extnum = 0; extnum < NR_XIRQS; extnum++) {
  48. switch (GET_XIRQ_TRIGGER(extnum)) {
  49. case XIRQ_TRIGGER_HILEVEL:
  50. case XIRQ_TRIGGER_LOWLEVEL:
  51. set_intr_postackable(XIRQ2IRQ(extnum));
  52. break;
  53. default:
  54. break;
  55. }
  56. }
  57. }