rd78x00-masa-setup.c 2.1 KB

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