Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 2 | /* |
| 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 Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 17 | */ |
| 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 Jarzmik | a927ef8 | 2015-07-11 21:33:06 +0200 | [diff] [blame] | 24 | #include <linux/regulator/machine.h> |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 25 | |
| 26 | #include <asm/mach-types.h> |
| 27 | #include <asm/mach/arch.h> |
| 28 | |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 29 | #include "pxa320.h" |
| 30 | #include "mxm8x10.h" |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 31 | |
| 32 | #include "generic.h" |
| 33 | |
| 34 | /* IDE (PATA) Support */ |
| 35 | static struct pata_platform_info pata_platform_data = { |
| 36 | .ioport_shift = 1 |
| 37 | }; |
| 38 | |
| 39 | static 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 Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 51 | .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)), |
| 52 | .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 53 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING |
| 54 | } |
| 55 | }; |
| 56 | |
| 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 */ |
| 64 | } |
| 65 | }; |
| 66 | |
| 67 | static 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) |
| 78 | static struct plat_serial8250_port ti16c752_platform_data[] = { |
| 79 | [0] = { |
| 80 | .mapbase = 0x14000000, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 81 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 82 | .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 Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 90 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 91 | .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 Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 99 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 100 | .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 Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 108 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 109 | .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 | |
| 120 | static struct platform_device ti16c752_device = { |
| 121 | .name = "serial8250", |
| 122 | .id = PLAT8250_DEV_PLATFORM, |
| 123 | .dev = { |
| 124 | .platform_data = ti16c752_platform_data |
| 125 | } |
| 126 | }; |
| 127 | |
| 128 | static void __init capc7117_uarts_init(void) |
| 129 | { |
| 130 | platform_device_register(&ti16c752_device); |
| 131 | } |
| 132 | |
| 133 | static 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 Jarzmik | a927ef8 | 2015-07-11 21:33:06 +0200 | [diff] [blame] | 145 | |
| 146 | regulator_has_full_constraints(); |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | MACHINE_START(CAPC7117, |
| 150 | "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 151 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 152 | .map_io = pxa3xx_map_io, |
Rob Herring | 4e61109 | 2012-01-03 16:53:48 -0600 | [diff] [blame] | 153 | .nr_irqs = PXA_NR_IRQS, |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 154 | .init_irq = pxa3xx_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 155 | .handle_irq = pxa3xx_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 156 | .init_time = pxa_timer_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 157 | .init_machine = capc7117_init, |
| 158 | .restart = pxa_restart, |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 159 | MACHINE_END |