setup.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * linux/arch/sh/kernel/setup_hs7751rvoip.c
  3. *
  4. * Copyright (C) 2000 Kazumoto Kojima
  5. *
  6. * Renesas Technology Sales HS7751RVoIP Support.
  7. *
  8. * Modified for HS7751RVoIP by
  9. * Atom Create Engineering Co., Ltd. 2002.
  10. * Lineo uSolutions, Inc. 2003.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/irq.h>
  14. #include <linux/mm.h>
  15. #include <linux/vmalloc.h>
  16. #include <linux/hdreg.h>
  17. #include <linux/ide.h>
  18. #include <linux/pm.h>
  19. #include <asm/hs7751rvoip/hs7751rvoip.h>
  20. #include <asm/hs7751rvoip/io.h>
  21. #include <asm/io.h>
  22. #include <asm/machvec.h>
  23. #include <asm/rtc.h>
  24. #include <asm/irq.h>
  25. unsigned int debug_counter;
  26. static void __init hs7751rvoip_init_irq(void)
  27. {
  28. #if defined(CONFIG_HS7751RVOIP_CODEC)
  29. make_ipr_irq(DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
  30. make_ipr_irq(DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
  31. #endif
  32. init_hs7751rvoip_IRQ();
  33. }
  34. struct sh_machine_vector mv_hs7751rvoip __initmv = {
  35. .mv_nr_irqs = 72,
  36. .mv_inb = hs7751rvoip_inb,
  37. .mv_inw = hs7751rvoip_inw,
  38. .mv_inl = hs7751rvoip_inl,
  39. .mv_outb = hs7751rvoip_outb,
  40. .mv_outw = hs7751rvoip_outw,
  41. .mv_outl = hs7751rvoip_outl,
  42. .mv_inb_p = hs7751rvoip_inb_p,
  43. .mv_inw_p = hs7751rvoip_inw,
  44. .mv_inl_p = hs7751rvoip_inl,
  45. .mv_outb_p = hs7751rvoip_outb_p,
  46. .mv_outw_p = hs7751rvoip_outw,
  47. .mv_outl_p = hs7751rvoip_outl,
  48. .mv_insb = hs7751rvoip_insb,
  49. .mv_insw = hs7751rvoip_insw,
  50. .mv_insl = hs7751rvoip_insl,
  51. .mv_outsb = hs7751rvoip_outsb,
  52. .mv_outsw = hs7751rvoip_outsw,
  53. .mv_outsl = hs7751rvoip_outsl,
  54. .mv_isa_port2addr = hs7751rvoip_isa_port2addr,
  55. .mv_init_irq = hs7751rvoip_init_irq,
  56. };
  57. ALIAS_MV(hs7751rvoip)
  58. const char *get_system_type(void)
  59. {
  60. return "HS7751RVoIP";
  61. }
  62. static void hs7751rvoip_power_off(void)
  63. {
  64. ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR);
  65. }
  66. /*
  67. * Initialize the board
  68. */
  69. void __init platform_setup(void)
  70. {
  71. printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
  72. ctrl_outb(0xf0, PA_OUTPORTR);
  73. pm_power_off = hs7751rvoip_power_off;
  74. debug_counter = 0;
  75. }
  76. void *area5_io8_base;
  77. void *area6_io8_base;
  78. void *area5_io16_base;
  79. void *area6_io16_base;
  80. static int __init hs7751rvoip_cf_init(void)
  81. {
  82. pgprot_t prot;
  83. unsigned long paddrbase;
  84. /* open I/O area window */
  85. paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
  86. prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
  87. area5_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
  88. if (!area5_io16_base) {
  89. printk("allocate_cf_area : can't open CF I/O window!\n");
  90. return -ENOMEM;
  91. }
  92. /* XXX : do we need attribute and common-memory area also? */
  93. paddrbase = virt_to_phys((void *)PA_AREA6_IO);
  94. #if defined(CONFIG_HS7751RVOIP_CODEC)
  95. prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
  96. #else
  97. prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
  98. #endif
  99. area6_io8_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
  100. if (!area6_io8_base) {
  101. printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
  102. return -ENOMEM;
  103. }
  104. prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
  105. area6_io16_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
  106. if (!area6_io16_base) {
  107. printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
  108. return -ENOMEM;
  109. }
  110. return 0;
  111. }
  112. __initcall(hs7751rvoip_cf_init);