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