1 // SPDX-License-Identifier: GPL-2.0-only
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>
34 /* IDE (PATA) Support */
35 static struct pata_platform_info pata_platform_data = {
39 static struct resource capc7117_ide_resources[] = {
43 .flags = IORESOURCE_MEM
48 .flags = IORESOURCE_MEM
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,
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 | \
77 #define TI16C752_UARTCLK (22118400)
78 static struct plat_serial8250_port ti16c752_platform_data[] = {
80 .mapbase = 0x14000000,
81 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
82 .irqflags = IRQF_TRIGGER_RISING,
83 .flags = TI16C752_FLAGS,
86 .uartclk = TI16C752_UARTCLK
89 .mapbase = 0x14000040,
90 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
91 .irqflags = IRQF_TRIGGER_RISING,
92 .flags = TI16C752_FLAGS,
95 .uartclk = TI16C752_UARTCLK
98 .mapbase = 0x14000080,
99 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
100 .irqflags = IRQF_TRIGGER_RISING,
101 .flags = TI16C752_FLAGS,
104 .uartclk = TI16C752_UARTCLK
107 .mapbase = 0x140000c0,
108 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
109 .irqflags = IRQF_TRIGGER_RISING,
110 .flags = TI16C752_FLAGS,
113 .uartclk = TI16C752_UARTCLK
120 static struct platform_device ti16c752_device = {
121 .name = "serial8250",
122 .id = PLAT8250_DEV_PLATFORM,
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)
136 mxm_8x10_barebones_init();
138 /* Init evaluation board peripherals */
139 mxm_8x10_ac97_init();
140 mxm_8x10_usb_host_init();
143 capc7117_uarts_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,