board-espt.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Data Technology Inc. ESPT-GIGA board suport
  3. *
  4. * Copyright (C) 2008, 2009 Renesas Solutions Corp.
  5. * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file "COPYING" in the main directory of this archive
  9. * for more details.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/mtd/physmap.h>
  15. #include <linux/io.h>
  16. #include <linux/sh_eth.h>
  17. #include <asm/machvec.h>
  18. #include <asm/sizes.h>
  19. /* NOR Flash */
  20. static struct mtd_partition espt_nor_flash_partitions[] = {
  21. {
  22. .name = "U-Boot",
  23. .offset = 0,
  24. .size = (2 * SZ_128K),
  25. .mask_flags = MTD_WRITEABLE, /* Read-only */
  26. }, {
  27. .name = "Linux-Kernel",
  28. .offset = MTDPART_OFS_APPEND,
  29. .size = (20 * SZ_128K),
  30. }, {
  31. .name = "Root Filesystem",
  32. .offset = MTDPART_OFS_APPEND,
  33. .size = MTDPART_SIZ_FULL,
  34. },
  35. };
  36. static struct physmap_flash_data espt_nor_flash_data = {
  37. .width = 2,
  38. .parts = espt_nor_flash_partitions,
  39. .nr_parts = ARRAY_SIZE(espt_nor_flash_partitions),
  40. };
  41. static struct resource espt_nor_flash_resources[] = {
  42. [0] = {
  43. .name = "NOR Flash",
  44. .start = 0,
  45. .end = SZ_8M - 1,
  46. .flags = IORESOURCE_MEM,
  47. },
  48. };
  49. static struct platform_device espt_nor_flash_device = {
  50. .name = "physmap-flash",
  51. .resource = espt_nor_flash_resources,
  52. .num_resources = ARRAY_SIZE(espt_nor_flash_resources),
  53. .dev = {
  54. .platform_data = &espt_nor_flash_data,
  55. },
  56. };
  57. /* SH-Ether */
  58. static struct resource sh_eth_resources[] = {
  59. {
  60. .start = 0xFEE00800, /* use eth1 */
  61. .end = 0xFEE00F7C - 1,
  62. .flags = IORESOURCE_MEM,
  63. }, {
  64. .start = 0xFEE01800, /* TSU */
  65. .end = 0xFEE01FFF,
  66. .flags = IORESOURCE_MEM,
  67. }, {
  68. .start = 57, /* irq number */
  69. .flags = IORESOURCE_IRQ,
  70. },
  71. };
  72. static struct sh_eth_plat_data sh7763_eth_pdata = {
  73. .phy = 0,
  74. .edmac_endian = EDMAC_LITTLE_ENDIAN,
  75. .register_type = SH_ETH_REG_GIGABIT,
  76. .phy_interface = PHY_INTERFACE_MODE_MII,
  77. };
  78. static struct platform_device espt_eth_device = {
  79. .name = "sh-eth",
  80. .resource = sh_eth_resources,
  81. .num_resources = ARRAY_SIZE(sh_eth_resources),
  82. .dev = {
  83. .platform_data = &sh7763_eth_pdata,
  84. },
  85. };
  86. static struct platform_device *espt_devices[] __initdata = {
  87. &espt_nor_flash_device,
  88. &espt_eth_device,
  89. };
  90. static int __init espt_devices_setup(void)
  91. {
  92. return platform_add_devices(espt_devices,
  93. ARRAY_SIZE(espt_devices));
  94. }
  95. device_initcall(espt_devices_setup);
  96. static struct sh_machine_vector mv_espt __initmv = {
  97. .mv_name = "ESPT-GIGA",
  98. };