diff options
Diffstat (limited to 'target/linux/adm8668/files/arch/mips/adm8668/platform.c')
-rw-r--r-- | target/linux/adm8668/files/arch/mips/adm8668/platform.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/target/linux/adm8668/files/arch/mips/adm8668/platform.c b/target/linux/adm8668/files/arch/mips/adm8668/platform.c index 4c158dd749..5030565a2c 100644 --- a/target/linux/adm8668/files/arch/mips/adm8668/platform.c +++ b/target/linux/adm8668/files/arch/mips/adm8668/platform.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Scott Nicholas <neutronscott@scottn.us> + * Copyright (C) 2012 Florian Fainelli <florian@openwrt.org> * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -13,6 +14,9 @@ #include <linux/pci.h> #include <linux/slab.h> #include <linux/ioport.h> +#include <linux/amba/bus.h> +#include <linux/amba/serial.h> + #include <asm/reboot.h> #include <asm/time.h> #include <asm/addrspace.h> @@ -20,23 +24,31 @@ #include <asm/io.h> #include <adm8668.h> -static struct resource uart_resources[] = { - { +static void adm8668_uart_set_mctrl(struct amba_device *dev, + void __iomem *base, + unsigned int mcrtl) +{ +} + +static struct amba_pl010_data adm8668_uart0_data = { + .set_mctrl = adm8668_uart_set_mctrl, +}; + +static struct amba_device adm8668_uart0_device = { + .dev = { + .init_name = "apb:uart0", + .platform_data = &adm8668_uart0_data, + }, + .res = { .start = ADM8668_UART0_BASE, .end = ADM8668_UART0_BASE + 0xF, .flags = IORESOURCE_MEM, }, - { - .start = INT_LVL_UART0, - .flags = IORESOURCE_IRQ, + .irq = { + INT_LVL_UART0, + -1 }, -}; - -static struct platform_device adm8668_uart_device = { - .name = "adm8668_uart", - .id = 0, - .resource = uart_resources, - .num_resources = ARRAY_SIZE(uart_resources), + .periphid = 0x0041010, }; static struct resource eth0_resources[] = { @@ -78,13 +90,18 @@ static struct platform_device adm8668_eth1_device = { }; static struct platform_device *adm8668_devs[] = { - &adm8668_uart_device, &adm8668_eth0_device, &adm8668_eth1_device, }; int __devinit adm8668_devs_register(void) { + int ret; + + ret = amba_device_register(&adm8668_uart0_device, &iomem_resource); + if (ret) + panic("failed to register AMBA UART"); + return platform_add_devices(adm8668_devs, ARRAY_SIZE(adm8668_devs)); } arch_initcall(adm8668_devs_register); |