Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * arch/arm/mach-mv78x00/rd78x00-masa-setup.c
0004  *
0005  * Marvell RD-78x00-mASA Development Board Setup
0006  */
0007 
0008 #include <linux/kernel.h>
0009 #include <linux/init.h>
0010 #include <linux/platform_device.h>
0011 #include <linux/ata_platform.h>
0012 #include <linux/mv643xx_eth.h>
0013 #include <linux/ethtool.h>
0014 #include <asm/mach-types.h>
0015 #include <asm/mach/arch.h>
0016 #include "mv78xx0.h"
0017 #include "common.h"
0018 
0019 static struct mv643xx_eth_platform_data rd78x00_masa_ge00_data = {
0020     .phy_addr   = MV643XX_ETH_PHY_ADDR(8),
0021 };
0022 
0023 static struct mv643xx_eth_platform_data rd78x00_masa_ge01_data = {
0024     .phy_addr   = MV643XX_ETH_PHY_ADDR(9),
0025 };
0026 
0027 static struct mv643xx_eth_platform_data rd78x00_masa_ge10_data = {
0028 };
0029 
0030 static struct mv643xx_eth_platform_data rd78x00_masa_ge11_data = {
0031 };
0032 
0033 static struct mv_sata_platform_data rd78x00_masa_sata_data = {
0034     .n_ports    = 2,
0035 };
0036 
0037 static void __init rd78x00_masa_init(void)
0038 {
0039     /*
0040      * Basic MV78x00 setup. Needs to be called early.
0041      */
0042     mv78xx0_init();
0043 
0044     /*
0045      * Partition on-chip peripherals between the two CPU cores.
0046      */
0047     if (mv78xx0_core_index() == 0) {
0048         mv78xx0_ehci0_init();
0049         mv78xx0_ehci1_init();
0050         mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
0051         mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
0052         mv78xx0_sata_init(&rd78x00_masa_sata_data);
0053         mv78xx0_uart0_init();
0054         mv78xx0_uart2_init();
0055     } else {
0056         mv78xx0_ehci2_init();
0057         mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
0058         mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
0059         mv78xx0_uart1_init();
0060         mv78xx0_uart3_init();
0061     }
0062 }
0063 
0064 static int __init rd78x00_pci_init(void)
0065 {
0066     /*
0067      * Assign all PCIe devices to CPU core #0.
0068      */
0069     if (machine_is_rd78x00_masa() && mv78xx0_core_index() == 0)
0070         mv78xx0_pcie_init(1, 1);
0071 
0072     return 0;
0073 }
0074 subsys_initcall(rd78x00_pci_init);
0075 
0076 MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
0077     /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
0078     .atag_offset    = 0x100,
0079     .nr_irqs    = MV78XX0_NR_IRQS,
0080     .init_machine   = rd78x00_masa_init,
0081     .map_io     = mv78xx0_map_io,
0082     .init_early = mv78xx0_init_early,
0083     .init_irq   = mv78xx0_init_irq,
0084     .init_time  = mv78xx0_timer_init,
0085     .restart    = mv78xx0_restart,
0086 MACHINE_END