diff options
Diffstat (limited to 'target/linux/ar7/files/arch/mips/ar7')
-rw-r--r-- | target/linux/ar7/files/arch/mips/ar7/clock.c | 4 | ||||
-rw-r--r-- | target/linux/ar7/files/arch/mips/ar7/platform.c | 60 | ||||
-rw-r--r-- | target/linux/ar7/files/arch/mips/ar7/prom.c | 45 | ||||
-rw-r--r-- | target/linux/ar7/files/arch/mips/ar7/setup.c | 2 | ||||
-rw-r--r-- | target/linux/ar7/files/arch/mips/ar7/vlynq-pci.c | 2 | ||||
-rw-r--r-- | target/linux/ar7/files/arch/mips/ar7/vlynq.c | 20 |
6 files changed, 66 insertions, 67 deletions
diff --git a/target/linux/ar7/files/arch/mips/ar7/clock.c b/target/linux/ar7/files/arch/mips/ar7/clock.c index 9bdc8f407..56ade75ac 100644 --- a/target/linux/ar7/files/arch/mips/ar7/clock.c +++ b/target/linux/ar7/files/arch/mips/ar7/clock.c @@ -339,7 +339,7 @@ static int tnetd7200_get_clock_base(int clock_id, u32 *bootcr) return AR7_AFE_CLOCK; } } else { - // Sync + // Sync if (*bootcr & BOOT_PLL_2TO1_MODE) { // 2:1 switch (clock_id) { @@ -348,7 +348,7 @@ static int tnetd7200_get_clock_base(int clock_id, u32 *bootcr) default: return AR7_AFE_CLOCK; } - } else { + } else { // 1:1 return AR7_REF_CLOCK; } diff --git a/target/linux/ar7/files/arch/mips/ar7/platform.c b/target/linux/ar7/files/arch/mips/ar7/platform.c index cae35bc22..b1122a6b7 100644 --- a/target/linux/ar7/files/arch/mips/ar7/platform.c +++ b/target/linux/ar7/files/arch/mips/ar7/platform.c @@ -98,14 +98,14 @@ 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 +113,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 +135,7 @@ static struct resource vlynq_low_res[] = { .flags = IORESOURCE_IRQ, .start = 29, .end = 29, - }, + }, { .name = "mem", .flags = IORESOURCE_MEM, @@ -155,14 +155,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, @@ -272,13 +272,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,35 +346,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; - } - + // 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 res = platform_device_register(&physmap_flash); diff --git a/target/linux/ar7/files/arch/mips/ar7/prom.c b/target/linux/ar7/files/arch/mips/ar7/prom.c index 28397427d..e06cd32a4 100644 --- a/target/linux/ar7/files/arch/mips/ar7/prom.c +++ b/target/linux/ar7/files/arch/mips/ar7/prom.c @@ -225,11 +225,10 @@ static void __init console_config(void) return; #ifdef CONFIG_KGDB - if (!strstr(prom_getcmdline(), "nokgdb")) - { - strcat(prom_getcmdline(), " console=kgdb"); - kgdb_enabled = 1; - return; + if (!strstr(prom_getcmdline(), "nokgdb")) { + strcat(prom_getcmdline(), " console=kgdb"); + kgdb_enabled = 1; + return; } #endif @@ -293,23 +292,23 @@ int prom_putchar(char c) // from adm5120/prom.c void prom_printf(char *fmt, ...) { - va_list args; - int l; - char *p, *buf_end; - char buf[1024]; - - va_start(args, fmt); - l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */ - va_end(args); - - buf_end = buf + l; - - for (p = buf; p < buf_end; p++) { - /* Crude cr/nl handling is better than none */ - if (*p == '\n') - prom_putchar('\r'); - prom_putchar(*p); - } + va_list args; + int l; + char *p, *buf_end; + char buf[1024]; + + va_start(args, fmt); + l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */ + va_end(args); + + buf_end = buf + l; + + for (p = buf; p < buf_end; p++) { + /* Crude cr/nl handling is better than none */ + if (*p == '\n') + prom_putchar('\r'); + prom_putchar(*p); + } } #ifdef CONFIG_KGDB @@ -320,7 +319,7 @@ int putDebugChar(char c) char getDebugChar(void) { - return prom_getchar(); + return prom_getchar(); } #endif diff --git a/target/linux/ar7/files/arch/mips/ar7/setup.c b/target/linux/ar7/files/arch/mips/ar7/setup.c index 4abc39f1d..b3bd56e2e 100644 --- a/target/linux/ar7/files/arch/mips/ar7/setup.c +++ b/target/linux/ar7/files/arch/mips/ar7/setup.c @@ -61,7 +61,7 @@ static void ar7_machine_halt(void) static void ar7_machine_power_off(void) { - volatile u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1); + volatile u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1); u32 power_state = *power_reg | (3 << 30); *power_reg = power_state; ar7_machine_halt(); diff --git a/target/linux/ar7/files/arch/mips/ar7/vlynq-pci.c b/target/linux/ar7/files/arch/mips/ar7/vlynq-pci.c index eb11a3b00..44a68a4d1 100644 --- a/target/linux/ar7/files/arch/mips/ar7/vlynq-pci.c +++ b/target/linux/ar7/files/arch/mips/ar7/vlynq-pci.c @@ -394,7 +394,7 @@ int pcibios_map_irq(struct pci_dev *pdev, u8 slot, u8 pin) return vlynq_virq_to_irq(dev, priv->config->irq); } - + /* Do platform specific device initialization at pci_enable_device() time */ int pcibios_plat_dev_init(struct pci_dev *dev) { diff --git a/target/linux/ar7/files/arch/mips/ar7/vlynq.c b/target/linux/ar7/files/arch/mips/ar7/vlynq.c index c9be21472..e4c03e28e 100644 --- a/target/linux/ar7/files/arch/mips/ar7/vlynq.c +++ b/target/linux/ar7/files/arch/mips/ar7/vlynq.c @@ -39,10 +39,10 @@ #define VLYNQ_CTRL_PM_ENABLE 0x80000000 #define VLYNQ_CTRL_CLOCK_INT 0x00008000 -#define VLYNQ_CTRL_CLOCK_DIV(x) ((x & 7) << 16) +#define VLYNQ_CTRL_CLOCK_DIV(x) (((x) & 7) << 16) #define VLYNQ_CTRL_INT_LOCAL 0x00004000 #define VLYNQ_CTRL_INT_ENABLE 0x00002000 -#define VLYNQ_CTRL_INT_VECTOR(x) ((x & 0x1f) << 8) +#define VLYNQ_CTRL_INT_VECTOR(x) (((x) & 0x1f) << 8) #define VLYNQ_CTRL_INT2CFG 0x00000080 #define VLYNQ_CTRL_RESET 0x00000001 @@ -197,11 +197,11 @@ static irqreturn_t vlynq_irq(int irq, void *dev_id) } static struct irq_chip vlynq_irq_chip = { - .typename = "VLYNQ", - .name = "vlynq", - .unmask = vlynq_irq_unmask, - .mask = vlynq_irq_mask, - .set_type = vlynq_irq_type, + .typename = "VLYNQ", + .name = "vlynq", + .unmask = vlynq_irq_unmask, + .mask = vlynq_irq_mask, + .set_type = vlynq_irq_type, }; static int vlynq_setup_irq(struct vlynq_device *dev) @@ -452,14 +452,14 @@ static int vlynq_probe(struct platform_device *pdev) if (!request_mem_region(regs_res->start, len, dev->dev.bus_id)) { printk("%s: Can't request vlynq registers\n", dev->dev.bus_id); result = -ENXIO; - goto fail_request; + goto fail_request; } dev->local = ioremap_nocache(regs_res->start, len); - if (!dev->local) { + if (!dev->local) { printk("%s: Can't remap vlynq registers\n", dev->dev.bus_id); result = -ENXIO; - goto fail_remap; + goto fail_remap; } dev->remote = (struct vlynq_regs *)((u32)dev->local + 128); |