setup.c 2.0 KB

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