openrd-setup.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * arch/arm/mach-kirkwood/openrd-setup.c
  3. *
  4. * Marvell OpenRD (Base|Client|Ultimate) 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/mtd/nand.h>
  14. #include <linux/mtd/partitions.h>
  15. #include <linux/ata_platform.h>
  16. #include <linux/mv643xx_eth.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include <mach/kirkwood.h>
  20. #include <plat/mvsdio.h>
  21. #include "common.h"
  22. #include "mpp.h"
  23. static struct mtd_partition openrd_nand_parts[] = {
  24. {
  25. .name = "u-boot",
  26. .offset = 0,
  27. .size = SZ_1M,
  28. .mask_flags = MTD_WRITEABLE
  29. }, {
  30. .name = "uImage",
  31. .offset = MTDPART_OFS_NXTBLK,
  32. .size = SZ_4M
  33. }, {
  34. .name = "root",
  35. .offset = MTDPART_OFS_NXTBLK,
  36. .size = MTDPART_SIZ_FULL
  37. },
  38. };
  39. static struct mv643xx_eth_platform_data openrd_ge00_data = {
  40. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  41. };
  42. static struct mv643xx_eth_platform_data openrd_ge01_data = {
  43. .phy_addr = MV643XX_ETH_PHY_ADDR(24),
  44. };
  45. static struct mv_sata_platform_data openrd_sata_data = {
  46. .n_ports = 2,
  47. };
  48. static struct mvsdio_platform_data openrd_mvsdio_data = {
  49. .gpio_card_detect = 29, /* MPP29 used as SD card detect */
  50. };
  51. static unsigned int openrd_mpp_config[] __initdata = {
  52. MPP29_GPIO,
  53. 0
  54. };
  55. static void __init openrd_init(void)
  56. {
  57. /*
  58. * Basic setup. Needs to be called early.
  59. */
  60. kirkwood_init();
  61. kirkwood_mpp_conf(openrd_mpp_config);
  62. kirkwood_uart0_init();
  63. kirkwood_nand_init(ARRAY_AND_SIZE(openrd_nand_parts), 25);
  64. kirkwood_ehci_init();
  65. if (machine_is_openrd_ultimate()) {
  66. openrd_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
  67. openrd_ge01_data.phy_addr = MV643XX_ETH_PHY_ADDR(1);
  68. }
  69. kirkwood_ge00_init(&openrd_ge00_data);
  70. if (!machine_is_openrd_base())
  71. kirkwood_ge01_init(&openrd_ge01_data);
  72. kirkwood_sata_init(&openrd_sata_data);
  73. kirkwood_sdio_init(&openrd_mvsdio_data);
  74. kirkwood_i2c_init();
  75. }
  76. static int __init openrd_pci_init(void)
  77. {
  78. if (machine_is_openrd_base() ||
  79. machine_is_openrd_client() ||
  80. machine_is_openrd_ultimate())
  81. kirkwood_pcie_init(KW_PCIE0);
  82. return 0;
  83. }
  84. subsys_initcall(openrd_pci_init);
  85. #ifdef CONFIG_MACH_OPENRD_BASE
  86. MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
  87. /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
  88. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  89. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  90. .boot_params = 0x00000100,
  91. .init_machine = openrd_init,
  92. .map_io = kirkwood_map_io,
  93. .init_irq = kirkwood_init_irq,
  94. .timer = &kirkwood_timer,
  95. MACHINE_END
  96. #endif
  97. #ifdef CONFIG_MACH_OPENRD_CLIENT
  98. MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
  99. /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
  100. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  101. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  102. .boot_params = 0x00000100,
  103. .init_machine = openrd_init,
  104. .map_io = kirkwood_map_io,
  105. .init_irq = kirkwood_init_irq,
  106. .timer = &kirkwood_timer,
  107. MACHINE_END
  108. #endif
  109. #ifdef CONFIG_MACH_OPENRD_ULTIMATE
  110. MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
  111. /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
  112. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  113. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  114. .boot_params = 0x00000100,
  115. .init_machine = openrd_init,
  116. .map_io = kirkwood_map_io,
  117. .init_irq = kirkwood_init_irq,
  118. .timer = &kirkwood_timer,
  119. MACHINE_END
  120. #endif