Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[linux/fpc-iii.git] / arch / arm / mach-pxa / capc7117.c
blob7712327f56a8465a1fc024998bb0e841a9f6082d
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * linux/arch/arm/mach-pxa/capc7117.c
5 * Support for the Embedian CAPC-7117 Evaluation Kit
6 * based on the Embedian MXM-8x10 Computer on Module
8 * Copyright (C) 2009 Embedian Inc.
9 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
11 * 2007-09-04: eric miao <eric.y.miao@gmail.com>
12 * rewrite to align with latest kernel
14 * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
15 * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
16 * rework for upstream merge
19 #include <linux/irq.h>
20 #include <linux/platform_device.h>
21 #include <linux/ata_platform.h>
22 #include <linux/serial_8250.h>
23 #include <linux/gpio.h>
24 #include <linux/regulator/machine.h>
26 #include <asm/mach-types.h>
27 #include <asm/mach/arch.h>
29 #include "pxa320.h"
30 #include "mxm8x10.h"
32 #include "generic.h"
34 /* IDE (PATA) Support */
35 static struct pata_platform_info pata_platform_data = {
36 .ioport_shift = 1
39 static struct resource capc7117_ide_resources[] = {
40 [0] = {
41 .start = 0x11000020,
42 .end = 0x1100003f,
43 .flags = IORESOURCE_MEM
45 [1] = {
46 .start = 0x1100001c,
47 .end = 0x1100001c,
48 .flags = IORESOURCE_MEM
50 [2] = {
51 .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
52 .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
53 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
57 static struct platform_device capc7117_ide_device = {
58 .name = "pata_platform",
59 .num_resources = ARRAY_SIZE(capc7117_ide_resources),
60 .resource = capc7117_ide_resources,
61 .dev = {
62 .platform_data = &pata_platform_data,
63 .coherent_dma_mask = ~0 /* grumble */
67 static void __init capc7117_ide_init(void)
69 platform_device_register(&capc7117_ide_device);
72 /* TI16C752 UART support */
73 #define TI16C752_FLAGS (UPF_BOOT_AUTOCONF | \
74 UPF_IOREMAP | \
75 UPF_BUGGY_UART | \
76 UPF_SKIP_TEST)
77 #define TI16C752_UARTCLK (22118400)
78 static struct plat_serial8250_port ti16c752_platform_data[] = {
79 [0] = {
80 .mapbase = 0x14000000,
81 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
82 .irqflags = IRQF_TRIGGER_RISING,
83 .flags = TI16C752_FLAGS,
84 .iotype = UPIO_MEM,
85 .regshift = 1,
86 .uartclk = TI16C752_UARTCLK
88 [1] = {
89 .mapbase = 0x14000040,
90 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
91 .irqflags = IRQF_TRIGGER_RISING,
92 .flags = TI16C752_FLAGS,
93 .iotype = UPIO_MEM,
94 .regshift = 1,
95 .uartclk = TI16C752_UARTCLK
97 [2] = {
98 .mapbase = 0x14000080,
99 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
100 .irqflags = IRQF_TRIGGER_RISING,
101 .flags = TI16C752_FLAGS,
102 .iotype = UPIO_MEM,
103 .regshift = 1,
104 .uartclk = TI16C752_UARTCLK
106 [3] = {
107 .mapbase = 0x140000c0,
108 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
109 .irqflags = IRQF_TRIGGER_RISING,
110 .flags = TI16C752_FLAGS,
111 .iotype = UPIO_MEM,
112 .regshift = 1,
113 .uartclk = TI16C752_UARTCLK
115 [4] = {
116 /* end of array */
120 static struct platform_device ti16c752_device = {
121 .name = "serial8250",
122 .id = PLAT8250_DEV_PLATFORM,
123 .dev = {
124 .platform_data = ti16c752_platform_data
128 static void __init capc7117_uarts_init(void)
130 platform_device_register(&ti16c752_device);
133 static void __init capc7117_init(void)
135 /* Init CoM */
136 mxm_8x10_barebones_init();
138 /* Init evaluation board peripherals */
139 mxm_8x10_ac97_init();
140 mxm_8x10_usb_host_init();
141 mxm_8x10_mmc_init();
143 capc7117_uarts_init();
144 capc7117_ide_init();
146 regulator_has_full_constraints();
149 MACHINE_START(CAPC7117,
150 "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
151 .atag_offset = 0x100,
152 .map_io = pxa3xx_map_io,
153 .nr_irqs = PXA_NR_IRQS,
154 .init_irq = pxa3xx_init_irq,
155 .handle_irq = pxa3xx_handle_irq,
156 .init_time = pxa_timer_init,
157 .init_machine = capc7117_init,
158 .restart = pxa_restart,
159 MACHINE_END