setup.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * arch/sh/boards/renesas/x3proto/setup.c
  3. *
  4. * Renesas SH-X3 Prototype Board Support.
  5. *
  6. * Copyright (C) 2007 Paul Mundt
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/kernel.h>
  15. #include <linux/io.h>
  16. static struct resource heartbeat_resources[] = {
  17. [0] = {
  18. .start = 0xb8140020,
  19. .end = 0xb8140020 + 8 - 1,
  20. .flags = IORESOURCE_MEM,
  21. },
  22. };
  23. static struct platform_device heartbeat_device = {
  24. .name = "heartbeat",
  25. .id = -1,
  26. .num_resources = ARRAY_SIZE(heartbeat_resources),
  27. .resource = heartbeat_resources,
  28. };
  29. static struct platform_device *x3proto_devices[] __initdata = {
  30. &heartbeat_device,
  31. };
  32. static int __init x3proto_devices_setup(void)
  33. {
  34. return platform_add_devices(x3proto_devices,
  35. ARRAY_SIZE(x3proto_devices));
  36. }
  37. device_initcall(x3proto_devices_setup);
  38. static void __init x3proto_init_irq(void)
  39. {
  40. plat_irq_setup_pins(IRQ_MODE_IRL3210);
  41. /* Set ICR0.LVLMODE */
  42. ctrl_outl(ctrl_inl(0xfe410000) | (1 << 21), 0xfe410000);
  43. }
  44. static struct sh_machine_vector mv_x3proto __initmv = {
  45. .mv_name = "x3proto",
  46. .mv_init_irq = x3proto_init_irq,
  47. };