lb88rc8480-setup.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * arch/arm/mach-loki/lb88rc8480-setup.c
  3. *
  4. * Marvell LB88RC8480 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/irq.h>
  14. #include <linux/mtd/physmap.h>
  15. #include <linux/mtd/nand.h>
  16. #include <linux/timer.h>
  17. #include <linux/ata_platform.h>
  18. #include <linux/mv643xx_eth.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/mach/arch.h>
  21. #include <mach/loki.h>
  22. #include "common.h"
  23. #define LB88RC8480_FLASH_BOOT_CS_BASE 0xf8000000
  24. #define LB88RC8480_FLASH_BOOT_CS_SIZE SZ_128M
  25. #define LB88RC8480_NOR_BOOT_BASE 0xff000000
  26. #define LB88RC8480_NOR_BOOT_SIZE SZ_16M
  27. static struct mtd_partition lb88rc8480_boot_flash_parts[] = {
  28. {
  29. .name = "kernel",
  30. .offset = 0,
  31. .size = SZ_2M,
  32. }, {
  33. .name = "root-fs",
  34. .offset = SZ_2M,
  35. .size = (SZ_8M + SZ_4M + SZ_1M),
  36. }, {
  37. .name = "u-boot",
  38. .offset = (SZ_8M + SZ_4M + SZ_2M + SZ_1M),
  39. .size = SZ_1M,
  40. },
  41. };
  42. static struct physmap_flash_data lb88rc8480_boot_flash_data = {
  43. .parts = lb88rc8480_boot_flash_parts,
  44. .nr_parts = ARRAY_SIZE(lb88rc8480_boot_flash_parts),
  45. .width = 1, /* 8 bit bus width */
  46. };
  47. static struct resource lb88rc8480_boot_flash_resource = {
  48. .flags = IORESOURCE_MEM,
  49. .start = LB88RC8480_NOR_BOOT_BASE,
  50. .end = LB88RC8480_NOR_BOOT_BASE + LB88RC8480_NOR_BOOT_SIZE - 1,
  51. };
  52. static struct platform_device lb88rc8480_boot_flash = {
  53. .name = "physmap-flash",
  54. .id = 0,
  55. .dev = {
  56. .platform_data = &lb88rc8480_boot_flash_data,
  57. },
  58. .num_resources = 1,
  59. .resource = &lb88rc8480_boot_flash_resource,
  60. };
  61. static struct mv643xx_eth_platform_data lb88rc8480_ge0_data = {
  62. .phy_addr = MV643XX_ETH_PHY_ADDR(1),
  63. .mac_addr = { 0x00, 0x50, 0x43, 0x11, 0x22, 0x33 },
  64. };
  65. static void __init lb88rc8480_init(void)
  66. {
  67. /*
  68. * Basic setup. Needs to be called early.
  69. */
  70. loki_init();
  71. loki_ge0_init(&lb88rc8480_ge0_data);
  72. loki_sas_init();
  73. loki_uart0_init();
  74. loki_uart1_init();
  75. loki_setup_dev_boot_win(LB88RC8480_FLASH_BOOT_CS_BASE,
  76. LB88RC8480_FLASH_BOOT_CS_SIZE);
  77. platform_device_register(&lb88rc8480_boot_flash);
  78. }
  79. MACHINE_START(LB88RC8480, "Marvell LB88RC8480 Development Board")
  80. /* Maintainer: Ke Wei <kewei@marvell.com> */
  81. .phys_io = LOKI_REGS_PHYS_BASE,
  82. .io_pg_offst = ((LOKI_REGS_VIRT_BASE) >> 18) & 0xfffc,
  83. .boot_params = 0x00000100,
  84. .init_machine = lb88rc8480_init,
  85. .map_io = loki_map_io,
  86. .init_irq = loki_init_irq,
  87. .timer = &loki_timer,
  88. MACHINE_END