cm-a510.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * arch/arm/mach-dove/cm-a510.c
  3. *
  4. * Copyright (C) 2010 CompuLab, Ltd.
  5. * Konstantin Sinyuk <kostyas@compulab.co.il>
  6. *
  7. * Based on Marvell DB-MV88AP510-BP Development Board Setup
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/ata_platform.h>
  17. #include <linux/mv643xx_eth.h>
  18. #include <linux/spi/spi.h>
  19. #include <linux/spi/flash.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <mach/dove.h>
  23. #include "common.h"
  24. static struct mv643xx_eth_platform_data cm_a510_ge00_data = {
  25. .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
  26. };
  27. static struct mv_sata_platform_data cm_a510_sata_data = {
  28. .n_ports = 1,
  29. };
  30. /*
  31. * SPI Devices:
  32. * SPI0: 1M Flash Winbond w25q32bv
  33. */
  34. static const struct flash_platform_data cm_a510_spi_flash_data = {
  35. .type = "w25q32bv",
  36. };
  37. static struct spi_board_info __initdata cm_a510_spi_flash_info[] = {
  38. {
  39. .modalias = "m25p80",
  40. .platform_data = &cm_a510_spi_flash_data,
  41. .irq = -1,
  42. .max_speed_hz = 20000000,
  43. .bus_num = 0,
  44. .chip_select = 0,
  45. },
  46. };
  47. static int __init cm_a510_pci_init(void)
  48. {
  49. if (machine_is_cm_a510())
  50. dove_pcie_init(1, 1);
  51. return 0;
  52. }
  53. subsys_initcall(cm_a510_pci_init);
  54. /* Board Init */
  55. static void __init cm_a510_init(void)
  56. {
  57. /*
  58. * Basic Dove setup. Needs to be called early.
  59. */
  60. dove_init();
  61. dove_ge00_init(&cm_a510_ge00_data);
  62. dove_ehci0_init();
  63. dove_ehci1_init();
  64. dove_sata_init(&cm_a510_sata_data);
  65. dove_sdio0_init();
  66. dove_sdio1_init();
  67. dove_spi0_init();
  68. dove_spi1_init();
  69. dove_uart0_init();
  70. dove_uart1_init();
  71. dove_i2c_init();
  72. spi_register_board_info(cm_a510_spi_flash_info,
  73. ARRAY_SIZE(cm_a510_spi_flash_info));
  74. }
  75. MACHINE_START(CM_A510, "Compulab CM-A510 Board")
  76. .atag_offset = 0x100,
  77. .nr_irqs = DOVE_NR_IRQS,
  78. .init_machine = cm_a510_init,
  79. .map_io = dove_map_io,
  80. .init_early = dove_init_early,
  81. .init_irq = dove_init_irq,
  82. .init_time = dove_timer_init,
  83. .restart = dove_restart,
  84. MACHINE_END