buffalo-wxl-setup.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
  3. *
  4. * Buffalo WXL (Terastation Duo) Setup routines
  5. *
  6. * sebastien requiem <sebastien@requiem.fr>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/ata_platform.h>
  16. #include <linux/mv643xx_eth.h>
  17. #include <linux/ethtool.h>
  18. #include <linux/i2c.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/mach/arch.h>
  21. #include "mv78xx0.h"
  22. #include "common.h"
  23. #include "mpp.h"
  24. /* This arch has 2 Giga Ethernet */
  25. static struct mv643xx_eth_platform_data db78x00_ge00_data = {
  26. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  27. };
  28. static struct mv643xx_eth_platform_data db78x00_ge01_data = {
  29. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  30. };
  31. /* 2 SATA controller supporting HotPlug */
  32. static struct mv_sata_platform_data db78x00_sata_data = {
  33. .n_ports = 2,
  34. };
  35. static struct i2c_board_info __initdata db78x00_i2c_rtc = {
  36. I2C_BOARD_INFO("ds1338", 0x68),
  37. };
  38. static unsigned int wxl_mpp_config[] __initdata = {
  39. MPP0_GE1_TXCLK,
  40. MPP1_GE1_TXCTL,
  41. MPP2_GE1_RXCTL,
  42. MPP3_GE1_RXCLK,
  43. MPP4_GE1_TXD0,
  44. MPP5_GE1_TXD1,
  45. MPP6_GE1_TXD2,
  46. MPP7_GE1_TXD3,
  47. MPP8_GE1_RXD0,
  48. MPP9_GE1_RXD1,
  49. MPP10_GE1_RXD2,
  50. MPP11_GE1_RXD3,
  51. MPP12_GPIO,
  52. MPP13_SYSRST_OUTn,
  53. MPP14_SATA1_ACTn,
  54. MPP15_SATA0_ACTn,
  55. MPP16_GPIO,
  56. MPP17_GPIO,
  57. MPP18_GPIO,
  58. MPP19_GPIO,
  59. MPP20_GPIO,
  60. MPP21_GPIO,
  61. MPP22_GPIO,
  62. MPP23_GPIO,
  63. MPP24_UA2_TXD,
  64. MPP25_UA2_RXD,
  65. MPP26_UA2_CTSn,
  66. MPP27_UA2_RTSn,
  67. MPP28_GPIO,
  68. MPP29_SYSRST_OUTn,
  69. MPP30_GPIO,
  70. MPP31_GPIO,
  71. MPP32_GPIO,
  72. MPP33_GPIO,
  73. MPP34_GPIO,
  74. MPP35_GPIO,
  75. MPP36_GPIO,
  76. MPP37_GPIO,
  77. MPP38_GPIO,
  78. MPP39_GPIO,
  79. MPP40_UNUSED,
  80. MPP41_UNUSED,
  81. MPP42_UNUSED,
  82. MPP43_UNUSED,
  83. MPP44_UNUSED,
  84. MPP45_UNUSED,
  85. MPP46_UNUSED,
  86. MPP47_UNUSED,
  87. MPP48_SATA1_ACTn,
  88. MPP49_SATA0_ACTn,
  89. 0
  90. };
  91. static void __init wxl_init(void)
  92. {
  93. /*
  94. * Basic MV78xx0 setup. Needs to be called early.
  95. */
  96. mv78xx0_init();
  97. mv78xx0_mpp_conf(wxl_mpp_config);
  98. /*
  99. * Partition on-chip peripherals between the two CPU cores.
  100. */
  101. mv78xx0_ehci0_init();
  102. mv78xx0_ehci1_init();
  103. mv78xx0_ehci2_init();
  104. mv78xx0_ge00_init(&db78x00_ge00_data);
  105. mv78xx0_ge01_init(&db78x00_ge01_data);
  106. mv78xx0_sata_init(&db78x00_sata_data);
  107. mv78xx0_uart0_init();
  108. mv78xx0_uart1_init();
  109. mv78xx0_uart2_init();
  110. mv78xx0_uart3_init();
  111. mv78xx0_i2c_init();
  112. i2c_register_board_info(0, &db78x00_i2c_rtc, 1);
  113. }
  114. static int __init wxl_pci_init(void)
  115. {
  116. if (machine_is_terastation_wxl()) {
  117. /*
  118. * Assign the x16 PCIe slot on the board to CPU core
  119. * #0, and let CPU core #1 have the four x1 slots.
  120. */
  121. if (mv78xx0_core_index() == 0)
  122. mv78xx0_pcie_init(0, 1);
  123. else
  124. mv78xx0_pcie_init(1, 0);
  125. }
  126. return 0;
  127. }
  128. subsys_initcall(wxl_pci_init);
  129. MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
  130. /* Maintainer: Sebastien Requiem <sebastien@requiem.fr> */
  131. .atag_offset = 0x100,
  132. .nr_irqs = MV78XX0_NR_IRQS,
  133. .init_machine = wxl_init,
  134. .map_io = mv78xx0_map_io,
  135. .init_early = mv78xx0_init_early,
  136. .init_irq = mv78xx0_init_irq,
  137. .init_time = mv78xx0_timer_init,
  138. .restart = mv78xx0_restart,
  139. MACHINE_END