db78x00-bp-setup.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 <linux/i2c.h>
  17. #include <mach/mv78xx0.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include "common.h"
  21. static struct mv643xx_eth_platform_data db78x00_ge00_data = {
  22. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  23. };
  24. static struct mv643xx_eth_platform_data db78x00_ge01_data = {
  25. .phy_addr = MV643XX_ETH_PHY_ADDR(9),
  26. };
  27. static struct mv643xx_eth_platform_data db78x00_ge10_data = {
  28. .phy_addr = MV643XX_ETH_PHY_ADDR(10),
  29. };
  30. static struct mv643xx_eth_platform_data db78x00_ge11_data = {
  31. .phy_addr = MV643XX_ETH_PHY_ADDR(11),
  32. };
  33. static struct mv_sata_platform_data db78x00_sata_data = {
  34. .n_ports = 2,
  35. };
  36. static struct i2c_board_info __initdata db78x00_i2c_rtc = {
  37. I2C_BOARD_INFO("ds1338", 0x68),
  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. mv78xx0_i2c_init();
  60. i2c_register_board_info(0, &db78x00_i2c_rtc, 1);
  61. } else {
  62. mv78xx0_uart1_init();
  63. mv78xx0_uart3_init();
  64. }
  65. }
  66. static int __init db78x00_pci_init(void)
  67. {
  68. if (machine_is_db78x00_bp()) {
  69. /*
  70. * Assign the x16 PCIe slot on the board to CPU core
  71. * #0, and let CPU core #1 have the four x1 slots.
  72. */
  73. if (mv78xx0_core_index() == 0)
  74. mv78xx0_pcie_init(0, 1);
  75. else
  76. mv78xx0_pcie_init(1, 0);
  77. }
  78. return 0;
  79. }
  80. subsys_initcall(db78x00_pci_init);
  81. MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
  82. /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
  83. .boot_params = 0x00000100,
  84. .init_machine = db78x00_init,
  85. .map_io = mv78xx0_map_io,
  86. .init_early = mv78xx0_init_early,
  87. .init_irq = mv78xx0_init_irq,
  88. .timer = &mv78xx0_timer,
  89. MACHINE_END