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