setup.c 2.0 KB

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