rd88f6281-setup.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * arch/arm/mach-kirkwood/rd88f6281-setup.c
  3. *
  4. * Marvell RD-88F6281 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/irq.h>
  14. #include <linux/mtd/partitions.h>
  15. #include <linux/ata_platform.h>
  16. #include <linux/mv643xx_eth.h>
  17. #include <linux/ethtool.h>
  18. #include <net/dsa.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/mach/arch.h>
  21. #include <mach/kirkwood.h>
  22. #include <plat/mvsdio.h>
  23. #include "common.h"
  24. #include "mpp.h"
  25. static struct mtd_partition rd88f6281_nand_parts[] = {
  26. {
  27. .name = "u-boot",
  28. .offset = 0,
  29. .size = SZ_1M
  30. }, {
  31. .name = "uImage",
  32. .offset = MTDPART_OFS_NXTBLK,
  33. .size = SZ_2M
  34. }, {
  35. .name = "root",
  36. .offset = MTDPART_OFS_NXTBLK,
  37. .size = MTDPART_SIZ_FULL
  38. },
  39. };
  40. static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
  41. .phy_addr = MV643XX_ETH_PHY_NONE,
  42. .speed = SPEED_1000,
  43. .duplex = DUPLEX_FULL,
  44. };
  45. static struct dsa_chip_data rd88f6281_switch_chip_data = {
  46. .port_names[0] = "lan1",
  47. .port_names[1] = "lan2",
  48. .port_names[2] = "lan3",
  49. .port_names[3] = "lan4",
  50. .port_names[5] = "cpu",
  51. };
  52. static struct dsa_platform_data rd88f6281_switch_plat_data = {
  53. .nr_chips = 1,
  54. .chip = &rd88f6281_switch_chip_data,
  55. };
  56. static struct mv643xx_eth_platform_data rd88f6281_ge01_data = {
  57. .phy_addr = MV643XX_ETH_PHY_ADDR(11),
  58. };
  59. static struct mv_sata_platform_data rd88f6281_sata_data = {
  60. .n_ports = 2,
  61. };
  62. static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
  63. .gpio_card_detect = 28,
  64. };
  65. static unsigned int rd88f6281_mpp_config[] __initdata = {
  66. MPP28_GPIO,
  67. 0
  68. };
  69. static void __init rd88f6281_init(void)
  70. {
  71. u32 dev, rev;
  72. /*
  73. * Basic setup. Needs to be called early.
  74. */
  75. kirkwood_init();
  76. kirkwood_mpp_conf(rd88f6281_mpp_config);
  77. kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
  78. kirkwood_ehci_init();
  79. kirkwood_ge00_init(&rd88f6281_ge00_data);
  80. kirkwood_pcie_id(&dev, &rev);
  81. if (rev == MV88F6281_REV_A0) {
  82. rd88f6281_switch_chip_data.sw_addr = 10;
  83. kirkwood_ge01_init(&rd88f6281_ge01_data);
  84. } else {
  85. rd88f6281_switch_chip_data.port_names[4] = "wan";
  86. }
  87. kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);
  88. kirkwood_sata_init(&rd88f6281_sata_data);
  89. kirkwood_sdio_init(&rd88f6281_mvsdio_data);
  90. kirkwood_uart0_init();
  91. }
  92. static int __init rd88f6281_pci_init(void)
  93. {
  94. if (machine_is_rd88f6281())
  95. kirkwood_pcie_init(KW_PCIE0);
  96. return 0;
  97. }
  98. subsys_initcall(rd88f6281_pci_init);
  99. MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
  100. /* Maintainer: Saeed Bishara <saeed@marvell.com> */
  101. .atag_offset = 0x100,
  102. .init_machine = rd88f6281_init,
  103. .map_io = kirkwood_map_io,
  104. .init_early = kirkwood_init_early,
  105. .init_irq = kirkwood_init_irq,
  106. .timer = &kirkwood_timer,
  107. .restart = kirkwood_restart,
  108. MACHINE_END