Linux Audio

Check our new training course

Loading...
v3.15
 
  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>
 
 27
 28#include <asm/mach-types.h>
 29#include <asm/mach/arch.h>
 30
 31#include <mach/pxa320.h>
 32#include <mach/mxm8x10.h>
 33
 34#include "generic.h"
 35
 36/* IDE (PATA) Support */
 37static struct pata_platform_info pata_platform_data = {
 38	.ioport_shift = 1
 39};
 40
 41static struct resource capc7117_ide_resources[] = {
 42	[0] = {
 43	       .start = 0x11000020,
 44	       .end = 0x1100003f,
 45	       .flags = IORESOURCE_MEM
 46	},
 47	[1] = {
 48	       .start = 0x1100001c,
 49	       .end = 0x1100001c,
 50	       .flags = IORESOURCE_MEM
 51	},
 52	[2] = {
 53	       .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
 54	       .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
 55	       .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
 56	}
 57};
 58
 59static struct platform_device capc7117_ide_device = {
 60	.name = "pata_platform",
 61	.num_resources = ARRAY_SIZE(capc7117_ide_resources),
 62	.resource = capc7117_ide_resources,
 63	.dev = {
 64		.platform_data = &pata_platform_data,
 65		.coherent_dma_mask = ~0		/* grumble */
 66	}
 67};
 68
 69static void __init capc7117_ide_init(void)
 70{
 71	platform_device_register(&capc7117_ide_device);
 72}
 73
 74/* TI16C752 UART support */
 75#define	TI16C752_FLAGS		(UPF_BOOT_AUTOCONF | \
 76					UPF_IOREMAP | \
 77					UPF_BUGGY_UART | \
 78					UPF_SKIP_TEST)
 79#define	TI16C752_UARTCLK	(22118400)
 80static struct plat_serial8250_port ti16c752_platform_data[] = {
 81	[0] = {
 82	       .mapbase = 0x14000000,
 83	       .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
 84	       .irqflags = IRQF_TRIGGER_RISING,
 85	       .flags = TI16C752_FLAGS,
 86	       .iotype = UPIO_MEM,
 87	       .regshift = 1,
 88	       .uartclk = TI16C752_UARTCLK
 89	},
 90	[1] = {
 91	       .mapbase = 0x14000040,
 92	       .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
 93	       .irqflags = IRQF_TRIGGER_RISING,
 94	       .flags = TI16C752_FLAGS,
 95	       .iotype = UPIO_MEM,
 96	       .regshift = 1,
 97	       .uartclk = TI16C752_UARTCLK
 98	},
 99	[2] = {
100	       .mapbase = 0x14000080,
101	       .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
102	       .irqflags = IRQF_TRIGGER_RISING,
103	       .flags = TI16C752_FLAGS,
104	       .iotype = UPIO_MEM,
105	       .regshift = 1,
106	       .uartclk = TI16C752_UARTCLK
107	},
108	[3] = {
109	       .mapbase = 0x140000c0,
110	       .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
111	       .irqflags = IRQF_TRIGGER_RISING,
112	       .flags = TI16C752_FLAGS,
113	       .iotype = UPIO_MEM,
114	       .regshift = 1,
115	       .uartclk = TI16C752_UARTCLK
116	},
117	[4] = {
118	       /* end of array */
119	}
120};
121
122static struct platform_device ti16c752_device = {
123	.name = "serial8250",
124	.id = PLAT8250_DEV_PLATFORM,
125	.dev = {
126		.platform_data = ti16c752_platform_data
127	}
128};
129
130static void __init capc7117_uarts_init(void)
131{
132	platform_device_register(&ti16c752_device);
133}
134
135static void __init capc7117_init(void)
136{
137	/* Init CoM */
138	mxm_8x10_barebones_init();
139
140	/* Init evaluation board peripherals */
141	mxm_8x10_ac97_init();
142	mxm_8x10_usb_host_init();
143	mxm_8x10_mmc_init();
144
145	capc7117_uarts_init();
146	capc7117_ide_init();
 
 
147}
148
149MACHINE_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,
159MACHINE_END
v5.14.15
  1// SPDX-License-Identifier: GPL-2.0-only
  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
 
 
 
 
 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>
 24#include <linux/regulator/machine.h>
 25
 26#include <asm/mach-types.h>
 27#include <asm/mach/arch.h>
 28
 29#include "pxa320.h"
 30#include "mxm8x10.h"
 31
 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] = {
 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
 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,
 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
 87	},
 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
 96	},
 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
105	},
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
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();
145
146	regulator_has_full_constraints();
147}
148
149MACHINE_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,
159MACHINE_END