/*
- * $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
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/ioport.h>
+#include <linux/io.h>
+
#include <asm/addrspace.h>
-#include <asm/io.h>
#include <asm/ar7/ar7.h>
#include <asm/ar7/gpio.h>
#include <asm/ar7/prom.h>
.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[] = {
.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[] = {
.flags = IORESOURCE_IRQ,
.start = 29,
.end = 29,
- },
+ },
{
.name = "mem",
.flags = IORESOURCE_MEM,
.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,
.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),
};
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),
};
*/
#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,
.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,
};
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 }
};
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)