rd88f6192-nas-setup.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
  3. *
  4. * Marvell RD-88F6192-NAS Reference 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. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/ata_platform.h>
  14. #include <linux/mv643xx_eth.h>
  15. #include <linux/gpio.h>
  16. #include <linux/spi/flash.h>
  17. #include <linux/spi/spi.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <mach/kirkwood.h>
  21. #include "common.h"
  22. #define RD88F6192_GPIO_USB_VBUS 10
  23. static struct mv643xx_eth_platform_data rd88f6192_ge00_data = {
  24. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  25. };
  26. static struct mv_sata_platform_data rd88f6192_sata_data = {
  27. .n_ports = 2,
  28. };
  29. static const struct flash_platform_data rd88F6192_spi_slave_data = {
  30. .type = "m25p128",
  31. };
  32. static struct spi_board_info __initdata rd88F6192_spi_slave_info[] = {
  33. {
  34. .modalias = "m25p80",
  35. .platform_data = &rd88F6192_spi_slave_data,
  36. .irq = -1,
  37. .max_speed_hz = 20000000,
  38. .bus_num = 0,
  39. .chip_select = 0,
  40. },
  41. };
  42. static void __init rd88f6192_init(void)
  43. {
  44. /*
  45. * Basic setup. Needs to be called early.
  46. */
  47. kirkwood_init();
  48. orion_gpio_set_valid(RD88F6192_GPIO_USB_VBUS, 1);
  49. if (gpio_request(RD88F6192_GPIO_USB_VBUS, "USB VBUS") != 0 ||
  50. gpio_direction_output(RD88F6192_GPIO_USB_VBUS, 1) != 0)
  51. pr_err("RD-88F6192-NAS: failed to setup USB VBUS GPIO\n");
  52. kirkwood_ehci_init();
  53. kirkwood_ge00_init(&rd88f6192_ge00_data);
  54. kirkwood_sata_init(&rd88f6192_sata_data);
  55. spi_register_board_info(rd88F6192_spi_slave_info,
  56. ARRAY_SIZE(rd88F6192_spi_slave_info));
  57. kirkwood_spi_init();
  58. kirkwood_uart0_init();
  59. }
  60. static int __init rd88f6192_pci_init(void)
  61. {
  62. if (machine_is_rd88f6192_nas())
  63. kirkwood_pcie_init(KW_PCIE0);
  64. return 0;
  65. }
  66. subsys_initcall(rd88f6192_pci_init);
  67. MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
  68. /* Maintainer: Saeed Bishara <saeed@marvell.com> */
  69. .atag_offset = 0x100,
  70. .init_machine = rd88f6192_init,
  71. .map_io = kirkwood_map_io,
  72. .init_early = kirkwood_init_early,
  73. .init_irq = kirkwood_init_irq,
  74. .timer = &kirkwood_timer,
  75. .restart = kirkwood_restart,
  76. MACHINE_END