setup.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * linux/arch/sh/boards/sh03/setup.c
  3. *
  4. * Copyright (C) 2004 Interface Co.,Ltd. Saito.K
  5. *
  6. */
  7. #include <linux/init.h>
  8. #include <linux/irq.h>
  9. #include <linux/pci.h>
  10. #include <linux/platform_device.h>
  11. #include <asm/io.h>
  12. #include <asm/rtc.h>
  13. #include <asm/sh03/io.h>
  14. #include <asm/sh03/sh03.h>
  15. #include <asm/addrspace.h>
  16. static void __init init_sh03_IRQ(void)
  17. {
  18. plat_irq_setup_pins(IRQ_MODE_IRQ);
  19. }
  20. extern void *cf_io_base;
  21. static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size)
  22. {
  23. if (PXSEG(port))
  24. return (void __iomem *)port;
  25. /* CompactFlash (IDE) */
  26. if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6))
  27. return (void __iomem *)((unsigned long)cf_io_base + port);
  28. return (void __iomem *)(port + PCI_IO_BASE);
  29. }
  30. /* arch/sh/boards/sh03/rtc.c */
  31. void sh03_time_init(void);
  32. static void __init sh03_setup(char **cmdline_p)
  33. {
  34. board_time_init = sh03_time_init;
  35. }
  36. static struct resource heartbeat_resources[] = {
  37. [0] = {
  38. .start = 0xa0800000,
  39. .end = 0xa0800000,
  40. .flags = IORESOURCE_MEM,
  41. },
  42. };
  43. static struct platform_device heartbeat_device = {
  44. .name = "heartbeat",
  45. .id = -1,
  46. .num_resources = ARRAY_SIZE(heartbeat_resources),
  47. .resource = heartbeat_resources,
  48. };
  49. static struct platform_device *sh03_devices[] __initdata = {
  50. &heartbeat_device,
  51. };
  52. static int __init sh03_devices_setup(void)
  53. {
  54. return platform_add_devices(sh03_devices, ARRAY_SIZE(sh03_devices));
  55. }
  56. __initcall(sh03_devices_setup);
  57. static struct sh_machine_vector mv_sh03 __initmv = {
  58. .mv_name = "Interface (CTP/PCI-SH03)",
  59. .mv_setup = sh03_setup,
  60. .mv_nr_irqs = 48,
  61. .mv_ioport_map = sh03_ioport_map,
  62. .mv_init_irq = init_sh03_IRQ,
  63. };