rd88f6183ap-ge-setup.c 3.3 KB

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