2 * Infineon/ADMTek 8668 (WildPass) platform devices support
4 * Copyright (C) 2010 Scott Nicholas <neutronscott@scottn.us>
5 * Copyright (C) 2012 Florian Fainelli <florian@openwrt.org>
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/platform_device.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/mtd/partitions.h>
17 #include <linux/pci.h>
18 #include <linux/slab.h>
19 #include <linux/ioport.h>
20 #include <linux/amba/bus.h>
21 #include <linux/amba/serial.h>
23 #include <asm/reboot.h>
25 #include <asm/addrspace.h>
26 #include <asm/bootinfo.h>
30 static void adm8668_uart_set_mctrl(struct amba_device *dev,
36 static struct amba_pl010_data adm8668_uart0_data = {
37 .set_mctrl = adm8668_uart_set_mctrl,
40 static struct amba_device adm8668_uart0_device = {
42 .init_name = "apb:uart0",
43 .platform_data = &adm8668_uart0_data,
46 .start = ADM8668_UART0_BASE,
47 .end = ADM8668_UART0_BASE + 0xF,
48 .flags = IORESOURCE_MEM,
54 .periphid = 0x0041010,
57 static struct resource eth0_resources[] = {
59 .start = ADM8668_LAN_BASE,
60 .end = ADM8668_LAN_BASE + 256,
61 .flags = IORESOURCE_MEM,
65 .flags = IORESOURCE_IRQ,
69 static struct platform_device adm8668_eth0_device = {
70 .name = "adm8668_eth",
72 .resource = eth0_resources,
73 .num_resources = ARRAY_SIZE(eth0_resources),
76 static struct resource eth1_resources[] = {
78 .start = ADM8668_WAN_BASE,
79 .end = ADM8668_WAN_BASE + 256,
80 .flags = IORESOURCE_MEM,
84 .flags = IORESOURCE_IRQ,
88 static struct platform_device adm8668_eth1_device = {
89 .name = "adm8668_eth",
91 .resource = eth1_resources,
92 .num_resources = ARRAY_SIZE(eth1_resources),
95 static const char *nor_probe_types[] = { "adm8668part", NULL };
97 static struct physmap_flash_data nor_flash_data = {
99 .part_probe_types = nor_probe_types,
102 static struct resource nor_resources[] = {
104 .start = ADM8668_SMEM1_BASE,
105 .end = ADM8668_SMEM1_BASE + 0x800000 - 1,
106 .flags = IORESOURCE_MEM,
110 static struct platform_device adm8668_nor_device = {
111 .name = "physmap-flash",
113 .resource = nor_resources,
114 .num_resources = ARRAY_SIZE(nor_resources),
115 .dev.platform_data = &nor_flash_data,
118 static struct platform_device *adm8668_devs[] = {
119 &adm8668_eth0_device,
120 &adm8668_eth1_device,
124 int __devinit adm8668_devs_register(void)
128 ret = amba_device_register(&adm8668_uart0_device, &iomem_resource);
130 panic("failed to register AMBA UART");
132 return platform_add_devices(adm8668_devs, ARRAY_SIZE(adm8668_devs));
134 arch_initcall(adm8668_devs_register);