setup.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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/config.h>
  23. #include <linux/sched.h>
  24. #include <linux/module.h>
  25. #include <linux/kernel.h>
  26. #include <linux/param.h>
  27. #include <linux/ioport.h>
  28. #include <linux/interrupt.h>
  29. #include <linux/init.h>
  30. #include <linux/irq.h>
  31. #include <linux/bitops.h>
  32. #include <asm/io.h>
  33. #include <asm/irq.h>
  34. #include <asm/machvec.h>
  35. #include <asm/bigsur/io.h>
  36. #include <asm/hd64465/hd64465.h>
  37. #include <asm/bigsur/bigsur.h>
  38. /*===========================================================*/
  39. // Big Sur Init Routines
  40. /*===========================================================*/
  41. const char *get_system_type(void)
  42. {
  43. return "Big Sur";
  44. }
  45. /*
  46. * The Machine Vector
  47. */
  48. extern void heartbeat_bigsur(void);
  49. extern void init_bigsur_IRQ(void);
  50. struct sh_machine_vector mv_bigsur __initmv = {
  51. .mv_nr_irqs = NR_IRQS, // Defined in <asm/irq.h>
  52. .mv_isa_port2addr = bigsur_isa_port2addr,
  53. .mv_irq_demux = bigsur_irq_demux,
  54. .mv_init_irq = init_bigsur_IRQ,
  55. #ifdef CONFIG_HEARTBEAT
  56. .mv_heartbeat = heartbeat_bigsur,
  57. #endif
  58. };
  59. ALIAS_MV(bigsur)
  60. int __init platform_setup(void)
  61. {
  62. /* Mask all 2nd level IRQ's */
  63. outb(-1,BIGSUR_IMR0);
  64. outb(-1,BIGSUR_IMR1);
  65. outb(-1,BIGSUR_IMR2);
  66. outb(-1,BIGSUR_IMR3);
  67. /* Mask 1st level interrupts */
  68. outb(-1,BIGSUR_IRLMR0);
  69. outb(-1,BIGSUR_IRLMR1);
  70. #if defined (CONFIG_HD64465) && defined (CONFIG_SERIAL)
  71. /* remap IO ports for first ISA serial port to HD64465 UART */
  72. bigsur_port_map(0x3f8, 8, CONFIG_HD64465_IOBASE + 0x8000, 1);
  73. #endif /* CONFIG_HD64465 && CONFIG_SERIAL */
  74. /* TODO: setup IDE registers */
  75. bigsur_port_map(BIGSUR_IDECTL_IOPORT, 2, BIGSUR_ICTL, 8);
  76. /* Setup the Ethernet port to BIGSUR_ETHER_IOPORT */
  77. bigsur_port_map(BIGSUR_ETHER_IOPORT, 16, BIGSUR_ETHR+BIGSUR_ETHER_IOPORT, 0);
  78. /* set page to 1 */
  79. outw(1, BIGSUR_ETHR+0xe);
  80. /* set the IO port to BIGSUR_ETHER_IOPORT */
  81. outw(BIGSUR_ETHER_IOPORT<<3, BIGSUR_ETHR+0x2);
  82. return 0;
  83. }