db78x00-bp-setup.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * arch/arm/mach-mv78xx0/db78x00-bp-setup.c
  3. *
  4. * Marvell DB-78x00-BP Development Board Setup
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/ata_platform.h>
  14. #include <linux/mv643xx_eth.h>
  15. #include <linux/ethtool.h>
  16. #include <mach/mv78xx0.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include "common.h"
  20. static struct mv643xx_eth_platform_data db78x00_ge00_data = {
  21. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  22. };
  23. static struct mv643xx_eth_platform_data db78x00_ge01_data = {
  24. .phy_addr = MV643XX_ETH_PHY_ADDR(9),
  25. };
  26. static struct mv643xx_eth_platform_data db78x00_ge10_data = {
  27. .phy_addr = MV643XX_ETH_PHY_NONE,
  28. .speed = SPEED_1000,
  29. .duplex = DUPLEX_FULL,
  30. };
  31. static struct mv643xx_eth_platform_data db78x00_ge11_data = {
  32. .phy_addr = MV643XX_ETH_PHY_NONE,
  33. .speed = SPEED_1000,
  34. .duplex = DUPLEX_FULL,
  35. };
  36. static struct mv_sata_platform_data db78x00_sata_data = {
  37. .n_ports = 2,
  38. };
  39. static void __init db78x00_init(void)
  40. {
  41. /*
  42. * Basic MV78xx0 setup. Needs to be called early.
  43. */
  44. mv78xx0_init();
  45. /*
  46. * Partition on-chip peripherals between the two CPU cores.
  47. */
  48. if (mv78xx0_core_index() == 0) {
  49. mv78xx0_ehci0_init();
  50. mv78xx0_ehci1_init();
  51. mv78xx0_ehci2_init();
  52. mv78xx0_ge00_init(&db78x00_ge00_data);
  53. mv78xx0_ge01_init(&db78x00_ge01_data);
  54. mv78xx0_ge10_init(&db78x00_ge10_data);
  55. mv78xx0_ge11_init(&db78x00_ge11_data);
  56. mv78xx0_sata_init(&db78x00_sata_data);
  57. mv78xx0_uart0_init();
  58. mv78xx0_uart2_init();
  59. } else {
  60. mv78xx0_uart1_init();
  61. mv78xx0_uart3_init();
  62. }
  63. }
  64. static int __init db78x00_pci_init(void)
  65. {
  66. if (machine_is_db78x00_bp()) {
  67. /*
  68. * Assign the x16 PCIe slot on the board to CPU core
  69. * #0, and let CPU core #1 have the four x1 slots.
  70. */
  71. if (mv78xx0_core_index() == 0)
  72. mv78xx0_pcie_init(0, 1);
  73. else
  74. mv78xx0_pcie_init(1, 0);
  75. }
  76. return 0;
  77. }
  78. subsys_initcall(db78x00_pci_init);
  79. MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
  80. /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
  81. .phys_io = MV78XX0_REGS_PHYS_BASE,
  82. .io_pg_offst = ((MV78XX0_REGS_VIRT_BASE) >> 18) & 0xfffc,
  83. .boot_params = 0x00000100,
  84. .init_machine = db78x00_init,
  85. .map_io = mv78xx0_map_io,
  86. .init_irq = mv78xx0_init_irq,
  87. .timer = &mv78xx0_timer,
  88. MACHINE_END