db78x00-bp-setup.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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_ADDR(10),
  28. };
  29. static struct mv643xx_eth_platform_data db78x00_ge11_data = {
  30. .phy_addr = MV643XX_ETH_PHY_ADDR(11),
  31. };
  32. static struct mv_sata_platform_data db78x00_sata_data = {
  33. .n_ports = 2,
  34. };
  35. static void __init db78x00_init(void)
  36. {
  37. /*
  38. * Basic MV78xx0 setup. Needs to be called early.
  39. */
  40. mv78xx0_init();
  41. /*
  42. * Partition on-chip peripherals between the two CPU cores.
  43. */
  44. if (mv78xx0_core_index() == 0) {
  45. mv78xx0_ehci0_init();
  46. mv78xx0_ehci1_init();
  47. mv78xx0_ehci2_init();
  48. mv78xx0_ge00_init(&db78x00_ge00_data);
  49. mv78xx0_ge01_init(&db78x00_ge01_data);
  50. mv78xx0_ge10_init(&db78x00_ge10_data);
  51. mv78xx0_ge11_init(&db78x00_ge11_data);
  52. mv78xx0_sata_init(&db78x00_sata_data);
  53. mv78xx0_uart0_init();
  54. mv78xx0_uart2_init();
  55. } else {
  56. mv78xx0_uart1_init();
  57. mv78xx0_uart3_init();
  58. }
  59. }
  60. static int __init db78x00_pci_init(void)
  61. {
  62. if (machine_is_db78x00_bp()) {
  63. /*
  64. * Assign the x16 PCIe slot on the board to CPU core
  65. * #0, and let CPU core #1 have the four x1 slots.
  66. */
  67. if (mv78xx0_core_index() == 0)
  68. mv78xx0_pcie_init(0, 1);
  69. else
  70. mv78xx0_pcie_init(1, 0);
  71. }
  72. return 0;
  73. }
  74. subsys_initcall(db78x00_pci_init);
  75. MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
  76. /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
  77. .phys_io = MV78XX0_REGS_PHYS_BASE,
  78. .io_pg_offst = ((MV78XX0_REGS_VIRT_BASE) >> 18) & 0xfffc,
  79. .boot_params = 0x00000100,
  80. .init_machine = db78x00_init,
  81. .map_io = mv78xx0_map_io,
  82. .init_irq = mv78xx0_init_irq,
  83. .timer = &mv78xx0_timer,
  84. MACHINE_END