2 * Copyright (C) 2010 Scott Nicholas <neutronscott@scottn.us>
3 * Copyright (C) 2012 Florian Fainelli <florian@openwrt.org>
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/pci.h>
15 #include <linux/slab.h>
16 #include <linux/ioport.h>
17 #include <linux/amba/bus.h>
18 #include <linux/amba/serial.h>
20 #include <asm/reboot.h>
22 #include <asm/addrspace.h>
23 #include <asm/bootinfo.h>
27 static void adm8668_uart_set_mctrl(struct amba_device
*dev
,
33 static struct amba_pl010_data adm8668_uart0_data
= {
34 .set_mctrl
= adm8668_uart_set_mctrl
,
37 static struct amba_device adm8668_uart0_device
= {
39 .init_name
= "apb:uart0",
40 .platform_data
= &adm8668_uart0_data
,
43 .start
= ADM8668_UART0_BASE
,
44 .end
= ADM8668_UART0_BASE
+ 0xF,
45 .flags
= IORESOURCE_MEM
,
51 .periphid
= 0x0041010,
54 static struct resource eth0_resources
[] = {
56 .start
= ADM8668_LAN_BASE
,
57 .end
= ADM8668_LAN_BASE
+ 256,
58 .flags
= IORESOURCE_MEM
,
62 .flags
= IORESOURCE_IRQ
,
66 static struct platform_device adm8668_eth0_device
= {
67 .name
= "adm8668_eth",
69 .resource
= eth0_resources
,
70 .num_resources
= ARRAY_SIZE(eth0_resources
),
73 static struct resource eth1_resources
[] = {
75 .start
= ADM8668_WAN_BASE
,
76 .end
= ADM8668_WAN_BASE
+ 256,
77 .flags
= IORESOURCE_MEM
,
81 .flags
= IORESOURCE_IRQ
,
85 static struct platform_device adm8668_eth1_device
= {
86 .name
= "adm8668_eth",
88 .resource
= eth1_resources
,
89 .num_resources
= ARRAY_SIZE(eth1_resources
),
92 static struct platform_device
*adm8668_devs
[] = {
97 int __devinit
adm8668_devs_register(void)
101 ret
= amba_device_register(&adm8668_uart0_device
, &iomem_resource
);
103 panic("failed to register AMBA UART");
105 return platform_add_devices(adm8668_devs
, ARRAY_SIZE(adm8668_devs
));
107 arch_initcall(adm8668_devs_register
);