setup.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * arch/sh/boards/dreamcast/setup.c
  3. *
  4. * Hardware support for the Sega Dreamcast.
  5. *
  6. * Copyright (c) 2001, 2002 M. R. Brown <mrbrown@linuxdc.org>
  7. * Copyright (c) 2002, 2003, 2004 Paul Mundt <lethal@linux-sh.org>
  8. *
  9. * This file is part of the LinuxDC project (www.linuxdc.org)
  10. *
  11. * Released under the terms of the GNU GPL v2.0.
  12. *
  13. * This file originally bore the message (with enclosed-$):
  14. * Id: setup_dc.c,v 1.5 2001/05/24 05:09:16 mrbrown Exp
  15. * SEGA Dreamcast support
  16. */
  17. #include <linux/sched.h>
  18. #include <linux/kernel.h>
  19. #include <linux/param.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/init.h>
  22. #include <linux/irq.h>
  23. #include <linux/device.h>
  24. #include <asm/io.h>
  25. #include <asm/irq.h>
  26. #include <asm/rtc.h>
  27. #include <asm/machvec.h>
  28. #include <asm/mach/sysasic.h>
  29. extern struct hw_interrupt_type systemasic_int;
  30. extern void aica_time_init(void);
  31. extern int gapspci_init(void);
  32. extern int systemasic_irq_demux(int);
  33. void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t);
  34. int dreamcast_consistent_free(struct device *, size_t, void *, dma_addr_t);
  35. static void __init dreamcast_setup(char **cmdline_p)
  36. {
  37. int i;
  38. /* Mask all hardware events */
  39. /* XXX */
  40. /* Acknowledge any previous events */
  41. /* XXX */
  42. __set_io_port_base(0xa0000000);
  43. /* Assign all virtual IRQs to the System ASIC int. handler */
  44. for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
  45. irq_desc[i].chip = &systemasic_int;
  46. board_time_init = aica_time_init;
  47. #ifdef CONFIG_PCI
  48. if (gapspci_init() < 0)
  49. printk(KERN_WARNING "GAPSPCI was not detected.\n");
  50. #endif
  51. }
  52. static struct sh_machine_vector mv_dreamcast __initmv = {
  53. .mv_name = "Sega Dreamcast",
  54. .mv_setup = dreamcast_setup,
  55. .mv_irq_demux = systemasic_irq_demux,
  56. #ifdef CONFIG_PCI
  57. .mv_consistent_alloc = dreamcast_consistent_alloc,
  58. .mv_consistent_free = dreamcast_consistent_free,
  59. #endif
  60. };