rd88f6183ap-ge-setup.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * arch/arm/mach-orion5x/rd88f6183-ap-ge-setup.c
  3. *
  4. * Marvell Orion-1-90 AP GE Reference Design 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/gpio.h>
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/pci.h>
  15. #include <linux/irq.h>
  16. #include <linux/mtd/physmap.h>
  17. #include <linux/mv643xx_eth.h>
  18. #include <linux/spi/spi.h>
  19. #include <linux/spi/orion_spi.h>
  20. #include <linux/spi/flash.h>
  21. #include <linux/ethtool.h>
  22. #include <net/dsa.h>
  23. #include <asm/mach-types.h>
  24. #include <asm/leds.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/pci.h>
  27. #include <mach/orion5x.h>
  28. #include "common.h"
  29. static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
  30. .phy_addr = -1,
  31. .speed = SPEED_1000,
  32. .duplex = DUPLEX_FULL,
  33. };
  34. static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
  35. .port_names[0] = "lan1",
  36. .port_names[1] = "lan2",
  37. .port_names[2] = "lan3",
  38. .port_names[3] = "lan4",
  39. .port_names[4] = "wan",
  40. .port_names[5] = "cpu",
  41. };
  42. static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
  43. .nr_chips = 1,
  44. .chip = &rd88f6183ap_ge_switch_chip_data,
  45. };
  46. static struct mtd_partition rd88f6183ap_ge_partitions[] = {
  47. {
  48. .name = "kernel",
  49. .offset = 0x00000000,
  50. .size = 0x00200000,
  51. }, {
  52. .name = "rootfs",
  53. .offset = 0x00200000,
  54. .size = 0x00500000,
  55. }, {
  56. .name = "nvram",
  57. .offset = 0x00700000,
  58. .size = 0x00080000,
  59. },
  60. };
  61. static struct flash_platform_data rd88f6183ap_ge_spi_slave_data = {
  62. .type = "m25p64",
  63. .nr_parts = ARRAY_SIZE(rd88f6183ap_ge_partitions),
  64. .parts = rd88f6183ap_ge_partitions,
  65. };
  66. static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
  67. {
  68. .modalias = "m25p80",
  69. .platform_data = &rd88f6183ap_ge_spi_slave_data,
  70. .irq = NO_IRQ,
  71. .max_speed_hz = 20000000,
  72. .bus_num = 0,
  73. .chip_select = 0,
  74. },
  75. };
  76. static void __init rd88f6183ap_ge_init(void)
  77. {
  78. /*
  79. * Setup basic Orion functions. Need to be called early.
  80. */
  81. orion5x_init();
  82. /*
  83. * Configure peripherals.
  84. */
  85. orion5x_ehci0_init();
  86. orion5x_eth_init(&rd88f6183ap_ge_eth_data);
  87. orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
  88. gpio_to_irq(3));
  89. spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
  90. ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
  91. orion5x_spi_init();
  92. orion5x_uart0_init();
  93. }
  94. static struct hw_pci rd88f6183ap_ge_pci __initdata = {
  95. .nr_controllers = 2,
  96. .swizzle = pci_std_swizzle,
  97. .setup = orion5x_pci_sys_setup,
  98. .scan = orion5x_pci_sys_scan_bus,
  99. .map_irq = orion5x_pci_map_irq,
  100. };
  101. static int __init rd88f6183ap_ge_pci_init(void)
  102. {
  103. if (machine_is_rd88f6183ap_ge()) {
  104. orion5x_pci_disable();
  105. pci_common_init(&rd88f6183ap_ge_pci);
  106. }
  107. return 0;
  108. }
  109. subsys_initcall(rd88f6183ap_ge_pci_init);
  110. MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
  111. /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
  112. .atag_offset = 0x100,
  113. .init_machine = rd88f6183ap_ge_init,
  114. .map_io = orion5x_map_io,
  115. .init_early = orion5x_init_early,
  116. .init_irq = orion5x_init_irq,
  117. .timer = &orion5x_timer,
  118. .fixup = tag_fixup_mem32,
  119. .restart = orion5x_restart,
  120. MACHINE_END