Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  *  linux/arch/arm/mach-pxa/mp900.c
0004  *
0005  *  Support for the NEC MobilePro900/C platform
0006  *
0007  *  Based on mach-pxa/gumstix.c
0008  *
0009  *  2007, 2008 Kristoffer Ericson <kristoffer.ericson@gmail.com>
0010  *  2007, 2008 Michael Petchkovsky <mkpetch@internode.on.net>
0011  */
0012 
0013 #include <linux/init.h>
0014 #include <linux/device.h>
0015 #include <linux/platform_device.h>
0016 #include <linux/types.h>
0017 #include <linux/usb/isp116x.h>
0018 
0019 #include <asm/mach-types.h>
0020 #include <asm/mach/arch.h>
0021 
0022 #include "pxa25x.h"
0023 #include "generic.h"
0024 
0025 static void isp116x_pfm_delay(struct device *dev, int delay)
0026 {
0027 
0028     /* 400MHz PXA2 = 2.5ns / instruction */
0029 
0030     int cyc = delay / 10;
0031 
0032     /* 4 Instructions = 4 x 2.5ns = 10ns */
0033     __asm__ volatile ("0:\n"
0034         "subs %0, %1, #1\n"
0035         "bge 0b\n"
0036         :"=r" (cyc)
0037         :"0"(cyc)
0038     );
0039 }
0040 
0041 static struct isp116x_platform_data isp116x_pfm_data = {
0042     .remote_wakeup_enable = 1,
0043     .delay = isp116x_pfm_delay,
0044 };
0045 
0046 static struct resource isp116x_pfm_resources[] = {
0047     [0] =   {
0048         .start  = 0x0d000000,
0049         .end    = 0x0d000000 + 1,
0050         .flags  = IORESOURCE_MEM,
0051         },
0052     [1] =   {
0053         .start  = 0x0d000000 + 4,
0054         .end    = 0x0d000000 + 5,
0055         .flags  = IORESOURCE_MEM,
0056         },
0057     [2] =   {
0058         .start  = 61,
0059         .end    = 61,
0060         .flags  = IORESOURCE_IRQ,
0061         },
0062 };
0063 
0064 static struct platform_device mp900c_dummy_device = {
0065     .name       = "mp900c_dummy",
0066     .id     = -1,
0067 };
0068 
0069 static struct platform_device mp900c_usb = {
0070     .name       = "isp116x-hcd",
0071     .num_resources  = ARRAY_SIZE(isp116x_pfm_resources),
0072     .resource   = isp116x_pfm_resources,
0073     .dev.platform_data = &isp116x_pfm_data,
0074 };
0075 
0076 static struct platform_device *devices[] __initdata = {
0077     &mp900c_dummy_device,
0078     &mp900c_usb,
0079 };
0080 
0081 static void __init mp900c_init(void)
0082 {
0083     printk(KERN_INFO "MobilePro 900/C machine init\n");
0084     pxa_set_ffuart_info(NULL);
0085     pxa_set_btuart_info(NULL);
0086     pxa_set_stuart_info(NULL);
0087     platform_add_devices(devices, ARRAY_SIZE(devices));
0088 }
0089 
0090 /* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */
0091 MACHINE_START(NEC_MP900, "MobilePro900/C")
0092     .atag_offset    = 0x220100,
0093     .init_time  = pxa_timer_init,
0094     .map_io     = pxa25x_map_io,
0095     .nr_irqs    = PXA_NR_IRQS,
0096     .init_irq   = pxa25x_init_irq,
0097     .handle_irq = pxa25x_handle_irq,
0098     .init_machine   = mp900c_init,
0099     .restart    = pxa_restart,
0100 MACHINE_END
0101