Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * arch/arm/mach-mv78xx0/db78x00-bp-setup.c
0004  *
0005  * Marvell DB-78x00-BP 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 <linux/i2c.h>
0015 #include <asm/mach-types.h>
0016 #include <asm/mach/arch.h>
0017 #include "mv78xx0.h"
0018 #include "common.h"
0019 
0020 static struct mv643xx_eth_platform_data db78x00_ge00_data = {
0021     .phy_addr   = MV643XX_ETH_PHY_ADDR(8),
0022 };
0023 
0024 static struct mv643xx_eth_platform_data db78x00_ge01_data = {
0025     .phy_addr   = MV643XX_ETH_PHY_ADDR(9),
0026 };
0027 
0028 static struct mv643xx_eth_platform_data db78x00_ge10_data = {
0029     .phy_addr   = MV643XX_ETH_PHY_ADDR(10),
0030 };
0031 
0032 static struct mv643xx_eth_platform_data db78x00_ge11_data = {
0033     .phy_addr   = MV643XX_ETH_PHY_ADDR(11),
0034 };
0035 
0036 static struct mv_sata_platform_data db78x00_sata_data = {
0037     .n_ports    = 2,
0038 };
0039 
0040 static struct i2c_board_info __initdata db78x00_i2c_rtc = {
0041     I2C_BOARD_INFO("ds1338", 0x68),
0042 };
0043 
0044 
0045 static void __init db78x00_init(void)
0046 {
0047     /*
0048      * Basic MV78xx0 setup. Needs to be called early.
0049      */
0050     mv78xx0_init();
0051 
0052     /*
0053      * Partition on-chip peripherals between the two CPU cores.
0054      */
0055     if (mv78xx0_core_index() == 0) {
0056         mv78xx0_ehci0_init();
0057         mv78xx0_ehci1_init();
0058         mv78xx0_ehci2_init();
0059         mv78xx0_ge00_init(&db78x00_ge00_data);
0060         mv78xx0_ge01_init(&db78x00_ge01_data);
0061         mv78xx0_ge10_init(&db78x00_ge10_data);
0062         mv78xx0_ge11_init(&db78x00_ge11_data);
0063         mv78xx0_sata_init(&db78x00_sata_data);
0064         mv78xx0_uart0_init();
0065         mv78xx0_uart2_init();
0066         mv78xx0_i2c_init();
0067         i2c_register_board_info(0, &db78x00_i2c_rtc, 1);
0068     } else {
0069         mv78xx0_uart1_init();
0070         mv78xx0_uart3_init();
0071     }
0072 }
0073 
0074 static int __init db78x00_pci_init(void)
0075 {
0076     if (machine_is_db78x00_bp()) {
0077         /*
0078          * Assign the x16 PCIe slot on the board to CPU core
0079          * #0, and let CPU core #1 have the four x1 slots.
0080          */
0081         if (mv78xx0_core_index() == 0)
0082             mv78xx0_pcie_init(0, 1);
0083         else
0084             mv78xx0_pcie_init(1, 0);
0085     }
0086 
0087     return 0;
0088 }
0089 subsys_initcall(db78x00_pci_init);
0090 
0091 MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
0092     /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
0093     .atag_offset    = 0x100,
0094     .nr_irqs    = MV78XX0_NR_IRQS,
0095     .init_machine   = db78x00_init,
0096     .map_io     = mv78xx0_map_io,
0097     .init_early = mv78xx0_init_early,
0098     .init_irq   = mv78xx0_init_irq,
0099     .init_time  = mv78xx0_timer_init,
0100     .restart    = mv78xx0_restart,
0101 MACHINE_END