setup.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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/io.h>
  20. #include <asm/hs7751rvoip/hs7751rvoip.h>
  21. /* defined in mm/ioremap.c */
  22. extern void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags);
  23. unsigned int debug_counter;
  24. const char *get_system_type(void)
  25. {
  26. return "HS7751RVoIP";
  27. }
  28. static void hs7751rvoip_power_off(void)
  29. {
  30. ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR);
  31. }
  32. /*
  33. * Initialize the board
  34. */
  35. void __init platform_setup(void)
  36. {
  37. printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
  38. ctrl_outb(0xf0, PA_OUTPORTR);
  39. pm_power_off = hs7751rvoip_power_off;
  40. debug_counter = 0;
  41. }
  42. void *area5_io8_base;
  43. void *area6_io8_base;
  44. void *area5_io16_base;
  45. void *area6_io16_base;
  46. int __init cf_init(void)
  47. {
  48. pgprot_t prot;
  49. unsigned long paddrbase, psize;
  50. /* open I/O area window */
  51. paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
  52. psize = PAGE_SIZE;
  53. prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
  54. area5_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
  55. if (!area5_io16_base) {
  56. printk("allocate_cf_area : can't open CF I/O window!\n");
  57. return -ENOMEM;
  58. }
  59. /* XXX : do we need attribute and common-memory area also? */
  60. paddrbase = virt_to_phys((void *)PA_AREA6_IO);
  61. psize = PAGE_SIZE;
  62. #if defined(CONFIG_HS7751RVOIP_CODEC)
  63. prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
  64. #else
  65. prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
  66. #endif
  67. area6_io8_base = p3_ioremap(paddrbase, psize, prot.pgprot);
  68. if (!area6_io8_base) {
  69. printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
  70. return -ENOMEM;
  71. }
  72. prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
  73. area6_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
  74. if (!area6_io16_base) {
  75. printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
  76. return -ENOMEM;
  77. }
  78. return 0;
  79. }
  80. __initcall (cf_init);