mp900.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * linux/arch/arm/mach-pxa/mp900.c
  3. *
  4. * Support for the NEC MobilePro900/C platform
  5. *
  6. * Based on mach-pxa/gumstix.c
  7. *
  8. * 2007, 2008 Kristoffer Ericson <kristoffer.ericson@gmail.com>
  9. * 2007, 2008 Michael Petchkovsky <mkpetch@internode.on.net>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/init.h>
  16. #include <linux/device.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/types.h>
  19. #include <linux/usb/isp116x.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <mach/pxa25x.h>
  23. #include "generic.h"
  24. static void isp116x_pfm_delay(struct device *dev, int delay)
  25. {
  26. /* 400Mhz PXA2 = 2.5ns / instruction */
  27. int cyc = delay / 10;
  28. /* 4 Instructions = 4 x 2.5ns = 10ns */
  29. __asm__ volatile ("0:\n"
  30. "subs %0, %1, #1\n"
  31. "bge 0b\n"
  32. :"=r" (cyc)
  33. :"0"(cyc)
  34. );
  35. }
  36. static struct isp116x_platform_data isp116x_pfm_data = {
  37. .remote_wakeup_enable = 1,
  38. .delay = isp116x_pfm_delay,
  39. };
  40. static struct resource isp116x_pfm_resources[] = {
  41. [0] = {
  42. .start = 0x0d000000,
  43. .end = 0x0d000000 + 1,
  44. .flags = IORESOURCE_MEM,
  45. },
  46. [1] = {
  47. .start = 0x0d000000 + 4,
  48. .end = 0x0d000000 + 5,
  49. .flags = IORESOURCE_MEM,
  50. },
  51. [2] = {
  52. .start = 61,
  53. .end = 61,
  54. .flags = IORESOURCE_IRQ,
  55. },
  56. };
  57. static struct platform_device mp900c_dummy_device = {
  58. .name = "mp900c_dummy",
  59. .id = -1,
  60. };
  61. static struct platform_device mp900c_usb = {
  62. .name = "isp116x-hcd",
  63. .num_resources = ARRAY_SIZE(isp116x_pfm_resources),
  64. .resource = isp116x_pfm_resources,
  65. .dev.platform_data = &isp116x_pfm_data,
  66. };
  67. static struct platform_device *devices[] __initdata = {
  68. &mp900c_dummy_device,
  69. &mp900c_usb,
  70. };
  71. static void __init mp900c_init(void)
  72. {
  73. printk(KERN_INFO "MobilePro 900/C machine init\n");
  74. pxa_set_ffuart_info(NULL);
  75. pxa_set_btuart_info(NULL);
  76. pxa_set_stuart_info(NULL);
  77. platform_add_devices(devices, ARRAY_SIZE(devices));
  78. }
  79. /* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */
  80. MACHINE_START(NEC_MP900, "MobilePro900/C")
  81. .atag_offset = 0x220100,
  82. .timer = &pxa_timer,
  83. .map_io = pxa25x_map_io,
  84. .nr_irqs = PXA_NR_IRQS,
  85. .init_irq = pxa25x_init_irq,
  86. .handle_irq = pxa25x_handle_irq,
  87. .init_machine = mp900c_init,
  88. .restart = pxa_restart,
  89. MACHINE_END