rd88f6281-setup.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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/pci.h>
  14. #include <linux/irq.h>
  15. #include <linux/mtd/physmap.h>
  16. #include <linux/mtd/nand.h>
  17. #include <linux/timer.h>
  18. #include <linux/ata_platform.h>
  19. #include <linux/mv643xx_eth.h>
  20. #include <linux/ethtool.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/pci.h>
  24. #include <mach/kirkwood.h>
  25. #include <plat/orion_nand.h>
  26. #include "common.h"
  27. static struct mtd_partition rd88f6281_nand_parts[] = {
  28. {
  29. .name = "u-boot",
  30. .offset = 0,
  31. .size = SZ_1M
  32. }, {
  33. .name = "uImage",
  34. .offset = MTDPART_OFS_NXTBLK,
  35. .size = SZ_2M
  36. }, {
  37. .name = "root",
  38. .offset = MTDPART_OFS_NXTBLK,
  39. .size = MTDPART_SIZ_FULL
  40. },
  41. };
  42. static struct resource rd88f6281_nand_resource = {
  43. .flags = IORESOURCE_MEM,
  44. .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
  45. .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
  46. KIRKWOOD_NAND_MEM_SIZE - 1,
  47. };
  48. static struct orion_nand_data rd88f6281_nand_data = {
  49. .parts = rd88f6281_nand_parts,
  50. .nr_parts = ARRAY_SIZE(rd88f6281_nand_parts),
  51. .cle = 0,
  52. .ale = 1,
  53. .width = 8,
  54. .chip_delay = 25,
  55. };
  56. static struct platform_device rd88f6281_nand_flash = {
  57. .name = "orion_nand",
  58. .id = -1,
  59. .dev = {
  60. .platform_data = &rd88f6281_nand_data,
  61. },
  62. .resource = &rd88f6281_nand_resource,
  63. .num_resources = 1,
  64. };
  65. static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
  66. .phy_addr = MV643XX_ETH_PHY_NONE,
  67. .speed = SPEED_1000,
  68. .duplex = DUPLEX_FULL,
  69. };
  70. static struct mv_sata_platform_data rd88f6281_sata_data = {
  71. .n_ports = 2,
  72. };
  73. static void __init rd88f6281_init(void)
  74. {
  75. /*
  76. * Basic setup. Needs to be called early.
  77. */
  78. kirkwood_init();
  79. kirkwood_ehci_init();
  80. kirkwood_ge00_init(&rd88f6281_ge00_data);
  81. kirkwood_rtc_init();
  82. kirkwood_sata_init(&rd88f6281_sata_data);
  83. kirkwood_uart0_init();
  84. platform_device_register(&rd88f6281_nand_flash);
  85. }
  86. static int __init rd88f6281_pci_init(void)
  87. {
  88. if (machine_is_rd88f6281())
  89. kirkwood_pcie_init();
  90. return 0;
  91. }
  92. subsys_initcall(rd88f6281_pci_init);
  93. MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
  94. /* Maintainer: Saeed Bishara <saeed@marvell.com> */
  95. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  96. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  97. .boot_params = 0x00000100,
  98. .init_machine = rd88f6281_init,
  99. .map_io = kirkwood_map_io,
  100. .init_irq = kirkwood_init_irq,
  101. .timer = &kirkwood_timer,
  102. MACHINE_END