rd88f6183ap-ge-setup.c 3.1 KB

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