blob: 7712327f56a8465a1fc024998bb0e841a9f6082d [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Edwin Peer1f3b5362010-02-05 18:31:48 +02002/*
3 * linux/arch/arm/mach-pxa/capc7117.c
4 *
5 * Support for the Embedian CAPC-7117 Evaluation Kit
6 * based on the Embedian MXM-8x10 Computer on Module
7 *
8 * Copyright (C) 2009 Embedian Inc.
9 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
10 *
11 * 2007-09-04: eric miao <eric.y.miao@gmail.com>
12 * rewrite to align with latest kernel
13 *
14 * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
15 * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
16 * rework for upstream merge
Edwin Peer1f3b5362010-02-05 18:31:48 +020017 */
18
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>
Robert Jarzmika927ef82015-07-11 21:33:06 +020024#include <linux/regulator/machine.h>
Edwin Peer1f3b5362010-02-05 18:31:48 +020025
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28
Arnd Bergmann4c25c5d2015-01-30 10:45:33 +010029#include "pxa320.h"
30#include "mxm8x10.h"
Edwin Peer1f3b5362010-02-05 18:31:48 +020031
32#include "generic.h"
33
34/* IDE (PATA) Support */
35static struct pata_platform_info pata_platform_data = {
36 .ioport_shift = 1
37};
38
39static struct resource capc7117_ide_resources[] = {
40 [0] = {
41 .start = 0x11000020,
42 .end = 0x1100003f,
43 .flags = IORESOURCE_MEM
44 },
45 [1] = {
46 .start = 0x1100001c,
47 .end = 0x1100001c,
48 .flags = IORESOURCE_MEM
49 },
50 [2] = {
Haojian Zhuang4929f5a2011-10-10 16:03:51 +080051 .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
52 .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
Edwin Peer1f3b5362010-02-05 18:31:48 +020053 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
54 }
55};
56
57static 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 */
64 }
65};
66
67static void __init capc7117_ide_init(void)
68{
69 platform_device_register(&capc7117_ide_device);
70}
71
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)
78static struct plat_serial8250_port ti16c752_platform_data[] = {
79 [0] = {
80 .mapbase = 0x14000000,
Haojian Zhuang4929f5a2011-10-10 16:03:51 +080081 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
Edwin Peer1f3b5362010-02-05 18:31:48 +020082 .irqflags = IRQF_TRIGGER_RISING,
83 .flags = TI16C752_FLAGS,
84 .iotype = UPIO_MEM,
85 .regshift = 1,
86 .uartclk = TI16C752_UARTCLK
87 },
88 [1] = {
89 .mapbase = 0x14000040,
Haojian Zhuang4929f5a2011-10-10 16:03:51 +080090 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
Edwin Peer1f3b5362010-02-05 18:31:48 +020091 .irqflags = IRQF_TRIGGER_RISING,
92 .flags = TI16C752_FLAGS,
93 .iotype = UPIO_MEM,
94 .regshift = 1,
95 .uartclk = TI16C752_UARTCLK
96 },
97 [2] = {
98 .mapbase = 0x14000080,
Haojian Zhuang4929f5a2011-10-10 16:03:51 +080099 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
Edwin Peer1f3b5362010-02-05 18:31:48 +0200100 .irqflags = IRQF_TRIGGER_RISING,
101 .flags = TI16C752_FLAGS,
102 .iotype = UPIO_MEM,
103 .regshift = 1,
104 .uartclk = TI16C752_UARTCLK
105 },
106 [3] = {
107 .mapbase = 0x140000c0,
Haojian Zhuang4929f5a2011-10-10 16:03:51 +0800108 .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
Edwin Peer1f3b5362010-02-05 18:31:48 +0200109 .irqflags = IRQF_TRIGGER_RISING,
110 .flags = TI16C752_FLAGS,
111 .iotype = UPIO_MEM,
112 .regshift = 1,
113 .uartclk = TI16C752_UARTCLK
114 },
115 [4] = {
116 /* end of array */
117 }
118};
119
120static struct platform_device ti16c752_device = {
121 .name = "serial8250",
122 .id = PLAT8250_DEV_PLATFORM,
123 .dev = {
124 .platform_data = ti16c752_platform_data
125 }
126};
127
128static void __init capc7117_uarts_init(void)
129{
130 platform_device_register(&ti16c752_device);
131}
132
133static void __init capc7117_init(void)
134{
135 /* Init CoM */
136 mxm_8x10_barebones_init();
137
138 /* Init evaluation board peripherals */
139 mxm_8x10_ac97_init();
140 mxm_8x10_usb_host_init();
141 mxm_8x10_mmc_init();
142
143 capc7117_uarts_init();
144 capc7117_ide_init();
Robert Jarzmika927ef82015-07-11 21:33:06 +0200145
146 regulator_has_full_constraints();
Edwin Peer1f3b5362010-02-05 18:31:48 +0200147}
148
149MACHINE_START(CAPC7117,
150 "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
Nicolas Pitre7375aba2011-07-05 22:38:15 -0400151 .atag_offset = 0x100,
Marek Vasut851982c2010-10-11 02:20:19 +0200152 .map_io = pxa3xx_map_io,
Rob Herring4e611092012-01-03 16:53:48 -0600153 .nr_irqs = PXA_NR_IRQS,
Edwin Peer1f3b5362010-02-05 18:31:48 +0200154 .init_irq = pxa3xx_init_irq,
Eric Miao8a97ae22011-05-18 21:30:04 +0800155 .handle_irq = pxa3xx_handle_irq,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700156 .init_time = pxa_timer_init,
Russell King271a74f2011-11-04 14:15:53 +0000157 .init_machine = capc7117_init,
158 .restart = pxa_restart,
Edwin Peer1f3b5362010-02-05 18:31:48 +0200159MACHINE_END