setup.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * FILE NAME
  3.  * arch/mips/vr41xx/zao-capcella/setup.c
  4.  *
  5.  * BRIEF MODULE DESCRIPTION
  6.  * Setup for the ZAO Networks Capcella.
  7.  *
  8.  * Copyright 2002 Yoichi Yuasa
  9.  *                yuasa@hh.iij4u.or.jp
  10.  *
  11.  *  This program is free software; you can redistribute it and/or modify it
  12.  *  under the terms of the GNU General Public License as published by the
  13.  *  Free Software Foundation; either version 2 of the License, or (at your
  14.  *  option) any later version.
  15.  */
  16. #include <linux/config.h>
  17. #include <linux/init.h>
  18. #include <linux/console.h>
  19. #include <linux/ide.h>
  20. #include <linux/ioport.h>
  21. #include <asm/pci_channel.h>
  22. #include <asm/reboot.h>
  23. #include <asm/time.h>
  24. #include <asm/vr41xx/capcella.h>
  25. #ifdef CONFIG_BLK_DEV_INITRD
  26. extern unsigned long initrd_start, initrd_end;
  27. extern void * __rd_start, * __rd_end;
  28. #endif
  29. #ifdef CONFIG_BLK_DEV_IDE
  30. extern struct ide_ops capcella_ide_ops;
  31. #endif
  32. #ifdef CONFIG_PCI
  33. static struct resource vr41xx_pci_io_resource = {
  34. "PCI I/O space",
  35. VR41XX_PCI_IO_START,
  36. VR41XX_PCI_IO_END,
  37. IORESOURCE_IO
  38. };
  39. static struct resource vr41xx_pci_mem_resource = {
  40. "PCI memory space",
  41. VR41XX_PCI_MEM_START,
  42. VR41XX_PCI_MEM_END,
  43. IORESOURCE_MEM
  44. };
  45. extern struct pci_ops vr41xx_pci_ops;
  46. struct pci_channel mips_pci_channels[] = {
  47. {&vr41xx_pci_ops, &vr41xx_pci_io_resource, &vr41xx_pci_mem_resource, 0, 256},
  48. {NULL, NULL, NULL, 0, 0}
  49. };
  50. struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
  51. VR41XX_PCI_MEM1_BASE,
  52. VR41XX_PCI_MEM1_MASK,
  53. IO_MEM1_RESOURCE_START
  54. };
  55. struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
  56. VR41XX_PCI_MEM2_BASE,
  57. VR41XX_PCI_MEM2_MASK,
  58. IO_MEM2_RESOURCE_START
  59. };
  60. struct vr41xx_pci_address_space vr41xx_pci_io = {
  61. VR41XX_PCI_IO_BASE,
  62. VR41XX_PCI_IO_MASK,
  63. IO_PORT_RESOURCE_START
  64. };
  65. static struct vr41xx_pci_address_map pci_address_map = {
  66. &vr41xx_pci_mem1,
  67. &vr41xx_pci_mem2,
  68. &vr41xx_pci_io
  69. };
  70. #endif
  71. void __init zao_capcella_setup(void)
  72. {
  73. set_io_port_base(IO_PORT_BASE);
  74. ioport_resource.start = IO_PORT_RESOURCE_START;
  75. ioport_resource.end = IO_PORT_RESOURCE_END;
  76. iomem_resource.start = IO_MEM1_RESOURCE_START;
  77. iomem_resource.end = IO_MEM2_RESOURCE_END;
  78. #ifdef CONFIG_BLK_DEV_INITRD
  79. ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
  80. initrd_start = (unsigned long)&__rd_start;
  81. initrd_end = (unsigned long)&__rd_end;
  82. #endif
  83. _machine_restart = vr41xx_restart;
  84. _machine_halt = vr41xx_halt;
  85. _machine_power_off = vr41xx_power_off;
  86. board_time_init = vr41xx_time_init;
  87. board_timer_setup = vr41xx_timer_setup;
  88. #ifdef CONFIG_FB
  89. conswitchp = &dummy_con;
  90. #endif
  91. #ifdef CONFIG_BLK_DEV_IDE
  92. ide_ops = &capcella_ide_ops;
  93. #endif
  94. vr41xx_bcu_init();
  95. vr41xx_cmu_init(0x0102);
  96. vr41xx_siu_init(SIU_RS232C, 0);
  97. #ifdef CONFIG_PCI
  98. vr41xx_pciu_init(&pci_address_map);
  99. #endif
  100. }