board-edosk7705.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * arch/sh/boards/renesas/edosk7705/setup.c
  4. *
  5. * Copyright (C) 2000 Kazumoto Kojima
  6. *
  7. * Hitachi SolutionEngine Support.
  8. *
  9. * Modified for edosk7705 development
  10. * board by S. Dunn, 2003.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/irq.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/smc91x.h>
  17. #include <linux/sh_intc.h>
  18. #include <asm/machvec.h>
  19. #include <linux/sizes.h>
  20. #define SMC_IOBASE 0xA2000000
  21. #define SMC_IO_OFFSET 0x300
  22. #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
  23. #define ETHERNET_IRQ evt2irq(0x320)
  24. static void __init sh_edosk7705_init_irq(void)
  25. {
  26. make_imask_irq(ETHERNET_IRQ);
  27. }
  28. /* eth initialization functions */
  29. static struct smc91x_platdata smc91x_info = {
  30. .flags = SMC91X_USE_16BIT | SMC91X_IO_SHIFT_1 | IORESOURCE_IRQ_LOWLEVEL,
  31. };
  32. static struct resource smc91x_res[] = {
  33. [0] = {
  34. .start = SMC_IOADDR,
  35. .end = SMC_IOADDR + SZ_32 - 1,
  36. .flags = IORESOURCE_MEM,
  37. },
  38. [1] = {
  39. .start = ETHERNET_IRQ,
  40. .end = ETHERNET_IRQ,
  41. .flags = IORESOURCE_IRQ ,
  42. }
  43. };
  44. static struct platform_device smc91x_dev = {
  45. .name = "smc91x",
  46. .id = -1,
  47. .num_resources = ARRAY_SIZE(smc91x_res),
  48. .resource = smc91x_res,
  49. .dev = {
  50. .platform_data = &smc91x_info,
  51. },
  52. };
  53. /* platform init code */
  54. static struct platform_device *edosk7705_devices[] __initdata = {
  55. &smc91x_dev,
  56. };
  57. static int __init init_edosk7705_devices(void)
  58. {
  59. return platform_add_devices(edosk7705_devices,
  60. ARRAY_SIZE(edosk7705_devices));
  61. }
  62. device_initcall(init_edosk7705_devices);
  63. /*
  64. * The Machine Vector
  65. */
  66. static struct sh_machine_vector mv_edosk7705 __initmv = {
  67. .mv_name = "EDOSK7705",
  68. .mv_init_irq = sh_edosk7705_init_irq,
  69. };