/* * Infineon/ADMTek 8668 (WildPass) platform devices support * * Copyright (C) 2010 Scott Nicholas * Copyright (C) 2012 Florian Fainelli * * 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 * for more details. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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, }, .irq = { INT_LVL_UART0, -1 }, .periphid = 0x0041010, }; static struct resource eth0_resources[] = { { .start = ADM8668_LAN_BASE, .end = ADM8668_LAN_BASE + 256, .flags = IORESOURCE_MEM, }, { .start = INT_LVL_LAN, .flags = IORESOURCE_IRQ, }, }; static struct platform_device adm8668_eth0_device = { .name = "adm8668_eth", .id = 0, .resource = eth0_resources, .num_resources = ARRAY_SIZE(eth0_resources), }; static struct resource eth1_resources[] = { { .start = ADM8668_WAN_BASE, .end = ADM8668_WAN_BASE + 256, .flags = IORESOURCE_MEM, }, { .start = INT_LVL_WAN, .flags = IORESOURCE_IRQ, }, }; static struct platform_device adm8668_eth1_device = { .name = "adm8668_eth", .id = 1, .resource = eth1_resources, .num_resources = ARRAY_SIZE(eth1_resources), }; static const char *nor_probe_types[] = { "adm8668part", NULL }; static struct physmap_flash_data nor_flash_data = { .width = 2, .part_probe_types = nor_probe_types, }; static struct resource nor_resources[] = { { .start = ADM8668_SMEM1_BASE, .end = ADM8668_SMEM1_BASE + 0x800000 - 1, .flags = IORESOURCE_MEM, }, }; static struct platform_device adm8668_nor_device = { .name = "physmap-flash", .id = -1, .resource = nor_resources, .num_resources = ARRAY_SIZE(nor_resources), .dev.platform_data = &nor_flash_data, }; static struct platform_device *adm8668_devs[] = { &adm8668_eth0_device, &adm8668_eth1_device, &adm8668_nor_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);