mp900.c 2.2 KB

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