setup.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. *
  3. * By Dustin McIntire (dustin@sensoria.com) (c)2001
  4. *
  5. * Setup and IRQ handling code for the HD64465 companion chip.
  6. * by Greg Banks <gbanks@pocketpenguins.com>
  7. * Copyright (c) 2000 PocketPenguins Inc
  8. *
  9. * Derived from setup_hd64465.c which bore the message:
  10. * Greg Banks <gbanks@pocketpenguins.com>
  11. * Copyright (c) 2000 PocketPenguins Inc and
  12. * Copyright (C) 2000 YAEGASHI Takeshi
  13. * and setup_cqreek.c which bore message:
  14. * Copyright (C) 2000 Niibe Yutaka
  15. *
  16. * May be copied or modified under the terms of the GNU General Public
  17. * License. See linux/COPYING for more information.
  18. *
  19. * Setup functions for a Hitachi Big Sur Evaluation Board.
  20. *
  21. */
  22. #include <linux/sched.h>
  23. #include <linux/module.h>
  24. #include <linux/kernel.h>
  25. #include <linux/param.h>
  26. #include <linux/ioport.h>
  27. #include <linux/interrupt.h>
  28. #include <linux/init.h>
  29. #include <linux/irq.h>
  30. #include <linux/bitops.h>
  31. #include <asm/io.h>
  32. #include <asm/irq.h>
  33. #include <asm/machvec.h>
  34. #include <asm/bigsur/io.h>
  35. #include <asm/hd64465/hd64465.h>
  36. #include <asm/bigsur/bigsur.h>
  37. /*===========================================================*/
  38. // Big Sur Init Routines
  39. /*===========================================================*/
  40. static void __init bigsur_setup(char **cmdline_p)
  41. {
  42. /* Mask all 2nd level IRQ's */
  43. outb(-1,BIGSUR_IMR0);
  44. outb(-1,BIGSUR_IMR1);
  45. outb(-1,BIGSUR_IMR2);
  46. outb(-1,BIGSUR_IMR3);
  47. /* Mask 1st level interrupts */
  48. outb(-1,BIGSUR_IRLMR0);
  49. outb(-1,BIGSUR_IRLMR1);
  50. #if defined (CONFIG_HD64465) && defined (CONFIG_SERIAL)
  51. /* remap IO ports for first ISA serial port to HD64465 UART */
  52. bigsur_port_map(0x3f8, 8, CONFIG_HD64465_IOBASE + 0x8000, 1);
  53. #endif /* CONFIG_HD64465 && CONFIG_SERIAL */
  54. /* TODO: setup IDE registers */
  55. bigsur_port_map(BIGSUR_IDECTL_IOPORT, 2, BIGSUR_ICTL, 8);
  56. /* Setup the Ethernet port to BIGSUR_ETHER_IOPORT */
  57. bigsur_port_map(BIGSUR_ETHER_IOPORT, 16, BIGSUR_ETHR+BIGSUR_ETHER_IOPORT, 0);
  58. /* set page to 1 */
  59. outw(1, BIGSUR_ETHR+0xe);
  60. /* set the IO port to BIGSUR_ETHER_IOPORT */
  61. outw(BIGSUR_ETHER_IOPORT<<3, BIGSUR_ETHR+0x2);
  62. }
  63. /*
  64. * The Machine Vector
  65. */
  66. extern void heartbeat_bigsur(void);
  67. extern void init_bigsur_IRQ(void);
  68. struct sh_machine_vector mv_bigsur __initmv = {
  69. .mv_name = "Big Sur",
  70. .mv_setup = bigsur_setup,
  71. .mv_isa_port2addr = bigsur_isa_port2addr,
  72. .mv_irq_demux = bigsur_irq_demux,
  73. .mv_init_irq = init_bigsur_IRQ,
  74. #ifdef CONFIG_HEARTBEAT
  75. .mv_heartbeat = heartbeat_bigsur,
  76. #endif
  77. };
  78. ALIAS_MV(bigsur)