1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * arch/arm/mach-dove/dove-db-setup.c
4  *
5  * Marvell DB-MV88AP510-BP Development Board Setup
6  */
7 
8 #include <linux/kernel.h>
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <linux/irq.h>
12 #include <linux/mtd/physmap.h>
13 #include <linux/mtd/rawnand.h>
14 #include <linux/timer.h>
15 #include <linux/ata_platform.h>
16 #include <linux/mv643xx_eth.h>
17 #include <linux/i2c.h>
18 #include <linux/pci.h>
19 #include <linux/spi/spi.h>
20 #include <linux/spi/flash.h>
21 #include <linux/gpio.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include "dove.h"
25 #include "common.h"
26 
27 static struct mv643xx_eth_platform_data dove_db_ge00_data = {
28 	.phy_addr	= MV643XX_ETH_PHY_ADDR_DEFAULT,
29 };
30 
31 static struct mv_sata_platform_data dove_db_sata_data = {
32 	.n_ports        = 1,
33 };
34 
35 /*****************************************************************************
36  * SPI Devices:
37  * 	SPI0: 4M Flash ST-M25P32-VMF6P
38  ****************************************************************************/
39 static const struct flash_platform_data dove_db_spi_flash_data = {
40 	.type		= "m25p64",
41 };
42 
43 static struct spi_board_info __initdata dove_db_spi_flash_info[] = {
44 	{
45 		.modalias       = "m25p80",
46 		.platform_data  = &dove_db_spi_flash_data,
47 		.irq            = -1,
48 		.max_speed_hz   = 20000000,
49 		.bus_num        = 0,
50 		.chip_select    = 0,
51 	},
52 };
53 
54 /*****************************************************************************
55  * PCI
56  ****************************************************************************/
dove_db_pci_init(void)57 static int __init dove_db_pci_init(void)
58 {
59 	if (machine_is_dove_db())
60 		dove_pcie_init(1, 1);
61 
62 	return 0;
63 }
64 
65 subsys_initcall(dove_db_pci_init);
66 
67 /*****************************************************************************
68  * Board Init
69  ****************************************************************************/
dove_db_init(void)70 static void __init dove_db_init(void)
71 {
72 	/*
73 	 * Basic Dove setup. Needs to be called early.
74 	 */
75 	dove_init();
76 
77 	dove_ge00_init(&dove_db_ge00_data);
78 	dove_ehci0_init();
79 	dove_ehci1_init();
80 	dove_sata_init(&dove_db_sata_data);
81 	dove_sdio0_init();
82 	dove_sdio1_init();
83 	dove_spi0_init();
84 	dove_spi1_init();
85 	dove_uart0_init();
86 	dove_uart1_init();
87 	dove_i2c_init();
88 	spi_register_board_info(dove_db_spi_flash_info,
89 				ARRAY_SIZE(dove_db_spi_flash_info));
90 }
91 
92 MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
93 	.atag_offset	= 0x100,
94 	.nr_irqs	= DOVE_NR_IRQS,
95 	.init_machine	= dove_db_init,
96 	.map_io		= dove_map_io,
97 	.init_early	= dove_init_early,
98 	.init_irq	= dove_init_irq,
99 	.init_time	= dove_timer_init,
100 	.restart	= dove_restart,
101 MACHINE_END
102