From 002c82ae9791e15a7de7802dad30bf871a0c40a6 Mon Sep 17 00:00:00 2001 From: Jonas Jensen Date: Wed, 13 Mar 2013 11:57:53 +0100 Subject: [PATCH] code style scripts/checkpatch.pl (linux-3.9-rc1) formatting --- arch/arm/Kconfig | 15 +- arch/arm/mach-moxart/apb_dma.c | 17 +- arch/arm/mach-moxart/board-UC-7112-LX.c | 4 +- arch/arm/mach-moxart/gpio.c | 16 +- arch/arm/mach-moxart/include/mach/apb_dma.h | 24 +- arch/arm/mach-moxart/include/mach/gpio.h | 34 +-- arch/arm/mach-moxart/include/mach/hardware.h | 2 + arch/arm/mach-moxart/irq.c | 24 +- arch/arm/mach-moxart/mm.c | 70 +++--- arch/arm/mach-moxart/time.c | 7 +- drivers/char/mxser.c | 31 +-- drivers/mmc/host/Kconfig | 3 + drivers/mmc/host/moxart.c | 24 +- drivers/mmc/host/moxart.h | 8 +- drivers/mtd/maps/Kconfig | 11 +- drivers/mtd/maps/uc7112lx.c | 13 +- drivers/net/arm/moxart_ether.c | 318 ++++++++++++++------------- drivers/net/arm/moxart_ether.h | 101 +++++---- drivers/rtc/Kconfig | 6 +- drivers/rtc/rtc-moxart.c | 76 +++---- drivers/watchdog/moxart_wdt.c | 6 +- 21 files changed, 431 insertions(+), 379 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 12204927..226f3c53 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -273,12 +273,15 @@ config ARCH_GEMINI Support for the Cortina Systems Gemini family SoCs config ARCH_MOXART - bool "MOXA ART SoC" - select CPU_FA526 - help - Support for the MOXA ART SoC. This is a Faraday FA526 ARMv4 32-bit 192 MHz processor with MMU and 16KB/8KB D/I-cache (UC-7112-LX) - This perticular processor is used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341. - These are DIN-rail / wall-mountable embedded PCs sold by MOXA ( http://www.moxa.com/product/Embedded_Computers.htm ). + bool "MOXA ART SoC" + select CPU_FA526 + help + Support for the MOXA ART SoC. This is a Faraday FA526 ARMv4 32-bit + 192 MHz processor with MMU and 16KB/8KB D/I-cache (UC-7112-LX) + This perticular processor is used on models: + UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341. + These are DIN-rail / wall-mountable embedded PCs sold by MOXA + ( http://www.moxa.com/product/Embedded_Computers.htm ) config ARCH_EBSA110 bool "EBSA-110" diff --git a/arch/arm/mach-moxart/apb_dma.c b/arch/arm/mach-moxart/apb_dma.c index ee90cbfb..9f4c5eaa 100644 --- a/arch/arm/mach-moxart/apb_dma.c +++ b/arch/arm/mach-moxart/apb_dma.c @@ -41,8 +41,9 @@ struct apb_dma_priv *apb_dma_alloc(int req_no) break; } spin_unlock_irqrestore(&apb_dma_lock, flags); - dbg_printk(KERN_INFO "MOXART APB DMA: apb_dma_alloc" - "uses DMA channel %d\n", i); + dbg_printk(KERN_INFO + "MOXART APB DMA: apb_dma_alloc uses DMA channel %d\n" + , i); return priv; } } @@ -168,9 +169,9 @@ void apb_dma_conf(struct apb_dma_priv *priv, struct apb_dma_conf_param *param) writel(cmd.ul, &priv->reg->command.ul); cmd.ul = readl(&priv->reg->command.ul); - dbg_printk(KERN_INFO "apb_dma_conf: cmd.ul=%x read from" - "&priv->reg->command.ul=%x\n", cmd.ul, - (unsigned int)&priv->reg->command.ul); + dbg_printk(KERN_INFO + "apb_dma_conf: cmd.ul=%x read from &priv->reg->command.ul=%x\n" + , cmd.ul, (unsigned int)&priv->reg->command.ul); spin_unlock_irqrestore(&apb_dma_lock, flags); } @@ -235,7 +236,7 @@ static struct irqaction moxart_dma_irq = { .handler = moxart_dma_interrupt, }; -static int __devinit moxart_dma_probe(struct platform_device *pdev) +static int moxart_dma_probe(struct platform_device *pdev) { int i; struct apb_dma_priv *priv = apb_dma_channel; @@ -251,12 +252,12 @@ static int __devinit moxart_dma_probe(struct platform_device *pdev) moxart_int_set_irq(IRQ_APB_DMA, EDGE, H_ACTIVE); setup_irq(IRQ_APB_DMA, &moxart_dma_irq); - printk(KERN_INFO "MOXART APB DMA: finished moxart_dma_probe"); + dev_info(&pdev->dev, "MOXART APB DMA: finished moxart_dma_probe\n"); return 0; } -static int __devexit moxart_dma_remove(struct platform_device *pdev) +static int moxart_dma_remove(struct platform_device *pdev) { return 0; } diff --git a/arch/arm/mach-moxart/board-UC-7112-LX.c b/arch/arm/mach-moxart/board-UC-7112-LX.c index aab49c89..f6d52886 100644 --- a/arch/arm/mach-moxart/board-UC-7112-LX.c +++ b/arch/arm/mach-moxart/board-UC-7112-LX.c @@ -27,13 +27,13 @@ static void __init fixup_uc711x(struct machine_desc *desc, } MACHINE_START(MOXART, "MOXA UC-7112-LX") - .fixup = fixup_uc711x, + .fixup = fixup_uc711x, .map_io = moxart_map_io, .init_machine = moxart_init, .init_irq = moxart_init_irq, .timer = &moxart_timer, -/* .boot_params = 0x100, +/* .boot_params = 0x100, .atag_offset = 0x100, .param_offset = 0x00000100, */ MACHINE_END diff --git a/arch/arm/mach-moxart/gpio.c b/arch/arm/mach-moxart/gpio.c index db0cd6af..3227311c 100644 --- a/arch/arm/mach-moxart/gpio.c +++ b/arch/arm/mach-moxart/gpio.c @@ -142,7 +142,7 @@ void reset_pin_detected(struct work_struct *work) if (in_interrupt()) return; - printk(KERN_INFO "MOXART GPIO: reset_pin_detected\n"); + pr_info("MOXART GPIO: reset_pin_detected\n"); /* commenting below, not everyone is going to * have /bin/setdef binary.. */ @@ -229,11 +229,11 @@ static int gpio_release(struct inode *inode, struct file *file) } static const struct file_operations gpio_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .ioctl = gpio_ioctl, - .open = gpio_open, - .release = gpio_release, + .owner = THIS_MODULE, + .llseek = no_llseek, + .ioctl = gpio_ioctl, + .open = gpio_open, + .release = gpio_release, }; static struct miscdevice gpio_dev = { @@ -256,9 +256,9 @@ static int __init gpio_init(void) { unsigned long flags; - printk(KERN_INFO "MOXART GPIO (LEDs and RESET pin) driver\n"); + pr_info("MOXART GPIO (LEDs and RESET pin) driver\n"); if (misc_register(&gpio_dev)) { - printk(KERN_INFO ": misc_register failed!\n"); + pr_info(": misc_register failed!\n"); return -ENOMEM; } diff --git a/arch/arm/mach-moxart/include/mach/apb_dma.h b/arch/arm/mach-moxart/include/mach/apb_dma.h index 769e32b9..42a27f61 100644 --- a/arch/arm/mach-moxart/include/mach/apb_dma.h +++ b/arch/arm/mach-moxart/include/mach/apb_dma.h @@ -8,7 +8,7 @@ #define __MACH_APB_DMA_H #define MAX_DMA_ADDRESS 0xffffffff -#define MAX_DMA_CHANNELS 0 +#define MAX_DMA_CHANNELS 0 #define APB_DMA_MAX_CHANNEL 4 #define AHB_DMA_MAX_CHANNEL 8 @@ -50,22 +50,22 @@ union _command { #define APB_DMA_DATA_WIDTH_1 (2<<20) #define APB_DMA_SOURCE_REQ_NO_MASK (15<<24) struct _bits { - unsigned int enable:1; /* enable DMA */ + unsigned int enable:1; /* enable DMA */ #define APB_DMAB_ENABLE 1 unsigned int fin_int_sts:1; /* finished interrupt status */ #define APB_DMAB_FIN_INT_STS 1 unsigned int fin_int_en:1; /* finished interrupt enable */ #define APB_DMAB_FIN_INT_EN 1 - unsigned int burst:1; /* burst mode */ + unsigned int burst:1; /* burst mode */ #define APB_DMAB_BURST_MODE 1 - unsigned int err_int_sts:1; /* error interrupt status */ + unsigned int err_int_sts:1; /* error interrupt status */ #define APB_DMAB_ERR_INT_STS 1 unsigned int err_int_en:1; /* error interrupt enable */ #define APB_DMAB_ERR_INT_EN 1 unsigned int source_sel:1; /* 0:APB (device),1:AHB (RAM) */ #define APB_DMAB_SOURCE_AHB 1 #define APB_DMAB_SOURCE_APB 0 - unsigned int dest_sel:1; /* 0:APB,1:AHB */ + unsigned int dest_sel:1; /* 0:APB,1:AHB */ #define APB_DMAB_DEST_AHB 1 #define APB_DMAB_DEST_APB 0 unsigned int source_inc:3; @@ -108,7 +108,7 @@ union _command { 0:no request/grant signal 1-15:request/grant signal */ #define APB_DMAB_DEST_REQ_NO_MASK 15 - unsigned int data_width:2; /* data width of transfer */ + unsigned int data_width:2; /* data width of transfer */ /* 00:word, 01:half, 10:byte */ #define APB_DMAB_DATA_WIDTH_MASK 3 #define APB_DMAB_DATA_WIDTH_4 0 @@ -128,7 +128,7 @@ union _command { struct apb_dma_reg { unsigned int source_addr; unsigned int dest_addr; - unsigned int cycles; /* is depended on burst mode */ + unsigned int cycles; /* is depended on burst mode */ #define APB_DMA_CYCLES_MASK 0x00ffffff union _command command; }; @@ -151,14 +151,14 @@ struct apb_dma_priv { }; struct apb_dma_conf_param { - unsigned int source_addr; /* need physical address */ - unsigned int dest_addr; /* need physical address */ - unsigned int size; /* total bytes number */ + unsigned int source_addr; /* need physical address */ + unsigned int dest_addr; /* need physical address */ + unsigned int size; /* total bytes number */ int data_width; int dest_inc; int source_inc; - int dest_sel; /* APB or AHB */ - int source_sel; /* APB or AHB */ + int dest_sel; /* APB or AHB */ + int source_sel; /* APB or AHB */ int burst_mode; }; diff --git a/arch/arm/mach-moxart/include/mach/gpio.h b/arch/arm/mach-moxart/include/mach/gpio.h index a43b4e53..489698ca 100644 --- a/arch/arm/mach-moxart/include/mach/gpio.h +++ b/arch/arm/mach-moxart/include/mach/gpio.h @@ -44,23 +44,23 @@ #define GPIO_RTC_BOUNCE_PRE_SCALE(base_addr) (base_addr + 0x44) */ -#define GPIO_RTC_PROTECT_W 0x8E -#define GPIO_RTC_PROTECT_R 0x8F -#define GPIO_RTC_YEAR_W 0x8C -#define GPIO_RTC_YEAR_R 0x8D -#define GPIO_RTC_DAY_W 0x8A -#define GPIO_RTC_DAY_R 0x8B -#define GPIO_RTC_MONTH_W 0x88 -#define GPIO_RTC_MONTH_R 0x89 -#define GPIO_RTC_DATE_W 0x86 -#define GPIO_RTC_DATE_R 0x87 -#define GPIO_RTC_HOURS_W 0x84 -#define GPIO_RTC_HOURS_R 0x85 -#define GPIO_RTC_MINUTES_W 0x82 -#define GPIO_RTC_MINUTES_R 0x83 -#define GPIO_RTC_SECONDS_W 0x80 -#define GPIO_RTC_SECONDS_R 0x81 -#define GPIO_RTC_DELAY_TIME 8 /* 8 usecond */ +#define GPIO_RTC_PROTECT_W 0x8E +#define GPIO_RTC_PROTECT_R 0x8F +#define GPIO_RTC_YEAR_W 0x8C +#define GPIO_RTC_YEAR_R 0x8D +#define GPIO_RTC_DAY_W 0x8A +#define GPIO_RTC_DAY_R 0x8B +#define GPIO_RTC_MONTH_W 0x88 +#define GPIO_RTC_MONTH_R 0x89 +#define GPIO_RTC_DATE_W 0x86 +#define GPIO_RTC_DATE_R 0x87 +#define GPIO_RTC_HOURS_W 0x84 +#define GPIO_RTC_HOURS_R 0x85 +#define GPIO_RTC_MINUTES_W 0x82 +#define GPIO_RTC_MINUTES_R 0x83 +#define GPIO_RTC_SECONDS_W 0x80 +#define GPIO_RTC_SECONDS_R 0x81 +#define GPIO_RTC_DELAY_TIME 8 /* 8 usecond */ #define GPIO_RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ #define GPIO_PIO(x) (1 << x) diff --git a/arch/arm/mach-moxart/include/mach/hardware.h b/arch/arm/mach-moxart/include/mach/hardware.h index 1146dec5..e390d6be 100644 --- a/arch/arm/mach-moxart/include/mach/hardware.h +++ b/arch/arm/mach-moxart/include/mach/hardware.h @@ -15,6 +15,8 @@ #define dbg_printk(x...) #endif +#define pr_warn pr_warning + #define MOXART_FLASH_BASE 0x80000000 #define MOXART_APB_DMA_BASE 0x90500000 #define MOXART_PMU_BASE 0x98100000 diff --git a/arch/arm/mach-moxart/irq.c b/arch/arm/mach-moxart/irq.c index b44747f6..65b01a13 100644 --- a/arch/arm/mach-moxart/irq.c +++ b/arch/arm/mach-moxart/irq.c @@ -61,24 +61,24 @@ static void moxart_unmask_irq(unsigned int irq) void moxart_generic_set_generic(unsigned int base, unsigned int irq, unsigned int low) { - unsigned int mask; - mask = __raw_readl(base); - (low) ? (mask |= (1 << irq)) : (mask &= ~(1 << irq)); - __raw_writel(mask, base); + unsigned int mask; + mask = __raw_readl(base); + (low) ? (mask |= (1 << irq)) : (mask &= ~(1 << irq)); + __raw_writel(mask, base); } /*void __init moxart_int_set_irq(unsigned int irq, int mode, int level)*/ void moxart_int_set_irq(unsigned int irq, int mode, int level) { - if (irq < 32) { + if (irq < 32) { moxart_generic_set_generic( IRQ_TMODE(IO_ADDRESS(MOXART_INTERRUPT_BASE)), irq, mode); moxart_generic_set_generic( IRQ_TLEVEL(IO_ADDRESS(MOXART_INTERRUPT_BASE)), irq, level); - } - if (irq < 64) { + } + if (irq < 64) { irq -= 32; moxart_generic_set_generic( FIQ_TMODE(IO_ADDRESS(MOXART_INTERRUPT_BASE)), @@ -86,7 +86,7 @@ void moxart_int_set_irq(unsigned int irq, int mode, int level) moxart_generic_set_generic( FIQ_TLEVEL(IO_ADDRESS(MOXART_INTERRUPT_BASE)), irq, level); - } + } } static struct irq_chip moxart_irq_chip = { @@ -122,20 +122,20 @@ void __init moxart_init_irq(void) } set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } - /* printk("IRQ chip/handler/flags assign finished\r\n"); */ + /* pr_info("IRQ chip/handler/flags assign finished\r\n"); */ __raw_writel(0, IRQ_MASK(IO_ADDRESS(MOXART_INTERRUPT_BASE))); __raw_writel(0, FIQ_MASK(IO_ADDRESS(MOXART_INTERRUPT_BASE))); __raw_writel(0xffffffff, IRQ_CLEAR(IO_ADDRESS(MOXART_INTERRUPT_BASE))); __raw_writel(0xffffffff, FIQ_CLEAR(IO_ADDRESS(MOXART_INTERRUPT_BASE))); - /* printk("IRQ init finished\n"); */ + /* pr_info("IRQ init finished\n"); */ __raw_writel(mode, IRQ_TMODE(IO_ADDRESS(MOXART_INTERRUPT_BASE))); __raw_writel(level, IRQ_TLEVEL(IO_ADDRESS(MOXART_INTERRUPT_BASE))); __raw_writel(0, FIQ_TMODE(IO_ADDRESS(MOXART_INTERRUPT_BASE))); __raw_writel(0, FIQ_TLEVEL(IO_ADDRESS(MOXART_INTERRUPT_BASE))); - /* printk("IRQ mode/level setup finished\n"); */ + /* pr_info("IRQ mode/level setup finished\n"); */ - printk(KERN_INFO "MOXART CPU IRQ: init_irq finished\n"); + pr_info("MOXART CPU IRQ: init_irq finished\n"); } diff --git a/arch/arm/mach-moxart/mm.c b/arch/arm/mach-moxart/mm.c index 2e1ac642..91e0630a 100644 --- a/arch/arm/mach-moxart/mm.c +++ b/arch/arm/mach-moxart/mm.c @@ -17,72 +17,72 @@ static struct map_desc moxart_io_desc[] __initdata = { .virtual = IO_ADDRESS(MOXART_APB_DMA_BASE), .pfn = __phys_to_pfn(MOXART_APB_DMA_BASE), .length = SZ_4K, - .type = MT_DEVICE, + .type = MT_DEVICE, }, { .virtual = IO_ADDRESS(MOXART_MMC_BASE), .pfn = __phys_to_pfn(MOXART_MMC_BASE), .length = SZ_4K, - .type = MT_DEVICE, + .type = MT_DEVICE, }, { .virtual = IO_ADDRESS(MOXART_TIMER_BASE), .pfn = __phys_to_pfn(MOXART_TIMER_BASE), .length = SZ_4K, - .type = MT_DEVICE, - }, { + .type = MT_DEVICE, + }, { /*apparently, RTC is handled using PMU base */ /*.virtual = IO_ADDRESS(MOXART_RTC_BASE), .pfn = __phys_to_pfn(MOXART_RTC_BASE), .length = SZ_4K, - .type = MT_DEVICE, + .type = MT_DEVICE, }, {*/ .virtual = IO_ADDRESS(MOXART_PMU_BASE), .pfn = __phys_to_pfn(MOXART_PMU_BASE), .length = SZ_4K, - .type = MT_DEVICE, + .type = MT_DEVICE, }, { .virtual = IO_ADDRESS(MOXART_GPIO_BASE), .pfn = __phys_to_pfn(MOXART_GPIO_BASE), .length = SZ_4K, - .type = MT_DEVICE, + .type = MT_DEVICE, }, { .virtual = IO_ADDRESS(MOXART_UART1_BASE), - .pfn = __phys_to_pfn(MOXART_UART1_BASE), - .length = SZ_4K, - .type = MT_DEVICE, + .pfn = __phys_to_pfn(MOXART_UART1_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, { - .virtual = IO_ADDRESS(MOXART_UART2_BASE), - .pfn = __phys_to_pfn(MOXART_UART2_BASE), - .length = SZ_4K, - .type = MT_DEVICE, + .virtual = IO_ADDRESS(MOXART_UART2_BASE), + .pfn = __phys_to_pfn(MOXART_UART2_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, { - .virtual = IO_ADDRESS(MOXART_INTERRUPT_BASE), - .pfn = __phys_to_pfn(MOXART_INTERRUPT_BASE), - .length = SZ_4K, - .type = MT_DEVICE, + .virtual = IO_ADDRESS(MOXART_INTERRUPT_BASE), + .pfn = __phys_to_pfn(MOXART_INTERRUPT_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, { .virtual = IO_ADDRESS(MOXART_FTMAC1_BASE), - .pfn = __phys_to_pfn(MOXART_FTMAC1_BASE), - .length = SZ_4K, - .type = MT_DEVICE, + .pfn = __phys_to_pfn(MOXART_FTMAC1_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, { - .virtual = IO_ADDRESS(MOXART_FTMAC2_BASE), - .pfn = __phys_to_pfn(MOXART_FTMAC2_BASE), - .length = SZ_4K, - .type = MT_DEVICE, + .virtual = IO_ADDRESS(MOXART_FTMAC2_BASE), + .pfn = __phys_to_pfn(MOXART_FTMAC2_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, { - .virtual = IO_ADDRESS(MOXART_WATCHDOG_BASE), - .pfn = __phys_to_pfn(MOXART_WATCHDOG_BASE), - .length = SZ_4K, - .type = MT_DEVICE, + .virtual = IO_ADDRESS(MOXART_WATCHDOG_BASE), + .pfn = __phys_to_pfn(MOXART_WATCHDOG_BASE), + .length = SZ_4K, + .type = MT_DEVICE, }, { - .virtual = IO_ADDRESS(MOXART_FLASH_BASE), - .pfn = __phys_to_pfn(MOXART_FLASH_BASE), - .length = SZ_16M, - .type = MT_DEVICE, - } + .virtual = IO_ADDRESS(MOXART_FLASH_BASE), + .pfn = __phys_to_pfn(MOXART_FLASH_BASE), + .length = SZ_16M, + .type = MT_DEVICE, + } }; void __init moxart_map_io(void) { - iotable_init(moxart_io_desc, ARRAY_SIZE(moxart_io_desc)); + iotable_init(moxart_io_desc, ARRAY_SIZE(moxart_io_desc)); } diff --git a/arch/arm/mach-moxart/time.c b/arch/arm/mach-moxart/time.c index b4afd3dd..af775583 100644 --- a/arch/arm/mach-moxart/time.c +++ b/arch/arm/mach-moxart/time.c @@ -152,11 +152,12 @@ void __init moxart_timer_init(void) " = %d\n", t_int); */ - printk(KERN_INFO "MOXART CPU TIMER: timer count/load set (APB_CLK / HZ)" - " where APB_CLK=%d HZ=%d IRQ=0x%x\n", APB_CLK, HZ, IRQ_TIMER1); + pr_info( + "MOXART TIMER: count/load set (APB_CLK=%d / HZ=%d) IRQ=0x%x\n" + , APB_CLK, HZ, IRQ_TIMER1); } struct sys_timer moxart_timer = { - .init = moxart_timer_init, + .init = moxart_timer_init, }; diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 8c2925f0..bd543c95 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -52,9 +52,9 @@ #define MXSERMAJOR 174 #ifdef CONFIG_ARCH_MOXART -#define MXSER_BOARDS 1 /* Max. boards */ +#define MXSER_BOARDS 1 /* Max. boards */ #else -#define MXSER_BOARDS 4 /* Max. boards */ +#define MXSER_BOARDS 4 /* Max. boards */ #endif #define MXSER_PORTS_PER_BOARD 8 /* Max. ports per board */ @@ -1137,21 +1137,22 @@ static void mxser_close_port(struct tty_struct *tty, struct tty_port *port) int mxser_tty_port_close_start(struct tty_port *port, struct tty_struct *tty, struct file *filp) { - unsigned long flags; + unsigned long flags; - spin_lock_irqsave(&port->lock, flags); + spin_lock_irqsave(&port->lock, flags); if (tty_hung_up_p(filp)) { spin_unlock_irqrestore(&port->lock, flags); return 0; - } + } if (tty->count == 1 && port->count != 1) { - printk(KERN_WARNING "tty_port_close_start: tty->count = 1" - " port count = %d.\n", port->count); + pr_warn( + "tty_port_close_start: tty->count = 1 port" + " count = %d.\n", port->count); port->count = 1; } if (--port->count < 0) { - printk(KERN_WARNING "tty_port_close_start: count = %d\n", + pr_warn("tty_port_close_start: count = %d\n", port->count); port->count = 0; } @@ -1163,15 +1164,17 @@ int mxser_tty_port_close_start(struct tty_port *port, return 0; } - /*set_bit(ASYNCB_CLOSING, &port->flags); */ + /* set_bit(ASYNCB_CLOSING, &port->flags); */ tty->closing = 1; spin_unlock_irqrestore(&port->lock, flags); /* Don't block on a stalled port, just pull the chain */ if (tty->flow_stopped) tty_driver_flush_buffer(tty); + if (test_bit(ASYNCB_INITIALIZED, &port->flags) && port->closing_wait != ASYNC_CLOSING_WAIT_NONE) tty_wait_until_sent(tty, port->closing_wait); + if (port->drain_delay) { unsigned int bps = tty_get_baud_rate(tty); long timeout; @@ -2503,9 +2506,8 @@ static int __devinit mxser_initbrd(struct mxser_board *brd, /* Enhance mode enabled here */ if (brd->chip_flag != MOXA_OTHER_UART) { - printk(KERN_INFO "mxser: brd->ports[%d]: mxser_enable_" - "must_enchance_mode info->ioaddr = 0x%lx\n", - i, info->ioaddr); + pr_info("mxser: brd->ports[%d]: mxser_enable_must_enchance_mode\n" + "info->ioaddr = 0x%lx\n", i, info->ioaddr); mxser_enable_must_enchance_mode(info->ioaddr); } @@ -2558,7 +2560,9 @@ static int __init mxser_get_ISA_conf(int cap, struct mxser_board *brd) brd->ports[i].max_baud = 921600; brd->ports[i].opmode_ioaddr = IO_ADDRESS(MOXART_UART_MODE_BASE); } + #else + brd->chip_flag = MOXA_OTHER_UART; id = mxser_read_register(cap, regs); @@ -2643,6 +2647,7 @@ static int __init mxser_get_ISA_conf(int cap, struct mxser_board *brd) brd->uart_type = PORT_16550A; else brd->uart_type = PORT_16450; + #endif if (!request_region(brd->ports[0].ioaddr, 8 * brd->info->nports, @@ -2836,7 +2841,7 @@ static int __init mxser_module_init(void) for (m = 0, b = 0; b < MXSER_BOARDS; b++) { #ifndef CONFIG_ARCH_MOXART /* no continue if no ioaddr param fed to module - (force past for UC-7112-LX) */ + (force past for UC-7112-LX) */ if (!ioaddr[b]) continue; #endif diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index d63b8579..b3b99ac8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -363,3 +363,6 @@ config MMC_MOXART depends on ARCH_MOXART && MMC help This selects the MOXART CPU MMC/SD Interface. + MOXA provides one multi-functional card reader which can + be found on some embedded hardware such as UC-7112-LX. + If you have a controller with this interface, say Y here. diff --git a/drivers/mmc/host/moxart.c b/drivers/mmc/host/moxart.c index eae8e0ad..98bf7b97 100644 --- a/drivers/mmc/host/moxart.c +++ b/drivers/mmc/host/moxart.c @@ -105,14 +105,14 @@ static void moxart_do_fifo(struct moxart_host *host, struct mmc_data *data) wcnt = host->remain >> 2; if (data->flags & MMC_DATA_WRITE) { /* dbg_printk(KERN_INFO "moxart_do_fifo:" - * " MMC_DATA_WRITE)\n"); */ + * " MMC_DATA_WRITE)\n"); */ for (i = 0; i < wcnt; i++, buffer += 4) { writel(*(unsigned int *)buffer, &host->reg->data_window); } } else { /* dbg_printk(KERN_INFO "moxart_do_fifo:" - * " MMC_DATA_READ)\n"); */ + * " MMC_DATA_READ)\n"); */ for (i = 0; i < wcnt; i++, buffer += 4) { *(unsigned int *)buffer = readl( &host->reg->data_window); @@ -168,12 +168,12 @@ static void moxart_prepare_data(struct moxart_host *host, struct mmc_data *data) if (host->size > MSD_FIFO_LENB && host->dma) { writel(MSD_INT_CARD_CHANGE, &host->reg->interrupt_mask); /* dbg_printk(KERN_INFO "moxart_prepare_data:" - * " calling moxart_do_fifo\n"); */ + * " calling moxart_do_fifo\n"); */ moxart_do_fifo(host, data); /* tasklet_schedule(&host->fifo_run_tasklet); */ } else { /* dbg_printk(KERN_INFO "moxart_prepare_data: calling writel(" - * "MSD_INT_FIFO_URUN | MSD_INT_FIFO_ORUN | + * "MSD_INT_FIFO_URUN | MSD_INT_FIFO_ORUN | MSD_INT_CARD_CHANGE, &host->reg->interrupt_mask); \n"); */ writel(MSD_INT_FIFO_URUN | MSD_INT_FIFO_ORUN | @@ -199,7 +199,7 @@ static void moxart_send_command(struct moxart_host *host, cmd->opcode); */ cmdctrl = cmd->opcode & MSD_CMD_IDX_MASK; - if (cmdctrl == SD_APP_SET_BUS_WIDTH || cmdctrl == SD_APP_OP_COND || + if (cmdctrl == SD_APP_SET_BUS_WIDTH || cmdctrl == SD_APP_OP_COND || cmdctrl == SD_APP_SEND_SCR) { /* this is SD application specific command */ cmdctrl |= MSD_APP_CMD; @@ -247,10 +247,10 @@ static void moxart_send_command(struct moxart_host *host, * spin_lock_irqsave:s can be re-enabled without * warnings and locking issues. * dbg_printk(KERN_INFO "moxart_send_command" - * " response:" - * " %x:%x:%x:%x\n", cmd->resp[0], + * " response:" + * " %x:%x:%x:%x\n", cmd->resp[0], * cmd->resp[1], cmd->resp[2], - * cmd->resp[3]); + * cmd->resp[3]); */ cmd->error = MMC_ERR_NONE; break; @@ -274,12 +274,12 @@ static irqreturn_t moxart_irq(int irq, void *devid) if (status & MSD_CARD_CHANGE) { /* has card inserted or removed */ /* writel(MSD_CLR_CARD_CHANGE, &host->reg->clear); */ /* dbg_printk(KERN_INFO "moxart_irq: status &" - * " MSD_CARD_CHANGE\n"); */ + * " MSD_CARD_CHANGE\n"); */ tasklet_schedule(&host->card_change_tasklet); } if (status & (MSD_FIFO_ORUN | MSD_FIFO_URUN)) { /* dbg_printk(KERN_INFO "moxart_irq: status &" - * " (MSD_FIFO_ORUN | MSD_FIFO_URUN)\n"); */ + * " (MSD_FIFO_ORUN | MSD_FIFO_URUN)\n"); */ writel(status & (MSD_FIFO_ORUN | MSD_FIFO_URUN), &host->reg->clear); tasklet_schedule(&host->fifo_run_tasklet); @@ -302,7 +302,7 @@ static void moxart_fifo_run(unsigned long param) } /* dbg_printk(KERN_INFO "moxart_fifo_run:" - * " moxart_do_fifo(host, data)\n"); */ + * " moxart_do_fifo(host, data)\n"); */ moxart_do_fifo(host, data); spin_lock_irqsave(&host->lock, flags); @@ -585,7 +585,7 @@ static int moxart_probe(struct device *dev) dev_set_drvdata(dev, mmc); mmc_add_host(mmc); - printk(KERN_INFO "MOXART MMC: finished moxart_probe\n"); + dev_info(dev, "MOXART MMC: finished moxart_probe\n"); return 0; out: diff --git a/drivers/mmc/host/moxart.h b/drivers/mmc/host/moxart.h index 093cc3a5..73d62cf6 100644 --- a/drivers/mmc/host/moxart.h +++ b/drivers/mmc/host/moxart.h @@ -39,7 +39,7 @@ #define MMC_ERR_BADCRC 2 #define MMC_VDD_360 23 -#define MSD_RETRY_COUNT 100 +#define MSD_RETRY_COUNT 100 #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ @@ -134,9 +134,9 @@ struct moxart_host { struct mmc_data *data; struct scatterlist *cur_sg; /* Current SG entry */ - unsigned int num_sg; /* Number of entries left */ - void *mapped_sg; /* vaddr of mapped sg */ - unsigned int remain; /* Data left in curren entry */ + unsigned int num_sg; /* Number of entries left */ + void *mapped_sg; /* vaddr of mapped sg */ + unsigned int remain; /* Data left in curren entry */ int size; /* Total size of transfer */ struct tasklet_struct card_change_tasklet; diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 95bf6e36..eeab5cb7 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig @@ -254,10 +254,13 @@ config MTD_NETtel Support for flash chips on NETtel/SecureEdge/SnapGear boards. config MTD_UC7112LX - tristate "CFI Flash device mapped on MOXART UC_7112_LX_PLUS" - depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS - help - This enables MTD access to flash device on MOXA UC-7112-LX. + tristate "CFI Flash device mapped on MOXART UC_7112_LX_PLUS" + depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS + help + This enables MTD access to flash device on MOXA UC-7112-LX. + Probing the 16-bit flash bus, flash mapping is 0x1000000 at 0x80000000 + This is "Intel/Sharp Extended Query Table at 0x0031" + If you have such a board, say 'Y'. config MTD_ALCHEMY tristate "AMD Alchemy Pb1xxx/Db1xxx/RDK MTD support" diff --git a/drivers/mtd/maps/uc7112lx.c b/drivers/mtd/maps/uc7112lx.c index 1a4ff473..5cbda867 100644 --- a/drivers/mtd/maps/uc7112lx.c +++ b/drivers/mtd/maps/uc7112lx.c @@ -57,7 +57,7 @@ static struct mtd_partition moxart_flash_partitions[] = { .name = "LinuxKernel", .offset = RW_PART1_OF, .size = RW_PART1_SZ, -/* .mask_flags = MTD_WRITEABLE */ +/* .mask_flags = MTD_WRITEABLE */ }, { .name = "RootFileSystem", @@ -100,19 +100,20 @@ static struct mtd_info *moxart_mtd; int __init init_flash(void) { - printk(KERN_NOTICE "MTD: MOXART CPU flash: probing %d-bit flash bus," - " flash mapping: 0x%x at 0x%x\n", moxart_flash_map.bankwidth*8, + pr_notice( + "MTD: MOXART flash: %d-bit bus, mapping: 0x%x at 0x%x\n", + moxart_flash_map.bankwidth*8, CONFIG_FLASH_SIZE, CONFIG_FLASH_MEM_BASE); simple_map_init(&moxart_flash_map); moxart_mtd = do_map_probe("cfi_probe", &moxart_flash_map); if (moxart_mtd) { moxart_mtd->owner = THIS_MODULE; - printk(KERN_NOTICE "MTD: Using static partition definition\n"); + pr_notice("MTD: Using static partition definition\n"); add_mtd_partitions(moxart_mtd, moxart_flash_partitions, ARRAY_SIZE(moxart_flash_partitions)); } else { - printk(KERN_ERR "MTD: map probe failed for flash\n"); + pr_err("MTD: map probe failed for flash\n"); iounmap(moxart_flash_map.virt); return -ENXIO; } @@ -127,7 +128,7 @@ int __init init_moxart_flash(void) status = init_flash(); if (status) - printk(KERN_ERR "MTD: Unable to init map for flash\n"); + pr_err("MTD: Unable to init map for flash\n"); /*else register_reboot_notifier(&mtd_notifier); */ return status; diff --git a/drivers/net/arm/moxart_ether.c b/drivers/net/arm/moxart_ether.c index 1eef341c..bf64e687 100644 --- a/drivers/net/arm/moxart_ether.c +++ b/drivers/net/arm/moxart_ether.c @@ -3,7 +3,8 @@ * 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. */ + * or (at your option) any later version. + */ #include #include @@ -44,13 +45,14 @@ static void moxart_update_mac_address(struct net_device *dev) moxart_emac_write(dev, MAC_MADR_REG_OFFSET + 4, ((dev->dev_addr[2] << 24) | (dev->dev_addr[3] << 16) | (dev->dev_addr[4] << 8) | (dev->dev_addr[5]))); - dbg_printk("MOXART Ethernet: finished moxart_update_mac_address" - "dev->base_addr=%x MAC=%x%x\n", (unsigned int) dev->base_addr, + dbg_printk( + "MOXART Ethernet: moxart_update_mac_address baddr=%x MAC=%x%x\n" + , (unsigned int) dev->base_addr, __raw_readl(dev->base_addr + MAC_MADR_REG_OFFSET), __raw_readl(dev->base_addr + MAC_MADR_REG_OFFSET + 4)); } -static int moxart_set_mac_address(struct net_device *dev, void* addr) +static int moxart_set_mac_address(struct net_device *dev, void *addr) { struct sockaddr *address = addr; @@ -61,26 +63,31 @@ static int moxart_set_mac_address(struct net_device *dev, void* addr) memcpy(dev->dev_addr, address->sa_data, dev->addr_len); moxart_update_mac_address(dev); - dbg_printk("MOXART Ethernet: finished moxart_set_mac_address " - "dev->base_addr=%x\n", (unsigned int) dev->base_addr); + dbg_printk( + "MOXART Ethernet: moxart_set_mac_address dev->base_addr=%x\n" + , (unsigned int) dev->base_addr); return 0; } static void moxart_mac_free_memory(struct net_device *dev) { struct moxart_mac_priv_t *priv = netdev_priv(dev); - if (priv->virtTxDescBaseAddr) + if (priv->virt_tx_desc_baseaddr) dma_free_coherent(NULL, sizeof(struct tx_desc_t)*TX_DESC_NUM, - priv->virtTxDescBaseAddr, priv->phyTxDescBaseAddr); - if (priv->virtRxDescBaseAddr) + priv->virt_tx_desc_baseaddr, + priv->phy_tx_desc_baseaddr); + if (priv->virt_rx_desc_baseaddr) dma_free_coherent(NULL, sizeof(struct rx_desc_t)*RX_DESC_NUM, - priv->virtRxDescBaseAddr, priv->phyRxDescBaseAddr); - if (priv->virtTxBufBaseAddr) + priv->virt_rx_desc_baseaddr, + priv->phy_rx_desc_baseaddr); + if (priv->virt_tx_buf_baseaddr) dma_free_coherent(NULL, TX_BUF_SIZE*TX_DESC_NUM, - priv->virtTxBufBaseAddr, priv->phyTxBufBaseAddr); - if (priv->virtRxBufBaseAddr) + priv->virt_tx_buf_baseaddr, + priv->phy_tx_buf_baseaddr); + if (priv->virt_rx_buf_baseaddr) dma_free_coherent(NULL, RX_BUF_SIZE*RX_DESC_NUM, - priv->virtRxBufBaseAddr, priv->phyRxBufBaseAddr); + priv->virt_rx_buf_baseaddr, + priv->phy_rx_buf_baseaddr); } static void moxart_mac_reset(struct net_device *dev) @@ -96,8 +103,9 @@ static void moxart_mac_reset(struct net_device *dev) /* removed ENRX_IN_HALFTX. RX_FTL added for 802.1Q support */ priv->maccr = RX_BROADPKT | FULLDUP | CRC_APD | RX_FTL; - dbg_printk("MOXART Ethernet: finished moxart_mac_reset " - "dev->base_addr=%x\n", (unsigned int) dev->base_addr); + dbg_printk( + "MOXART Ethernet: moxart_mac_reset dev->base_addr=%x\n" + , (unsigned int) dev->base_addr); } static void moxart_mac_enable(struct net_device *dev) @@ -109,14 +117,16 @@ static void moxart_mac_enable(struct net_device *dev) /* use NORXBUF_M to test interrupt */ /* outl(RPKT_FINISH_M | NORXBUF_M | AHB_ERR_M, - dev->base_addr + IMR_REG_OFFSET); */ + dev->base_addr + IMR_REG_OFFSET); + */ outl(RPKT_FINISH_M, dev->base_addr + IMR_REG_OFFSET); priv->maccr |= (RCV_EN | XMT_EN | RDMA_EN | XDMA_EN); outl(priv->maccr, dev->base_addr + MACCR_REG_OFFSET); - dbg_printk("MOXART Ethernet: finished moxart_mac_enable " - "dev->base=%x\n", (unsigned int) dev->base_addr); + dbg_printk( + "MOXART Ethernet: moxart_mac_enable dev->base=%x\n" + , (unsigned int) dev->base_addr); } static void moxart_mac_setup_desc_ring(struct net_device *dev) @@ -128,45 +138,48 @@ static void moxart_mac_setup_desc_ring(struct net_device *dev) unsigned int phybuf; int i; - virtbuf = priv->virtTxBufBaseAddr; - phybuf = priv->phyTxBufBaseAddr; + virtbuf = priv->virt_tx_buf_baseaddr; + phybuf = priv->phy_tx_buf_baseaddr; for (i = 0; i < TX_DESC_NUM; i++, virtbuf += TX_BUF_SIZE, phybuf += TX_BUF_SIZE) { - txdesc = &priv->virtTxDescBaseAddr[i]; + txdesc = &priv->virt_tx_desc_baseaddr[i]; memset(txdesc, 0, sizeof(struct tx_desc_t)); - txdesc->txdes2.phyTxBufBaseAddr = phybuf; - txdesc->txdes2.virtTxBufBaseAddr = virtbuf; + txdesc->txdes2.phy_tx_buf_baseaddr = phybuf; + txdesc->txdes2.virt_tx_buf_baseaddr = virtbuf; } - priv->virtTxDescBaseAddr[TX_DESC_NUM - 1].txdes1.ubit.Edotr = 1; + priv->virt_tx_desc_baseaddr[TX_DESC_NUM - 1].txdes1.ubit.edotr = 1; - virtbuf = priv->virtRxBufBaseAddr; - phybuf = priv->phyRxBufBaseAddr; + virtbuf = priv->virt_rx_buf_baseaddr; + phybuf = priv->phy_rx_buf_baseaddr; for (i = 0; i < RX_DESC_NUM; i++, virtbuf += RX_BUF_SIZE, phybuf += RX_BUF_SIZE) { - rxdesc = &priv->virtRxDescBaseAddr[i]; + rxdesc = &priv->virt_rx_desc_baseaddr[i]; memset(rxdesc, 0, sizeof(struct rx_desc_t)); - rxdesc->rxdes0.ubit.RxDMAOwn = 1; - rxdesc->rxdes1.ubit.RxBufSize = RX_BUF_SIZE; - rxdesc->rxdes2.phyRxBufBaseAddr = phybuf; - rxdesc->rxdes2.virtRxBufBaseAddr = virtbuf; + rxdesc->rxdes0.ubit.rx_dma_own = 1; + rxdesc->rxdes1.ubit.rx_buf_size = RX_BUF_SIZE; + rxdesc->rxdes2.phy_rx_buf_baseaddr = phybuf; + rxdesc->rxdes2.virt_rx_buf_baseaddr = virtbuf; } - priv->virtRxDescBaseAddr[RX_DESC_NUM - 1].rxdes1.ubit.Edorr = 1; + priv->virt_rx_desc_baseaddr[RX_DESC_NUM - 1].rxdes1.ubit.edorr = 1; /* dbg_printk("First Rx desc des0=0x%x, des1=%x\n", - priv->virtRxDescBaseAddr[0].rxdes0.ui, - priv->virtRxDescBaseAddr[0].rxdes1.ui);*/ + priv->virt_rx_desc_baseaddr[0].rxdes0.ui, + priv->virt_rx_desc_baseaddr[0].rxdes1.ui); + */ - priv->TxDescNow = priv->RxDescNow = 0; + priv->tx_desc_now = priv->rx_desc_now = 0; /* reset the MAC controler Tx/Rx desciptor base address */ - outl(priv->phyTxDescBaseAddr, dev->base_addr + TXR_BADR_REG_OFFSET); - outl(priv->phyRxDescBaseAddr, dev->base_addr + RXR_BADR_REG_OFFSET); - - dbg_printk("MOXART Ethernet: finished moxart_mac_setup_desc_ring" - " dev->base_addr=%x Tx/Rx desc phy=0x%x,0x%x, virt=0x%x,0x%x" - " set Tx desc base address=0x%x, Rx=0x%x\n", - (unsigned int) dev->base_addr, priv->phyTxDescBaseAddr, - priv->phyRxDescBaseAddr, (unsigned int)priv->virtTxDescBaseAddr, - (unsigned int)priv->virtRxDescBaseAddr, + outl(priv->phy_tx_desc_baseaddr, dev->base_addr + TXR_BADR_REG_OFFSET); + outl(priv->phy_rx_desc_baseaddr, dev->base_addr + RXR_BADR_REG_OFFSET); + + dbg_printk( + "MOXART Ethernet: moxart_mac_setup_desc_ring base_addr=%x\n" + "Tx/Rx desc phy=0x%x,0x%x, virt=0x%x,0x%x\n" + "set Tx desc base address=0x%x, Rx=0x%x\n", + (unsigned int) dev->base_addr, priv->phy_tx_desc_baseaddr, + priv->phy_rx_desc_baseaddr, + (unsigned int)priv->virt_tx_desc_baseaddr, + (unsigned int)priv->virt_rx_desc_baseaddr, inl(dev->base_addr+TXR_BADR_REG_OFFSET), inl(dev->base_addr+RXR_BADR_REG_OFFSET)); } @@ -184,8 +197,8 @@ static int moxart_mac_open(struct net_device *dev) spin_unlock_irq(&priv->txlock); netif_start_queue(dev); - dbg_printk("MOXART Ethernet: finished moxart_mac_open" - " IMR=0x%x, MACCR=0x%x\n", inl(dev->base_addr+IMR_REG_OFFSET), + dbg_printk("MOXART Ethernet: moxart_mac_open IMR=0x%x, MACCR=0x%x\n" + , inl(dev->base_addr+IMR_REG_OFFSET), inl(dev->base_addr+MACCR_REG_OFFSET)); return 0; } @@ -215,27 +228,27 @@ static void moxart_mac_recv(struct work_struct *ptr) struct rx_desc_t *rxdesc; struct sk_buff *skb; unsigned int ui, len; - int rxnow = priv->RxDescNow; + int rxnow = priv->rx_desc_now; int loops = RX_DESC_NUM; /* dbg_printk("MOXART Ethernet: moxart_mac_recv\n"); */ - /* - dbg_printk("RxDescNow=%d, desc phy=0x%x, virt=0x%x, buf phy=0x%x, - virt=0x%x\n", priv->RxDescNow, - priv->phyRxDescBaseAddr+(priv->RxDescNow*sizeof(rx_desc_t)), - (unsigned int)&priv->virtRxDescBaseAddr[priv->RxDescNow], - priv->virtRxDescBaseAddr[priv->RxDescNow] - .rxdes2.phyRxBufBaseAddr, - (unsigned int)priv->virtRxDescBaseAddr[priv->RxDescNow] - .rxdes2.virtRxBufBaseAddr); + /*dbg_printk("rx_desc_now=%d, desc phy=0x%x, virt=0x%x, buf phy=0x%x, + virt=0x%x\n", priv->rx_desc_now, + priv->phy_rx_desc_baseaddr+ + (priv->rx_desc_now*sizeof(rx_desc_t)), + (unsigned int)&priv->virt_rx_desc_baseaddr[priv->rx_desc_now], + priv->virt_rx_desc_baseaddr[priv->rx_desc_now] + .rxdes2.phy_rx_buf_baseaddr, + (unsigned int)priv->virt_rx_desc_baseaddr[priv->rx_desc_now] + .rxdes2.virt_rx_buf_baseaddr); dbg_printk("Now Rx desc des0=0x%x, des1=0x%x\n", - priv->virtRxDescBaseAddr[priv->RxDescNow].rxdes0.ui, - priv->virtRxDescBaseAddr[priv->RxDescNow].rxdes1.ui); + priv->virt_rx_desc_baseaddr[priv->rx_desc_now].rxdes0.ui, + priv->virt_rx_desc_baseaddr[priv->rx_desc_now].rxdes1.ui); */ repeat_recv: - rxdesc = &priv->virtRxDescBaseAddr[rxnow]; + rxdesc = &priv->virt_rx_desc_baseaddr[rxnow]; ui = rxdesc->rxdes0.ui; /* if ( rxdesc->rxdes0.ubit.RxDMAOwn ) { */ @@ -263,11 +276,12 @@ repeat_recv: skb_reserve(skb, 2); skb->dev = dev; - memcpy(skb_put(skb, len), rxdesc->rxdes2.virtRxBufBaseAddr, len); + memcpy(skb_put(skb, len), rxdesc->rxdes2.virt_rx_buf_baseaddr, len); netif_rx(skb); /* dbg_printk("MOXART Ethernet: receive data pointer = 0x%x\n", - (unsigned long)data); */ + (unsigned long)data); + */ skb->protocol = eth_type_trans(skb, dev); dev->last_rx = jiffies; @@ -280,7 +294,7 @@ recv_finish: rxdesc->rxdes0.ui = RXDMA_OWN; rxnow++; rxnow &= RX_DESC_NUM_MASK; - priv->RxDescNow = rxnow; + priv->rx_desc_now = rxnow; if (loops-- > 0) goto repeat_recv; } @@ -295,7 +309,7 @@ static irqreturn_t moxart_mac_interrupt(int irq, void *dev_id) if (ists & RPKT_FINISH) { moxart_mac_recv((void *) dev); } else { -#ifdef moxart_MAC_DEBUG +#ifdef MOXART_MAC_DEBUG if (ists & NORXBUF) { dbg_printk("MOXART Ethernet: NORXBUF interrupt\n"); outl(inl(dev->base_addr + IMR_REG_OFFSET) & ~NORXBUF_M, @@ -313,38 +327,38 @@ static int moxart_mac_start_xmit(struct sk_buff *skb, struct net_device *dev) struct moxart_mac_priv_t *priv = netdev_priv(dev); struct tx_desc_t *txdesc; int len; - int txnow = priv->TxDescNow; + int txnow = priv->tx_desc_now; /* dbg_printk("MOXART Ethernet: moxart_mac_hard_start_xmit\n"); */ spin_lock_irq(&priv->txlock); - txdesc = &priv->virtTxDescBaseAddr[txnow]; - if (txdesc->txdes0.ubit.TxDMAOwn) { - dbg_printk("MOXART Ethernet: no Tx space to transmit" - " the packet !\n"); + txdesc = &priv->virt_tx_desc_baseaddr[txnow]; + if (txdesc->txdes0.ubit.tx_dma_own) { + dbg_printk( + "MOXART Ethernet: no Tx space for packet!\n"); priv->stats.tx_dropped++; goto xmit_final; } - /* - len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; + + /*len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; len = len > TX_BUF_SIZE ? TX_BUF_SIZE : len; */ len = skb->len > TX_BUF_SIZE ? TX_BUF_SIZE : skb->len; - memcpy(txdesc->txdes2.virtTxBufBaseAddr, skb->data, len); + memcpy(txdesc->txdes2.virt_tx_buf_baseaddr, skb->data, len); if (skb->len < ETH_ZLEN) { - memset(&txdesc->txdes2.virtTxBufBaseAddr[skb->len], + memset(&txdesc->txdes2.virt_tx_buf_baseaddr[skb->len], 0, ETH_ZLEN - skb->len); len = ETH_ZLEN; } - txdesc->txdes1.ubit.Lts = 1; - txdesc->txdes1.ubit.Fts = 1; - txdesc->txdes1.ubit.Tx2fic = 0; - txdesc->txdes1.ubit.Txic = 0; - txdesc->txdes1.ubit.TxBufSize = len; + txdesc->txdes1.ubit.lts = 1; + txdesc->txdes1.ubit.fts = 1; + txdesc->txdes1.ubit.tx2_fic = 0; + txdesc->txdes1.ubit.tx_ic = 0; + txdesc->txdes1.ubit.tx_buf_size = len; txdesc->txdes0.ui = TXDMA_OWN; dbg_printk("MOXART Ethernet: transmit data pointer = 0x%x\n", @@ -353,25 +367,24 @@ static int moxart_mac_start_xmit(struct sk_buff *skb, struct net_device *dev) /* start to send packet */ outl(0xffffffff, dev->base_addr + TXPD_REG_OFFSET); - /* - dbg_printk("TxDescNow=%d, address=0x%x, des0=0x%x, - des1=0x%x\n", priv->TxDescNow, - (unsigned int)&priv->virtTxDescBaseAddr[priv->TxDescNow], + /*dbg_printk("tx_desc_now=%d, address=0x%x, des0=0x%x, + des1=0x%x\n", priv->tx_desc_now, + (unsigned int)&priv->virt_tx_desc_baseaddr[priv->tx_desc_now], txdesc->txdes0.ui, txdesc->txdes1.ui); dbg_printk("Buffer phy address=0x%x, virt=0x%x\n", - txdesc->txdes2.phyTxBufBaseAddr, - (unsigned int)txdesc->txdes2.virtTxBufBaseAddr); - dbg_printk("TxDescNow-1=%d, address=0x%x, des0=0x%x\n", - (priv->TxDescNow-1)&TX_DESC_NUM_MASK, - (unsigned int)&priv->virtTxDescBaseAddr[(priv->TxDescNow-1) + txdesc->txdes2.phy_tx_buf_baseaddr, + (unsigned int)txdesc->txdes2.virt_tx_buf_baseaddr); + dbg_printk("tx_desc_now-1=%d, address=0x%x, des0=0x%x\n", + (priv->tx_desc_now-1)&TX_DESC_NUM_MASK, + (unsigned int)&priv->virt_tx_desc_baseaddr[(priv->tx_desc_now-1) &TX_DESC_NUM_MASK], - priv->virtTxDescBaseAddr[(priv->TxDescNow-1) + priv->virt_tx_desc_baseaddr[(priv->tx_desc_now-1) &TX_DESC_NUM_MASK].txdes0.ui); */ txnow++; txnow &= TX_DESC_NUM_MASK; - priv->TxDescNow = txnow; + priv->tx_desc_now = txnow; dev->trans_start = jiffies; priv->stats.tx_packets++; priv->stats.tx_bytes += len; @@ -386,34 +399,37 @@ xmit_final: static struct net_device_stats *moxart_mac_get_stats(struct net_device *dev) { struct moxart_mac_priv_t *priv = netdev_priv(dev); - int desc = priv->RxDescNow; + int desc = priv->rx_desc_now; #ifdef MOXART_DEBUG unsigned int base = dev->base_addr; #endif dbg_printk("MOXART Ethernet: moxart_mac_get_stats:\n"); - dbg_printk("RxDescNow=%d, desc phy=0x%x, virt=0x%x, buf phy=0x%x," - " virt=0x%x Now Rx desc des0=0x%x, des1=0x%x\n", desc, - priv->phyRxDescBaseAddr+(desc*sizeof(rx_desc_t)), - (unsigned int)&priv->virtRxDescBaseAddr[desc], - priv->virtRxDescBaseAddr[desc].rxdes2.phyRxBufBaseAddr, - (unsigned int)priv->virtRxDescBaseAddr[desc] - .rxdes2.virtRxBufBaseAddr, - priv->virtRxDescBaseAddr[desc].rxdes0.ui, - priv->virtRxDescBaseAddr[desc].rxdes1.ui); + dbg_printk( + "rx_desc_now=%d, desc phy=0x%x, virt=0x%x, buf phy=0x%x\n" + "virt=0x%x Now Rx desc des0=0x%x, des1=0x%x\n", desc, + priv->phy_rx_desc_baseaddr+(desc*sizeof(rx_desc_t)), + (unsigned int)&priv->virt_rx_desc_baseaddr[desc], + priv->virt_rx_desc_baseaddr[desc].rxdes2.phy_rx_buf_baseaddr, + (unsigned int)priv->virt_rx_desc_baseaddr[desc] + .rxdes2.virt_rx_buf_baseaddr, + priv->virt_rx_desc_baseaddr[desc].rxdes0.ui, + priv->virt_rx_desc_baseaddr[desc].rxdes1.ui); desc++; desc &= RX_DESC_NUM_MASK; - dbg_printk("RxDescNow=%d, desc phy=0x%x, virt=0x%x, buf phy=0x%x," - " virt=0x%x Now Rx desc des0=0x%x, des1=0x%x (desc++)\n", - desc, priv->phyRxDescBaseAddr+(desc*sizeof(rx_desc_t)), - (unsigned int)&priv->virtRxDescBaseAddr[desc], - priv->virtRxDescBaseAddr[desc].rxdes2.phyRxBufBaseAddr, - (unsigned int)priv->virtRxDescBaseAddr[desc] - .rxdes2.virtRxBufBaseAddr, - priv->virtRxDescBaseAddr[desc].rxdes0.ui, - priv->virtRxDescBaseAddr[desc].rxdes1.ui); - dbg_printk("TX_MCOL_TX_SCOL=0x%x RPF_AEP=0x%x XM_PG=0x%x" - " RUNT_CNT_TLCC=0x%x CRCER_CNT_FTL_CNT=0x%x RLC_RCC=0x%x" + dbg_printk( + "rx_desc_now=%d, desc phy=0x%x, virt=0x%x, buf phy=0x%x\n" + "virt=0x%x Now Rx desc des0=0x%x, des1=0x%x (desc++)\n", + desc, priv->phy_rx_desc_baseaddr+(desc*sizeof(rx_desc_t)), + (unsigned int)&priv->virt_rx_desc_baseaddr[desc], + priv->virt_rx_desc_baseaddr[desc].rxdes2.phy_rx_buf_baseaddr, + (unsigned int)priv->virt_rx_desc_baseaddr[desc] + .rxdes2.virt_rx_buf_baseaddr, + priv->virt_rx_desc_baseaddr[desc].rxdes0.ui, + priv->virt_rx_desc_baseaddr[desc].rxdes1.ui); + dbg_printk( + "TX_MCOL_TX_SCOL=0x%x RPF_AEP=0x%x XM_PG=0x%x\n" + " RUNT_CNT_TLCC=0x%x CRCER_CNT_FTL_CNT=0x%x RLC_RCC=0x%x\n" " BROC=0x%x MUCLA=0x%x RP=0x%x XP=0x%x\n", inl(base+TX_MCOL_TX_SCOL_REG_OFFSET), inl(base+RPF_AEP_REG_OFFSET), inl(base+XM_PG_REG_OFFSET), @@ -430,8 +446,8 @@ static struct net_device_stats *moxart_mac_get_stats(struct net_device *dev) static int crc32(char *s, int length) { - int perByte; - int perBit; + int per_byte; + int per_bit; /* crc polynomial */ const unsigned long poly = 0xedb88320; @@ -439,10 +455,10 @@ static int crc32(char *s, int length) /* crc value - preinitialized to all 1's */ unsigned long crc_value = 0xffffffff; - for (perByte = 0; perByte < length; perByte++) { + for (per_byte = 0; per_byte < length; per_byte++) { unsigned char c; c = *(s++); - for (perBit = 0; perBit < 8; perBit++) { + for (per_bit = 0; per_bit < 8; per_bit++) { crc_value = (crc_value >> 1) ^ (((crc_value ^ c) & 0x01) ? poly : 0); c >>= 1; @@ -512,7 +528,8 @@ static struct net_device_ops moxart_netdev_ops = { .ndo_validate_addr = eth_validate_addr, .ndo_change_mtu = eth_change_mtu, /* .ndo_tx_timeout = moxart_mac_tx_timeout, - .ndo_init = moxart_mac_init, */ + .ndo_init = moxart_mac_init, +*/ }; /*static struct net_device moxart_mac1_dev = { @@ -523,7 +540,8 @@ static struct net_device_ops moxart_netdev_ops = { static struct net_device moxart_mac2_dev = { .name = "eth1", .netdev_ops = &moxart_netdev_ops, -};*/ +}; +*/ /* Get MAC address stored in flash memory and write it to net_device */ static void __init moxart_get_mac_address(struct net_device *dev, @@ -533,8 +551,9 @@ static void __init moxart_get_mac_address(struct net_device *dev, for (i = 0; i <= 5; i++) dev->dev_addr[i] = inb(IO_ADDRESS(MOXART_FLASH_BASE) + mac_addr_flash_offset + i); - dbg_printk("MOXART Ethernet: finished get_mac_address" - " dev->base_addr=%x\n", (unsigned int) dev->base_addr); + dbg_printk( + "MOXART Ethernet: get_mac_address dev->base_addr=%x\n" + , (unsigned int) dev->base_addr); } static int __init moxart_mac_probe(struct platform_device *pdev) @@ -557,36 +576,38 @@ static int __init moxart_mac_probe(struct platform_device *pdev) /* memset((void *) priv, 0, sizeof(struct moxart_mac_priv_t)); */ spin_lock_init(&priv->txlock); - priv->virtTxDescBaseAddr = (struct tx_desc_t *) + priv->virt_tx_desc_baseaddr = (struct tx_desc_t *) dma_alloc_coherent(NULL, sizeof(struct tx_desc_t) * TX_DESC_NUM, - (dma_addr_t *)&priv->phyTxDescBaseAddr, GFP_DMA | GFP_KERNEL); - if (priv->virtTxDescBaseAddr == NULL || - (priv->phyTxDescBaseAddr & 0x0f)) { - printk(KERN_INFO "Allocate the Tx descriptor memory fail !\n"); + (dma_addr_t *)&priv->phy_tx_desc_baseaddr, + GFP_DMA | GFP_KERNEL); + if (priv->virt_tx_desc_baseaddr == NULL || + (priv->phy_tx_desc_baseaddr & 0x0f)) { + pr_info("Allocate the Tx descriptor memory fail !\n"); goto init_fail; } - priv->virtRxDescBaseAddr = (struct rx_desc_t *) + priv->virt_rx_desc_baseaddr = (struct rx_desc_t *) dma_alloc_coherent(NULL, sizeof(struct rx_desc_t) * RX_DESC_NUM, - (dma_addr_t *)&priv->phyRxDescBaseAddr, GFP_DMA | GFP_KERNEL); - if (priv->virtRxDescBaseAddr == NULL || - (priv->phyRxDescBaseAddr & 0x0f)) { - printk(KERN_INFO "Allocate the Rx descriptor memory fail !\n"); + (dma_addr_t *)&priv->phy_rx_desc_baseaddr, + GFP_DMA | GFP_KERNEL); + if (priv->virt_rx_desc_baseaddr == NULL || + (priv->phy_rx_desc_baseaddr & 0x0f)) { + pr_info("Allocate the Rx descriptor memory fail !\n"); goto init_fail; } - priv->virtTxBufBaseAddr = (unsigned char *) + priv->virt_tx_buf_baseaddr = (unsigned char *) dma_alloc_coherent(NULL, TX_BUF_SIZE * TX_DESC_NUM, - (dma_addr_t *)&priv->phyTxBufBaseAddr, GFP_DMA | GFP_KERNEL); - if (priv->virtTxBufBaseAddr == NULL || - (priv->phyTxBufBaseAddr & 0x03)) { - printk(KERN_INFO "Allocate the Tx buffer memory fail !\n"); + (dma_addr_t *)&priv->phy_tx_buf_baseaddr, GFP_DMA | GFP_KERNEL); + if (priv->virt_tx_buf_baseaddr == NULL || + (priv->phy_tx_buf_baseaddr & 0x03)) { + pr_info("Allocate the Tx buffer memory fail !\n"); goto init_fail; } - priv->virtRxBufBaseAddr = (unsigned char *) + priv->virt_rx_buf_baseaddr = (unsigned char *) dma_alloc_coherent(NULL, RX_BUF_SIZE * RX_DESC_NUM, - (dma_addr_t *)&priv->phyRxBufBaseAddr, GFP_DMA | GFP_KERNEL); - if (priv->virtRxBufBaseAddr == NULL || - (priv->phyRxBufBaseAddr & 0x03)) { - printk(KERN_INFO "Allocate the Rx buffer memory fail !\n"); + (dma_addr_t *)&priv->phy_rx_buf_baseaddr, GFP_DMA | GFP_KERNEL); + if (priv->virt_rx_buf_baseaddr == NULL || + (priv->phy_rx_buf_baseaddr & 0x03)) { + pr_info("Allocate the Rx buffer memory fail !\n"); goto init_fail; } platform_set_drvdata(pdev, dev); @@ -606,24 +627,24 @@ static int __init moxart_mac_probe(struct platform_device *pdev) if (request_irq(dev->irq, &moxart_mac_interrupt, IRQF_DISABLED, dev->name, dev)) { + pr_info("MOXART Ethernet: request_irq failed\n"); free_netdev(dev); - printk(KERN_INFO "MOXART Ethernet: request interrupt service failed\n"); return -EBUSY; } - printk(KERN_INFO "MOXART Ethernet: finished moxart_mac_probe %s IRQ=%d" + pr_info("MOXART Ethernet: moxart_mac_probe %s IRQ=%d\n" " address=%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, dev->irq, dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); return 0; init_fail: - printk(KERN_INFO "MOXART Ethernet: init_fail! \n"); + pr_info("MOXART Ethernet: init_fail!\n"); moxart_mac_free_memory(dev); return -ENOMEM; } -static int __devexit moxart_remove(struct platform_device *pdev) +static int moxart_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); unregister_netdev(dev); @@ -637,22 +658,23 @@ static int __devexit moxart_remove(struct platform_device *pdev) struct __initdata platform_driver moxart_mac_driver = { .probe = &moxart_mac_probe, /* .suspend = NULL, - .resume = NULL, */ + .resume = NULL, +*/ .remove = __devexit_p(moxart_remove), .driver = { .name = "MOXART_RTL8201CP", .owner = THIS_MODULE, }, - }; +}; - static int __init moxart_mac_init(void) - { +static int __init moxart_mac_init(void) +{ return platform_driver_register(&moxart_mac_driver); - } +} static void __exit moxart_mac_exit(void) { - platform_driver_unregister(&moxart_mac_driver); + platform_driver_unregister(&moxart_mac_driver); } module_init(moxart_mac_init) diff --git a/drivers/net/arm/moxart_ether.h b/drivers/net/arm/moxart_ether.h index cd6442f1..a7f0cedf 100644 --- a/drivers/net/arm/moxart_ether.h +++ b/drivers/net/arm/moxart_ether.h @@ -3,7 +3,8 @@ * 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. */ + * or (at your option) any later version. + */ #ifndef _MOXART_ETHERNET_H #define _MOXART_ETHERNET_H @@ -23,15 +24,15 @@ struct tx_desc_t { #define TXPKT_LATECOL (1<<0) struct { /* is aborted due to late collision */ - unsigned int TxPktLateCol:1; + unsigned int tx_pkt_late_col:1; /* is aborted after 16 collisions */ - unsigned int TxPktExsCol:1; + unsigned int rx_pkt_exs_col:1; - unsigned int Reserved1:29; + unsigned int reserved1:29; /* is owned by the MAC controller */ - unsigned int TxDMAOwn:1; + unsigned int tx_dma_own:1; } ubit; } txdes0; union { @@ -45,32 +46,32 @@ struct tx_desc_t { #define TXBUF_SIZE_MAX (TXBUF_SIZE_MASK+1) struct { /* transmit buffer size in byte */ - unsigned int TxBufSize:11; + unsigned int tx_buf_size:11; - unsigned int Reserved2:16; + unsigned int reserved2:16; /* is the last descriptor of a Tx packet */ - unsigned int Lts:1; + unsigned int lts:1; /* is the first descriptor of a Tx packet */ - unsigned int Fts:1; + unsigned int fts:1; /* transmit to FIFO interrupt on completion */ - unsigned int Tx2fic:1; + unsigned int tx2_fic:1; /* transmit interrupt on completion */ - unsigned int Txic:1; + unsigned int tx_ic:1; /* end descriptor of transmit ring */ - unsigned int Edotr:1; + unsigned int edotr:1; } ubit; } txdes1; struct { /* transmit buffer physical base address */ - unsigned int phyTxBufBaseAddr; + unsigned int phy_tx_buf_baseaddr; /* transmit buffer virtual base address */ - unsigned char *virtTxBufBaseAddr; + unsigned char *virt_tx_buf_baseaddr; } txdes2; }; @@ -91,33 +92,33 @@ struct rx_desc_t { #define RFL_MAX (RFL_MASK+1) struct { /* receive frame length */ - unsigned int RecvFrameLen:11; - unsigned int Reserved1:5; + unsigned int recv_frame_len:11; + unsigned int reserved1:5; /* multicast frame */ - unsigned int Multicast:1; + unsigned int multicast:1; /* broadcast frame */ - unsigned int Broadcast:1; - unsigned int RxErr:1; /* receive error */ - unsigned int CRCErr:1; /* CRC error */ - unsigned int Ftl:1; /* frame too long */ + unsigned int broadcast:1; + unsigned int rx_err:1; /* receive error */ + unsigned int crc_err:1; /* CRC error */ + unsigned int ftl:1; /* frame too long */ /* runt packet, less than 64 bytes */ - unsigned int Runt:1; + unsigned int runt:1; /* receive odd nibbles */ - unsigned int RxOddNb:1; - unsigned int Reserved2:5; + unsigned int rx_odd_nb:1; + unsigned int reserved2:5; /* last receive segment descriptor */ - unsigned int Lrs:1; + unsigned int lrs:1; /* first receive segment descriptor */ - unsigned int Frs:1; + unsigned int frs:1; - unsigned int Reserved3:1; - unsigned int RxDMAOwn:1; /* RXDMA onwership */ + unsigned int reserved3:1; + unsigned int rx_dma_own:1; /* RXDMA onwership */ } ubit; } rxdes0; union { @@ -127,20 +128,20 @@ struct rx_desc_t { #define RXBUF_SIZE_MAX (RXBUF_SIZE_MASK+1) struct { /* receive buffer size */ - unsigned int RxBufSize:11; + unsigned int rx_buf_size:11; - unsigned int Reserved4:20; + unsigned int reserved4:20; /* end descriptor of receive ring */ - unsigned int Edorr:1; + unsigned int edorr:1; } ubit; } rxdes1; struct { /* receive buffer physical base address */ - unsigned int phyRxBufBaseAddr; + unsigned int phy_rx_buf_baseaddr; /* receive buffer virtual base address */ - unsigned char *virtRxBufBaseAddr; + unsigned char *virt_rx_buf_baseaddr; } rxdes2; }; @@ -163,7 +164,8 @@ struct mac_control_reg_t { #define XPKT_OK_INT_STS (1<<4) /* packets transmitted to ethernet lost due to late - * collision or excessive collision */ + * collision or excessive collision + */ #define XPKT_LOST_INT_STS (1<<5) /* packets received into RX FIFO successfully */ @@ -283,7 +285,8 @@ struct mac_control_reg_t { #define RX_RUNT (1<<10) /* enable storing incoming packet if the packet passes hash table - * address filtering and is a multicast packet */ + * address filtering and is a multicast packet + */ #define HT_MULTI_EN (1<<9) #define RCV_EN (1<<8) /* receiver enable */ @@ -310,7 +313,8 @@ struct mac_control_reg_t { #define LATE_COL (1<<10) /* packet transmitted to ethernet lost due to late collision - * or excessive collision */ + * or excessive collision + */ #define XPKT_LOST (1<<9) /* packets transmitted to ethernet successfully */ @@ -338,7 +342,8 @@ struct mac_control_reg_t { unsigned int phycr; /* PHY control, 0x90 */ /* initialize a write sequence to PHY by setting this bit to 1. - * This bit would be auto cleared after the write operation is finished. */ + * This bit would be auto cleared after the write operation is finished. + */ #define MIIWR (1<<27) #define MIIRD (1<<26) @@ -490,38 +495,38 @@ struct mac_control_reg_t { /* PHY Status register */ #define AN_COMPLETE 0x0020 -#define Link_Status 0x0004 +#define LINK_STATUS 0x0004 struct moxart_mac_priv_t { /* Tx descriptor physical base address */ - unsigned int phyTxDescBaseAddr; + unsigned int phy_tx_desc_baseaddr; /* Tx descriptor virtual base address */ - struct tx_desc_t *virtTxDescBaseAddr; + struct tx_desc_t *virt_tx_desc_baseaddr; /* Rx descriptor physical base address */ - unsigned int phyRxDescBaseAddr; + unsigned int phy_rx_desc_baseaddr; /* Rx descriptor virtual base address */ - struct rx_desc_t *virtRxDescBaseAddr; + struct rx_desc_t *virt_rx_desc_baseaddr; /* Tx buffer physical base address */ - unsigned int phyTxBufBaseAddr; + unsigned int phy_tx_buf_baseaddr; /* Tx buffer virtual base address */ - unsigned char *virtTxBufBaseAddr; + unsigned char *virt_tx_buf_baseaddr; /* Rx buffer physical base address */ - unsigned int phyRxBufBaseAddr; + unsigned int phy_rx_buf_baseaddr; /* Rx buffer virtual base address */ - unsigned char *virtRxBufBaseAddr; + unsigned char *virt_rx_buf_baseaddr; /* Tx descriptor now first used index */ - int TxDescNow; + int tx_desc_now; /* Rx descriptor now first used index */ - int RxDescNow; + int rx_desc_now; /* OS about the ethernet statistics */ struct net_device_stats stats; diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index bf7b1f05..8a5dc20a 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -453,7 +453,11 @@ config RTC_DRV_DS1553 config RTC_DRV_MOXART tristate "MOXA ART RTC" help - If you say yes here you get support for the MOXA ART timekeeping chip. + If you say yes here you get support for the + MOXA ART timekeeping chip. + + This driver can also be built as a module. If so, the module + will be called rtc-moxart config RTC_DRV_DS1742 tristate "Maxim/Dallas DS1742/1743" diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c index cb777581..8fe20f26 100644 --- a/drivers/rtc/rtc-moxart.c +++ b/drivers/rtc/rtc-moxart.c @@ -39,53 +39,53 @@ static int day_of_year[12] = {0, 31, 59, 90, 120, 151, 181, static u8 moxart_rtc_read_register(u8 cmd) { - u8 data; - unsigned long flags; + u8 data; + unsigned long flags; - local_irq_save(flags); + local_irq_save(flags); - moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_OUTPUT); - moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_HIGH); - udelay(GPIO_RTC_DELAY_TIME); + moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_OUTPUT); + moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_HIGH); + udelay(GPIO_RTC_DELAY_TIME); - moxart_gpio_write_byte(cmd); + moxart_gpio_write_byte(cmd); - moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_INPUT); - udelay(GPIO_RTC_DELAY_TIME); + moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_INPUT); + udelay(GPIO_RTC_DELAY_TIME); - data = moxart_gpio_read_byte(); + data = moxart_gpio_read_byte(); - moxart_gpio_set(GPIO_RTC_SCLK, GPIO_EM1240_LOW); - moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_LOW); - udelay(GPIO_RTC_DELAY_TIME); + moxart_gpio_set(GPIO_RTC_SCLK, GPIO_EM1240_LOW); + moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_LOW); + udelay(GPIO_RTC_DELAY_TIME); - local_irq_restore(flags); + local_irq_restore(flags); - return data; + return data; } static void moxart_rtc_write_register(u8 cmd, u8 data) { - unsigned long flags; + unsigned long flags; - local_irq_save(flags); + local_irq_save(flags); - moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_OUTPUT); - moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_HIGH); - udelay(GPIO_RTC_DELAY_TIME); + moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_OUTPUT); + moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_HIGH); + udelay(GPIO_RTC_DELAY_TIME); - moxart_gpio_write_byte(cmd); + moxart_gpio_write_byte(cmd); - moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_OUTPUT); + moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_OUTPUT); - moxart_gpio_write_byte(data); + moxart_gpio_write_byte(data); - moxart_gpio_set(GPIO_RTC_SCLK, GPIO_EM1240_LOW); - moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_LOW); - udelay(GPIO_RTC_DELAY_TIME); - /* moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_INPUT); */ + moxart_gpio_set(GPIO_RTC_SCLK, GPIO_EM1240_LOW); + moxart_gpio_set(GPIO_RTC_RESET, GPIO_EM1240_LOW); + udelay(GPIO_RTC_DELAY_TIME); + /* moxart_gpio_inout(GPIO_RTC_DATA, GPIO_EM1240_INPUT); */ - local_irq_restore(flags); + local_irq_restore(flags); } static int moxart_rtc_set_time(struct device *dev, struct rtc_time *tm) @@ -110,8 +110,9 @@ static int moxart_rtc_set_time(struct device *dev, struct rtc_time *tm) spin_unlock_irq(&rtc_lock); - dbg_printk(KERN_INFO "MOXART RTC: moxart_rtc_set_time success tm_year" - "=%d tm_mon=%d tm_mday=%d tm_hour=%d tm_min=%d tm_sec=%d\n", + dbg_printk(KERN_INFO + "MOXART RTC: moxart_rtc_set_time success tm_year=%d tm_mon=%d\n" + "tm_mday=%d tm_hour=%d tm_min=%d tm_sec=%d\n", tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); @@ -185,7 +186,7 @@ static const struct rtc_class_ops moxart_rtc_ops = { .ioctl = moxart_rtc_ioctl, }; -static int __devinit moxart_rtc_probe(struct platform_device *pdev) +static int moxart_rtc_probe(struct platform_device *pdev) { struct rtc_device *rtc; struct resource *res; @@ -195,24 +196,25 @@ static int __devinit moxart_rtc_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { - printk(KERN_INFO "MOXART RTC: platform_get_resource failed\n"); + dev_info(&pdev->dev, + "MOXART RTC: platform_get_resource failed\n"); return -ENODEV; } pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); if (!pdata) { - printk(KERN_INFO "MOXART RTC: kzalloc failed\n"); + dev_info(&pdev->dev, "MOXART RTC: devm_kzalloc failed\n"); return -ENOMEM; } if (!request_mem_region(res->start, RTC_REG_SIZE, pdev->name)) { ret = -EBUSY; - printk(KERN_INFO "MOXART RTC: request_mem_region failed\n"); + dev_info(&pdev->dev, "MOXART RTC: request_mem_region failed\n"); goto out; } pdata->baseaddr = res->start; ioaddr = ioremap(pdata->baseaddr, RTC_REG_SIZE); if (!ioaddr) { ret = -ENOMEM; - printk(KERN_INFO "MOXART RTC: ioremap failed\n"); + dev_info(&pdev->dev, "MOXART RTC: ioremap failed\n"); goto out; } pdata->ioaddr = ioaddr; @@ -233,7 +235,7 @@ static int __devinit moxart_rtc_probe(struct platform_device *pdev) spin_lock_init(&rtc_lock); - printk(KERN_INFO "MOXART RTC: finished moxart_rtc_probe\n"); + dev_info(&pdev->dev, "MOXART RTC: finished moxart_rtc_probe\n"); if (ret) goto out; @@ -251,7 +253,7 @@ static int __devinit moxart_rtc_probe(struct platform_device *pdev) return ret; } -static int __devexit moxart_rtc_remove(struct platform_device *pdev) +static int moxart_rtc_remove(struct platform_device *pdev) { struct rtc_plat_data *pdata = platform_get_drvdata(pdev); diff --git a/drivers/watchdog/moxart_wdt.c b/drivers/watchdog/moxart_wdt.c index c9512615..e115de14 100644 --- a/drivers/watchdog/moxart_wdt.c +++ b/drivers/watchdog/moxart_wdt.c @@ -207,7 +207,7 @@ static void wdt_poll(unsigned long ignore) wdt_enable(); #endif del_timer(&wdt_timer); - printk(KERN_INFO "MOXART watchdog: Now reboot the system.\n"); + pr_info("MOXART watchdog: Now reboot the system.\n"); schedule_work(&rebootqueue); local_irq_restore(flags); } @@ -270,7 +270,7 @@ static void __exit moxart_wdt_exit(void) static int __init moxart_wdt_init(void) { if (misc_register(&wdt_dev)) { - printk(KERN_INFO "MOXART watchdog: misc_register: failed to register device.\n"); + pr_info("MOXART watchdog: misc_register failed!\n"); goto moxart_wdt_init_err; } @@ -291,7 +291,7 @@ static int __init moxart_wdt_init(void) create_proc_read_entry("driver/moxart_wdt", 0, 0, wdt_read_proc, NULL); - printk(KERN_INFO "MOXART watchdog driver\n"); + pr_info("MOXART watchdog driver\n"); return 0; -- 2.11.4.GIT