db88f6281-bp-setup.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * arch/arm/mach-kirkwood/db88f6281-bp-setup.c
  3. *
  4. * Marvell DB-88F6281-BP Development 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/nand.h>
  16. #include <linux/mtd/partitions.h>
  17. #include <linux/timer.h>
  18. #include <linux/ata_platform.h>
  19. #include <linux/mv643xx_eth.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/pci.h>
  23. #include <mach/kirkwood.h>
  24. #include <plat/orion_nand.h>
  25. #include <plat/mvsdio.h>
  26. #include "common.h"
  27. #include "mpp.h"
  28. static struct mtd_partition db88f6281_nand_parts[] = {
  29. {
  30. .name = "u-boot",
  31. .offset = 0,
  32. .size = SZ_1M
  33. }, {
  34. .name = "uImage",
  35. .offset = MTDPART_OFS_NXTBLK,
  36. .size = SZ_4M
  37. }, {
  38. .name = "root",
  39. .offset = MTDPART_OFS_NXTBLK,
  40. .size = MTDPART_SIZ_FULL
  41. },
  42. };
  43. static struct resource db88f6281_nand_resource = {
  44. .flags = IORESOURCE_MEM,
  45. .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
  46. .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
  47. KIRKWOOD_NAND_MEM_SIZE - 1,
  48. };
  49. static struct orion_nand_data db88f6281_nand_data = {
  50. .parts = db88f6281_nand_parts,
  51. .nr_parts = ARRAY_SIZE(db88f6281_nand_parts),
  52. .cle = 0,
  53. .ale = 1,
  54. .width = 8,
  55. .chip_delay = 25,
  56. };
  57. static struct platform_device db88f6281_nand_flash = {
  58. .name = "orion_nand",
  59. .id = -1,
  60. .dev = {
  61. .platform_data = &db88f6281_nand_data,
  62. },
  63. .resource = &db88f6281_nand_resource,
  64. .num_resources = 1,
  65. };
  66. static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
  67. .phy_addr = MV643XX_ETH_PHY_ADDR(8),
  68. };
  69. static struct mv_sata_platform_data db88f6281_sata_data = {
  70. .n_ports = 2,
  71. };
  72. static struct mvsdio_platform_data db88f6281_mvsdio_data = {
  73. .gpio_write_protect = 37,
  74. .gpio_card_detect = 38,
  75. };
  76. static unsigned int db88f6281_mpp_config[] __initdata = {
  77. MPP37_GPIO,
  78. MPP38_GPIO,
  79. 0
  80. };
  81. static void __init db88f6281_init(void)
  82. {
  83. /*
  84. * Basic setup. Needs to be called early.
  85. */
  86. kirkwood_init();
  87. kirkwood_mpp_conf(db88f6281_mpp_config);
  88. kirkwood_ehci_init();
  89. kirkwood_ge00_init(&db88f6281_ge00_data);
  90. kirkwood_rtc_init();
  91. kirkwood_sata_init(&db88f6281_sata_data);
  92. kirkwood_uart0_init();
  93. kirkwood_sdio_init(&db88f6281_mvsdio_data);
  94. platform_device_register(&db88f6281_nand_flash);
  95. }
  96. static int __init db88f6281_pci_init(void)
  97. {
  98. if (machine_is_db88f6281_bp())
  99. kirkwood_pcie_init();
  100. return 0;
  101. }
  102. subsys_initcall(db88f6281_pci_init);
  103. MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
  104. /* Maintainer: Saeed Bishara <saeed@marvell.com> */
  105. .phys_io = KIRKWOOD_REGS_PHYS_BASE,
  106. .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
  107. .boot_params = 0x00000100,
  108. .init_machine = db88f6281_init,
  109. .map_io = kirkwood_map_io,
  110. .init_irq = kirkwood_init_irq,
  111. .timer = &kirkwood_timer,
  112. MACHINE_END