Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 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 <kristoffer.ericson@gmail.com> |
| 10 | * 2007, 2008 Michael Petchkovsky <mkpetch@internode.on.net> |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/device.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/types.h> |
| 17 | #include <linux/usb/isp116x.h> |
| 18 | |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 19 | #include <asm/mach-types.h> |
| 20 | #include <asm/mach/arch.h> |
Eric Miao | 51c6298 | 2009-01-02 23:17:22 +0800 | [diff] [blame] | 21 | |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 22 | #include "pxa25x.h" |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 23 | #include "generic.h" |
| 24 | |
| 25 | static void isp116x_pfm_delay(struct device *dev, int delay) |
| 26 | { |
| 27 | |
Russell King | 6a53bc7 | 2015-05-14 16:18:46 +0100 | [diff] [blame] | 28 | /* 400MHz PXA2 = 2.5ns / instruction */ |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 29 | |
| 30 | int cyc = delay / 10; |
| 31 | |
| 32 | /* 4 Instructions = 4 x 2.5ns = 10ns */ |
| 33 | __asm__ volatile ("0:\n" |
| 34 | "subs %0, %1, #1\n" |
| 35 | "bge 0b\n" |
| 36 | :"=r" (cyc) |
| 37 | :"0"(cyc) |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | static struct isp116x_platform_data isp116x_pfm_data = { |
| 42 | .remote_wakeup_enable = 1, |
| 43 | .delay = isp116x_pfm_delay, |
| 44 | }; |
| 45 | |
| 46 | static struct resource isp116x_pfm_resources[] = { |
| 47 | [0] = { |
| 48 | .start = 0x0d000000, |
| 49 | .end = 0x0d000000 + 1, |
| 50 | .flags = IORESOURCE_MEM, |
| 51 | }, |
| 52 | [1] = { |
| 53 | .start = 0x0d000000 + 4, |
| 54 | .end = 0x0d000000 + 5, |
| 55 | .flags = IORESOURCE_MEM, |
| 56 | }, |
| 57 | [2] = { |
| 58 | .start = 61, |
| 59 | .end = 61, |
| 60 | .flags = IORESOURCE_IRQ, |
| 61 | }, |
| 62 | }; |
| 63 | |
| 64 | static struct platform_device mp900c_dummy_device = { |
| 65 | .name = "mp900c_dummy", |
| 66 | .id = -1, |
| 67 | }; |
| 68 | |
| 69 | static struct platform_device mp900c_usb = { |
| 70 | .name = "isp116x-hcd", |
| 71 | .num_resources = ARRAY_SIZE(isp116x_pfm_resources), |
| 72 | .resource = isp116x_pfm_resources, |
| 73 | .dev.platform_data = &isp116x_pfm_data, |
| 74 | }; |
| 75 | |
| 76 | static struct platform_device *devices[] __initdata = { |
| 77 | &mp900c_dummy_device, |
| 78 | &mp900c_usb, |
| 79 | }; |
| 80 | |
| 81 | static void __init mp900c_init(void) |
| 82 | { |
| 83 | printk(KERN_INFO "MobilePro 900/C machine init\n"); |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 84 | pxa_set_ffuart_info(NULL); |
| 85 | pxa_set_btuart_info(NULL); |
| 86 | pxa_set_stuart_info(NULL); |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 87 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 88 | } |
| 89 | |
| 90 | /* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */ |
| 91 | MACHINE_START(NEC_MP900, "MobilePro900/C") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 92 | .atag_offset = 0x220100, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 93 | .init_time = pxa_timer_init, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 94 | .map_io = pxa25x_map_io, |
Rob Herring | 4e61109 | 2012-01-03 16:53:48 -0600 | [diff] [blame] | 95 | .nr_irqs = PXA_NR_IRQS, |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 96 | .init_irq = pxa25x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 97 | .handle_irq = pxa25x_handle_irq, |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 98 | .init_machine = mp900c_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 99 | .restart = pxa_restart, |
Kristoffer Ericson | 49ea26d0 | 2008-10-02 20:15:35 +0100 | [diff] [blame] | 100 | MACHINE_END |
| 101 | |