rd88f6183ap-ge-setup.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 <asm/mach-types.h>
  22. #include <asm/gpio.h>
  23. #include <asm/leds.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/pci.h>
  26. #include <mach/orion5x.h>
  27. #include "common.h"
  28. #include "mpp.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 mtd_partition rd88f6183ap_ge_partitions[] = {
  35. {
  36. .name = "kernel",
  37. .offset = 0x00000000,
  38. .size = 0x00200000,
  39. }, {
  40. .name = "rootfs",
  41. .offset = 0x00200000,
  42. .size = 0x00500000,
  43. }, {
  44. .name = "nvram",
  45. .offset = 0x00700000,
  46. .size = 0x00080000,
  47. },
  48. };
  49. static struct flash_platform_data rd88f6183ap_ge_spi_slave_data = {
  50. .type = "m25p64",
  51. .nr_parts = ARRAY_SIZE(rd88f6183ap_ge_partitions),
  52. .parts = rd88f6183ap_ge_partitions,
  53. };
  54. static struct spi_board_info __initdata rd88f6183ap_ge_spi_slave_info[] = {
  55. {
  56. .modalias = "m25p80",
  57. .platform_data = &rd88f6183ap_ge_spi_slave_data,
  58. .irq = NO_IRQ,
  59. .max_speed_hz = 20000000,
  60. .bus_num = 0,
  61. .chip_select = 0,
  62. },
  63. };
  64. static void __init rd88f6183ap_ge_init(void)
  65. {
  66. /*
  67. * Setup basic Orion functions. Need to be called early.
  68. */
  69. orion5x_init();
  70. /*
  71. * Configure peripherals.
  72. */
  73. orion5x_ehci0_init();
  74. orion5x_eth_init(&rd88f6183ap_ge_eth_data);
  75. spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
  76. ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
  77. orion5x_spi_init();
  78. orion5x_uart0_init();
  79. }
  80. static struct hw_pci rd88f6183ap_ge_pci __initdata = {
  81. .nr_controllers = 2,
  82. .swizzle = pci_std_swizzle,
  83. .setup = orion5x_pci_sys_setup,
  84. .scan = orion5x_pci_sys_scan_bus,
  85. .map_irq = orion5x_pci_map_irq,
  86. };
  87. static int __init rd88f6183ap_ge_pci_init(void)
  88. {
  89. if (machine_is_rd88f6183ap_ge()) {
  90. orion5x_pci_disable();
  91. pci_common_init(&rd88f6183ap_ge_pci);
  92. }
  93. return 0;
  94. }
  95. subsys_initcall(rd88f6183ap_ge_pci_init);
  96. MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
  97. /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
  98. .phys_io = ORION5X_REGS_PHYS_BASE,
  99. .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
  100. .boot_params = 0x00000100,
  101. .init_machine = rd88f6183ap_ge_init,
  102. .map_io = orion5x_map_io,
  103. .init_irq = orion5x_init_irq,
  104. .timer = &orion5x_timer,
  105. .fixup = tag_fixup_mem32,
  106. MACHINE_END