X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Far7%2Ffiles%2Farch%2Fmips%2Far7%2Fplatform.c;h=6c7744c6bc34a407f6d6426b956dd2123096bf2f;hb=f482a6cf2a8491ffbeaa3dfa1596e1cfd4e73aef;hp=cae35bc2290655b9ef97944baef7698bcd53e104;hpb=5c903cc55c673e5e6eda9c78f51a81b715eb4eec;p=openwrt%2Fsvn-archive%2Farchive.git diff --git a/target/linux/ar7/files/arch/mips/ar7/platform.c b/target/linux/ar7/files/arch/mips/ar7/platform.c index cae35bc229..6c7744c6bc 100644 --- a/target/linux/ar7/files/arch/mips/ar7/platform.c +++ b/target/linux/ar7/files/arch/mips/ar7/platform.c @@ -1,18 +1,16 @@ /* - * $Id$ - * * Copyright (C) 2006, 2007 OpenWrt.org - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -28,8 +26,9 @@ #include #include #include +#include + #include -#include #include #include #include @@ -91,21 +90,21 @@ static struct resource physmap_flash_resource = { .flags = IORESOURCE_MEM, .start = 0x10000000, .end = 0x107fffff, -}; +}; static struct resource cpmac_low_res[] = { { .name = "regs", .flags = IORESOURCE_MEM, .start = AR7_REGS_MAC0, - .end = AR7_REGS_MAC0 + 0x7FF, + .end = AR7_REGS_MAC0 + 0x7ff, }, { .name = "irq", .flags = IORESOURCE_IRQ, .start = 27, .end = 27, - }, + }, }; static struct resource cpmac_high_res[] = { @@ -113,14 +112,14 @@ static struct resource cpmac_high_res[] = { .name = "regs", .flags = IORESOURCE_MEM, .start = AR7_REGS_MAC1, - .end = AR7_REGS_MAC1 + 0x7FF, + .end = AR7_REGS_MAC1 + 0x7ff, }, { .name = "irq", .flags = IORESOURCE_IRQ, .start = 41, .end = 41, - }, + }, }; static struct resource vlynq_low_res[] = { @@ -135,7 +134,7 @@ static struct resource vlynq_low_res[] = { .flags = IORESOURCE_IRQ, .start = 29, .end = 29, - }, + }, { .name = "mem", .flags = IORESOURCE_MEM, @@ -155,14 +154,14 @@ static struct resource vlynq_high_res[] = { .name = "regs", .flags = IORESOURCE_MEM, .start = AR7_REGS_VLYNQ1, - .end = AR7_REGS_VLYNQ1 + 0xFF, + .end = AR7_REGS_VLYNQ1 + 0xff, }, { .name = "irq", .flags = IORESOURCE_IRQ, .start = 33, .end = 33, - }, + }, { .name = "mem", .flags = IORESOURCE_MEM, @@ -215,10 +214,15 @@ static struct platform_device physmap_flash = { .num_resources = 1, }; +static u64 cpmac_dma_mask = DMA_32BIT_MASK; static struct platform_device cpmac_low = { .id = 0, .name = "cpmac", - .dev.platform_data = &cpmac_low_data, + .dev = { + .dma_mask = &cpmac_dma_mask; + .coherent_dma_mask = DMA_32BIT_MASK; + .platform_data = &cpmac_low_data, + }, .resource = cpmac_low_res, .num_resources = ARRAY_SIZE(cpmac_low_res), }; @@ -226,7 +230,11 @@ static struct platform_device cpmac_low = { static struct platform_device cpmac_high = { .id = 1, .name = "cpmac", - .dev.platform_data = &cpmac_high_data, + .dev = { + .dma_mask = &cpmac_dma_mask; + .coherent_dma_mask = DMA_32BIT_MASK; + .platform_data = &cpmac_high_data, + }, .resource = cpmac_high_res, .num_resources = ARRAY_SIZE(cpmac_high_res), }; @@ -253,8 +261,7 @@ static struct platform_device vlynq_high = { */ #if !defined(CONFIG_SERIAL_8250) -static struct plat_serial8250_port uart0_data = -{ +static struct plat_serial8250_port uart0_data = { .mapbase = AR7_REGS_UART0, .irq = AR7_IRQ_UART0, .regshift = 2, @@ -262,8 +269,7 @@ static struct plat_serial8250_port uart0_data = .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, }; -static struct plat_serial8250_port uart1_data = -{ +static struct plat_serial8250_port uart1_data = { .mapbase = UR8_REGS_UART1, .irq = AR7_IRQ_UART1, .regshift = 2, @@ -272,13 +278,13 @@ static struct plat_serial8250_port uart1_data = }; static struct plat_serial8250_port uart_data[] = { - uart0_data, - uart1_data, + uart0_data, + uart1_data, { .flags = 0 } }; static struct plat_serial8250_port uart_data_single[] = { - uart0_data, + uart0_data, { .flags = 0 } }; @@ -346,36 +352,35 @@ static int __init ar7_register_devices(void) return res; - // Only TNETD73xx have a second serial port - if (ar7_has_second_uart()) { - uart_port[1].type = PORT_AR7; - uart_port[1].line = 1; - uart_port[1].irq = AR7_IRQ_UART1; - uart_port[1].uartclk = ar7_bus_freq() / 2; - uart_port[1].iotype = UPIO_MEM; - uart_port[1].mapbase = UR8_REGS_UART1; - uart_port[1].membase = ioremap(uart_port[1].mapbase, 256); - uart_port[1].regshift = 2; - res = early_serial_setup(&uart_port[1]); - if (res) - return res; - } - -#else // !CONFIG_SERIAL_8250 + /* Only TNETD73xx have a second serial port */ + if (ar7_has_second_uart()) { + uart_port[1].type = PORT_AR7; + uart_port[1].line = 1; + uart_port[1].irq = AR7_IRQ_UART1; + uart_port[1].uartclk = ar7_bus_freq() / 2; + uart_port[1].iotype = UPIO_MEM; + uart_port[1].mapbase = UR8_REGS_UART1; + uart_port[1].membase = ioremap(uart_port[1].mapbase, 256); + uart_port[1].regshift = 2; + res = early_serial_setup(&uart_port[1]); + if (res) + return res; + } + +#else /* !CONFIG_SERIAL_8250 */ uart_data[0].uartclk = ar7_bus_freq() / 2; uart_data[1].uartclk = uart_data[0].uartclk; - // Only TNETD73xx have a second serial port - if (ar7_has_second_uart()) { - uart.dev.platform_data = uart_data; - } + /* Only TNETD73xx have a second serial port */ + if (ar7_has_second_uart()) + uart.dev.platform_data = uart_data; res = platform_device_register(&uart); if (res) return res; - -#endif // CONFIG_SERIAL_8250 + +#endif /* CONFIG_SERIAL_8250 */ res = platform_device_register(&physmap_flash); if (res)