Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-pxa/capc7117.c |
| 3 | * |
| 4 | * Support for the Embedian CAPC-7117 Evaluation Kit |
| 5 | * based on the Embedian MXM-8x10 Computer on Module |
| 6 | * |
| 7 | * Copyright (C) 2009 Embedian Inc. |
| 8 | * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd. |
| 9 | * |
| 10 | * 2007-09-04: eric miao <eric.y.miao@gmail.com> |
| 11 | * rewrite to align with latest kernel |
| 12 | * |
| 13 | * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za> |
| 14 | * Hennie van der Merwe <hvdmerwe@tmtservices.co.za> |
| 15 | * rework for upstream merge |
| 16 | * |
| 17 | * This program is free software; you can redistribute it and/or modify |
| 18 | * it under the terms of the GNU General Public License version 2 as |
| 19 | * published by the Free Software Foundation. |
| 20 | */ |
| 21 | |
| 22 | #include <linux/irq.h> |
| 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/ata_platform.h> |
| 25 | #include <linux/serial_8250.h> |
| 26 | #include <linux/gpio.h> |
Robert Jarzmik | a927ef8 | 2015-07-11 21:33:06 +0200 | [diff] [blame] | 27 | #include <linux/regulator/machine.h> |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 28 | |
| 29 | #include <asm/mach-types.h> |
| 30 | #include <asm/mach/arch.h> |
| 31 | |
| 32 | #include <mach/pxa320.h> |
| 33 | #include <mach/mxm8x10.h> |
| 34 | |
| 35 | #include "generic.h" |
| 36 | |
| 37 | /* IDE (PATA) Support */ |
| 38 | static struct pata_platform_info pata_platform_data = { |
| 39 | .ioport_shift = 1 |
| 40 | }; |
| 41 | |
| 42 | static struct resource capc7117_ide_resources[] = { |
| 43 | [0] = { |
| 44 | .start = 0x11000020, |
| 45 | .end = 0x1100003f, |
| 46 | .flags = IORESOURCE_MEM |
| 47 | }, |
| 48 | [1] = { |
| 49 | .start = 0x1100001c, |
| 50 | .end = 0x1100001c, |
| 51 | .flags = IORESOURCE_MEM |
| 52 | }, |
| 53 | [2] = { |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 54 | .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)), |
| 55 | .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 56 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING |
| 57 | } |
| 58 | }; |
| 59 | |
| 60 | static struct platform_device capc7117_ide_device = { |
| 61 | .name = "pata_platform", |
| 62 | .num_resources = ARRAY_SIZE(capc7117_ide_resources), |
| 63 | .resource = capc7117_ide_resources, |
| 64 | .dev = { |
| 65 | .platform_data = &pata_platform_data, |
| 66 | .coherent_dma_mask = ~0 /* grumble */ |
| 67 | } |
| 68 | }; |
| 69 | |
| 70 | static void __init capc7117_ide_init(void) |
| 71 | { |
| 72 | platform_device_register(&capc7117_ide_device); |
| 73 | } |
| 74 | |
| 75 | /* TI16C752 UART support */ |
| 76 | #define TI16C752_FLAGS (UPF_BOOT_AUTOCONF | \ |
| 77 | UPF_IOREMAP | \ |
| 78 | UPF_BUGGY_UART | \ |
| 79 | UPF_SKIP_TEST) |
| 80 | #define TI16C752_UARTCLK (22118400) |
| 81 | static struct plat_serial8250_port ti16c752_platform_data[] = { |
| 82 | [0] = { |
| 83 | .mapbase = 0x14000000, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 84 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 85 | .irqflags = IRQF_TRIGGER_RISING, |
| 86 | .flags = TI16C752_FLAGS, |
| 87 | .iotype = UPIO_MEM, |
| 88 | .regshift = 1, |
| 89 | .uartclk = TI16C752_UARTCLK |
| 90 | }, |
| 91 | [1] = { |
| 92 | .mapbase = 0x14000040, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 93 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 94 | .irqflags = IRQF_TRIGGER_RISING, |
| 95 | .flags = TI16C752_FLAGS, |
| 96 | .iotype = UPIO_MEM, |
| 97 | .regshift = 1, |
| 98 | .uartclk = TI16C752_UARTCLK |
| 99 | }, |
| 100 | [2] = { |
| 101 | .mapbase = 0x14000080, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 102 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 103 | .irqflags = IRQF_TRIGGER_RISING, |
| 104 | .flags = TI16C752_FLAGS, |
| 105 | .iotype = UPIO_MEM, |
| 106 | .regshift = 1, |
| 107 | .uartclk = TI16C752_UARTCLK |
| 108 | }, |
| 109 | [3] = { |
| 110 | .mapbase = 0x140000c0, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 111 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)), |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 112 | .irqflags = IRQF_TRIGGER_RISING, |
| 113 | .flags = TI16C752_FLAGS, |
| 114 | .iotype = UPIO_MEM, |
| 115 | .regshift = 1, |
| 116 | .uartclk = TI16C752_UARTCLK |
| 117 | }, |
| 118 | [4] = { |
| 119 | /* end of array */ |
| 120 | } |
| 121 | }; |
| 122 | |
| 123 | static struct platform_device ti16c752_device = { |
| 124 | .name = "serial8250", |
| 125 | .id = PLAT8250_DEV_PLATFORM, |
| 126 | .dev = { |
| 127 | .platform_data = ti16c752_platform_data |
| 128 | } |
| 129 | }; |
| 130 | |
| 131 | static void __init capc7117_uarts_init(void) |
| 132 | { |
| 133 | platform_device_register(&ti16c752_device); |
| 134 | } |
| 135 | |
| 136 | static void __init capc7117_init(void) |
| 137 | { |
| 138 | /* Init CoM */ |
| 139 | mxm_8x10_barebones_init(); |
| 140 | |
| 141 | /* Init evaluation board peripherals */ |
| 142 | mxm_8x10_ac97_init(); |
| 143 | mxm_8x10_usb_host_init(); |
| 144 | mxm_8x10_mmc_init(); |
| 145 | |
| 146 | capc7117_uarts_init(); |
| 147 | capc7117_ide_init(); |
Robert Jarzmik | a927ef8 | 2015-07-11 21:33:06 +0200 | [diff] [blame] | 148 | |
| 149 | regulator_has_full_constraints(); |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | MACHINE_START(CAPC7117, |
| 153 | "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 154 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 155 | .map_io = pxa3xx_map_io, |
Rob Herring | 4e61109 | 2012-01-03 16:53:48 -0600 | [diff] [blame] | 156 | .nr_irqs = PXA_NR_IRQS, |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 157 | .init_irq = pxa3xx_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 158 | .handle_irq = pxa3xx_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 159 | .init_time = pxa_timer_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 160 | .init_machine = capc7117_init, |
| 161 | .restart = pxa_restart, |
Edwin Peer | 1f3b536 | 2010-02-05 18:31:48 +0200 | [diff] [blame] | 162 | MACHINE_END |