openrd-setup.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * arch/arm/mach-kirkwood/openrd-setup.c
  3. *
  4. * Marvell OpenRD (Base|Client) 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. kirkwood_ge00_init(&openrd_ge00_data);
  66. if (machine_is_openrd_client())
  67. kirkwood_ge01_init(&openrd_ge01_data);
  68. kirkwood_sata_init(&openrd_sata_data);
  69. kirkwood_sdio_init(&openrd_mvsdio_data);
  70. kirkwood_i2c_init();
  71. }
  72. static int __init openrd_pci_init(void)
  73. {
  74. if (machine_is_openrd_base() || machine_is_openrd_client())
  75. kirkwood_pcie_init();
  76. return 0;
  77. }
  78. subsys_initcall(openrd_pci_init);
  79. #ifdef CONFIG_MACH_OPENRD_BASE
  80. MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
  81. /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
  82. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  83. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  84. .boot_params = 0x00000100,
  85. .init_machine = openrd_init,
  86. .map_io = kirkwood_map_io,
  87. .init_irq = kirkwood_init_irq,
  88. .timer = &kirkwood_timer,
  89. MACHINE_END
  90. #endif
  91. #ifdef CONFIG_MACH_OPENRD_CLIENT
  92. MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
  93. /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
  94. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  95. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  96. .boot_params = 0x00000100,
  97. .init_machine = openrd_init,
  98. .map_io = kirkwood_map_io,
  99. .init_irq = kirkwood_init_irq,
  100. .timer = &kirkwood_timer,
  101. MACHINE_END
  102. #endif