board-espt.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Data Technology Inc. ESPT-GIGA board support
  4. *
  5. * Copyright (C) 2008, 2009 Renesas Solutions Corp.
  6. * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <[email protected]>
  7. */
  8. #include <linux/init.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/interrupt.h>
  11. #include <linux/mtd/physmap.h>
  12. #include <linux/io.h>
  13. #include <linux/sh_eth.h>
  14. #include <linux/sh_intc.h>
  15. #include <asm/machvec.h>
  16. #include <linux/sizes.h>
  17. /* NOR Flash */
  18. static struct mtd_partition espt_nor_flash_partitions[] = {
  19. {
  20. .name = "U-Boot",
  21. .offset = 0,
  22. .size = (2 * SZ_128K),
  23. .mask_flags = MTD_WRITEABLE, /* Read-only */
  24. }, {
  25. .name = "Linux-Kernel",
  26. .offset = MTDPART_OFS_APPEND,
  27. .size = (20 * SZ_128K),
  28. }, {
  29. .name = "Root Filesystem",
  30. .offset = MTDPART_OFS_APPEND,
  31. .size = MTDPART_SIZ_FULL,
  32. },
  33. };
  34. static struct physmap_flash_data espt_nor_flash_data = {
  35. .width = 2,
  36. .parts = espt_nor_flash_partitions,
  37. .nr_parts = ARRAY_SIZE(espt_nor_flash_partitions),
  38. };
  39. static struct resource espt_nor_flash_resources[] = {
  40. [0] = {
  41. .name = "NOR Flash",
  42. .start = 0,
  43. .end = SZ_8M - 1,
  44. .flags = IORESOURCE_MEM,
  45. },
  46. };
  47. static struct platform_device espt_nor_flash_device = {
  48. .name = "physmap-flash",
  49. .resource = espt_nor_flash_resources,
  50. .num_resources = ARRAY_SIZE(espt_nor_flash_resources),
  51. .dev = {
  52. .platform_data = &espt_nor_flash_data,
  53. },
  54. };
  55. /* SH-Ether */
  56. static struct resource sh_eth_resources[] = {
  57. {
  58. .start = 0xFEE00800, /* use eth1 */
  59. .end = 0xFEE00F7C - 1,
  60. .flags = IORESOURCE_MEM,
  61. }, {
  62. .start = 0xFEE01800, /* TSU */
  63. .end = 0xFEE01FFF,
  64. .flags = IORESOURCE_MEM,
  65. }, {
  66. .start = evt2irq(0x920), /* irq number */
  67. .flags = IORESOURCE_IRQ,
  68. },
  69. };
  70. static struct sh_eth_plat_data sh7763_eth_pdata = {
  71. .phy = 0,
  72. .phy_interface = PHY_INTERFACE_MODE_MII,
  73. };
  74. static struct platform_device espt_eth_device = {
  75. .name = "sh7763-gether",
  76. .resource = sh_eth_resources,
  77. .num_resources = ARRAY_SIZE(sh_eth_resources),
  78. .dev = {
  79. .platform_data = &sh7763_eth_pdata,
  80. },
  81. };
  82. static struct platform_device *espt_devices[] __initdata = {
  83. &espt_nor_flash_device,
  84. &espt_eth_device,
  85. };
  86. static int __init espt_devices_setup(void)
  87. {
  88. return platform_add_devices(espt_devices,
  89. ARRAY_SIZE(espt_devices));
  90. }
  91. device_initcall(espt_devices_setup);
  92. static struct sh_machine_vector mv_espt __initmv = {
  93. .mv_name = "ESPT-GIGA",
  94. };