rd78x00-masa-setup.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * arch/arm/mach-mv78x00/rd78x00-masa-setup.c
  3. *
  4. * Marvell RD-78x00-mASA 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 <asm/mach-types.h>
  17. #include <asm/mach/arch.h>
  18. #include "mv78xx0.h"
  19. #include "common.h"
  20. static struct mv643xx_eth_platform_data rd78x00_masa_ge00_data = {
  21. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  22. };
  23. static struct mv643xx_eth_platform_data rd78x00_masa_ge01_data = {
  24. .phy_addr = MV643XX_ETH_PHY_ADDR(9),
  25. };
  26. static struct mv643xx_eth_platform_data rd78x00_masa_ge10_data = {
  27. };
  28. static struct mv643xx_eth_platform_data rd78x00_masa_ge11_data = {
  29. };
  30. static struct mv_sata_platform_data rd78x00_masa_sata_data = {
  31. .n_ports = 2,
  32. };
  33. static void __init rd78x00_masa_init(void)
  34. {
  35. /*
  36. * Basic MV78x00 setup. Needs to be called early.
  37. */
  38. mv78xx0_init();
  39. /*
  40. * Partition on-chip peripherals between the two CPU cores.
  41. */
  42. if (mv78xx0_core_index() == 0) {
  43. mv78xx0_ehci0_init();
  44. mv78xx0_ehci1_init();
  45. mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
  46. mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
  47. mv78xx0_sata_init(&rd78x00_masa_sata_data);
  48. mv78xx0_uart0_init();
  49. mv78xx0_uart2_init();
  50. } else {
  51. mv78xx0_ehci2_init();
  52. mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
  53. mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
  54. mv78xx0_uart1_init();
  55. mv78xx0_uart3_init();
  56. }
  57. }
  58. static int __init rd78x00_pci_init(void)
  59. {
  60. /*
  61. * Assign all PCIe devices to CPU core #0.
  62. */
  63. if (machine_is_rd78x00_masa() && mv78xx0_core_index() == 0)
  64. mv78xx0_pcie_init(1, 1);
  65. return 0;
  66. }
  67. subsys_initcall(rd78x00_pci_init);
  68. MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
  69. /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
  70. .atag_offset = 0x100,
  71. .nr_irqs = MV78XX0_NR_IRQS,
  72. .init_machine = rd78x00_masa_init,
  73. .map_io = mv78xx0_map_io,
  74. .init_early = mv78xx0_init_early,
  75. .init_irq = mv78xx0_init_irq,
  76. .init_time = mv78xx0_timer_init,
  77. .restart = mv78xx0_restart,
  78. MACHINE_END