Re: [PATCH] rtc: rtc-at91rm9200: use a variable for storing IMR
On 03/20/2013 10:50 PM, Andrew Morton : > On Fri, 15 Mar 2013 18:37:12 +0100 Nicolas Ferre > wrote: > >> On some revisions of AT91 SoCs, the RTC IMR register is not working. >> Instead of elaborating a workaround for that specific SoC or IP version, >> we simply use a software variable to store the Interrupt Mask Register and >> modify it for each enabling/disabling of an interrupt. The overhead of this >> is negligible anyway. > > This description doesn't really allow me or others to work out whether > the fix should be included in 3.9 or backported into earlier kernels. > > So please, when fixing a bug do include a full description of the > user-visible effects of that bug. And your opinion regarding the > -mainline and -stable decision is always useful. Yes, sure. Concerning this patch, we can imagine to push it upstream as a bugfix for 3.9-rc. It is not a regression because... well... it has never worked properly on the affected SoC family. For -stable, we can add this tag: Cc: stable [v3.8+] As this patch applies up to this revision. For other kernel releases, I will need to rework the patch a little bit due to files name modifications. Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] rtc: at91rm9200: add DT support
On 03/08/2013 10:14 AM, Nicolas Ferre : > On 02/14/2013 10:59 PM, Joachim Eastwood : >> Signed-off-by: Joachim Eastwood > > Acked-by: Nicolas Ferre > > Alessandro, do you want to queue this one on your side? Ping? Maybe Andrew, you may take this one on your side? > Best regards, > >> --- >> .../devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt | 15 >> +++ >> drivers/rtc/rtc-at91rm9200.c | 9 + >> 2 files changed, 24 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> >> diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> new file mode 100644 >> index 000..2a3feab >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> @@ -0,0 +1,15 @@ >> +Atmel AT91RM9200 Real Time Clock >> + >> +Required properties: >> +- compatible: should be: "atmel,at91rm9200-rtc" >> +- reg: physical base address of the controller and length of memory mapped >> + region. >> +- interrupts: rtc alarm/event interrupt >> + >> +Example: >> + >> +rtc@fe00 { >> +compatible = "atmel,at91rm9200-rtc"; >> +reg = <0xfe00 0x100>; >> +interrupts = <1 4 7>; >> +}; >> diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c >> index b6469e2..2ea0ee3 100644 >> --- a/drivers/rtc/rtc-at91rm9200.c >> +++ b/drivers/rtc/rtc-at91rm9200.c >> @@ -28,6 +28,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> >> #include >> >> @@ -382,12 +384,19 @@ static const struct dev_pm_ops at91_rtc_pm = { >> #define at91_rtc_pm_ptr NULL >> #endif >> >> +static const struct of_device_id at91_rtc_dt_ids[] = { >> +{ .compatible = "atmel,at91rm9200-rtc" }, >> +{ /* sentinel */ } >> +}; >> +MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids); >> + >> static struct platform_driver at91_rtc_driver = { >> .remove = __exit_p(at91_rtc_remove), >> .driver = { >> .name = "at91_rtc", >> .owner = THIS_MODULE, >> .pm = at91_rtc_pm_ptr, >> +.of_match_table = of_match_ptr(at91_rtc_dt_ids), >> }, >> }; -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/7] pcmcia: at91_cf: clean up and add DT support
These patches clean up at91_cf a bit and add DT bindings. It is based on a previous series from Joachim Eastwood and other cleanup patches by Fabio and Laurent. I have collected them together as they are lying around for some time. Please tell me if It can go through PCMCIA tree or if Andrew or Greg can take them. Note that they are not bug fixes, so you can stack them for 3.10. Thanks for your help, best regards. v2: add 2 more cleanup patches: - move to module_platform_driver_probe() - little trivial indentation fix Fabio Porcedda (1): pcmcia: at91_cf: use module_platform_driver_probe() Joachim Eastwood (5): pcmcia: at91_cf: fix gpio_get_value in at91_cf_get_status pcmcia: at91_cf: convert to dev_ print functions pcmcia: at91_cf: use devm_ functions for allocations pcmcia: at91_cf: clean up header includes pcmcia: at91_cf: add support for DT Laurent Navet (1): pcmcia/trivial: at91_cf: fix checkpatch error .../devicetree/bindings/ata/atmel-at91_cf.txt | 19 +++ drivers/pcmcia/Kconfig | 2 +- drivers/pcmcia/at91_cf.c | 176 ++--- 3 files changed, 108 insertions(+), 89 deletions(-) create mode 100644 Documentation/devicetree/bindings/ata/atmel-at91_cf.txt -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/7] pcmcia: at91_cf: fix gpio_get_value in at91_cf_get_status
From: Joachim Eastwood Commit 80af9e6d (pcmcia at91_cf: fix raw gpio number usage) forgot to change the parameter in gpio_get_value after adding gpio validation. Signed-off-by: Joachim Eastwood Signed-off-by: Nicolas Ferre --- drivers/pcmcia/at91_cf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 01463c7..1b2c631 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -100,9 +100,9 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp) int vcc = gpio_is_valid(cf->board->vcc_pin); *sp = SS_DETECT | SS_3VCARD; - if (!rdy || gpio_get_value(rdy)) + if (!rdy || gpio_get_value(cf->board->irq_pin)) *sp |= SS_READY; - if (!vcc || gpio_get_value(vcc)) + if (!vcc || gpio_get_value(cf->board->vcc_pin)) *sp |= SS_POWERON; } else *sp = 0; -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/7] pcmcia: at91_cf: convert to dev_ print functions
From: Joachim Eastwood Convert all pr_* functions to equivalent dev_* functions and drop the driver_name variable. Signed-off-by: Joachim Eastwood Signed-off-by: Nicolas Ferre --- drivers/pcmcia/at91_cf.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 1b2c631..4eec14b 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -41,8 +41,6 @@ /*--*/ -static const char driver_name[] = "at91_cf"; - struct at91_cf_socket { struct pcmcia_socketsocket; @@ -76,7 +74,7 @@ static irqreturn_t at91_cf_irq(int irq, void *_cf) /* kick pccard as needed */ if (present != cf->present) { cf->present = present; - pr_debug("%s: card %s\n", driver_name, + dev_dbg(&cf->pdev->dev, "card %s\n", present ? "present" : "gone"); pcmcia_parse_events(&cf->socket, SS_DETECT); } @@ -134,8 +132,8 @@ at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) /* toggle reset if needed */ gpio_set_value(cf->board->rst_pin, s->flags & SS_RESET); - pr_debug("%s: Vcc %d, io_irq %d, flags %04x csc %04x\n", - driver_name, s->Vcc, s->io_irq, s->flags, s->csc_mask); + dev_dbg(&cf->pdev->dev, "Vcc %d, io_irq %d, flags %04x csc %04x\n", + s->Vcc, s->io_irq, s->flags, s->csc_mask); return 0; } @@ -171,10 +169,10 @@ static int at91_cf_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) */ if (!(io->flags & (MAP_16BIT | MAP_AUTOSZ))) { csr |= AT91_SMC_DBW_8; - pr_debug("%s: 8bit i/o bus\n", driver_name); + dev_dbg(&cf->pdev->dev, "8bit i/o bus\n"); } else { csr |= AT91_SMC_DBW_16; - pr_debug("%s: 16bit i/o bus\n", driver_name); + dev_dbg(&cf->pdev->dev, "16bit i/o bus\n"); } at91_ramc_write(0, AT91_SMC_CSR(cf->board->chipselect), csr); @@ -242,7 +240,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) status = gpio_request(board->det_pin, "cf_det"); if (status < 0) goto fail0; - status = request_irq(gpio_to_irq(board->det_pin), at91_cf_irq, 0, driver_name, cf); + status = request_irq(gpio_to_irq(board->det_pin), at91_cf_irq, 0, "at91_cf detect", cf); if (status < 0) goto fail00; device_init_wakeup(&pdev->dev, 1); @@ -268,7 +266,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) if (status < 0) goto fail0c; status = request_irq(gpio_to_irq(board->irq_pin), at91_cf_irq, - IRQF_SHARED, driver_name, cf); + IRQF_SHARED, "at91_cf", cf); if (status < 0) goto fail0d; cf->socket.pci_irq = gpio_to_irq(board->irq_pin); @@ -284,12 +282,12 @@ static int __init at91_cf_probe(struct platform_device *pdev) } /* reserve chip-select regions */ - if (!request_mem_region(io->start, resource_size(io), driver_name)) { + if (!request_mem_region(io->start, resource_size(io), "at91_cf")) { status = -ENXIO; goto fail1; } - pr_info("%s: irqs det #%d, io #%d\n", driver_name, + dev_info(&pdev->dev, "irqs det #%d, io #%d\n", gpio_to_irq(board->det_pin), gpio_to_irq(board->irq_pin)); cf->socket.owner = THIS_MODULE; @@ -391,7 +389,7 @@ static int at91_cf_resume(struct platform_device *pdev) static struct platform_driver at91_cf_driver = { .driver = { - .name = (char *) driver_name, + .name = "at91_cf", .owner = THIS_MODULE, }, .remove = __exit_p(at91_cf_remove), -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/7] pcmcia: at91_cf: use devm_ functions for allocations
From: Joachim Eastwood Signed-off-by: Joachim Eastwood Signed-off-by: Nicolas Ferre --- drivers/pcmcia/at91_cf.c | 77 +++- 1 file changed, 24 insertions(+), 53 deletions(-) diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 4eec14b..43bc342 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -227,7 +227,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) if (!io) return -ENODEV; - cf = kzalloc(sizeof *cf, GFP_KERNEL); + cf = devm_kzalloc(&pdev->dev, sizeof(*cf), GFP_KERNEL); if (!cf) return -ENOMEM; @@ -237,22 +237,25 @@ static int __init at91_cf_probe(struct platform_device *pdev) platform_set_drvdata(pdev, cf); /* must be a GPIO; ergo must trigger on both edges */ - status = gpio_request(board->det_pin, "cf_det"); + status = devm_gpio_request(&pdev->dev, board->det_pin, "cf_det"); if (status < 0) - goto fail0; - status = request_irq(gpio_to_irq(board->det_pin), at91_cf_irq, 0, "at91_cf detect", cf); + return status; + + status = devm_request_irq(&pdev->dev, gpio_to_irq(board->det_pin), + at91_cf_irq, 0, "at91_cf detect", cf); if (status < 0) - goto fail00; + return status; + device_init_wakeup(&pdev->dev, 1); - status = gpio_request(board->rst_pin, "cf_rst"); + status = devm_gpio_request(&pdev->dev, board->rst_pin, "cf_rst"); if (status < 0) goto fail0a; if (gpio_is_valid(board->vcc_pin)) { - status = gpio_request(board->vcc_pin, "cf_vcc"); + status = devm_gpio_request(&pdev->dev, board->vcc_pin, "cf_vcc"); if (status < 0) - goto fail0b; + goto fail0a; } /* @@ -262,29 +265,30 @@ static int __init at91_cf_probe(struct platform_device *pdev) * (Note: DK board doesn't wire the IRQ pin...) */ if (gpio_is_valid(board->irq_pin)) { - status = gpio_request(board->irq_pin, "cf_irq"); + status = devm_gpio_request(&pdev->dev, board->irq_pin, "cf_irq"); if (status < 0) - goto fail0c; - status = request_irq(gpio_to_irq(board->irq_pin), at91_cf_irq, - IRQF_SHARED, "at91_cf", cf); + goto fail0a; + + status = devm_request_irq(&pdev->dev, gpio_to_irq(board->irq_pin), + at91_cf_irq, IRQF_SHARED, "at91_cf", cf); if (status < 0) - goto fail0d; + goto fail0a; cf->socket.pci_irq = gpio_to_irq(board->irq_pin); } else cf->socket.pci_irq = nr_irqs + 1; /* pcmcia layer only remaps "real" memory not iospace */ - cf->socket.io_offset = (unsigned long) - ioremap(cf->phys_baseaddr + CF_IO_PHYS, SZ_2K); + cf->socket.io_offset = (unsigned long) devm_ioremap(&pdev->dev, + cf->phys_baseaddr + CF_IO_PHYS, SZ_2K); if (!cf->socket.io_offset) { status = -ENXIO; - goto fail1; + goto fail0a; } /* reserve chip-select regions */ - if (!request_mem_region(io->start, resource_size(io), "at91_cf")) { + if (!devm_request_mem_region(&pdev->dev, io->start, resource_size(io), "at91_cf")) { status = -ENXIO; - goto fail1; + goto fail0a; } dev_info(&pdev->dev, "irqs det #%d, io #%d\n", @@ -301,55 +305,22 @@ static int __init at91_cf_probe(struct platform_device *pdev) status = pcmcia_register_socket(&cf->socket); if (status < 0) - goto fail2; + goto fail0a; return 0; -fail2: - release_mem_region(io->start, resource_size(io)); -fail1: - if (cf->socket.io_offset) - iounmap((void __iomem *) cf->socket.io_offset); - if (gpio_is_valid(board->irq_pin)) { - free_irq(gpio_to_irq(board->irq_pin), cf); -fail0d: - gpio_free(board->irq_pin); - } -fail0c: - if (gpio_is_valid(board->vcc_pin)) - gpio_free(board->vcc_pin); -fail0b: - gpio_free(board->rst_pin); fail0a: device_init_wakeup(&pdev->dev, 0); - free_irq(
[PATCH v2 4/7] pcmcia: at91_cf: clean up header includes
From: Joachim Eastwood Use includes from linux/ instead of asm/ and remove a unnecessary mach/ include. Signed-off-by: Joachim Eastwood Signed-off-by: Nicolas Ferre --- drivers/pcmcia/at91_cf.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 43bc342..bce8a64 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -18,13 +18,11 @@ #include #include #include +#include +#include #include -#include -#include -#include - #include #include -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 5/7] pcmcia: at91_cf: add support for DT
From: Joachim Eastwood Signed-off-by: Joachim Eastwood Signed-off-by: Nicolas Ferre --- .../devicetree/bindings/ata/atmel-at91_cf.txt | 19 + drivers/pcmcia/Kconfig | 2 +- drivers/pcmcia/at91_cf.c | 45 +- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/ata/atmel-at91_cf.txt diff --git a/Documentation/devicetree/bindings/ata/atmel-at91_cf.txt b/Documentation/devicetree/bindings/ata/atmel-at91_cf.txt new file mode 100644 index 000..c1d22b3 --- /dev/null +++ b/Documentation/devicetree/bindings/ata/atmel-at91_cf.txt @@ -0,0 +1,19 @@ +Atmel AT91RM9200 CompactFlash + +Required properties: +- compatible : "atmel,at91rm9200-cf". +- reg : should specify localbus address and size used. +- gpios : specifies the gpio pins to control the CF device. Detect + and reset gpio's are mandatory while irq and vcc gpio's are + optional and may be set to 0 if not present. + +Example: +compact-flash@5000 { + compatible = "atmel,at91rm9200-cf"; + reg = <0x5000 0x3000>; + gpios = <&pioC 13 0 /* irq */ +&pioC 15 0 /* detect */ +0 /* vcc */ +&pioC 5 0 /* reset */ + >; +}; diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index b90f85b..80faa56 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig @@ -288,7 +288,7 @@ config BFIN_CFPCMCIA config AT91_CF tristate "AT91 CompactFlash Controller" - depends on PCMCIA && ARCH_AT91RM9200 + depends on PCMCIA && ARCH_AT91 help Say Y here to support the CompactFlash controller on AT91 chips. Or choose M to compile the driver as a module named "at91_cf". diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index bce8a64..149b95c 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -20,6 +20,9 @@ #include #include #include +#include +#include +#include #include @@ -211,6 +214,37 @@ static struct pccard_operations at91_cf_ops = { /*--*/ +#if defined(CONFIG_OF) +static const struct of_device_id at91_cf_dt_ids[] = { + { .compatible = "atmel,at91rm9200-cf" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, at91_cf_dt_ids); + +static int at91_cf_dt_init(struct platform_device *pdev) +{ + struct at91_cf_data *board; + + board = devm_kzalloc(&pdev->dev, sizeof(*board), GFP_KERNEL); + if (!board) + return -ENOMEM; + + board->irq_pin = of_get_gpio(pdev->dev.of_node, 0); + board->det_pin = of_get_gpio(pdev->dev.of_node, 1); + board->vcc_pin = of_get_gpio(pdev->dev.of_node, 2); + board->rst_pin = of_get_gpio(pdev->dev.of_node, 3); + + pdev->dev.platform_data = board; + + return 0; +} +#else +static int at91_cf_dt_init(struct platform_device *pdev) +{ + return -ENODEV; +} +#endif + static int __init at91_cf_probe(struct platform_device *pdev) { struct at91_cf_socket *cf; @@ -218,7 +252,15 @@ static int __init at91_cf_probe(struct platform_device *pdev) struct resource *io; int status; - if (!board || !gpio_is_valid(board->det_pin) || !gpio_is_valid(board->rst_pin)) + if (!board) { + status = at91_cf_dt_init(pdev); + if (status) + return status; + + board = pdev->dev.platform_data; + } + + if (!gpio_is_valid(board->det_pin) || !gpio_is_valid(board->rst_pin)) return -ENODEV; io = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -360,6 +402,7 @@ static struct platform_driver at91_cf_driver = { .driver = { .name = "at91_cf", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(at91_cf_dt_ids), }, .remove = __exit_p(at91_cf_remove), .suspend= at91_cf_suspend, -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 6/7] pcmcia: at91_cf: use module_platform_driver_probe()
From: Fabio Porcedda Use module_platform_driver_probe() macro which makes the code smaller and simpler. Signed-off-by: Fabio Porcedda Cc: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Nicolas Ferre --- drivers/pcmcia/at91_cf.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 149b95c..8ddc57c 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -411,17 +411,7 @@ static struct platform_driver at91_cf_driver = { /*--*/ -static int __init at91_cf_init(void) -{ - return platform_driver_probe(&at91_cf_driver, at91_cf_probe); -} -module_init(at91_cf_init); - -static void __exit at91_cf_exit(void) -{ - platform_driver_unregister(&at91_cf_driver); -} -module_exit(at91_cf_exit); +module_platform_driver_probe(at91_cf_driver, at91_cf_probe); MODULE_DESCRIPTION("AT91 Compact Flash Driver"); MODULE_AUTHOR("David Brownell"); -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 7/7] pcmcia/trivial: at91_cf: fix checkpatch error
From: Laurent Navet fix this checkpatch error: - ERROR: switch and case should be at the same indent Signed-off-by: Laurent Navet Signed-off-by: Nicolas Ferre --- drivers/pcmcia/at91_cf.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 8ddc57c..b8f5acf 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -119,14 +119,14 @@ at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) /* switch Vcc if needed and possible */ if (gpio_is_valid(cf->board->vcc_pin)) { switch (s->Vcc) { - case 0: - gpio_set_value(cf->board->vcc_pin, 0); - break; - case 33: - gpio_set_value(cf->board->vcc_pin, 1); - break; - default: - return -EINVAL; + case 0: + gpio_set_value(cf->board->vcc_pin, 0); + break; + case 33: + gpio_set_value(cf->board->vcc_pin, 1); + break; + default: + return -EINVAL; } } -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] DTS at91sam9x5ek: i2c1 and i2c2 conflict with macb and lcd
On 03/20/2013 12:22 PM, Richard Genoud : > on at91sam9x5ek, macb0 is enabled, so it conflicts with i2c2 (PB4) > same for i2c1, (conflicts with LCD). > Moreover, only i2c0 is used on this board. > > Signed-off-by: Richard Genoud Acked-by: Nicolas Ferre And pushed to at91-3.10-dt branch. Thanks, > --- > arch/arm/boot/dts/at91sam9x5ek.dtsi |8 > 1 files changed, 0 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/boot/dts/at91sam9x5ek.dtsi > b/arch/arm/boot/dts/at91sam9x5ek.dtsi > index 8a7cf1d..1128565 100644 > --- a/arch/arm/boot/dts/at91sam9x5ek.dtsi > +++ b/arch/arm/boot/dts/at91sam9x5ek.dtsi > @@ -61,14 +61,6 @@ > status = "okay"; > }; > > - i2c1: i2c@f8014000 { > - status = "okay"; > - }; > - > - i2c2: i2c@f8018000 { > - status = "okay"; > - }; > - > pinctrl@f400 { > mmc0 { > pinctrl_board_mmc0: mmc0-board { > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] DTS at91sam9x5cm: add 1-wire chip on CM board
On 03/20/2013 12:23 PM, Richard Genoud : > This add the 1-wire chip present on the CM board to the DTS. > As the pin is also used by leds, tt's disabled by default. > If the board really wants it, it can be enabled in the board DTS. > > Signed-off-by: Richard Genoud Acked-by: Nicolas Ferre And pushed to at91-3.10-dt branch. Thanks, > --- > arch/arm/boot/dts/at91sam9x5cm.dtsi | 20 > 1 files changed, 20 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/boot/dts/at91sam9x5cm.dtsi > b/arch/arm/boot/dts/at91sam9x5cm.dtsi > index 4027ac7..347a74a 100644 > --- a/arch/arm/boot/dts/at91sam9x5cm.dtsi > +++ b/arch/arm/boot/dts/at91sam9x5cm.dtsi > @@ -24,6 +24,16 @@ > }; > > ahb { > + apb { > + pinctrl@f400 { > + 1wire_cm { > + pinctrl_1wire_cm: 1wire_cm-0 { > + atmel,pins = <1 18 0x0 0x2>; /* > PB18 multidrive, conflicts with led */ > + }; > + }; > + }; > + }; > + > nand0: nand@4000 { > nand-bus-width = <8>; > nand-ecc-mode = "hw"; > @@ -74,4 +84,14 @@ > gpios = <&pioD 21 0>; > }; > }; > + > + 1wire_cm { > + compatible = "w1-gpio"; > + gpios = <&pioB 18 0>; > + linux,open-drain; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_1wire_cm>; > + status = "okay"; > + }; > + > }; > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: dt for 3.10 #1
Arnd, Olof, This is an AT91 pull-request about Device Tree material for -next. The following changes since commit a937536b868b8369b98967929045f1df54234323: Linux 3.9-rc3 (2013-03-17 15:59:32 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-dt for you to fetch changes up to 6901d947be5ba1245a0f63271355b95f9056a362: ARM: at91/at91sam9x5cm: add 1-wire chip on CM board (2013-03-21 16:07:15 +0100) DT modifications for at91rm9200 and at91sam9x5 SoCs, mainly around I2C. Also some cleanup of some unneeded properties and conflicting nodes. One more DT-only board based on at91rm9200. Joachim Eastwood (3): ARM: at91: add TWI bindings to RM9200 DT ARM: at91: add pinctrl nodes to i2c-gpio on RM92000 DT ARM: at91: add MPA 1600 DT board Nicolas Ferre (1): ARM: at91/dt: gpio-keys: remove address-cells and size-cells properties Richard Genoud (4): ARM: at91: dt: at91sam9x5: add i2c pinctrl ARM: at91: dt: at91sam9x5: add i2c-gpio pinctrl ARM: at91/at91sam9x5ek: i2c1 and i2c2 conflict with macb and lcd ARM: at91/at91sam9x5cm: add 1-wire chip on CM board arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/at91rm9200.dtsi | 28 ++ arch/arm/boot/dts/at91sam9263ek.dts | 2 - arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 2 - arch/arm/boot/dts/at91sam9m10g45ek.dts | 2 - arch/arm/boot/dts/at91sam9n12ek.dts | 2 - arch/arm/boot/dts/at91sam9x5.dtsi | 60 ++ arch/arm/boot/dts/at91sam9x5cm.dtsi | 20 ++ arch/arm/boot/dts/at91sam9x5ek.dtsi | 8 arch/arm/boot/dts/mpa1600.dts | 69 +++ arch/arm/mach-at91/at91rm9200.c | 1 + 11 files changed, 179 insertions(+), 16 deletions(-) create mode 100644 arch/arm/boot/dts/mpa1600.dts Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: fixes for 3.9-rc1
Arnd, Olof, As I realized reading Linus' email that it was not possible to queue more fixes for 3.8, I took my time to send this tiny pull request. But now that the merge window is approaching, I prefer not to wait for more material. So, here is a "fixes" pull-request embedding a single patch. I have placed this one on top of material that you already have from me in your "fixes" and "for-next" branches. The following changes since commit 7d4cfece23f535b60496d88a717a3d7bfca50187: ARM: at91/at91sam9x5.dtsi: fix usart3 TXD (2013-01-30 10:09:17 +0100) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to c3f0f282d950a1e87496a2633ed9e924e275ff8c: ARM: at91/DT: remove atmel,use-dma-* from 9x5 and 9n12 USART nodes (2013-02-05 10:55:11 +0100) Correction of 9x5 and 9n12 USART nodes -------- Nicolas Ferre (1): ARM: at91/DT: remove atmel,use-dma-* from 9x5 and 9n12 USART nodes arch/arm/boot/dts/at91sam9n12.dtsi | 8 arch/arm/boot/dts/at91sam9x5.dtsi | 6 -- 2 files changed, 14 deletions(-) Thanks, bye, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [v4 PATCH 11/12] ARM: dts: add spi nodes for atmel SoC
t;; >>> + reg = <0xfffa8000 0x200>; >>> + interrupts = <15 4 3>; >>> + status = "disabled"; >>> + }; >>> }; >>> >>> nand0: nand@4000 { >>> diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi >> b/arch/arm/boot/dts/at91sam9g45.dtsi >>> index 231858f..0100b80 100644 >>> --- a/arch/arm/boot/dts/at91sam9g45.dtsi >>> +++ b/arch/arm/boot/dts/at91sam9g45.dtsi >>> @@ -495,6 +495,24 @@ >>> reg = <0xfd40 0x10>; >>> status = "disabled"; >>> }; >>> + >>> + spi0: spi@fffa4000 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "atmel,at91sam9g45-spi"; >>> + reg = <0xfffa4000 0x200>; >>> + interrupts = <14 4 3>; >>> + status = "disabled"; >>> + }; >>> + >>> + spi1: spi@fffa8000 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "atmel,at91sam9g45-spi"; >>> + reg = <0xfffa8000 0x200>; >>> + interrupts = <15 4 3>; >>> + status = "disabled"; >>> + }; >>> }; >>> >>> nand0: nand@4000 { >>> diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi >> b/arch/arm/boot/dts/at91sam9n12.dtsi >>> index e9efb34..86d5357 100644 >>> --- a/arch/arm/boot/dts/at91sam9n12.dtsi >>> +++ b/arch/arm/boot/dts/at91sam9n12.dtsi >>> @@ -355,6 +355,24 @@ >>> #size-cells = <0>; >>> status = "disabled"; >>> }; >>> + >>> + spi0: spi@f000 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "atmel,at91sam9x5-spi"; >>> + reg = <0xf000 0x100>; >>> + interrupts = <13 4 3>; >>> + status = "disabled"; >>> + }; >>> + >>> + spi1: spi@f0004000 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "atmel,at91sam9x5-spi"; >>> + reg = <0xf0004000 0x100>; >>> + interrupts = <14 4 3>; >>> + status = "disabled"; >>> + }; >>> }; >>> >>> nand0: nand@4000 { >>> diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi >> b/arch/arm/boot/dts/at91sam9x5.dtsi >>> index 40ac3a4..8ea2f7d 100644 >>> --- a/arch/arm/boot/dts/at91sam9x5.dtsi >>> +++ b/arch/arm/boot/dts/at91sam9x5.dtsi >>> @@ -473,6 +473,24 @@ >>> trigger-value = <0x6>; >>> }; >>> }; >>> + >>> + spi0: spi@f000 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "atmel,at91sam9x5-spi"; >>> + reg = <0xf000 0x100>; >>> + interrupts = <13 4 3>; >>> + status = "disabled"; >>> + }; >>> + >>> + spi1: spi@f0004000 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "atmel,at91sam9x5-spi"; >>> + reg = <0xf0004000 0x100>; >>> + interrupts = <14 4 3>; >>> + status = "disabled"; >>> + }; >>> }; >>> >>> nand0: nand@4000 { >>> -- >>> 1.7.9.5 >>> > > Best Regards, > Wenyou Yang > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: Device Tree related material for 3.9
Arnd, Olof, Here is a pull request for AT91 Device Tree material. It is pretty small and mostly related to at91rm9200 work done by Joachim. This one can go on top of the GIT PULL request that I sent two days ago: "[GIT PULL] at91: fixes for 3.9-rc1". But actually it is not related... The following changes since commit 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7: Linux 3.8-rc6 (2013-02-01 12:08:14 +1100) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-dt for you to fetch changes up to ce3b2630fd4737a3f9aa9119d40647a9ac7baa38: ARM: at91: add EMAC bindings to RM9200 DT (2013-02-07 16:40:09 +0100) Update to DT files for AT91: - adding the watchdog to Animeo IP board - some more DT support for at91rm9200 peripherals Jean-Christophe PLAGNIOL-VILLARD (1): ARM: at91: Animeo IP: enable watchdog support Joachim Eastwood (3): ARM: at91: add MMC bindings to RM9200 DT ARM: at91: add SSC bindings to RM9200 DT ARM: at91: add EMAC bindings to RM9200 DT arch/arm/boot/dts/animeo_ip.dts| 4 + arch/arm/boot/dts/at91rm9200.dtsi | 158 +++ arch/arm/boot/dts/at91rm9200ek.dts | 5 ++ arch/arm/mach-at91/at91rm9200.c| 2 + 4 files changed, 169 insertions(+) Thanks best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: at91: remove NEOCORE 926 board
The board is not available anymore and it seems its use is very limited. Signed-off-by: Nicolas Ferre Cc: Alexandre Belloni --- arch/arm/mach-at91/Kconfig| 6 - arch/arm/mach-at91/Makefile | 1 - arch/arm/mach-at91/board-neocore926.c | 387 -- 3 files changed, 394 deletions(-) delete mode 100644 arch/arm/mach-at91/board-neocore926.c diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 958358c..6071f4c 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -352,12 +352,6 @@ config MACH_USB_A9263 Select this if you are using a Calao Systems USB-A9263. <http://www.calao-systems.com> -config MACH_NEOCORE926 - bool "Adeneo NEOCORE926" - select HAVE_AT91_DATAFLASH_CARD - help - Select this if you are using the Adeneo Neocore 926 board. - endif # -- diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index b38a1dc..39218ca 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -66,7 +66,6 @@ obj-$(CONFIG_MACH_AT91SAM9G10EK) += board-sam9261ek.o # AT91SAM9263 board-specific support obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o obj-$(CONFIG_MACH_USB_A9263) += board-usb-a926x.o -obj-$(CONFIG_MACH_NEOCORE926) += board-neocore926.o # AT91SAM9RL board-specific support obj-$(CONFIG_MACH_AT91SAM9RLEK)+= board-sam9rlek.o diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c deleted file mode 100644 index bc7a1c4..000 --- a/arch/arm/mach-at91/board-neocore926.c +++ /dev/null @@ -1,387 +0,0 @@ -/* - * linux/arch/arm/mach-at91/board-neocore926.c - * - * Copyright (C) 2005 SAN People - * Copyright (C) 2007 Atmel Corporation - * Copyright (C) 2008 ADENEO. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include "at91_aic.h" -#include "board.h" -#include "sam9_smc.h" -#include "generic.h" - - -static void __init neocore926_init_early(void) -{ - /* Initialize processor: 20 MHz crystal */ - at91_initialize(2000); -} - -/* - * USB Host port - */ -static struct at91_usbh_data __initdata neocore926_usbh_data = { - .ports = 2, - .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 }, - .overcurrent_pin= {-EINVAL, -EINVAL}, -}; - -/* - * USB Device port - */ -static struct at91_udc_data __initdata neocore926_udc_data = { - .vbus_pin = AT91_PIN_PA25, - .pullup_pin = -EINVAL, /* pull-up driven by UDC */ -}; - - -/* - * ADS7846 Touchscreen - */ -#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) -static int ads7843_pendown_state(void) -{ - return !at91_get_gpio_value(AT91_PIN_PA15); /* Touchscreen PENIRQ */ -} - -static struct ads7846_platform_data ads_info = { - .model = 7843, - .x_min = 150, - .x_max = 3830, - .y_min = 190, - .y_max = 3830, - .vref_delay_usecs = 100, - .x_plate_ohms = 450, - .y_plate_ohms = 250, - .pressure_max = 15000, - .debounce_max = 1, - .debounce_rep = 0, - .debounce_tol = (~0), - .get_pendown_state = ads7843_pendown_state, -}; - -static void __init neocore926_add_device_ts(void) -{ - at91_set_B_periph(AT91_PIN_PA15, 1);/* External IRQ1, with pullup */ - at91_set_gpio_input(AT91_PIN_PC13, 1); /* Touchscreen BUSY signal */ -} -#else -static void __init neocore926_add_device_ts(void) {} -#endif - -/* - * SPI devices. - */ -static struct spi_board_info neocore926_spi_devices[] = { -#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) - { /* DataFlash card */ - .modalias = "mtd_dataflash", - .chip
[GIT PULL] at91: little cleanup for 3.9
Arnd, Olof, There is a cleanup pull-request that allows us to remove an unused AT91 board file. The following changes since commit 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7: Linux 3.8-rc6 (2013-02-01 12:08:14 +1100) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-cleanup for you to fetch changes up to 80916a1a55eb71e511be904b2497b640b5fa02b3: ARM: at91: remove NEOCORE 926 board (2013-02-07 18:46:55 +0100) Little AT91 cleanup: only remove one deprecated board. Nicolas Ferre (1): ARM: at91: remove NEOCORE 926 board arch/arm/mach-at91/Kconfig| 6 - arch/arm/mach-at91/Makefile | 1 - arch/arm/mach-at91/board-neocore926.c | 387 --- 3 files changed, 394 deletions(-) delete mode 100644 arch/arm/mach-at91/board-neocore926.c Best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL v2] at91: little cleanup for 3.9
Arnd, Olof, There is a cleanup pull-request that allows us to remove an unused AT91 board file. This is a v2 of the pull-request, because I have included in this one a correction of the patch: I now remove this board entry in at91sam9263_defconfig as well. The following changes since commit 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7: Linux 3.8-rc6 (2013-02-01 12:08:14 +1100) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-cleanup for you to fetch changes up to b65adbec2d92769242e0ffe742630d88e68f7f22: ARM: at91: remove NEOCORE 926 board (2013-02-08 16:25:20 +0100) Little AT91 cleanup: only remove one deprecated board. Nicolas Ferre (1): ARM: at91: remove NEOCORE 926 board arch/arm/configs/at91sam9263_defconfig | 1 - arch/arm/mach-at91/Kconfig | 6 - arch/arm/mach-at91/Makefile| 1 - arch/arm/mach-at91/board-neocore926.c | 387 --- 4 files changed, 395 deletions(-) delete mode 100644 arch/arm/mach-at91/board-neocore926.c Thanks, bye, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/5] atmel_lcdfb: fix 16-bpp modes on older SOCs
From: Johan Hovold Fix regression introduced by commit 787f9fd23283 ("atmel_lcdfb: support 16bit BGR:565 mode, remove unsupported 15bit modes") which broke 16-bpp modes for older SOCs which use IBGR:555 (msb is intensity) rather than BGR:565. Use SOC-type to determine the pixel layout. Tested on at91sam9263 and at91sam9g45. Cc: Acked-by: Peter Korsgaard Signed-off-by: Johan Hovold Signed-off-by: Nicolas Ferre --- drivers/video/atmel_lcdfb.c | 22 +++--- include/video/atmel_lcdc.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 12cf5f3..025428e 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -422,17 +422,22 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, = var->bits_per_pixel; break; case 16: + /* Older SOCs use IBGR:555 rather than BGR:565. */ + if (sinfo->have_intensity_bit) + var->green.length = 5; + else + var->green.length = 6; + if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { - /* RGB:565 mode */ - var->red.offset = 11; + /* RGB:5X5 mode */ + var->red.offset = var->green.length + 5; var->blue.offset = 0; } else { - /* BGR:565 mode */ + /* BGR:5X5 mode */ var->red.offset = 0; - var->blue.offset = 11; + var->blue.offset = var->green.length + 5; } var->green.offset = 5; - var->green.length = 6; var->red.length = var->blue.length = 5; break; case 32: @@ -679,8 +684,7 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red, case FB_VISUAL_PSEUDOCOLOR: if (regno < 256) { - if (cpu_is_at91sam9261() || cpu_is_at91sam9263() - || cpu_is_at91sam9rl()) { + if (sinfo->have_intensity_bit) { /* old style I+BGR:555 */ val = ((red >> 11) & 0x001f); val |= ((green >> 6) & 0x03e0); @@ -870,6 +874,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) } sinfo->info = info; sinfo->pdev = pdev; + if (cpu_is_at91sam9261() || cpu_is_at91sam9263() || + cpu_is_at91sam9rl()) { + sinfo->have_intensity_bit = true; + } strcpy(info->fix.id, sinfo->pdev->name); info->flags = ATMEL_LCDFB_FBINFO_DEFAULT; diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index 28447f1..5f0e234 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h @@ -62,6 +62,7 @@ struct atmel_lcdfb_info { void (*atmel_lcdfb_power_control)(int on); struct fb_monspecs *default_monspecs; u32 pseudo_palette[16]; + boolhave_intensity_bit; }; #define ATMEL_LCDC_DMABADDR1 0x00 -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/5] ARM: at91/neocore926: fix LCD-wiring mode
From: Johan Hovold Fix regression introduced by commit 787f9fd23283 ("atmel_lcdfb: support 16bit BGR:565 mode, remove unsupported 15bit modes") which broke 16-bpp modes for older SOCs which use IBGR:555 (msb is intensity) rather than BGR:565. The above commit also removed the RGB:555-wiring hack without fixing the neocore926 board which used it. Fix by specifying RGB-wiring and let the driver handle the final SOC-dependant layout. Remove the no longer used ATMEL_LCDC_WIRING_RGB555 define. Compile-only tested. Cc: Acked-by: Peter Korsgaard Signed-off-by: Johan Hovold Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/board-neocore926.c | 2 +- include/video/atmel_lcdc.h| 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c index bc7a1c4..4726297 100644 --- a/arch/arm/mach-at91/board-neocore926.c +++ b/arch/arm/mach-at91/board-neocore926.c @@ -266,7 +266,7 @@ static struct atmel_lcdfb_info __initdata neocore926_lcdc_data = { .default_monspecs = &at91fb_default_monspecs, .atmel_lcdfb_power_control = at91_lcdc_power_control, .guard_time = 1, - .lcd_wiring_mode= ATMEL_LCDC_WIRING_RGB555, + .lcd_wiring_mode= ATMEL_LCDC_WIRING_RGB, }; #else diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index 5f0e234..8deb226 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h @@ -30,7 +30,6 @@ */ #define ATMEL_LCDC_WIRING_BGR 0 #define ATMEL_LCDC_WIRING_RGB 1 -#define ATMEL_LCDC_WIRING_RGB555 2 /* LCD Controller info data structure, stored in device platform_data */ -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/5] ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
From: Johan Hovold Add hclk entry for the atmel_lcdfb bus clock. On at91sam9261, at91sam9g10 and at32ap the bus clock has to be enabled as well as the peripheral clock. Add the appropriate lookup entries to these SOCs and fake clocks to the SOCs that do not use it. This allows us to get rid of the conditional enabling of the clocks in the driver which relied on the cpu_is macros. Tested on at91sam9263 and at91sam9g45, compile-tested for other AT91-SOCs, and untested for AVR32. Signed-off-by: Johan Hovold Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/at91sam9261.c| 1 + arch/arm/mach-at91/at91sam9263.c| 1 + arch/arm/mach-at91/at91sam9g45.c| 1 + arch/arm/mach-at91/at91sam9rl.c | 1 + arch/avr32/mach-at32ap/at32ap700x.c | 4 ++-- drivers/video/atmel_lcdfb.c | 23 --- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 2998a08..5838f12 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c @@ -169,6 +169,7 @@ static struct clk *periph_clocks[] __initdata = { }; static struct clk_lookup periph_clocks_lookups[] = { + CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &hck1), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index b9fc60d..520a63d 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c @@ -190,6 +190,7 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk), + CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index d3addee..ea6b62b 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c @@ -228,6 +228,7 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_ID("hclk", &macb_clk), /* One additional fake clock for ohci */ CLKDEV_CON_ID("ohci_clk", &uhphs_clk), + CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk), CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk), CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index eb98704..4cd4fa9 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c @@ -179,6 +179,7 @@ static struct clk *periph_clocks[] __initdata = { }; static struct clk_lookup periph_clocks_lookups[] = { + CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk), CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index b323d8d..cd25b01 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c @@ -1453,7 +1453,7 @@ static struct resource atmel_lcdfb0_resource[] = { }, }; DEFINE_DEV_DATA(atmel_lcdfb, 0); -DEV_CLK(hck1, atmel_lcdfb0, hsb, 7); +DEV_CLK(hclk, atmel_lcdfb0, hsb, 7); static struct clk atmel_lcdfb0_pixclk = { .name = "lcdc_clk", .dev= &atmel_lcdfb0_device.dev, @@ -2246,7 +2246,7 @@ static __initdata struct clk *init_clocks[] = { &atmel_twi0_pclk, &atmel_mci0_pclk, #if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002) - &atmel_lcdfb0_hck1, + &atmel_lcdfb0_hclk, &atmel_lcdfb0_pixclk, #endif &ssc0_pclk, diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 025428e..c5883ca 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -821,15 +821,13 @@ static int __init atmel_lcdfb_init_fbinf
[PATCH 4/5] atmel_lcdfb: move lcdcon2 register access to compute_hozval
From: Johan Hovold Pass atmel_lcd_info structure to compute_hozval and only do the register access on SOCs that actually use it. This will also simplify the removal of the cpu_is macros. Signed-off-by: Johan Hovold Signed-off-by: Nicolas Ferre --- drivers/video/atmel_lcdfb.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index c5883ca..2effd35 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -193,14 +193,17 @@ static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = { .accel = FB_ACCEL_NONE, }; -static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2) +static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo, + unsigned long xres) { + unsigned long lcdcon2; unsigned long value; if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10() || cpu_is_at32ap7000())) return xres; + lcdcon2 = lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2); value = xres; if ((lcdcon2 & ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) { /* STN display */ @@ -591,8 +594,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value); /* Horizontal value (aka line size) */ - hozval_linesz = compute_hozval(info->var.xres, - lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2)); + hozval_linesz = compute_hozval(sinfo, info->var.xres); /* Display size */ value = (hozval_linesz - 1) << ATMEL_LCDC_HOZVAL_OFFSET; -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
These patches fix a regression in 16-bpp support for older SOCs which use IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to determine if the controller uses the intensity-bit and restore the old layout in that case. The last patch is a removal of uses of cpu_is_() macros in atmel_lcdfb with a platform-device-id table and static configurations. Patches from Johan Hovold taken from: "[PATCH 0/3] atmel_lcdfb: fix 16-bpp regression" and "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb: remove cpu_is macros" patch series to form a clean patch series with my signature. Arnd, Olof, as it seems that old fbdev drivers are not so much reviewed those days, can we take the decision to queue this material through arm-soc with other AT91 drivers updates? Best regards, Johan Hovold (5): atmel_lcdfb: fix 16-bpp modes on older SOCs ARM: at91/neocore926: fix LCD-wiring mode ARM: at91/avr32/atmel_lcdfb: add bus-clock entry atmel_lcdfb: move lcdcon2 register access to compute_hozval ARM: at91/avr32/atmel_lcdfb: add platform device-id table arch/arm/mach-at91/at91sam9261.c | 2 + arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263.c | 1 + arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45.c | 2 + arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl.c | 1 + arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/arm/mach-at91/board-neocore926.c| 2 +- arch/avr32/mach-at32ap/at32ap700x.c | 6 +- drivers/video/atmel_lcdfb.c | 130 --- include/video/atmel_lcdc.h | 4 +- 12 files changed, 127 insertions(+), 37 deletions(-) -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/5] ARM: at91/avr32/atmel_lcdfb: add platform device-id table
From: Johan Hovold Add platform device-id table in order to identify the controller and determine its configuration. The currently used configuration parameters are: have_alt_pixclock - SOC uses an alternate pixel-clock calculation formula (at91sam9g45 non-ES) have_hozval - SOC has a HOZVAL field in LCDFRMCFG which is used to determine the linesize for STN displays (at91sam9261, at921sam9g10 and at32ap) have_intensity_bit - SOC uses IBGR:555 rather than BGR:565 16-bit pixel layout (at91sam9261, at91sam9263 and at91sam9rl) This allows us to remove all the remaining uses of cpu_is macros from the driver. Tested on at91sam9263 and at91sam9g45, compile-tested for other AT91-SOCs, and untested for AVR32. Signed-off-by: Johan Hovold Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/at91sam9261.c | 3 +- arch/arm/mach-at91/at91sam9261_devices.c | 6 ++- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45.c | 3 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 ++- arch/arm/mach-at91/at91sam9rl.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/avr32/mach-at32ap/at32ap700x.c | 2 + drivers/video/atmel_lcdfb.c | 89 include/video/atmel_lcdc.h | 4 +- 11 files changed, 102 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 5838f12..0204f4c 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c @@ -169,7 +169,8 @@ static struct clk *periph_clocks[] __initdata = { }; static struct clk_lookup periph_clocks_lookups[] = { - CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &hck1), + CLKDEV_CON_DEV_ID("hclk", "at91sam9261-lcdfb.0", &hck1), + CLKDEV_CON_DEV_ID("hclk", "at91sam9g10-lcdfb.0", &hck1), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 92e0f86..629ea5f 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c @@ -488,7 +488,6 @@ static struct resource lcdc_resources[] = { }; static struct platform_device at91_lcdc_device = { - .name = "atmel_lcdfb", .id = 0, .dev= { .dma_mask = &lcdc_dmamask, @@ -505,6 +504,11 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) return; } + if (cpu_is_at91sam9g10()) + at91_lcdc_device.name = "at91sam9g10-lcdfb"; + else + at91_lcdc_device.name = "at91sam9261-lcdfb"; + #if defined(CONFIG_FB_ATMEL_STN) at91_set_A_periph(AT91_PIN_PB0, 0); /* LCDVSYNC */ at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */ diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 520a63d..2282fd7 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c @@ -190,7 +190,7 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk), - CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk), + CLKDEV_CON_DEV_ID("hclk", "at91sam9263-lcdfb.0", &lcdc_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk), CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk), CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index ed666f5..858c8aa 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c @@ -848,7 +848,7 @@ static struct resource lcdc_resources[] = { }; static struct platform_device at91_lcdc_device = { - .name = "atmel_lcdfb", + .name = "at91sam9263-lcdfb", .id = 0, .dev= { .dma_mask = &lcdc_dmamask, diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index ea6b62b..c68960d 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach
Re: [GIT PULL] at91: fixes for 3.9-rc1
On 02/05/2013 11:20 AM, Nicolas Ferre : > Arnd, Olof, > > As I realized reading Linus' email that it was not possible to queue more > fixes for 3.8, I took my time to send this tiny pull request. But now that > the merge window is approaching, I prefer not to wait for more material. > So, here is a "fixes" pull-request embedding a single patch. I have placed > this > one on top of material that you already have from me in your "fixes" and > "for-next" branches. Olof, Ping? As the other AT91 related branches have been pulled in, I suspect this little pull-request had been forgotten. Best regards, > The following changes since commit 7d4cfece23f535b60496d88a717a3d7bfca50187: > > ARM: at91/at91sam9x5.dtsi: fix usart3 TXD (2013-01-30 10:09:17 +0100) > > are available in the git repository at: > > git://github.com/at91linux/linux-at91.git tags/at91-fixes > > for you to fetch changes up to c3f0f282d950a1e87496a2633ed9e924e275ff8c: > > ARM: at91/DT: remove atmel,use-dma-* from 9x5 and 9n12 USART nodes > (2013-02-05 10:55:11 +0100) > > > Correction of 9x5 and 9n12 USART nodes > > > Nicolas Ferre (1): > ARM: at91/DT: remove atmel,use-dma-* from 9x5 and 9n12 USART nodes > > arch/arm/boot/dts/at91sam9n12.dtsi | 8 ---- > arch/arm/boot/dts/at91sam9x5.dtsi | 6 -- > 2 files changed, 14 deletions(-) > > > Thanks, bye, > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] net/macb: fix race with RX interrupt while doing NAPI
When interrupts are disabled, an RX condition can occur but it is not reported when enabling interrupts again. We need to check RSR and use napi_reschedule() if condition is met. Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index a9b0830..b9d4bb9 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -693,6 +693,11 @@ static int macb_poll(struct napi_struct *napi, int budget) * get notified when new packets arrive. */ macb_writel(bp, IER, MACB_RX_INT_FLAGS); + + /* Packets received while interrupts were disabled */ + status = macb_readl(bp, RSR); + if (unlikely(status)) + napi_reschedule(napi); } /* TODO: Handle errors */ -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC PATCH] rtc: rtc-at91rm9200: manage IMR depending on revision
Signed-off-by: Nicolas Ferre --- Hi all, The funny thing is that I was writing exactly the same code as Johan's when he posted his series. So, here is my single patch, with the comment about the readback stolen from Johan's, but without the way to determine with IP is buggy and which one is not... After having dug the possibility to read the IP revision, I discovered that it is not possible to use this information ("version" register offset changing according to... IP version number: well done!). In conclusion, I guess that the only way to determine if we need the workaround is to use the DT. One remark though: if we use the compatibility string for this purpose, I fear that we would twist the meaning of this information: SoC using an "atmel,at91sam9x5-rtc" compatible RTC will not necessarily be touched by the "non responding IMR" bug: at91sam9n12 or upcoming sama5d3 are not affected for instance, and we need to cling to "atmel,at91rm9200-rtc" for them... I think that we can use this method for the moment and move to another compatibility string later if it is needed. Thanks for your help, best regards. drivers/rtc/rtc-at91rm9200.c | 75 drivers/rtc/rtc-at91rm9200.h | 1 + 2 files changed, 76 insertions(+) diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index 29b92e4..4960d42 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,74 @@ static unsigned int at91_alarm_year = AT91_RTC_EPOCH; static void __iomem *at91_rtc_regs; static int irq; static u32 at91_rtc_imr; +static DEFINE_SPINLOCK(lock); +static void (*at91_rtc_set_irq)(u32 irq_mask); +static void (*at91_rtc_clear_irq)(u32 irq_mask); +static u32 (*at91_rtc_read_imr)(void); + +static inline unsigned int at91_rtc_get_version(void) +{ + return at91_rtc_read(AT91_RTC_VERSION) & 0x0fff; +} + +static void at91_rtc_set_irq_simple(u32 irq_mask) +{ + at91_rtc_write(AT91_RTC_IER, irq_mask); +} + +static void at91_rtc_clear_irq_simple(u32 irq_mask) +{ + at91_rtc_write(AT91_RTC_IDR, irq_mask); +} + +static u32 at91_rtc_read_imr_simple(void) +{ + return at91_rtc_read(AT91_RTC_IMR); +} + +static void at91_rtc_set_irq_brokenimr(u32 irq_mask) +{ + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + at91_rtc_imr |= irq_mask; + at91_rtc_write(AT91_RTC_IER, irq_mask); + spin_unlock_irqrestore(&lock, flags); +} + +static void at91_rtc_clear_irq_brokenimr(u32 irq_mask) +{ + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + at91_rtc_write(AT91_RTC_IDR, irq_mask); + /* +* Register read back (of any RTC-register) needed to make sure +* IDR-register write has reached the peripheral before updating +* shadow mask. +* +* Note that there is still a possibility that the mask is updated +* before interrupts have actually been disabled in hardware. The only +* way to be certain would be to poll the IMR-register, which is is +* the very register we are trying to emulate. The register read back +* is a reasonable heuristic. +*/ + at91_rtc_read(AT91_RTC_SR); + at91_rtc_imr &= ~irq_mask; + spin_unlock_irqrestore(&lock, flags); +} + +static u32 at91_rtc_read_imr_brokenimr(void) +{ + unsigned long flags; + u32 shadow_imr; + + spin_lock_irqsave(&lock, flags); + shadow_imr = at91_rtc_imr; + spin_unlock_irqrestore(&lock, flags); + + return shadow_imr; +} /* * Decode time/date into rtc_time structure @@ -300,6 +369,12 @@ static int __init at91_rtc_probe(struct platform_device *pdev) AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV); at91_rtc_imr = 0; + spin_lock_init(&lock); + + /* Choose IMR access functions */ + at91_rtc_set_irq = at91_rtc_set_irq_simple; + at91_rtc_clear_irq = at91_rtc_clear_irq_simple; + at91_rtc_read_imr = at91_rtc_read_imr_simple; ret = request_irq(irq, at91_rtc_interrupt, IRQF_SHARED, diff --git a/drivers/rtc/rtc-at91rm9200.h b/drivers/rtc/rtc-at91rm9200.h index 5f940b6..da1945e 100644 --- a/drivers/rtc/rtc-at91rm9200.h +++ b/drivers/rtc/rtc-at91rm9200.h @@ -64,6 +64,7 @@ #defineAT91_RTC_SCCR 0x1c/* Status Clear Command Register */ #defineAT91_RTC_IER0x20/* Interrupt Enable Register */ #defineAT91_RTC_IDR0x24/* Interrupt Disable Register */ +#defineAT91_RTC_IMR0x28/* Interrupt Mask Register */ #define
Re: [RFC PATCH] rtc: rtc-at91rm9200: manage IMR depending on revision
On 04/02/2013 05:32 PM, Douglas Gilbert : > On 13-04-02 09:06 AM, Nicolas Ferre wrote: >> Signed-off-by: Nicolas Ferre >> --- >> Hi all, >> >> The funny thing is that I was writing exactly the same code as Johan's >> when he posted his series. >> >> So, here is my single patch, with the comment about the readback >> stolen from >> Johan's, but without the way to determine with IP is buggy and which >> one is >> not... >> After having dug the possibility to read the IP revision, I discovered >> that it >> is not possible to use this information ("version" register offset >> changing >> according to... IP version number: well done!). >> In conclusion, I guess that the only way to determine if we need the >> workaround >> is to use the DT. >> One remark though: if we use the compatibility string for this >> purpose, I fear >> that we would twist the meaning of this information: SoC using an >> "atmel,at91sam9x5-rtc" compatible RTC will not necessarily be touched >> by the >> "non responding IMR" bug: at91sam9n12 or upcoming sama5d3 are not >> affected for >> instance, and we need to cling to "atmel,at91rm9200-rtc" for them... >> I think that we can use this method for the moment and move to another >> compatibility string later if it is needed. > > Rather than have so many people working on rtc-at91rm9200.c, > how about someone bring its "RTT" sibling into the DT > world. I'm talking about drivers/rtc/rtc-at91sam9.c ... I am currently trying to fix the issue that I have created by pushing a boggus fix to Andrew's patch series (and "stable" incidentally). So I am trying to find the best way to address this and: - a correct - a smallest possible path or patch series (I admit that I prefer a single patch). So, I am still posting rtc-at91rm9200.c patches and hoping from a feedback. Once we have a good solution I will try to include it in 3.9 and the stable trees affected. Best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC PATCH v2] rtc: rtc-at91rm9200: manage IMR depending on revision
Signed-off-by: Nicolas Ferre --- Hi again, Here is my latest revision of this fix. It depends on the patch that is already in Andrew's patch stack: "drivers-rtc-rtc-at91rm9200c-add-dt-support.patch". I now use a different compatibility string to figure out what is the IP revision that has the "boggus IMR" error. I think this way to handle it is much simpler than the "config" structure one from Johan. The small number of line changed and the "single patch" nature of it make me think that it will be easier to send upstream and in the "stable" trees... Please give feedback, but moreover, I would like to know if you (Johan and Douglas) agree to give your "Signed-off-by" line because this patch is certainly inspired by your comments, code and reviews. Thank you for your help. Best regards, .../bindings/rtc/atmel,at91rm9200-rtc.txt | 3 +- drivers/rtc/rtc-at91rm9200.c | 126 - drivers/rtc/rtc-at91rm9200.h | 1 + 3 files changed, 101 insertions(+), 29 deletions(-) diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt index 2a3feab..9b87053 100644 --- a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt +++ b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt @@ -1,7 +1,8 @@ Atmel AT91RM9200 Real Time Clock Required properties: -- compatible: should be: "atmel,at91rm9200-rtc" +- compatible: should be: "atmel,at91rm9200-rtc", "atmel,at91sam9x5-rtc" or + "atmel,at91sam9n12-rtc". - reg: physical base address of the controller and length of memory mapped region. - interrupts: rtc alarm/event interrupt diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index 29b92e4..f6b2ee3 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,69 @@ static unsigned int at91_alarm_year = AT91_RTC_EPOCH; static void __iomem *at91_rtc_regs; static int irq; static u32 at91_rtc_imr; +static DEFINE_SPINLOCK(lock); +static void (*at91_rtc_set_irq)(u32 irq_mask); +static void (*at91_rtc_clear_irq)(u32 irq_mask); +static u32 (*at91_rtc_read_imr)(void); + +static void at91_rtc_set_irq_simple(u32 irq_mask) +{ + at91_rtc_write(AT91_RTC_IER, irq_mask); +} + +static void at91_rtc_clear_irq_simple(u32 irq_mask) +{ + at91_rtc_write(AT91_RTC_IDR, irq_mask); +} + +static u32 at91_rtc_read_imr_simple(void) +{ + return at91_rtc_read(AT91_RTC_IMR); +} + +static void at91_rtc_set_irq_brokenimr(u32 irq_mask) +{ + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + at91_rtc_imr |= irq_mask; + at91_rtc_write(AT91_RTC_IER, irq_mask); + spin_unlock_irqrestore(&lock, flags); +} + +static void at91_rtc_clear_irq_brokenimr(u32 irq_mask) +{ + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + at91_rtc_write(AT91_RTC_IDR, irq_mask); + /* +* Register read back (of any RTC-register) needed to make sure +* IDR-register write has reached the peripheral before updating +* shadow mask. +* +* Note that there is still a possibility that the mask is updated +* before interrupts have actually been disabled in hardware. The only +* way to be certain would be to poll the IMR-register, which is is +* the very register we are trying to emulate. The register read back +* is a reasonable heuristic. +*/ + at91_rtc_read(AT91_RTC_SR); + at91_rtc_imr &= ~irq_mask; + spin_unlock_irqrestore(&lock, flags); +} + +static u32 at91_rtc_read_imr_brokenimr(void) +{ + unsigned long flags; + u32 shadow_imr; + + spin_lock_irqsave(&lock, flags); + shadow_imr = at91_rtc_imr; + spin_unlock_irqrestore(&lock, flags); + + return shadow_imr; +} /* * Decode time/date into rtc_time structure @@ -111,11 +175,9 @@ static int at91_rtc_settime(struct device *dev, struct rtc_time *tm) cr = at91_rtc_read(AT91_RTC_CR); at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); - at91_rtc_imr |= AT91_RTC_ACKUPD; - at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD); + at91_rtc_set_irq(AT91_RTC_ACKUPD); wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */ - at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); - at91_rtc_imr &= ~AT91_RTC_ACKUPD; + at91_rtc_clear_irq(AT91_RTC_ACKUPD); at91_rtc_write(AT91_RTC_TIMR, bin2bcd(tm->tm_sec) << 0 @@ -147,7 +209,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) tm
Re: [GIT PULL] at91: soc for 3.10 #2
On 04/03/2013 02:26 AM, Olof Johansson : > On Wed, Mar 27, 2013 at 12:01 PM, Arnd Bergmann wrote: >> On Wednesday 27 March 2013, Nicolas Ferre wrote: >> >>> >>> Introduction of new Atmel Cortex-A5: SAMA5D3 family. >>> - Modify AT91 Kconfig to plit ARMv4/5 and ARMv7 arch >>> - Modify PMC driver (clocks) >>> - Core SAMA5 support >>> - Board file, DT files and defconfig >> >> Looks really good. Olof said he'd take over merging tomorrow, >> so I'll leave it for him. >> >>> >>> Ludovic Desroches (6): >>> ARM: at91: change name template in AT91_SOC_START macro >>> ARM: at91: add AT91_SAM9_TIME entry to select at91sam926x_time.c >>> compilation >>> ARM: at91: introduce the core type choice to split ARMv4/5 and ARMv7 >>> arch >>> ARM: at91: introduce SAMA5 support >>> ARM: at91: dt: add device tree files for SAMA5D3 family >>> ARM: at91: add defconfig for SAMA5 >> >> There is one obvious change that would be nice to include here, >> can you add this on top (either Nicolas or Olof)? >> >> 8<- >> Subject: ARM: at91: make ATAGS support conditional on CONFIG_ATAGS >> >> We have the global CONFIG_ATAGS symbol that is used to determine >> whether ATAGS based boot is possible or not. Since we are >> splitting out the legacy boards from the main Kconfig on at91, >> we can use that symbol to easily hide the old options. >> >> Signed-off-by: Arnd Bergmann >> >> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig >> index 0280238..119a0a4 100644 >> --- a/arch/arm/mach-at91/Kconfig >> +++ b/arch/arm/mach-at91/Kconfig >> @@ -137,8 +137,9 @@ config SOC_AT91SAM9N12 >> Select this if you are using Atmel's AT91SAM9N12 SoC. >> >> # -- >> - >> +if ATAGS >> source arch/arm/mach-at91/Kconfig.non_dt >> +endif >> endif # SOC_SAM_V4_V5 >> >> comment "Generic Board Type" > > Actually, it's not that simple. With this patch, I get: > > arch/arm/Kconfig:1841:error: recursive dependency detected! > arch/arm/Kconfig:1841: symbol USE_OF is selected by MACH_AT91RM9200_DT > arch/arm/mach-at91/Kconfig:147: symbol MACH_AT91RM9200_DT depends on > SOC_AT91RM9200 > arch/arm/mach-at91/Kconfig:74: symbol SOC_AT91RM9200 is selected by > ARCH_AT91RM9200 > arch/arm/mach-at91/Kconfig.non_dt:12: symbol ARCH_AT91RM9200 is part > of choice > arch/arm/mach-at91/Kconfig.non_dt:6:choice contains symbol > > arch/arm/mach-at91/Kconfig.non_dt:6:choice contains symbol ATAGS > arch/arm/Kconfig:1850: symbol ATAGS depends on USE_OF > > Also, USE_OF isn't set at that point (it's controlled by the next > section), so it can't be used as a replacement. > > Also, isn't it a bit backwards in the first place to first set ATAGS > vs no-ATAGS, and then get to choose what hardware you want to build > for? True, I was thinking it was a common pattern. > I'll take off the last patch from the branch and re-merge it (since I > hadn't pushed it out yet), the above can be sorted out separately. Thanks Olof for taking care about this! We will come back on this later or simply decide that it is not worth it / not logical... Best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: at91/tc: fix clock source id for tc block > 1
On 04/03/2013 06:45 AM, Jean-Christophe PLAGNIOL-VILLARD : > On 18:46 Tue 02 Apr , Boris BREZILLON wrote: >> This patch fixes wrong clock request for TC block 2. >> The second block was using t0_clk, t1_clk and t2_clk clks instead of >> t3_clk, t4_clk and t5_clk clks. >> > this is intended as we have 3 clock per device True. Boris, did you hit an issue with former code that your patch is solving? What is the reason for this patch? Thanks, best regards, >> Signed-off-by: Boris BREZILLON >> --- >> drivers/misc/atmel_tclib.c | 24 >> 1 file changed, 16 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c >> index c8d8e38..768a988 100644 >> --- a/drivers/misc/atmel_tclib.c >> +++ b/drivers/misc/atmel_tclib.c >> @@ -142,6 +142,8 @@ static int __init tc_probe(struct platform_device *pdev) >> struct atmel_tc *tc; >> struct clk *clk; >> int irq; >> +charclk_id[7]; >> +int clk_offset; >> >> if (!platform_get_resource(pdev, IORESOURCE_MEM, 0)) >> return -EINVAL; >> @@ -156,25 +158,31 @@ static int __init tc_probe(struct platform_device >> *pdev) >> >> tc->pdev = pdev; >> >> -clk = clk_get(&pdev->dev, "t0_clk"); >> -if (IS_ERR(clk)) { >> -kfree(tc); >> -return -EINVAL; >> -} >> - >> /* Now take SoC information if available */ >> if (pdev->dev.of_node) { >> const struct of_device_id *match; >> match = of_match_node(atmel_tcb_dt_ids, pdev->dev.of_node); >> if (match) >> tc->tcb_config = match->data; >> +clk_offset = of_alias_get_id(tc->pdev->dev.of_node, "tcb"); >> +} else >> +clk_offset = pdev->id; >> +clk_offset *= 3; >> + >> +snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++); >> +clk = clk_get(&pdev->dev, clk_id); >> +if (IS_ERR(clk)) { >> +kfree(tc); >> +return -EINVAL; >> } >> >> tc->clk[0] = clk; >> -tc->clk[1] = clk_get(&pdev->dev, "t1_clk"); >> +snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++); >> +tc->clk[1] = clk_get(&pdev->dev, clk_id); >> if (IS_ERR(tc->clk[1])) >> tc->clk[1] = clk; >> -tc->clk[2] = clk_get(&pdev->dev, "t2_clk"); >> +snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++); >> +tc->clk[2] = clk_get(&pdev->dev, clk_id); >> if (IS_ERR(tc->clk[2])) >> tc->clk[2] = clk; >> >> -- >> 1.7.9.5 >> >> >> ___ >> linux-arm-kernel mailing list >> linux-arm-ker...@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] at91: DT changes for 3.10 #2
On 04/02/2013 08:49 PM, Olof Johansson : > On Fri, Mar 29, 2013 at 03:59:39PM +0100, Nicolas Ferre wrote: >> Arnd, Olof, >> >> Here is a pull-request for AT91 that is dedicated to Device Tree >> modifications. It is stacked on the material that you already have >> for 3.10 in your arm-soc/at91/dt branch. >> Following our discussion with Arnd, I added the non-urgent patches that I >> already proposed too late for 3.9. I also included the moving of macb node >> and kept the original patch. >> >> Thanks, best regards, >> >> The following changes since commit 6901d947be5ba1245a0f63271355b95f9056a362: >> >> ARM: at91/at91sam9x5cm: add 1-wire chip on CM board (2013-03-21 16:07:15 >> +0100) >> >> are available in the git repository at: >> >> git://github.com/at91linux/linux-at91.git tags/at91-dt >> >> for you to fetch changes up to cc2e191b0ccc5a987fdb29261ab9c264c608924d: >> >> ARM: at91/dt: fix macb node declaration (2013-03-29 10:02:04 +0100) >> >> >> One macb DT node move for 9x5 family: 9g15 doesn't >> have an Ethernet interface. >> Little fixes mainly related to at91sam9x5 DT and the >> RTC addition. >> Addition of the Acme Systems Aria G25 board. >> >> >> Douglas Gilbert (1): >> ARM: at91: add Acme Systems Aria G25 board > > Hi, > > I just replied to the above patch -- please prefix the dts files with the > platform so it's easier to navigate the directory. Yes, I have to make sure that everybody agree on our side... > Otherwise the branch contents looks good, so send a fresh request when you've > respun. > > Also, the new dts isn't added to the Makefile, please add it. Ok, I will do. Maybe I can also stack a DT related patch about ADC support that I was planning to add in another pull-request covering the same topic. Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: at91/tc: fix clock source id for tc block > 1
On 04/03/2013 09:59 AM, Boris BREZILLON : > On 03/04/2013 09:26, Nicolas Ferre wrote: >> On 04/03/2013 06:45 AM, Jean-Christophe PLAGNIOL-VILLARD : >>> On 18:46 Tue 02 Apr , Boris BREZILLON wrote: >>>> This patch fixes wrong clock request for TC block 2. >>>> The second block was using t0_clk, t1_clk and t2_clk clks instead of >>>> t3_clk, t4_clk and t5_clk clks. >>>> >>> this is intended as we have 3 clock per device > You're right. >> >> True. >> Boris, did you hit an issue with former code that your patch is solving? >> What is the reason for this patch? > I should have taken a closer look at the code before sending this patch. > I mistook clk name for conid devid association. > > As I am enabling the tc block 1 clocks in the bootstrap code, I thought > this was the reason for these clocks to be enabled after the kernel boot. > > But I tried to disable these clocks in the bootstrap and this works fine. > > Sorry if I bothered you. Not bothered at all Boris! This is exactly how I like to see the community working together. Please feel free to send more and more patches about AT91: this is always valuable for us. Best regards, >>>> Signed-off-by: Boris BREZILLON >>>> --- >>>> drivers/misc/atmel_tclib.c | 24 >>>> 1 file changed, 16 insertions(+), 8 deletions(-) >>>> >>>> diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c >>>> index c8d8e38..768a988 100644 >>>> --- a/drivers/misc/atmel_tclib.c >>>> +++ b/drivers/misc/atmel_tclib.c >>>> @@ -142,6 +142,8 @@ static int __init tc_probe(struct >>>> platform_device *pdev) >>>> struct atmel_tc *tc; >>>> struct clk*clk; >>>> intirq; >>>> +charclk_id[7]; >>>> +intclk_offset; >>>> >>>> if (!platform_get_resource(pdev, IORESOURCE_MEM, 0)) >>>> return -EINVAL; >>>> @@ -156,25 +158,31 @@ static int __init tc_probe(struct >>>> platform_device *pdev) >>>> >>>> tc->pdev = pdev; >>>> >>>> -clk = clk_get(&pdev->dev, "t0_clk"); >>>> -if (IS_ERR(clk)) { >>>> -kfree(tc); >>>> -return -EINVAL; >>>> -} >>>> - >>>> /* Now take SoC information if available */ >>>> if (pdev->dev.of_node) { >>>> const struct of_device_id *match; >>>> match = of_match_node(atmel_tcb_dt_ids, pdev->dev.of_node); >>>> if (match) >>>> tc->tcb_config = match->data; >>>> +clk_offset = of_alias_get_id(tc->pdev->dev.of_node, "tcb"); >>>> +} else >>>> +clk_offset = pdev->id; >>>> +clk_offset *= 3; >>>> + >>>> +snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++); >>>> +clk = clk_get(&pdev->dev, clk_id); >>>> +if (IS_ERR(clk)) { >>>> +kfree(tc); >>>> +return -EINVAL; >>>> } >>>> >>>> tc->clk[0] = clk; >>>> -tc->clk[1] = clk_get(&pdev->dev, "t1_clk"); >>>> +snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++); >>>> +tc->clk[1] = clk_get(&pdev->dev, clk_id); >>>> if (IS_ERR(tc->clk[1])) >>>> tc->clk[1] = clk; >>>> -tc->clk[2] = clk_get(&pdev->dev, "t2_clk"); >>>> +snprintf(clk_id, sizeof(clk_id), "t%d_clk", clk_offset++); >>>> +tc->clk[2] = clk_get(&pdev->dev, clk_id); >>>> if (IS_ERR(tc->clk[2])) >>>> tc->clk[2] = clk; >>>> >>>> -- >>>> 1.7.9.5 >>>> >>>> >>>> ___ >>>> linux-arm-kernel mailing list >>>> linux-arm-ker...@lists.infradead.org >>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >>> >> >> > > > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: at91: remove unused dbgu_readl() macro
Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/include/mach/at91_dbgu.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h index 2aa0c5e..3b59485 100644 --- a/arch/arm/mach-at91/include/mach/at91_dbgu.h +++ b/arch/arm/mach-at91/include/mach/at91_dbgu.h @@ -16,9 +16,6 @@ #ifndef AT91_DBGU_H #define AT91_DBGU_H -#define dbgu_readl(dbgu, field) \ - __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field) - #if !defined(CONFIG_ARCH_AT91X40) #define AT91_DBGU_CR (0x00) /* Control Register */ #define AT91_DBGU_MR (0x04) /* Mode Register */ -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR"
On 04/03/2013 11:54 AM, Johan Hovold : > This reverts commit 0ef1594c017521ea89278e80fe3f80dafb17abde. > > This patch introduced a few races which cannot be easily fixed with a > small follow-up patch. Furthermore, the SoC with the broken hardware > register, which this patch intended to add support for, can only be used > with device trees, which this driver currently does not support. > > Cc: stable > Signed-off-by: Johan Hovold Fair enough, after fighting to find a solution that can makes us move forward... your strong arguments convinced me. So, Andrew, please can you take this "revert" patch for 3.9-rc ? And sorry for the noise. Acked-by: Nicolas Ferre (Andrew, I figured out that you are not in copy of the original email: do I need to send it back to you or can you pick it up in patchwork? https://patchwork.kernel.org/patch/2385921/ ) > --- > drivers/rtc/rtc-at91rm9200.c | 50 > +--- > drivers/rtc/rtc-at91rm9200.h | 1 + > 2 files changed, 20 insertions(+), 31 deletions(-) > > diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c > index 0a9f27e..434ebc3 100644 > --- a/drivers/rtc/rtc-at91rm9200.c > +++ b/drivers/rtc/rtc-at91rm9200.c > @@ -44,7 +44,6 @@ static DECLARE_COMPLETION(at91_rtc_updated); > static unsigned int at91_alarm_year = AT91_RTC_EPOCH; > static void __iomem *at91_rtc_regs; > static int irq; > -static u32 at91_rtc_imr; > > /* > * Decode time/date into rtc_time structure > @@ -109,11 +108,9 @@ static int at91_rtc_settime(struct device *dev, struct > rtc_time *tm) > cr = at91_rtc_read(AT91_RTC_CR); > at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); > > - at91_rtc_imr |= AT91_RTC_ACKUPD; > at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD); > wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */ > at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); > - at91_rtc_imr &= ~AT91_RTC_ACKUPD; > > at91_rtc_write(AT91_RTC_TIMR, > bin2bcd(tm->tm_sec) << 0 > @@ -145,7 +142,7 @@ static int at91_rtc_readalarm(struct device *dev, struct > rtc_wkalrm *alrm) > tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); > tm->tm_year = at91_alarm_year - 1900; > > - alrm->enabled = (at91_rtc_imr & AT91_RTC_ALARM) > + alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM) > ? 1 : 0; > > dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, > @@ -171,7 +168,6 @@ static int at91_rtc_setalarm(struct device *dev, struct > rtc_wkalrm *alrm) > tm.tm_sec = alrm->time.tm_sec; > > at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); > - at91_rtc_imr &= ~AT91_RTC_ALARM; > at91_rtc_write(AT91_RTC_TIMALR, > bin2bcd(tm.tm_sec) << 0 > | bin2bcd(tm.tm_min) << 8 > @@ -184,7 +180,6 @@ static int at91_rtc_setalarm(struct device *dev, struct > rtc_wkalrm *alrm) > > if (alrm->enabled) { > at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); > - at91_rtc_imr |= AT91_RTC_ALARM; > at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); > } > > @@ -201,12 +196,9 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, > unsigned int enabled) > > if (enabled) { > at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); > - at91_rtc_imr |= AT91_RTC_ALARM; > at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); > - } else { > + } else > at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); > - at91_rtc_imr &= ~AT91_RTC_ALARM; > - } > > return 0; > } > @@ -215,10 +207,12 @@ static int at91_rtc_alarm_irq_enable(struct device > *dev, unsigned int enabled) > */ > static int at91_rtc_proc(struct device *dev, struct seq_file *seq) > { > + unsigned long imr = at91_rtc_read(AT91_RTC_IMR); > + > seq_printf(seq, "update_IRQ\t: %s\n", > - (at91_rtc_imr & AT91_RTC_ACKUPD) ? "yes" : "no"); > + (imr & AT91_RTC_ACKUPD) ? "yes" : "no"); > seq_printf(seq, "periodic_IRQ\t: %s\n", > - (at91_rtc_imr & AT91_RTC_SECEV) ? "yes" : "no"); > + (imr & AT91_RTC_SECEV) ? "yes" : "no"); > > return 0; > } > @@ -233,7 +227,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void > *dev_id) > unsign
Re: [RFC PATCH v2] rtc: rtc-at91rm9200: manage IMR depending on revision
On 04/03/2013 11:51 AM, Johan Hovold : > On Tue, Apr 02, 2013 at 06:36:06PM +0200, Nicolas Ferre wrote: >> Signed-off-by: Nicolas Ferre >> --- >> Hi again, >> >> Here is my latest revision of this fix. It depends on the patch that is >> already >> in Andrew's patch stack: "drivers-rtc-rtc-at91rm9200c-add-dt-support.patch". > > That is a problem, as the patch in Andrew's stack is not (and should > not) be marked for stable. Hence this patch cannot be applied to the > stable trees and it won't even apply to 3.9-rc. My intentions were to tag both patches for "stable". You highlight that it is not a good practice: I admit that you are right. > But there's more: The offending patch introduced the races we have been > discussion while attempting to add support for the sam9x5 with the > broken hardware register. But that family cannot be used without > DT-support, which the driver currently does not support. Hence, we added > a workaround (and introduced a regression by mistake), while adding > support for a SoC which still could not use the driver. [ For example, > the sam9x5 RTC-base register address can only be supplied from DT. ] > > I think the only reasonable thing to do is to revert the patch and add > whatever version of the work-around on top of the device-tree support > when that is added to the driver (hence, earliest v3.10). Yes. Let's do this. >> I now use a different compatibility string to figure out what is the IP >> revision that has the "boggus IMR" error. I think this way to handle it >> is much simpler than the "config" structure one from Johan. > > I wouldn't say it's much simpler. My solution is only more generic, but > could of course also be reduced to "set a flag if compatible matches > sam9x5". The advantage is precisely to avoid the need for a "flag". Only function pointers that are changed in case of the compatible string matching. >> The small number of line changed and the "single patch" nature of it >> make me think that it will be easier to send upstream and in the >> "stable" trees... > > Unfortunately, the 130-line diff isn't very small. In fact, it violates > the stable-kernel guide line of <100 lines. And as noted above, it > depends on another patch which adds DT-support (which is a new feature > and not a fix). > > But the fundamental problem remains: it does not fix anything which was > working before the first work-around patch introduced the regression. I > think this is a clear case where we need to revert. Okay. >> Please give feedback, but moreover, I would like to know if you (Johan and >> Douglas) >> agree to give your "Signed-off-by" line because this patch is certainly >> inspired by your comments, code and reviews. >> >> Thank you for your help. Best regards, >> >> .../bindings/rtc/atmel,at91rm9200-rtc.txt | 3 +- >> drivers/rtc/rtc-at91rm9200.c | 126 >> - >> drivers/rtc/rtc-at91rm9200.h | 1 + >> 3 files changed, 101 insertions(+), 29 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> index 2a3feab..9b87053 100644 >> --- a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> +++ b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt >> @@ -1,7 +1,8 @@ >> Atmel AT91RM9200 Real Time Clock >> >> Required properties: >> -- compatible: should be: "atmel,at91rm9200-rtc" >> +- compatible: should be: "atmel,at91rm9200-rtc", "atmel,at91sam9x5-rtc" or >> + "atmel,at91sam9n12-rtc". > > Also at91sam9g45 and at91sam9rl use this driver. Yes, sure, I did not want to add every single user of the RTC... > As seems to be the case > for other peripherals, I suggest we use "atmel,at91sam9x5-rtc" for > sam9x5 and "atmel,at91rm9200-rtc" for the other SoCs, that is, the least > (and first) common denominator. ... I was just following the habit of naming the changes in peripheral revision by it first use in a SoC: at91rm9200-rtc: from rm9200 up to 9g45 at91sam9x5-rtc: sam9x5 only (with IMR issue) at91sam9n12-rtc: fist SoC that corrects the IMR issue with a new IP revision, until now and sama5d3 SoC > Either way, there's not need to add at91sam9n12-rtc in this patch. > >> - reg: physical base address of the controller and length of memory mapped >>region. >> - interrupts: rtc alarm/event interrupt > > I'll respond to this mail with a revert-patch, and an updated RFC-series > based on top of the DT-patch in Andrew's queue. Best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] at91: DT changes for 3.10 #2
On 04/03/2013 09:45 AM, Nicolas Ferre : > On 04/02/2013 08:49 PM, Olof Johansson : >> On Fri, Mar 29, 2013 at 03:59:39PM +0100, Nicolas Ferre wrote: >>> Arnd, Olof, >>> >>> Here is a pull-request for AT91 that is dedicated to Device Tree >>> modifications. It is stacked on the material that you already have >>> for 3.10 in your arm-soc/at91/dt branch. >>> Following our discussion with Arnd, I added the non-urgent patches that I >>> already proposed too late for 3.9. I also included the moving of macb node >>> and kept the original patch. >>> >>> Thanks, best regards, >>> >>> The following changes since commit 6901d947be5ba1245a0f63271355b95f9056a362: >>> >>> ARM: at91/at91sam9x5cm: add 1-wire chip on CM board (2013-03-21 16:07:15 >>> +0100) >>> >>> are available in the git repository at: >>> >>> git://github.com/at91linux/linux-at91.git tags/at91-dt >>> >>> for you to fetch changes up to cc2e191b0ccc5a987fdb29261ab9c264c608924d: >>> >>> ARM: at91/dt: fix macb node declaration (2013-03-29 10:02:04 +0100) >>> >>> >>> One macb DT node move for 9x5 family: 9g15 doesn't >>> have an Ethernet interface. >>> Little fixes mainly related to at91sam9x5 DT and the >>> RTC addition. >>> Addition of the Acme Systems Aria G25 board. >>> >>> >>> Douglas Gilbert (1): >>> ARM: at91: add Acme Systems Aria G25 board >> >> Hi, >> >> I just replied to the above patch -- please prefix the dts files with the >> platform so it's easier to navigate the directory. I do not want to spark a debate here, but moving to directories per "mach" earlier would have made things easier. If I recall well, Jean-Christophe has proposed it a long time ago... > Yes, I have to make sure that everybody agree on our side... The difficult point with this prefix... well it is difficult to tell... our product will never be called "at91" again! So, yes, our Linux identity is still "at91" and we are pretty attached to it but our newer products are named "sam" + "core" + "product family" which results in our newer family: "sama5d3" (note the at91 is missing)... => anyway, we think that the at91 prefix is still vivid in Linux community and we consider it as a good choice for now. So, I may rename the newly introduced "sama5d3*.dts[i]" files with "at91-sama5d3*.dts[i]" (while .c/.h files will remain the same). >> Otherwise the branch contents looks good, so send a fresh request when you've >> respun. >> >> Also, the new dts isn't added to the Makefile, please add it. > > Ok, I will do. Maybe I can also stack a DT related patch about ADC > support that I was planning to add in another pull-request covering the > same topic. > > Thanks, best regards, > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] ARM: at91: add Acme Systems Aria G25 board
On 04/03/2013 09:10 PM, Douglas Gilbert : > On 13-04-02 02:48 PM, Olof Johansson wrote: >> Hi, >> >> I just saw this since it came in through a pull request >> >> On Tue, Mar 26, 2013 at 4:39 AM, Nicolas Ferre >> wrote: >>> From: Douglas Gilbert >>> >>> Signed-off-by: Douglas Gilbert >>> Signed-off-by: Nicolas Ferre >>> --- >>> arch/arm/boot/dts/ariag25.dts | 175 >>> ++ >>> 1 file changed, 175 insertions(+) >>> create mode 100644 arch/arm/boot/dts/ariag25.dts >>> >>> diff --git a/arch/arm/boot/dts/ariag25.dts >>> b/arch/arm/boot/dts/ariag25.dts >>> new file mode 100644 >>> index 000..b43266f >>> --- /dev/null >>> +++ b/arch/arm/boot/dts/ariag25.dts >> >> Please prefix the boards with the platform. Most other SoCs already do >> this, and I see now that some at91 boards haven't been prefixed in the >> past, but it's a good idea to not add more of them. >> >> So, at91-ariag25.dts is a good name in this case. > > That is fine with me. I have changed my working DT > config file to at91-ariag25.dts and will push that > out to Robert Nelson soon. > > Also I'm working on a DT version of an existing Acme > product called the FoxG20 which is based on the > AT91SAM9G20 SoC. It already has non-DT support inside > the mainline kernel. I am using at91-foxg20.dts for > its DT config file. Yep! Works for me. Bye, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3] ARM: at91: add Acme Systems Aria G25 board
From: Douglas Gilbert Signed-off-by: Douglas Gilbert Signed-off-by: Nicolas Ferre --- Hi all, Here is the third revision of this patch. I plan to include it in a pull-request real-soon-now! v3: - move to "at91-" prefix for .dts[i] files - remove the rtc activation code because of the ongoing discussions about this IP and its DT binding. arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/at91-ariag25.dts | 171 + 2 files changed, 172 insertions(+) create mode 100644 arch/arm/boot/dts/at91-ariag25.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 4c7f8a8..b07f162 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -27,6 +27,7 @@ dtb-$(CONFIG_ARCH_AT91) += pm9g45.dtb # sam9n12 dtb-$(CONFIG_ARCH_AT91) += at91sam9n12ek.dtb # sam9x5 +dtb-$(CONFIG_ARCH_AT91) += at91-ariag25.dtb dtb-$(CONFIG_ARCH_AT91) += at91sam9g15ek.dtb dtb-$(CONFIG_ARCH_AT91) += at91sam9g25ek.dtb dtb-$(CONFIG_ARCH_AT91) += at91sam9g35ek.dtb diff --git a/arch/arm/boot/dts/at91-ariag25.dts b/arch/arm/boot/dts/at91-ariag25.dts new file mode 100644 index 000..c7aebba --- /dev/null +++ b/arch/arm/boot/dts/at91-ariag25.dts @@ -0,0 +1,171 @@ +/* + * at91-ariag25.dts - Device Tree file for Acme Systems Aria G25 (AT91SAM9G25 based) + * + * Copyright (C) 2013 Douglas Gilbert , + *Robert Nelson + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +/include/ "at91sam9g25.dtsi" + +/ { + model = "Acme Systems Aria G25"; + compatible = "acme,ariag25", "atmel,at91sam9x5ek", +"atmel,at91sam9x5", "atmel,at91sam9"; + + aliases { + serial0 = &dbgu; + serial1 = &usart0; + serial2 = &usart1; + serial3 = &usart2; + serial4 = &usart3; + serial5 = &uart0; + }; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"; + }; + + memory { + /* 128 MB, change this for 256 MB revision */ + reg = <0x2000 0x800>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <1200>; + }; + }; + + ahb { + apb { + mmc0: mmc@f0008000 { + /* N.B. Aria has no SD card detect (CD), assumed present */ + + pinctrl-0 = < + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + i2c0: i2c@f801 { + status = "okay"; + }; + + i2c1: i2c@f8014000 { + status = "okay"; + }; + + /* TWD2+TCLK2 hidden behind ethernet, so no i2c2 */ + + usart0: serial@f801c000 { + pinctrl-0 = <&pinctrl_usart0 +&pinctrl_usart0_rts +&pinctrl_usart0_cts>; + status = "okay"; + }; + + usart1: serial@f802 { + pinctrl-0 = <&pinctrl_usart1 +/* &pinctrl_usart1_rts */ +/* &pinctrl_usart1_cts */ + >; + status = "okay"; + }; + + usart2: serial@f8024000 { + /* cannot activate RTS2+CTS2, clash with +* ethernet on PB0 and PB1 */ + pinctrl-0 = <&pinctrl_usart2>; + status = "okay"; + }; + + usart3: serial@f8028000 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xf8028000 0x200>; +
[PATCH v2] ARM: at91/at91sam9260.dtsi: fix u(s)art pinctrl encoding
From: Douglas Gilbert Signed-off-by: Douglas Gilbert [nicolas.fe...@atmel.com: fix rts/cts for usart3] Signed-off-by: Nicolas Ferre Cc: stable #3.8+ --- Hi, v2: - add commit message - correct rts/cts for usart3 - add stable tag arch/arm/boot/dts/at91sam9260.dtsi | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index 367a604..3e2adfb 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi @@ -158,8 +158,8 @@ usart1 { pinctrl_usart1: usart1-0 { atmel,pins = - <2 6 0x1 0x1/* PB6 periph A with pullup */ -2 7 0x1 0x0>; /* PB7 periph A */ + <1 6 0x1 0x1/* PB6 periph A with pullup */ +1 7 0x1 0x0>; /* PB7 periph A */ }; pinctrl_usart1_rts: usart1_rts-0 { @@ -194,18 +194,18 @@ usart3 { pinctrl_usart3: usart3-0 { atmel,pins = - <2 10 0x1 0x1 /* PB10 periph A with pullup */ -2 11 0x1 0x0>; /* PB11 periph A */ + <1 10 0x1 0x1 /* PB10 periph A with pullup */ +1 11 0x1 0x0>; /* PB11 periph A */ }; pinctrl_usart3_rts: usart3_rts-0 { atmel,pins = - <3 8 0x2 0x0>; /* PB8 periph B */ + <2 8 0x2 0x0>; /* PC8 periph B */ }; pinctrl_usart3_cts: usart3_cts-0 { atmel,pins = - <3 10 0x2 0x0>; /* PB10 periph B */ + <2 10 0x2 0x0>; /* PC10 periph B */ }; }; @@ -220,8 +220,8 @@ uart1 { pinctrl_uart1: uart1-0 { atmel,pins = - <2 12 0x1 0x1 /* PB12 periph A with pullup */ -2 13 0x1 0x0>; /* PB13 periph A */ + <1 12 0x1 0x1 /* PB12 periph A with pullup */ +1 13 0x1 0x0>; /* PB13 periph A */ }; }; -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: DT changes for 3.10 #3
Arnd, Olof, Here is the refreshed pull-request for AT91 that is dedicated to Device Tree modifications. It is stacked on the material that you already have for 3.10 in your arm-soc/at91/dt branch. Following our discussion with Arnd, I added the non-urgent patches that I already proposed too late for 3.9. I also included the moving of macb node and kept the original patch. As Olof asked, I renamed the Aria board dts file: at91-ariag25.dts and placed it in the Makefile. I also took the advantage of this delay to stack two more DT related patches. Thanks, best regards, The following changes since commit 6901d947be5ba1245a0f63271355b95f9056a362: ARM: at91/at91sam9x5cm: add 1-wire chip on CM board (2013-03-21 16:07:15 +0100) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-dt for you to fetch changes up to f10491fff07dcced77f8ab1b3bc1f8e18715bfb9: ARM: at91/at91sam9260.dtsi: fix u(s)art pinctrl encoding (2013-04-04 18:31:17 +0200) One macb DT node move for 9x5 family: 9g15 doesn't have an Ethernet interface. Little fixes mainly related to at91sam9x5 DT, IIO ADC bindings, pinctrl for at91sam9260/g20 DT and the RTC addition. Addition of the Acme Systems Aria G25 board. Douglas Gilbert (2): ARM: at91: add Acme Systems Aria G25 board ARM: at91/at91sam9260.dtsi: fix u(s)art pinctrl encoding Ludovic Desroches (1): ARM: at91: dts: add adc resolution stuff Nicolas Ferre (5): ARM: at91/at91sam9x5: add RTC node ARM: at91/trivial: typos in compatible property ARM: at91/trivial: fix model name for SAM9G15-EK ARM: at91: remove partial parameter in bootargs for at91sam9x5ek.dtsi ARM: at91/dt: fix macb node declaration arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/at91-ariag25.dts | 171 +++ arch/arm/boot/dts/at91sam9260.dtsi | 19 ++-- arch/arm/boot/dts/at91sam9g15.dtsi | 2 +- arch/arm/boot/dts/at91sam9g15ek.dts | 2 +- arch/arm/boot/dts/at91sam9g25.dtsi | 2 +- arch/arm/boot/dts/at91sam9g25ek.dts | 9 ++ arch/arm/boot/dts/at91sam9g35.dtsi | 2 +- arch/arm/boot/dts/at91sam9g35ek.dts | 9 ++ arch/arm/boot/dts/at91sam9g45.dtsi | 3 + arch/arm/boot/dts/at91sam9x25.dtsi | 2 +- arch/arm/boot/dts/at91sam9x25ek.dts | 14 +++ arch/arm/boot/dts/at91sam9x35.dtsi | 2 +- arch/arm/boot/dts/at91sam9x35ek.dts | 9 ++ arch/arm/boot/dts/at91sam9x5.dtsi | 10 ++ arch/arm/boot/dts/at91sam9x5ek.dtsi | 7 +- 16 files changed, 244 insertions(+), 20 deletions(-) create mode 100644 arch/arm/boot/dts/at91-ariag25.dts -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR"
On 04/03/2013 12:18 PM, Nicolas Ferre : > On 04/03/2013 11:54 AM, Johan Hovold : >> This reverts commit 0ef1594c017521ea89278e80fe3f80dafb17abde. >> >> This patch introduced a few races which cannot be easily fixed with a >> small follow-up patch. Furthermore, the SoC with the broken hardware >> register, which this patch intended to add support for, can only be used >> with device trees, which this driver currently does not support. >> >> Cc: stable >> Signed-off-by: Johan Hovold > > Fair enough, after fighting to find a solution that can makes us move > forward... your strong arguments convinced me. > > So, Andrew, please can you take this "revert" patch for 3.9-rc ? > And sorry for the noise. > > Acked-by: Nicolas Ferre > > (Andrew, I figured out that you are not in copy of the original email: > do I need to send it back to you or can you pick it up in patchwork? > https://patchwork.kernel.org/patch/2385921/ > ) Andrew, ping? Thanks, best regards, >> --- >> drivers/rtc/rtc-at91rm9200.c | 50 >> +--- >> drivers/rtc/rtc-at91rm9200.h | 1 + >> 2 files changed, 20 insertions(+), 31 deletions(-) >> >> diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c >> index 0a9f27e..434ebc3 100644 >> --- a/drivers/rtc/rtc-at91rm9200.c >> +++ b/drivers/rtc/rtc-at91rm9200.c >> @@ -44,7 +44,6 @@ static DECLARE_COMPLETION(at91_rtc_updated); >> static unsigned int at91_alarm_year = AT91_RTC_EPOCH; >> static void __iomem *at91_rtc_regs; >> static int irq; >> -static u32 at91_rtc_imr; >> >> /* >> * Decode time/date into rtc_time structure >> @@ -109,11 +108,9 @@ static int at91_rtc_settime(struct device *dev, struct >> rtc_time *tm) >> cr = at91_rtc_read(AT91_RTC_CR); >> at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); >> >> -at91_rtc_imr |= AT91_RTC_ACKUPD; >> at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD); >> wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */ >> at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); >> -at91_rtc_imr &= ~AT91_RTC_ACKUPD; >> >> at91_rtc_write(AT91_RTC_TIMR, >>bin2bcd(tm->tm_sec) << 0 >> @@ -145,7 +142,7 @@ static int at91_rtc_readalarm(struct device *dev, struct >> rtc_wkalrm *alrm) >> tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); >> tm->tm_year = at91_alarm_year - 1900; >> >> -alrm->enabled = (at91_rtc_imr & AT91_RTC_ALARM) >> +alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM) >> ? 1 : 0; >> >> dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, >> @@ -171,7 +168,6 @@ static int at91_rtc_setalarm(struct device *dev, struct >> rtc_wkalrm *alrm) >> tm.tm_sec = alrm->time.tm_sec; >> >> at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); >> -at91_rtc_imr &= ~AT91_RTC_ALARM; >> at91_rtc_write(AT91_RTC_TIMALR, >>bin2bcd(tm.tm_sec) << 0 >> | bin2bcd(tm.tm_min) << 8 >> @@ -184,7 +180,6 @@ static int at91_rtc_setalarm(struct device *dev, struct >> rtc_wkalrm *alrm) >> >> if (alrm->enabled) { >> at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); >> -at91_rtc_imr |= AT91_RTC_ALARM; >> at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); >> } >> >> @@ -201,12 +196,9 @@ static int at91_rtc_alarm_irq_enable(struct device >> *dev, unsigned int enabled) >> >> if (enabled) { >> at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); >> -at91_rtc_imr |= AT91_RTC_ALARM; >> at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); >> -} else { >> +} else >> at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); >> -at91_rtc_imr &= ~AT91_RTC_ALARM; >> -} >> >> return 0; >> } >> @@ -215,10 +207,12 @@ static int at91_rtc_alarm_irq_enable(struct device >> *dev, unsigned int enabled) >> */ >> static int at91_rtc_proc(struct device *dev, struct seq_file *seq) >> { >> +unsigned long imr = at91_rtc_read(AT91_RTC_IMR); >> + >> seq_printf(seq, "update_IRQ\t: %s\n", >> -(at91_rtc_imr & AT91_RTC_ACKUPD) ? "yes" : "no"); >> +(imr & AT91_RT
[PATCH] Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR"
From: Johan Hovold This reverts commit 0ef1594. This patch introduced a few races which cannot be easily fixed with a small follow-up patch. Furthermore, the SoC with the broken hardware register, which this patch intended to add support for, can only be used with device trees, which this driver currently does not support. Cc: stable Signed-off-by: Johan Hovold Signed-off-by: Nicolas Ferre --- Linus, As suggested by Greg, I send you directly this "revert" patch. I hope it will join your tree before 3.9-final. Here is the discussion that led to this "revert" patch. https://lkml.org/lkml/2013/4/3/176 Thanks a lot, best regards, drivers/rtc/rtc-at91rm9200.c | 50 +--- drivers/rtc/rtc-at91rm9200.h | 1 + 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index 0a9f27e..434ebc3 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -44,7 +44,6 @@ static DECLARE_COMPLETION(at91_rtc_updated); static unsigned int at91_alarm_year = AT91_RTC_EPOCH; static void __iomem *at91_rtc_regs; static int irq; -static u32 at91_rtc_imr; /* * Decode time/date into rtc_time structure @@ -109,11 +108,9 @@ static int at91_rtc_settime(struct device *dev, struct rtc_time *tm) cr = at91_rtc_read(AT91_RTC_CR); at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); - at91_rtc_imr |= AT91_RTC_ACKUPD; at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD); wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */ at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); - at91_rtc_imr &= ~AT91_RTC_ACKUPD; at91_rtc_write(AT91_RTC_TIMR, bin2bcd(tm->tm_sec) << 0 @@ -145,7 +142,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); tm->tm_year = at91_alarm_year - 1900; - alrm->enabled = (at91_rtc_imr & AT91_RTC_ALARM) + alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM) ? 1 : 0; dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, @@ -171,7 +168,6 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) tm.tm_sec = alrm->time.tm_sec; at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); - at91_rtc_imr &= ~AT91_RTC_ALARM; at91_rtc_write(AT91_RTC_TIMALR, bin2bcd(tm.tm_sec) << 0 | bin2bcd(tm.tm_min) << 8 @@ -184,7 +180,6 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) if (alrm->enabled) { at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); - at91_rtc_imr |= AT91_RTC_ALARM; at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); } @@ -201,12 +196,9 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) if (enabled) { at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); - at91_rtc_imr |= AT91_RTC_ALARM; at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); - } else { + } else at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); - at91_rtc_imr &= ~AT91_RTC_ALARM; - } return 0; } @@ -215,10 +207,12 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) */ static int at91_rtc_proc(struct device *dev, struct seq_file *seq) { + unsigned long imr = at91_rtc_read(AT91_RTC_IMR); + seq_printf(seq, "update_IRQ\t: %s\n", - (at91_rtc_imr & AT91_RTC_ACKUPD) ? "yes" : "no"); + (imr & AT91_RTC_ACKUPD) ? "yes" : "no"); seq_printf(seq, "periodic_IRQ\t: %s\n", - (at91_rtc_imr & AT91_RTC_SECEV) ? "yes" : "no"); + (imr & AT91_RTC_SECEV) ? "yes" : "no"); return 0; } @@ -233,7 +227,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id) unsigned int rtsr; unsigned long events = 0; - rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_imr; + rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read(AT91_RTC_IMR); if (rtsr) { /* this interrupt is shared! Is it ours? */ if (rtsr & AT91_RTC_ALARM) events |= (RTC_AF | RTC_IRQF); @@ -297,7 +291,6 @@ static int __init at91_rtc_probe(struct platform_device *pdev) at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV |
[GIT PULL] at91: fixes for 3.8-rc6
Arnd, Olof, Here are two little DT fixes that will fix the use of USART3 on at91sam9x5 platforms. The following changes since commit 949db153b6466c6f7cad5a427ecea94985927311: Linux 3.8-rc5 (2013-01-25 11:57:28 -0800) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to 7d4cfece23f535b60496d88a717a3d7bfca50187: ARM: at91/at91sam9x5.dtsi: fix usart3 TXD (2013-01-30 10:09:17 +0100) Two little Device Tree fixes for USART on at91sam9x5. Douglas Gilbert (1): ARM: at91/at91sam9x5.dtsi: fix usart3 TXD Robert Nelson (1): ARM: at91: at91sam9x5: fix usart3 pinctrl name arch/arm/boot/dts/at91sam9x5.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Thanks, bye, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: at91/DT: remove atmel,use-dma-* from 9x5 and 9n12 USART nodes
Fix the use of USART on both at91sam9x5 and at91sam9n12. In DTS, the atmel,use-dma-[rx|tx] property is present but a DMA channel cannot be used. Indeed the connexion between the DMA engine and the slave is not implemented yet in Device Tree. Note however that this property is also used for PDC (private DMA) on older SoCs. This is why the driver alone cannot determine the validity of this property. Reported-by: Douglas Gilbert Signed-off-by: Nicolas Ferre --- arch/arm/boot/dts/at91sam9n12.dtsi | 8 arch/arm/boot/dts/at91sam9x5.dtsi | 6 -- 2 files changed, 14 deletions(-) diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index 80e29c6..4801717 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi @@ -324,8 +324,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf801c000 0x4000>; interrupts = <5 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; status = "disabled"; @@ -335,8 +333,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf802 0x4000>; interrupts = <6 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; status = "disabled"; @@ -346,8 +342,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf8024000 0x4000>; interrupts = <7 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; status = "disabled"; @@ -357,8 +351,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf8028000 0x4000>; interrupts = <8 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; status = "disabled"; diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index 0c60090..d112c3a 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi @@ -402,8 +402,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf801c000 0x200>; interrupts = <5 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; status = "disabled"; @@ -413,8 +411,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf802 0x200>; interrupts = <6 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; status = "disabled"; @@ -424,8 +420,6 @@ compatible = "atmel,at91sam9260-usart"; reg = <0xf8024000 0x200>; interrupts = <7 4 5>; - atmel,use-dma-rx; - atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; status = "disabled"; -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/9] ARM: at91/at91_dt_defconfig: remove memory specification to cmdline
On 01/23/2013 11:20 AM, Jean-Christophe PLAGNIOL-VILLARD : > On 10:48 Wed 23 Jan , Nicolas Ferre wrote: >> No need for this cmdline option as we are using DT. >> Moreover this defconfig is targeted to multiple SoC/boards: this option >> was nonsense. > just keep the console the rest is a nonsense too > > as on 9g45 the initrd will be at 0x7xxx Understood, but I prefer to keep a "root" option at least, so I keep it like this. > the console too but as the patch serie to support via DT is not yet mainline > we can keep it Ok for this. > > Best Regards, > J. >> >> Reported-by: Josh Wu >> Signed-off-by: Nicolas Ferre >> --- >> arch/arm/configs/at91_dt_defconfig | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm/configs/at91_dt_defconfig >> b/arch/arm/configs/at91_dt_defconfig >> index b175577..a353ff6 100644 >> --- a/arch/arm/configs/at91_dt_defconfig >> +++ b/arch/arm/configs/at91_dt_defconfig >> @@ -31,7 +31,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0 >> CONFIG_ZBOOT_ROM_BSS=0x0 >> CONFIG_ARM_APPENDED_DTB=y >> CONFIG_ARM_ATAG_DTB_COMPAT=y >> -CONFIG_CMDLINE="mem=128M console=ttyS0,115200 initrd=0x2110,25165824 >> root=/dev/ram0 rw" >> +CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x2110,25165824 >> root=/dev/ram0 rw" >> CONFIG_KEXEC=y >> CONFIG_AUTO_ZRELADDR=y >> # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set >> -- >> 1.8.0 >> > > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: fixes for 3.8-rc5
Arnd, Olof, Here is the pull request related to the fixes series that I sent earlier this week. Changes are obvious and are very constrained in AT91-related material. The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619: Linux 3.8-rc4 (2013-01-17 19:25:45 -0800) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to 8461c2f6fdd3ef0b26f931d561435df8cae2a9a5: ARM: at91/dts: correct comment in at91sam9x5.dtsi for mii (2013-01-23 10:40:51 +0100) Here are fixes for AT91 that are mainly related to device tree. One RM9200 setup option is the only C code change. Some documentation changes can clarify the pinctrl use. Then, some defconfig modifications are allowing the affected platforms to boot. Boris BREZILLON (1): ARM: at91/dts: add macb mii pinctrl config for kizbox Douglas Gilbert (1): ARM: at91/dts: correct comment in at91sam9x5.dtsi for mii Jean-Christophe PLAGNIOL-VILLARD (1): ARM: at91: rm9200: remake the BGA as default version Joachim Eastwood (1): ARM: at91: fix gpios on i2c-gpio for RM9200 DT Nicolas Ferre (2): ARM: at91/at91_dt_defconfig: remove memory specification to cmdline ARM: at91/at91_dt_defconfig: add at91sam9n12 SoC to DT defconfig Richard Genoud (3): ARM: at91/at91-pinctrl documentation: fix typo and add some details ARM: at91/at91sam9x5 DTS: correct wrong PIO BANK values on u(s)arts ARM: at91/at91sam9x5 DTS: add SCK USART pins Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt | 5 +-- arch/arm/boot/dts/at91rm9200.dtsi| 4 +-- arch/arm/boot/dts/at91sam9x5.dtsi| 60 +++ arch/arm/boot/dts/kizbox.dts | 2 ++ arch/arm/configs/at91_dt_defconfig | 3 +- arch/arm/mach-at91/setup.c | 2 ++ 6 files changed, 51 insertions(+), 25 deletions(-) Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 10/19] watchdog: at91sam9: at91_wdt_dt_ids cannot be __init
On 01/25/2013 11:44 PM, Arnd Bergmann : > The device IDs are referenced by the driver and potentially > used beyond the init time, as kbuild correctly warns > about. Remove the __initconst annotation. > > Without this patch, building at91_dt_defconfig results in: > > WARNING: drivers/watchdog/built-in.o(.data+0x28): Section mismatch in > reference from the variable at91wdt_driver to the (unknown reference) > .init.rodata:(unknown) > The variable at91wdt_driver references > the (unknown reference) __initconst (unknown) > > Signed-off-by: Arnd Bergmann > Cc: Wim Van Sebroeck > Cc: linux-watch...@vger.kernel.org > Cc: Nicolas Ferre Acked-by: Nicolas Ferre Thanks, > Cc: Fabio Porcedda > --- > drivers/watchdog/at91sam9_wdt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c > index dc42e44..6dad954 100644 > --- a/drivers/watchdog/at91sam9_wdt.c > +++ b/drivers/watchdog/at91sam9_wdt.c > @@ -304,7 +304,7 @@ static int __exit at91wdt_remove(struct platform_device > *pdev) > } > > #if defined(CONFIG_OF) > -static const struct of_device_id at91_wdt_dt_ids[] __initconst = { > +static const struct of_device_id at91_wdt_dt_ids[] = { > { .compatible = "atmel,at91sam9260-wdt" }, > { /* sentinel */ } > }; > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 14/19] spi/atmel: remove incorrect __exit_p()
On 01/25/2013 11:44 PM, Arnd Bergmann : > Since we no longer allow building without hotplug, the > atmel_spi_remove function is always present and we should > not use __exit_p() to refer to it. > > Without this patch, building at91_dt_defconfig results in: > > drivers/spi/spi-atmel.c:1006:12: warning: 'atmel_spi_remove' defined but not > used [-Wunused-function] > > Signed-off-by: Arnd Bergmann > Cc: Nicolas Ferre Acked-by: Nicolas Ferre > Cc: Grant Likely > Cc: spi-devel-gene...@lists.sourceforge.net > --- > drivers/spi/spi-atmel.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c > index ab34497..656d137 100644 > --- a/drivers/spi/spi-atmel.c > +++ b/drivers/spi/spi-atmel.c > @@ -1088,7 +1088,7 @@ static struct platform_driver atmel_spi_driver = { > .suspend= atmel_spi_suspend, > .resume = atmel_spi_resume, > .probe = atmel_spi_probe, > - .remove = __exit_p(atmel_spi_remove), > + .remove = atmel_spi_remove, > }; > module_platform_driver(atmel_spi_driver); > > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: fixes for 3.9-rc #1
Arnd, Olof, Here is a little pull-request for 3.9-rc (I guess it if -rc4 now that you've just sent the one for -rc3). I have other material but it is related to the AT91 framebuffer and we are currently discussing it so I hold them back for now. Thanks, best regards, The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9: Linux 3.9-rc2 (2013-03-10 16:54:19 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to 5982c177468eb5829146e16b55d43f0b08270ac0: ARM: at91: fix infinite loop in at91_irq_suspend/resume (2013-03-13 10:25:38 +0100) Two patches for Device Tree on at91sam9x5/NAND. Two more for fixing PM suspend/resume IRQ on AIC5 and GPIO used with pinctrl. Ludovic Desroches (2): ARM: at91: add gpio suspend/resume support when using pinctrl ARM: at91: fix infinite loop in at91_irq_suspend/resume Richard Genoud (2): ARM: at91: dt: at91sam9x5: correct NAND pins comments ARM: at91: dt: at91sam9x5: complete NAND pinctrl arch/arm/boot/dts/at91sam9x5.dtsi | 28 ++-- arch/arm/mach-at91/include/mach/gpio.h | 8 + arch/arm/mach-at91/irq.c | 20 +--- arch/arm/mach-at91/pm.c| 10 -- drivers/pinctrl/pinctrl-at91.c | 61 ++- 5 files changed, 110 insertions(+), 17 deletions(-) -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
On 03/08/2013 10:37 AM, Nicolas Ferre : > On 02/10/2013 07:45 PM, Johan Hovold : >> On Sun, Feb 10, 2013 at 1:47 AM, Olof Johansson wrote: >>> On Fri, Feb 08, 2013 at 05:35:13PM +0100, Nicolas Ferre wrote: >>>> These patches fix a regression in 16-bpp support for older SOCs which >>>> use IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to >>>> determine if the controller uses the intensity-bit and restore the >>>> old layout in that case. >>>> >>>> The last patch is a removal of uses of cpu_is_() macros in >>>> atmel_lcdfb with a platform-device-id table and static >>>> configurations. >>>> >>>> >>>> Patches from Johan Hovold taken from: "[PATCH 0/3] atmel_lcdfb: fix >>>> 16-bpp regression" and "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb: >>>> remove cpu_is macros" patch series to form a clean patch series with >>>> my signature. >>>> >>>> Arnd, Olof, as it seems that old fbdev drivers are not so much >>>> reviewed those days, can we take the decision to queue this material >>>> through arm-soc with other AT91 drivers updates? >>> >>> It would be beneficial to get an ack from Florian. Was he involved in >>> the review of the code that regressed 16-bpp support in the first >>> place? When was the regression introduced? >> >> In v3.4 by commit 787f9fd2328 ("atmel_lcdfb: support 16bit BGR:565 mode, >> remove unsupported 15bit modes"). > > Arnd, Olof, > > Please tell me if I can do something to ease the adoption of these > patches during 3.9-rc timeframe (I can rebase it on top of 3.9-rc1 to > avoid any conflict: the file board-neocore926.c was removed during the > merge window). > Johan has written the series a long time ago and we still do not have it > in mainline. > > If the option to ask Andrew is better in your opinion, please tell me. In case we end-up with an agreement on the path those fixes should follow, here is the location of my updated material rebased on top of 3.9-rc2: The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9: Linux 3.9-rc2 (2013-03-10 16:54:19 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git at91-3.9-fixesLCD for you to fetch changes up to bbd44f6bd9d1aa735b180b29b5719d63a8e87b55: ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-03-13 11:05:12 +0100) Johan Hovold (5): atmel_lcdfb: fix 16-bpp modes on older SOCs ARM: at91: fix LCD-wiring mode ARM: at91/avr32/atmel_lcdfb: add bus-clock entry atmel_lcdfb: move lcdcon2 register access to compute_hozval ARM: at91/avr32/atmel_lcdfb: add platform device-id table arch/arm/mach-at91/at91sam9261.c | 2 + arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263.c | 1 + arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45.c | 2 + arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl.c | 1 + arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/avr32/mach-at32ap/at32ap700x.c | 6 +- drivers/video/atmel_lcdfb.c | 130 +++ include/video/atmel_lcdc.h | 4 +- 11 files changed, 126 insertions(+), 36 deletions(-) Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] at91: fixes for 3.9-rc #1
(Updated to include Linus' acknowledgement on pinctrl-related patch) Arnd, Olof, Here is a little pull-request for 3.9-rc (I guess it if -rc4 now that you've just sent the one for -rc3). I have other material but it is related to the AT91 framebuffer and we are currently discussing it so I hold them back for now. Thanks, best regards, The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9: Linux 3.9-rc2 (2013-03-10 16:54:19 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to 0ed66befaae893e82c9f016238282d73ef9fd6c7: ARM: at91: fix infinite loop in at91_irq_suspend/resume (2013-03-14 09:37:55 +0100) Two patches for Device Tree on at91sam9x5/NAND. Two more for fixing PM suspend/resume IRQ on AIC5 and GPIO used with pinctrl. Ludovic Desroches (2): ARM: at91: add gpio suspend/resume support when using pinctrl ARM: at91: fix infinite loop in at91_irq_suspend/resume Richard Genoud (2): ARM: at91: dt: at91sam9x5: correct NAND pins comments ARM: at91: dt: at91sam9x5: complete NAND pinctrl arch/arm/boot/dts/at91sam9x5.dtsi | 28 ++-- arch/arm/mach-at91/include/mach/gpio.h | 8 + arch/arm/mach-at91/irq.c | 20 +--- arch/arm/mach-at91/pm.c| 10 -- drivers/pinctrl/pinctrl-at91.c | 61 ++- 5 files changed, 110 insertions(+), 17 deletions(-) -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: framebuffer enhancements for 3.10
Arnd, Olof, Following our conversation about these framebuffer patches for Atmel LCD driver, here are the remaining three patches that can be pushed for 3.10. As suggested by Arnd, I have kept them on top of last commit concerning this topic that have already been merged in arm-soc 3.9 fixes branch. Thanks a lot for taking care of these modifications. Best regards, The following changes since commit 67cf9c0a00bd88443adb7d6c3efa8b18d03f97c5: ARM: at91: fix LCD-wiring mode (2013-03-13 11:05:04 +0100) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-driversLCD for you to fetch changes up to bbd44f6bd9d1aa735b180b29b5719d63a8e87b55: ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-03-13 11:05:12 +0100) Some Atmel framebuffer driver enhancements with modification of configuration data in ARM/AT91 and AVR32/AP7 trees. A merge of these modifications seems easier through arm-soc git tree nowadays. Johan Hovold (3): ARM: at91/avr32/atmel_lcdfb: add bus-clock entry atmel_lcdfb: move lcdcon2 register access to compute_hozval ARM: at91/avr32/atmel_lcdfb: add platform device-id table arch/arm/mach-at91/at91sam9261.c | 2 + arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263.c | 1 + arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9g45.c | 2 + arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl.c | 1 + arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- arch/avr32/mach-at32ap/at32ap700x.c | 6 +- drivers/video/atmel_lcdfb.c | 120 +++ include/video/atmel_lcdc.h | 4 +- 11 files changed, 117 insertions(+), 35 deletions(-) -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
On 03/15/2013 12:03 AM, Arnd Bergmann : > On Wednesday 13 March 2013, Nicolas Ferre wrote: >> In case we end-up with an agreement on the path those fixes should >> follow, here is the location of my updated material rebased on top of >> 3.9-rc2: >> >> The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9: >> >> Linux 3.9-rc2 (2013-03-10 16:54:19 -0700) >> >> are available in the git repository at: >> >> git://github.com/at91linux/linux-at91.git at91-3.9-fixesLCD >> >> for you to fetch changes up to bbd44f6bd9d1aa735b180b29b5719d63a8e87b55: >> >> ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-03-13 >> 11:05:12 +0100) >> >> >> Johan Hovold (5): >> atmel_lcdfb: fix 16-bpp modes on older SOCs >> ARM: at91: fix LCD-wiring mode >> ARM: at91/avr32/atmel_lcdfb: add bus-clock entry >> atmel_lcdfb: move lcdcon2 register access to compute_hozval >> ARM: at91/avr32/atmel_lcdfb: add platform device-id table >> > > I have merged the first two patches into the fixes branch now, from up to > commit > 67cf9c0a. Please resubmit the remaining ones on top of this commit for 3.10, > either > through arm-soc or through the framebuffer tree. Thanks a lot. I have just sent the pull-request for remaining material. Tell me if it is what you've expected. Best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: cleanup + soc for 3.10 #1
Arnd, Olof, This is a pull-request targeted to do some cleanup in AT91 Kconfig and board-dt-xxx.c files. It will prepare the coming introduction of our SAMA5D3 family (Atmel new Cortex-A5) that we will stack on top of these modifications soon. Thanks, best regards, The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9: Linux 3.9-rc2 (2013-03-10 16:54:19 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-soc for you to fetch changes up to 9317960fa38ff50ac287904e4c751a169635ecbf: ARM: at91: renamme rm9200 dt file (2013-03-13 17:28:14 +0100) Simplification of Kconfig and splitting of the non-DT part. Common pattern for DT board file naming. Jean-Christophe PLAGNIOL-VILLARD (3): ARM: at91: move non DT Kconfig to Kconfig.non_dt ARM: at91: rename board-dt to more specific name board-dt-sam9 ARM: at91: renamme rm9200 dt file arch/arm/configs/at91_dt_defconfig | 2 +- arch/arm/configs/at91sam9260_defconfig | 2 +- arch/arm/configs/at91sam9g20_defconfig | 2 +- arch/arm/configs/at91sam9g45_defconfig | 2 +- arch/arm/mach-at91/Kconfig | 398 +- arch/arm/mach-at91/Kconfig.non_dt | 399 +++ arch/arm/mach-at91/Makefile | 4 +- arch/arm/mach-at91/{board-rm9200-dt.c => board-dt-rm9200.c} | 0 arch/arm/mach-at91/{board-dt.c => board-dt-sam9.c} | 0 9 files changed, 407 insertions(+), 402 deletions(-) create mode 100644 arch/arm/mach-at91/Kconfig.non_dt rename arch/arm/mach-at91/{board-rm9200-dt.c => board-dt-rm9200.c} (100%) rename arch/arm/mach-at91/{board-dt.c => board-dt-sam9.c} (100%) -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1] tty: atmel_serial_probe(): index of atmel_ports[] fix
On 02/20/2013 05:26 PM, Pawel Wieczorkiewicz : > From: Pawel Wieczorkiewicz > > Index of atmel_ports[ATMEL_MAX_UART] should be smaller > than ATMEL_MAX_UART. > > Signed-off-by: Pawel Wieczorkiewicz Acked-by: Nicolas Ferre It can be good to include this one in 3.9-rc. I also would like to add the "stable" tag to it: Cc: stable # 3.2+ Greg, can you take this one or do I need to re-send it with appropriate "stable" line? Thanks, best regards, > --- > drivers/tty/serial/atmel_serial.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/tty/serial/atmel_serial.c > b/drivers/tty/serial/atmel_serial.c > index d4a7c24..3467462 100644 > --- a/drivers/tty/serial/atmel_serial.c > +++ b/drivers/tty/serial/atmel_serial.c > @@ -158,7 +158,7 @@ struct atmel_uart_port { > }; > > static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; > -static unsigned long atmel_ports_in_use; > +static DECLARE_BITMAP(atmel_ports_in_use, ATMEL_MAX_UART); > > #ifdef SUPPORT_SYSRQ > static struct console atmel_console; > @@ -1769,15 +1769,14 @@ static int atmel_serial_probe(struct platform_device > *pdev) > if (ret < 0) > /* port id not found in platform data nor device-tree aliases: >* auto-enumerate it */ > - ret = find_first_zero_bit(&atmel_ports_in_use, > - sizeof(atmel_ports_in_use)); > + ret = find_first_zero_bit(atmel_ports_in_use, ATMEL_MAX_UART); > > - if (ret > ATMEL_MAX_UART) { > + if (ret >= ATMEL_MAX_UART) { > ret = -ENODEV; > goto err; > } > > - if (test_and_set_bit(ret, &atmel_ports_in_use)) { > + if (test_and_set_bit(ret, atmel_ports_in_use)) { > /* port already in use */ > ret = -EBUSY; > goto err; > @@ -1857,7 +1856,7 @@ static int atmel_serial_remove(struct platform_device > *pdev) > > /* "port" is allocated statically, so we shouldn't free it */ > > - clear_bit(port->line, &atmel_ports_in_use); > + clear_bit(port->line, atmel_ports_in_use); > > clk_put(atmel_port->clk); > > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] MAINTAINERS: add maintainer entry for atmel i2c driver
On 03/15/2013 04:32 PM, ludovic.desroc...@atmel.com : > From: Ludovic Desroches > > Create an entry for atmel i2c driver: i2c-at91.c > > Signed-off-by: Ludovic Desroches Acked-by: Nicolas Ferre > --- > Hello, > > If there are no objections, I'll take the maintenance of the at91 i2c driver > since there is no maintainer. Sure, no objection ;-) Good luck! > Wolfram, can you take this patch or do I have to ask someone else? > > Regards > > Ludovic > > > MAINTAINERS | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 9561658..d667ecc 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1467,6 +1467,12 @@ F: drivers/dma/at_hdmac.c > F: drivers/dma/at_hdmac_regs.h > F: include/linux/platform_data/dma-atmel.h > > +ATMEL I2C DRIVER > +M: Ludovic Desroches > +L: linux-...@vger.kernel.org > +S: Supported > +F: drivers/i2c/busses/i2c-at91.c > + > ATMEL ISI DRIVER > M: Josh Wu > L: linux-me...@vger.kernel.org > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] rtc: rtc-at91rm9200: use a variable for storing IMR
On some revisions of AT91 SoCs, the RTC IMR register is not working. Instead of elaborating a workaround for that specific SoC or IP version, we simply use a software variable to store the Interrupt Mask Register and modify it for each enabling/disabling of an interrupt. The overhead of this is negligible anyway. Reported-by: Douglas Gilbert Signed-off-by: Nicolas Ferre --- drivers/rtc/rtc-at91rm9200.c | 50 +++- drivers/rtc/rtc-at91rm9200.h | 1 - 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index 79233d0..29b92e4 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -46,6 +46,7 @@ static DECLARE_COMPLETION(at91_rtc_updated); static unsigned int at91_alarm_year = AT91_RTC_EPOCH; static void __iomem *at91_rtc_regs; static int irq; +static u32 at91_rtc_imr; /* * Decode time/date into rtc_time structure @@ -110,9 +111,11 @@ static int at91_rtc_settime(struct device *dev, struct rtc_time *tm) cr = at91_rtc_read(AT91_RTC_CR); at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM); + at91_rtc_imr |= AT91_RTC_ACKUPD; at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD); wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */ at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD); + at91_rtc_imr &= ~AT91_RTC_ACKUPD; at91_rtc_write(AT91_RTC_TIMR, bin2bcd(tm->tm_sec) << 0 @@ -144,7 +147,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); tm->tm_year = at91_alarm_year - 1900; - alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM) + alrm->enabled = (at91_rtc_imr & AT91_RTC_ALARM) ? 1 : 0; dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, @@ -170,6 +173,7 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) tm.tm_sec = alrm->time.tm_sec; at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); + at91_rtc_imr &= ~AT91_RTC_ALARM; at91_rtc_write(AT91_RTC_TIMALR, bin2bcd(tm.tm_sec) << 0 | bin2bcd(tm.tm_min) << 8 @@ -182,6 +186,7 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) if (alrm->enabled) { at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); + at91_rtc_imr |= AT91_RTC_ALARM; at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); } @@ -198,9 +203,12 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) if (enabled) { at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM); + at91_rtc_imr |= AT91_RTC_ALARM; at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM); - } else + } else { at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM); + at91_rtc_imr &= ~AT91_RTC_ALARM; + } return 0; } @@ -209,12 +217,10 @@ static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) */ static int at91_rtc_proc(struct device *dev, struct seq_file *seq) { - unsigned long imr = at91_rtc_read(AT91_RTC_IMR); - seq_printf(seq, "update_IRQ\t: %s\n", - (imr & AT91_RTC_ACKUPD) ? "yes" : "no"); + (at91_rtc_imr & AT91_RTC_ACKUPD) ? "yes" : "no"); seq_printf(seq, "periodic_IRQ\t: %s\n", - (imr & AT91_RTC_SECEV) ? "yes" : "no"); + (at91_rtc_imr & AT91_RTC_SECEV) ? "yes" : "no"); return 0; } @@ -229,7 +235,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id) unsigned int rtsr; unsigned long events = 0; - rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read(AT91_RTC_IMR); + rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_imr; if (rtsr) { /* this interrupt is shared! Is it ours? */ if (rtsr & AT91_RTC_ALARM) events |= (RTC_AF | RTC_IRQF); @@ -293,6 +299,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV); + at91_rtc_imr = 0; ret = request_irq(irq, at91_rtc_interrupt, IRQF_SHARED, @@ -331,6 +338,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev) at91_rtc_write(AT91_RTC_IDR, AT91_RTC
[PATCH] USB: ohci-at91: fix PIO handling in relation with number of ports
If the number of ports present on the SoC/board is not the maximum and that the platform data is not filled with all data, there is an easy way to mess the PIO setup for this interface. This quick fix addresses mis-configuration in USB host platform data that is common in at91 boards since commit 0ee6d1e (USB: ohci-at91: change maximum number of ports) that did not modified the associatd board files. Reported-by: Klaus Falkner Signed-off-by: Nicolas Ferre Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: linux-...@vger.kernel.org Cc: Stable [3.4+] --- drivers/usb/host/ohci-at91.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index a665b3e..aaa8d2b 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -570,6 +570,16 @@ static int __devinit ohci_hcd_at91_drv_probe(struct platform_device *pdev) if (pdata) { at91_for_each_port(i) { + /* +* do not configure PIO if not in relation with +* real USB port on board +*/ + if (i >= pdata->ports) { + pdata->vbus_pin[i] = -EINVAL; + pdata->overcurrent_pin[i] = -EINVAL; + break; + } + if (!gpio_is_valid(pdata->vbus_pin[i])) continue; gpio = pdata->vbus_pin[i]; -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] USB: ohci-at91: fix PIO handling in relation with number of ports
On 08/29/2012 11:49 AM, Nicolas Ferre : > If the number of ports present on the SoC/board is not the maximum > and that the platform data is not filled with all data, there is > an easy way to mess the PIO setup for this interface. > This quick fix addresses mis-configuration in USB host platform data > that is common in at91 boards since commit 0ee6d1e (USB: ohci-at91: > change maximum number of ports) that did not modified the associatd > board files. > > Reported-by: Klaus Falkner > Signed-off-by: Nicolas Ferre > Cc: Alan Stern > Cc: Greg Kroah-Hartman > Cc: linux-...@vger.kernel.org > Cc: Stable [3.4+] Alan, Greg, gentle ping... I really would like to seen it landing in stable soon... Thanks, best regards, > --- > drivers/usb/host/ohci-at91.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c > index a665b3e..aaa8d2b 100644 > --- a/drivers/usb/host/ohci-at91.c > +++ b/drivers/usb/host/ohci-at91.c > @@ -570,6 +570,16 @@ static int __devinit ohci_hcd_at91_drv_probe(struct > platform_device *pdev) > > if (pdata) { > at91_for_each_port(i) { > + /* > + * do not configure PIO if not in relation with > + * real USB port on board > + */ > + if (i >= pdata->ports) { > + pdata->vbus_pin[i] = -EINVAL; > + pdata->overcurrent_pin[i] = -EINVAL; > + break; > + } > + > if (!gpio_is_valid(pdata->vbus_pin[i])) > continue; > gpio = pdata->vbus_pin[i]; > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 01/10] net/macb: Add support for Gigabit Ethernet mode
From: Patrice Vilchez Add Gigabit Ethernet mode to GEM cadence IP and enable RGMII connection. Signed-off-by: Patrice Vilchez Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 15 --- drivers/net/ethernet/cadence/macb.h |4 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 033064b..9a10f69 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -152,13 +152,17 @@ static void macb_handle_link_change(struct net_device *dev) reg = macb_readl(bp, NCFGR); reg &= ~(MACB_BIT(SPD) | MACB_BIT(FD)); + if (macb_is_gem(bp)) + reg &= ~GEM_BIT(GBE); if (phydev->duplex) reg |= MACB_BIT(FD); if (phydev->speed == SPEED_100) reg |= MACB_BIT(SPD); + if (phydev->speed == SPEED_1000) + reg |= GEM_BIT(GBE); - macb_writel(bp, NCFGR, reg); + macb_or_gem_writel(bp, NCFGR, reg); bp->speed = phydev->speed; bp->duplex = phydev->duplex; @@ -216,7 +220,10 @@ static int macb_mii_probe(struct net_device *dev) } /* mask with MAC supported features */ - phydev->supported &= PHY_BASIC_FEATURES; + if (macb_is_gem(bp)) + phydev->supported &= PHY_GBIT_FEATURES; + else + phydev->supported &= PHY_BASIC_FEATURES; phydev->advertising = phydev->supported; @@ -1384,7 +1391,9 @@ static int __init macb_probe(struct platform_device *pdev) bp->phy_interface = err; } - if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) + if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII) + macb_or_gem_writel(bp, USRIO, GEM_BIT(RGMII)); + else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) #if defined(CONFIG_ARCH_AT91) macb_or_gem_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN))); diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 335e288..f69ceef 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -145,6 +145,8 @@ #define MACB_IRXFCS_SIZE 1 /* GEM specific NCFGR bitfields. */ +#define GEM_GBE_OFFSET 10 +#define GEM_GBE_SIZE 1 #define GEM_CLK_OFFSET 18 #define GEM_CLK_SIZE 3 #define GEM_DBW_OFFSET 21 @@ -246,6 +248,8 @@ /* Bitfields in USRIO (AT91) */ #define MACB_RMII_OFFSET 0 #define MACB_RMII_SIZE 1 +#define GEM_RGMII_OFFSET 0 /* GEM gigabit mode */ +#define GEM_RGMII_SIZE 1 #define MACB_CLKEN_OFFSET 1 #define MACB_CLKEN_SIZE1 -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 03/10] net/macb: change debugging messages
From: Havard Skinnemoen Convert some noisy netdev_dbg() statements to netdev_vdbg(). Defining DEBUG will no longer fill up the logs; VERBOSE_DEBUG still does. Add one more verbose debug for ISR status. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics, add ISR status] Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 26ca01e..2228dfc 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -313,7 +313,7 @@ static void macb_tx(struct macb *bp) status = macb_readl(bp, TSR); macb_writel(bp, TSR, status); - netdev_dbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); + netdev_vdbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { int i; @@ -380,7 +380,7 @@ static void macb_tx(struct macb *bp) if (!(bufstat & MACB_BIT(TX_USED))) break; - netdev_dbg(bp->dev, "skb %u (data %p) TX complete\n", + netdev_vdbg(bp->dev, "skb %u (data %p) TX complete\n", tail, skb->data); dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len, DMA_TO_DEVICE); @@ -406,7 +406,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, len = MACB_BFEXT(RX_FRMLEN, bp->rx_ring[last_frag].ctrl); - netdev_dbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n", + netdev_vdbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n", first_frag, last_frag, len); skb = netdev_alloc_skb(bp->dev, len + RX_OFFSET); @@ -453,7 +453,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, bp->stats.rx_packets++; bp->stats.rx_bytes += len; - netdev_dbg(bp->dev, "received skb of length %u, csum: %08x\n", + netdev_vdbg(bp->dev, "received skb of length %u, csum: %08x\n", skb->len, skb->csum); netif_receive_skb(skb); @@ -535,7 +535,7 @@ static int macb_poll(struct napi_struct *napi, int budget) work_done = 0; - netdev_dbg(bp->dev, "poll: status = %08lx, budget = %d\n", + netdev_vdbg(bp->dev, "poll: status = %08lx, budget = %d\n", (unsigned long)status, budget); work_done = macb_rx(bp, budget); @@ -574,6 +574,8 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) break; } + netdev_vdbg(bp->dev, "isr = 0x%08lx\n", (unsigned long)status); + if (status & MACB_RX_INT_FLAGS) { /* * There's no point taking any more interrupts @@ -585,7 +587,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) macb_writel(bp, IDR, MACB_RX_INT_FLAGS); if (napi_schedule_prep(&bp->napi)) { - netdev_dbg(bp->dev, "scheduling RX softirq\n"); + netdev_vdbg(bp->dev, "scheduling RX softirq\n"); __napi_schedule(&bp->napi); } } @@ -647,8 +649,8 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) u32 ctrl; unsigned long flags; -#ifdef DEBUG - netdev_dbg(bp->dev, +#if defined(DEBUG) && defined(VERBOSE_DEBUG) + netdev_vdbg(bp->dev, "start_xmit: len %u head %p data %p tail %p end %p\n", skb->len, skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb)); @@ -670,12 +672,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) } entry = bp->tx_head; - netdev_dbg(bp->dev, "Allocated ring entry %u\n", entry); + netdev_vdbg(bp->dev, "Allocated ring entry %u\n", entry); mapping = dma_map_single(&bp->pdev->dev, skb->data, len, DMA_TO_DEVICE); bp->tx_skb[entry].skb = skb; bp->tx_skb[entry].mapping = mapping; - netdev_dbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n", + netdev_vdbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n", skb->data, (unsigned long)mapping); ctrl = MACB_BF(TX_FRMLEN, len); -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 04/10] net/macb: Fix a race in macb_start_xmit()
From: Havard Skinnemoen Fix a race in macb_start_xmit() where we unconditionally set the TSTART bit. If an underrun just happened (we do this with interrupts disabled, so it might not have been handled yet), the controller starts transmitting from the first entry in the ring, which is usually wrong. Restart the controller after error handling. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics] Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 2228dfc..f4b8adf 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -390,6 +390,13 @@ static void macb_tx(struct macb *bp) dev_kfree_skb_irq(skb); } + /* +* Someone may have submitted a new frame while this interrupt +* was pending, or we may just have handled an error. +*/ + if (head != tail && !(status & MACB_BIT(TGO))) + macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART)); + bp->tx_tail = tail; if (netif_queue_stopped(bp->dev) && TX_BUFFS_AVAIL(bp) > MACB_TX_WAKEUP_THRESH) @@ -696,7 +703,18 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) skb_tx_timestamp(skb); - macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART)); + /* +* Only start the controller if the queue was empty; otherwise +* we may race against the hardware resetting the ring pointer +* due to a transmit error. +* +* If the controller is idle but the queue isn't empty, there +* must be a pending interrupt that will trigger as soon as we +* re-enable interrupts, and the interrupt handler will make +* sure the controler is started. +*/ + if (NEXT_TX(bp->tx_tail) == bp->tx_head) + macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART)); if (TX_BUFFS_AVAIL(bp) < 1) netif_stop_queue(dev); -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 00/10] net/macb: driver enhancement concerning GEM support, ring logic and cleanup
This is an enhancement work that began several years ago. I try to catchup with some performance improvement that has been implemented then by Havard. The ring index logic and the TX error path modification are the biggest changes but some cleanup/debugging have been added along the way. The GEM revision will benefit from the Gigabit support. The series has been tested on several Atmel AT91 SoC with the two MACB/GEM flavors. Havard Skinnemoen (5): net/macb: memory barriers cleanup net/macb: change debugging messages net/macb: Fix a race in macb_start_xmit() net/macb: clean up ring buffer logic net/macb: Offset first RX buffer by two bytes Nicolas Ferre (4): net/macb: better manage tx errors net/macb: tx status is more than 8 bits now net/macb: macb_get_drvinfo: add GEM/MACB suffix to differentiate revision net/macb: ethtool interface: add register dump feature Patrice Vilchez (1): net/macb: Add support for Gigabit Ethernet mode drivers/net/ethernet/cadence/macb.c | 408 --- drivers/net/ethernet/cadence/macb.h | 29 ++- 2 files changed, 304 insertions(+), 133 deletions(-) -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 02/10] net/macb: memory barriers cleanup
From: Havard Skinnemoen Remove a couple of unneeded barriers and document the remaining ones. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics] Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 9a10f69..26ca01e 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -372,7 +372,9 @@ static void macb_tx(struct macb *bp) BUG_ON(skb == NULL); + /* Make hw descriptor updates visible to CPU */ rmb(); + bufstat = bp->tx_ring[tail].ctrl; if (!(bufstat & MACB_BIT(TX_USED))) @@ -415,7 +417,10 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, if (frag == last_frag) break; } + + /* Make descriptor updates visible to hardware */ wmb(); + return 1; } @@ -436,12 +441,14 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, frag_len); offset += RX_BUFFER_SIZE; bp->rx_ring[frag].addr &= ~MACB_BIT(RX_USED); - wmb(); if (frag == last_frag) break; } + /* Make descriptor updates visible to hardware */ + wmb(); + skb->protocol = eth_type_trans(skb, bp->dev); bp->stats.rx_packets++; @@ -461,6 +468,8 @@ static void discard_partial_frame(struct macb *bp, unsigned int begin, for (frag = begin; frag != end; frag = NEXT_RX(frag)) bp->rx_ring[frag].addr &= ~MACB_BIT(RX_USED); + + /* Make descriptor updates visible to hardware */ wmb(); /* @@ -479,7 +488,9 @@ static int macb_rx(struct macb *bp, int budget) for (; budget > 0; tail = NEXT_RX(tail)) { u32 addr, ctrl; + /* Make hw descriptor updates visible to CPU */ rmb(); + addr = bp->rx_ring[tail].addr; ctrl = bp->rx_ring[tail].ctrl; @@ -674,6 +685,8 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) bp->tx_ring[entry].addr = mapping; bp->tx_ring[entry].ctrl = ctrl; + + /* Make newly initialized descriptor visible to hardware */ wmb(); entry = NEXT_TX(entry); @@ -782,9 +795,6 @@ static void macb_init_rings(struct macb *bp) static void macb_reset_hw(struct macb *bp) { - /* Make sure we have the write buffer for ourselves */ - wmb(); - /* * Disable RX and TX (XXX: Should we halt the transmission * more gracefully?) -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 05/10] net/macb: clean up ring buffer logic
From: Havard Skinnemoen Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize the chances of messing this up. This makes the code slightly smaller, and hopefully faster as well. Also, doing the ring buffer management this way will simplify things a lot when making the ring sizes configurable in the future. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics, adapt to newer kernel] Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 170 ++- drivers/net/ethernet/cadence/macb.h | 22 +++-- 2 files changed, 123 insertions(+), 69 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index f4b8adf..3d3a077 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -31,24 +31,13 @@ #define RX_BUFFER_SIZE 128 #define RX_RING_SIZE 512 -#define RX_RING_BYTES (sizeof(struct dma_desc) * RX_RING_SIZE) +#define RX_RING_BYTES (sizeof(struct macb_dma_desc) * RX_RING_SIZE) /* Make the IP header word-aligned (the ethernet header is 14 bytes) */ #define RX_OFFSET 2 #define TX_RING_SIZE 128 -#define DEF_TX_RING_PENDING(TX_RING_SIZE - 1) -#define TX_RING_BYTES (sizeof(struct dma_desc) * TX_RING_SIZE) - -#define TX_RING_GAP(bp)\ - (TX_RING_SIZE - (bp)->tx_pending) -#define TX_BUFFS_AVAIL(bp) \ - (((bp)->tx_tail <= (bp)->tx_head) ? \ -(bp)->tx_tail + (bp)->tx_pending - (bp)->tx_head : \ -(bp)->tx_tail - (bp)->tx_head - TX_RING_GAP(bp)) -#define NEXT_TX(n) (((n) + 1) & (TX_RING_SIZE - 1)) - -#define NEXT_RX(n) (((n) + 1) & (RX_RING_SIZE - 1)) +#define TX_RING_BYTES (sizeof(struct macb_dma_desc) * TX_RING_SIZE) /* minimum number of free TX descriptors before waking up TX process */ #define MACB_TX_WAKEUP_THRESH (TX_RING_SIZE / 4) @@ -56,6 +45,51 @@ #define MACB_RX_INT_FLAGS (MACB_BIT(RCOMP) | MACB_BIT(RXUBR) \ | MACB_BIT(ISR_ROVR)) +/* Ring buffer accessors */ +static unsigned int macb_tx_ring_wrap(unsigned int index) +{ + return index & (TX_RING_SIZE - 1); +} + +static unsigned int macb_tx_ring_avail(struct macb *bp) +{ + return TX_RING_SIZE - (bp->tx_head - bp->tx_tail); +} + +static struct macb_dma_desc *macb_tx_desc(struct macb *bp, unsigned int index) +{ + return &bp->tx_ring[macb_tx_ring_wrap(index)]; +} + +static struct macb_tx_skb *macb_tx_skb(struct macb *bp, unsigned int index) +{ + return &bp->tx_skb[macb_tx_ring_wrap(index)]; +} + +static dma_addr_t macb_tx_dma(struct macb *bp, unsigned int index) +{ + dma_addr_t offset; + + offset = macb_tx_ring_wrap(index) * sizeof(struct macb_dma_desc); + + return bp->tx_ring_dma + offset; +} + +static unsigned int macb_rx_ring_wrap(unsigned int index) +{ + return index & (RX_RING_SIZE - 1); +} + +static struct macb_dma_desc *macb_rx_desc(struct macb *bp, unsigned int index) +{ + return &bp->rx_ring[macb_rx_ring_wrap(index)]; +} + +static void *macb_rx_buffer(struct macb *bp, unsigned int index) +{ + return bp->rx_buffers + RX_BUFFER_SIZE * macb_rx_ring_wrap(index); +} + static void __macb_set_hwaddr(struct macb *bp) { u32 bottom; @@ -335,17 +369,18 @@ static void macb_tx(struct macb *bp) bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP); /* free transmit buffer in upper layer*/ - for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) { - struct ring_info *rp = &bp->tx_skb[tail]; - struct sk_buff *skb = rp->skb; - - BUG_ON(skb == NULL); + for (tail = bp->tx_tail; tail != head; tail++) { + struct macb_tx_skb *tx_skb; + struct sk_buff *skb; rmb(); - dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len, -DMA_TO_DEVICE); - rp->skb = NULL; + tx_skb = macb_tx_skb(bp, tail); + skb = tx_skb->skb; + + dma_unmap_single(&bp->pdev->dev, tx_skb->mapping, + skb->len, DMA_TO_DEVICE); + tx_skb->skb = NULL; dev_kfree_skb_irq(skb); } @@ -365,28 +400,32 @@ static void macb_tx(s
[PATCH 07/10] net/macb: tx status is more than 8 bits now
On some revision of GEM, TSR status register is has more information. Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index af71151..bd331fd 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -390,7 +390,7 @@ static void macb_tx_interrupt(struct macb *bp) status = macb_readl(bp, TSR); macb_writel(bp, TSR, status); - netdev_vdbg(bp->dev, "macb_tx_interrupt status = %02lx\n", + netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n", (unsigned long)status); head = bp->tx_head; -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 06/10] net/macb: better manage tx errors
Handle all TX errors, not only underruns. Reinitialize the TX ring after skipping all remaining frames, and restart the controller when everything has been cleaned up properly. Original idea from a patch by Havard Skinnemoen. Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 124 --- 1 file changed, 71 insertions(+), 53 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 3d3a077..af71151 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -44,6 +44,10 @@ #define MACB_RX_INT_FLAGS (MACB_BIT(RCOMP) | MACB_BIT(RXUBR) \ | MACB_BIT(ISR_ROVR)) +#define MACB_TX_INT_FLAGS (MACB_BIT(ISR_TUND) \ + | MACB_BIT(ISR_RLE) \ + | MACB_BIT(TXERR) \ + | MACB_BIT(TCOMP)) /* Ring buffer accessors */ static unsigned int macb_tx_ring_wrap(unsigned int index) @@ -338,66 +342,56 @@ static void macb_update_stats(struct macb *bp) *p += __raw_readl(reg); } -static void macb_tx(struct macb *bp) +static void macb_handle_tx_error(struct macb *bp, unsigned int err_tail, u32 ctrl) { - unsigned int tail; - unsigned int head; - u32 status; - - status = macb_readl(bp, TSR); - macb_writel(bp, TSR, status); + struct macb_tx_skb *tx_skb; + struct sk_buff *skb; + unsigned inthead = bp->tx_head; - netdev_vdbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); + netdev_dbg(bp->dev, "TX error: ctrl 0x%08x, head %u, error tail %u\n", + ctrl, head, err_tail); - if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { - int i; - netdev_err(bp->dev, "TX %s, resetting buffers\n", - status & MACB_BIT(UND) ? - "underrun" : "retry limit exceeded"); - - /* Transfer ongoing, disable transmitter, to avoid confusion */ - if (status & MACB_BIT(TGO)) - macb_writel(bp, NCR, macb_readl(bp, NCR) & ~MACB_BIT(TE)); - - head = bp->tx_head; - - /*Mark all the buffer as used to avoid sending a lost buffer*/ - for (i = 0; i < TX_RING_SIZE; i++) - bp->tx_ring[i].ctrl = MACB_BIT(TX_USED); - - /* Add wrap bit */ - bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP); + /* +* "Buffers exhausted mid-frame" errors may only happen if the +* driver is buggy, so complain loudly about those. Statistics +* are updated by hardware. +*/ + if (ctrl & MACB_BIT(TX_BUF_EXHAUSTED)) + netdev_err(bp->dev, "BUG: TX buffers exhausted mid-frame\n"); - /* free transmit buffer in upper layer*/ - for (tail = bp->tx_tail; tail != head; tail++) { - struct macb_tx_skb *tx_skb; - struct sk_buff *skb; + /* +* Drop the frames that caused the error plus all remaining in queue. +* Free transmit buffers in upper layer. +*/ + for (; err_tail != head; err_tail++) { + struct macb_dma_desc*desc; - rmb(); + tx_skb = macb_tx_skb(bp, err_tail); + skb = tx_skb->skb; + dma_unmap_single(&bp->pdev->dev, tx_skb->mapping, skb->len, +DMA_TO_DEVICE); + dev_kfree_skb_irq(skb); + tx_skb->skb = NULL; - tx_skb = macb_tx_skb(bp, tail); - skb = tx_skb->skb; + desc = macb_tx_desc(bp, err_tail); + desc->ctrl |= MACB_BIT(TX_USED); + } - dma_unmap_single(&bp->pdev->dev, tx_skb->mapping, - skb->len, DMA_TO_DEVICE); - tx_skb->skb = NULL; - dev_kfree_skb_irq(skb); - } + /* Make descriptor updates visible to hardware */ + wmb(); +} - bp->tx_head = bp->tx_tail = 0; +static void macb_tx_interrupt(struct macb *bp) +{ + unsigned int tail; + unsigned int head; + u32 status; - /* Enable the transmitter again */ - if (status & MACB_BIT(TGO)) - macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TE)); - } + status = macb_readl(bp, TSR); + macb_writel(bp, TSR, status); - if (!(status & MACB_BIT(CO
[PATCH 09/10] net/macb: ethtool interface: add register dump feature
Add macb_get_regs() ethtool function and its helper function: macb_get_regs_len(). Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 40 +++ drivers/net/ethernet/cadence/macb.h |3 +++ 2 files changed, 43 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index c7c39f1..f31c0a7 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -1321,10 +1321,50 @@ static void macb_get_drvinfo(struct net_device *dev, strcpy(info->bus_info, dev_name(&bp->pdev->dev)); } +static int macb_get_regs_len(struct net_device *netdev) +{ + return MACB_GREGS_LEN * sizeof(u32); +} + +static void macb_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + struct macb *bp = netdev_priv(dev); + unsigned int tail, head; + u32 *regs_buff = p; + +memset(p, 0, MACB_GREGS_LEN * sizeof(u32)); + regs->version = MACB_BFEXT(IDNUM, macb_readl(bp, MID)); + + tail = macb_tx_ring_wrap(bp->tx_tail); + head = macb_tx_ring_wrap(bp->tx_head); + + regs_buff[0] = macb_readl(bp, NCR); + regs_buff[1] = macb_or_gem_readl(bp, NCFGR); + regs_buff[2] = macb_readl(bp, NSR); + regs_buff[3] = macb_readl(bp, TSR); + regs_buff[4] = macb_readl(bp, RBQP); + regs_buff[5] = macb_readl(bp, TBQP); + regs_buff[6] = macb_readl(bp, RSR); + regs_buff[7] = macb_readl(bp, IMR); + + regs_buff[8] = tail; + regs_buff[9] = head; + regs_buff[10] = macb_tx_dma(bp, tail); + regs_buff[11] = macb_tx_dma(bp, head); + + if (macb_is_gem(bp)) { + regs_buff[12] = gem_readl(bp, USRIO); + regs_buff[13] = gem_readl(bp, DMACFG); + } +} + static const struct ethtool_ops macb_ethtool_ops = { .get_settings = macb_get_settings, .set_settings = macb_set_settings, .get_drvinfo= macb_get_drvinfo, + .get_regs_len = macb_get_regs_len, + .get_regs = macb_get_regs, .get_link = ethtool_op_get_link, .get_ts_info= ethtool_op_get_ts_info, }; diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 8a4ee2f..d509e88 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -10,6 +10,9 @@ #ifndef _MACB_H #define _MACB_H + +#define MACB_GREGS_LEN 32 + /* MACB register offsets */ #define MACB_NCR 0x #define MACB_NCFGR 0x0004 -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 08/10] net/macb: macb_get_drvinfo: add GEM/MACB suffix to differentiate revision
Add an indication about which revision of the hardware we are running in info->driver string. Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index bd331fd..c7c39f1 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -1313,6 +1313,10 @@ static void macb_get_drvinfo(struct net_device *dev, struct macb *bp = netdev_priv(dev); strcpy(info->driver, bp->pdev->dev.driver->name); + if (macb_is_gem(bp)) + strcat(info->driver, " GEM"); + else + strcat(info->driver, " MACB"); strcpy(info->version, "$Revision: 1.14 $"); strcpy(info->bus_info, dev_name(&bp->pdev->dev)); } -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 10/10] net/macb: Offset first RX buffer by two bytes
From: Havard Skinnemoen Make the ethernet frame payload word-aligned, possibly making the memcpy into the skb a bit faster. This will be even more important after we eliminate the copy altogether. Also eliminate the redundant RX_OFFSET constant -- it has the same definition and purpose as NET_IP_ALIGN. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: adapt to newer kernel] Signed-off-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index f31c0a7..f7716b6 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -33,9 +33,6 @@ #define RX_RING_SIZE 512 #define RX_RING_BYTES (sizeof(struct macb_dma_desc) * RX_RING_SIZE) -/* Make the IP header word-aligned (the ethernet header is 14 bytes) */ -#define RX_OFFSET 2 - #define TX_RING_SIZE 128 #define TX_RING_BYTES (sizeof(struct macb_dma_desc) * TX_RING_SIZE) @@ -466,7 +463,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, { unsigned int len; unsigned int frag; - unsigned int offset = 0; + unsigned int offset; struct sk_buff *skb; struct macb_dma_desc *desc; @@ -477,7 +474,16 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, macb_rx_ring_wrap(first_frag), macb_rx_ring_wrap(last_frag), len); - skb = netdev_alloc_skb(bp->dev, len + RX_OFFSET); + /* +* The ethernet header starts NET_IP_ALIGN bytes into the +* first buffer. Since the header is 14 bytes, this makes the +* payload word-aligned. +* +* Instead of calling skb_reserve(NET_IP_ALIGN), we just copy +* the two padding bytes into the skb so that we avoid hitting +* the slowpath in memcpy(), and pull them off afterwards. +*/ + skb = netdev_alloc_skb(bp->dev, len + NET_IP_ALIGN); if (!skb) { bp->stats.rx_dropped++; for (frag = first_frag; ; frag++) { @@ -493,7 +499,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, return 1; } - skb_reserve(skb, RX_OFFSET); + offset = 0; + len += NET_IP_ALIGN; skb_checksum_none_assert(skb); skb_put(skb, len); @@ -517,10 +524,11 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, /* Make descriptor updates visible to hardware */ wmb(); + __skb_pull(skb, NET_IP_ALIGN); skb->protocol = eth_type_trans(skb, bp->dev); bp->stats.rx_packets++; - bp->stats.rx_bytes += len; + bp->stats.rx_bytes += skb->len; netdev_vdbg(bp->dev, "received skb of length %u, csum: %08x\n", skb->len, skb->csum); netif_receive_skb(skb); @@ -985,6 +993,7 @@ static void macb_init_hw(struct macb *bp) __macb_set_hwaddr(bp); config = macb_mdc_clk_div(bp); + config |= MACB_BF(RBOF, NET_IP_ALIGN); /* Make eth data aligned */ config |= MACB_BIT(PAE);/* PAuse Enable */ config |= MACB_BIT(DRFCS); /* Discard Rx FCS */ config |= MACB_BIT(BIG);/* Receive oversized frames */ -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 01/16] ARM: at91: move platform_data definitions
On 09/11/2012 03:20 PM, Jean-Christophe PLAGNIOL-VILLARD : > On 14:59 Tue 11 Sep , Arnd Bergmann wrote: >> Platform data for device drivers should be defined in >> include/linux/platform_data/*.h, not in the architecture >> and platform specific directories. >> >> This moves such data out of the at91 include directories >> >> Signed-off-by: Arnd Bergmann >> Cc: Nicolas Ferre >> Cc: Jean-Christophe Plagniol-Villard >> Cc: Vinod Koul >> Cc: Dan Williams >> --- >> arch/arm/mach-at91/at91sam9g45_devices.c |2 >> +- >> arch/arm/mach-at91/at91sam9rl_devices.c |2 >> +- >> arch/arm/mach-at91/include/mach/atmel-mci.h |2 >> +- >> drivers/dma/at_hdmac_regs.h |2 >> +- >> include/linux/platform_data/atmel-aes.h |2 >> +- >> .../mach/at_hdmac.h => include/linux/platform_data/dma-atmel.h |0 >> 6 files changed, 5 insertions(+), 5 deletions(-) >> rename arch/arm/mach-at91/include/mach/at_hdmac.h => >> include/linux/platform_data/dma-atmel.h (100%) >> >> diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c >> b/arch/arm/mach-at91/at91sam9g45_devices.c >> index 0607399..0aa9bdb 100644 >> --- a/arch/arm/mach-at91/at91sam9g45_devices.c >> +++ b/arch/arm/mach-at91/at91sam9g45_devices.c >> @@ -31,7 +31,7 @@ >> #include >> #include >> #include >> -#include >> +#include >> #include >> >> #include >> diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c >> b/arch/arm/mach-at91/at91sam9rl_devices.c >> index f09fff9..e4da717 100644 >> --- a/arch/arm/mach-at91/at91sam9rl_devices.c >> +++ b/arch/arm/mach-at91/at91sam9rl_devices.c >> @@ -22,7 +22,7 @@ >> #include >> #include >> #include >> -#include >> +#include > I prefer to have all of them in atmel.h > > as I started Sorry J. but I do not agree: - ok for what is currently in include/mach/board.h ==> platform_data/atmel.h - no for individual drivers that have already a dedicated header file So for this move of at_hdmac.h ==> dma-atmel.h Acked-by: Nicolas Ferre Best regards, >> #include "generic.h" >> >> diff --git a/arch/arm/mach-at91/include/mach/atmel-mci.h >> b/arch/arm/mach-at91/include/mach/atmel-mci.h >> index 998cb0c..cd580a1 100644 >> --- a/arch/arm/mach-at91/include/mach/atmel-mci.h >> +++ b/arch/arm/mach-at91/include/mach/atmel-mci.h >> @@ -1,7 +1,7 @@ >> #ifndef __MACH_ATMEL_MCI_H >> #define __MACH_ATMEL_MCI_H >> >> -#include >> +#include >> >> /** >> * struct mci_dma_data - DMA data for MCI interface >> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h >> index 8a6c8e8..116e4ad 100644 >> --- a/drivers/dma/at_hdmac_regs.h >> +++ b/drivers/dma/at_hdmac_regs.h >> @@ -11,7 +11,7 @@ >> #ifndef AT_HDMAC_REGS_H >> #define AT_HDMAC_REGS_H >> >> -#include >> +#include >> >> #define AT_DMA_MAX_NR_CHANNELS 8 >> >> diff --git a/include/linux/platform_data/atmel-aes.h >> b/include/linux/platform_data/atmel-aes.h >> index e7a1949..ab68082 100644 >> --- a/include/linux/platform_data/atmel-aes.h >> +++ b/include/linux/platform_data/atmel-aes.h >> @@ -1,7 +1,7 @@ >> #ifndef __LINUX_ATMEL_AES_H >> #define __LINUX_ATMEL_AES_H >> >> -#include >> +#include >> >> /** >> * struct aes_dma_data - DMA data for AES >> diff --git a/arch/arm/mach-at91/include/mach/at_hdmac.h >> b/include/linux/platform_data/dma-atmel.h >> similarity index 100% >> rename from arch/arm/mach-at91/include/mach/at_hdmac.h >> rename to include/linux/platform_data/dma-atmel.h >> -- >> 1.7.10 >> > > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] dmaengine: at_hdmac: fix comment in atc_prep_slave_sg()
s/dma_memcpy/slave_sg/ and it is sg length that we are talking about. Signed-off-by: Nicolas Ferre Cc: Stable [2.6.31+] --- drivers/dma/at_hdmac.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 3934fcc..6c09e18 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -661,7 +661,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, flags); if (unlikely(!atslave || !sg_len)) { - dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n"); + dev_dbg(chan2dev(chan), "prep_slave_sg: sg length is zero!\n"); return NULL; } -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] dmaengine: at_hdmac: check that each sg data length is non-null
Avoid the construction of a malformed DMA request sent to the DMA controller. Log message is for debug only because this condition is unlikely to append and may only trigger at driver development time. Signed-off-by: Nicolas Ferre Cc: Stable [2.6.31+] --- drivers/dma/at_hdmac.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 6c09e18..7ab6e26 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -689,6 +689,11 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, mem = sg_dma_address(sg); len = sg_dma_len(sg); + if (unlikely(!len)) { + dev_dbg(chan2dev(chan), + "prep_slave_sg: sg(%d) data length is zero\n", i); + goto err; + } mem_width = 2; if (unlikely(mem & 3 || len & 3)) mem_width = 0; @@ -724,6 +729,11 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, mem = sg_dma_address(sg); len = sg_dma_len(sg); + if (unlikely(!len)) { + dev_dbg(chan2dev(chan), + "prep_slave_sg: sg(%d) data length is zero\n", i); + goto err; + } mem_width = 2; if (unlikely(mem & 3 || len & 3)) mem_width = 0; @@ -757,6 +767,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, err_desc_get: dev_err(chan2dev(chan), "not enough descriptors available\n"); +err: atc_desc_put(atchan, first); return NULL; } -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v11 0/4] AT91: replace old i2c-at91.c TWI driver
On 08/29/2012 09:28 AM, Nikolaus Voss : > The old driver has two main deficencies: > i) No repeated start (Sr) condiction is possible, this makes it unusable > e.g. for most SMBus transfers. > ii) I/O was done with polling/busy waiting what caused over-/underruns > even at light system loads and clock speeds. > > The new driver overcomes these deficencies and in addition allows for > more than one TWI interface. > > A remaining limitation is the fact, that only one repeated start is > possible (two concatenated messages). This limitation is imposed by > the hardware. However, this should not be a problem as all common > i2c-client communication does not rely on more than one repeated start. > > Changes since v11: > - corrected wrong id_entry on sam9261 twi gpio pdev Hi Wolfram, Despite the patch revision written in the subject, it is actually the real v12 patch series from Nikolaus. BTW, I suspect that you were not in copy... In addition to the "Tested-By" tag by Ludovic, you can add my: Reviewed-by: Nicolas Ferre > Nikolaus Voss (4): > drivers/i2c/busses/i2c-at91.c: remove old polling driver > Replace clk_lookup.con_id with clk_lookup.dev_id entries for twi clk > drivers/i2c/busses/i2c-at91.c: add new driver > G45 TWI: remove open drain setting for twi function gpios > > arch/arm/mach-at91/at91rm9200.c|1 + > arch/arm/mach-at91/at91rm9200_devices.c|9 + > arch/arm/mach-at91/at91sam9260.c |1 + > arch/arm/mach-at91/at91sam9261.c |1 + > arch/arm/mach-at91/at91sam9261_devices.c |9 + > arch/arm/mach-at91/at91sam9263.c |1 + > arch/arm/mach-at91/at91sam9g45.c |2 + > arch/arm/mach-at91/at91sam9g45_devices.c |6 - > arch/arm/mach-at91/at91sam9rl.c|2 + > arch/arm/mach-at91/at91sam9x5.c|3 + > arch/arm/mach-at91/include/mach/at91_twi.h | 68 > drivers/i2c/busses/Kconfig | 11 +- > drivers/i2c/busses/i2c-at91.c | 591 > ++-- > 13 files changed, 418 insertions(+), 287 deletions(-) > delete mode 100644 arch/arm/mach-at91/include/mach/at91_twi.h > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] at91_mci: use generic GPIO calls
From: David Brownell <[EMAIL PROTECTED]> Update the AT91 MMC driver to use the generic GPIO calls instead of the AT91-specific calls; and to request (and release) those GPIO signals. That required updating the probe() fault cleanup codepaths. Now there is a single sequence for freeing resources, in reverse order of their allocation. Also that code uses use dev_*() for messaging, and has less abuse of KERN_ERR. Likewise with updating remove() cleanup. This had to free the GPIOs, and while adding that code I noticed and fixed two other problems: it was poking at a workqueue owned by the mmc core; and in one (rare) case would try freeing an IRQ that it didn't allocate. Signed-off-by: David Brownell <[EMAIL PROTECTED]> Signed-off-by: Nicolas Ferre <[EMAIL PROTECTED]> --- Little update from previous patch to match the modification introduced by : http://lkml.org/lkml/2008/1/30/308 So it applies on to of it. drivers/mmc/host/at91_mci.c | 114 ++-- 1 file changed, 80 insertions(+), 34 deletions(-) --- linux-2.6-snapshot.orig/drivers/mmc/host/at91_mci.c +++ linux-2.6-snapshot/drivers/mmc/host/at91_mci.c @@ -70,10 +70,11 @@ #include #include +#include + #include #include #include -#include #include #define DRIVER_NAME "at91_mci" @@ -659,10 +660,10 @@ static void at91_mci_set_ios(struct mmc_ if (host->board->vcc_pin) { switch (ios->power_mode) { case MMC_POWER_OFF: - at91_set_gpio_value(host->board->vcc_pin, 0); + gpio_set_value(host->board->vcc_pin, 0); break; case MMC_POWER_UP: - at91_set_gpio_value(host->board->vcc_pin, 1); + gpio_set_value(host->board->vcc_pin, 1); break; default: break; @@ -769,7 +770,7 @@ static irqreturn_t at91_mci_irq(int irq, static irqreturn_t at91_mmc_det_irq(int irq, void *_host) { struct at91mci_host *host = _host; - int present = !at91_get_gpio_value(irq); + int present = !gpio_get_value(irq_to_gpio(irq)); /* * we expect this irq on both insert and remove, @@ -794,7 +795,7 @@ static int at91_mci_get_ro(struct mmc_ho struct at91mci_host *host = mmc_priv(mmc); if (host->board->wp_pin) { - read_only = at91_get_gpio_value(host->board->wp_pin); + read_only = gpio_get_value(host->board->wp_pin); printk(KERN_WARNING "%s: card is %s\n", mmc_hostname(mmc), (read_only ? "read-only" : "read-write") ); } @@ -821,8 +822,6 @@ static int __init at91_mci_probe(struct struct resource *res; int ret; - pr_debug("Probe MCI devices\n"); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENXIO; @@ -832,9 +831,9 @@ static int __init at91_mci_probe(struct mmc = mmc_alloc_host(sizeof(struct at91mci_host), &pdev->dev); if (!mmc) { - pr_debug("Failed to allocate mmc host\n"); - release_mem_region(res->start, res->end - res->start + 1); - return -ENOMEM; + ret = -ENOMEM; + dev_dbg(&pdev->dev, "couldn't allocate mmc host\n"); + goto fail6; } mmc->ops = &at91_mci_ops; @@ -854,19 +853,44 @@ static int __init at91_mci_probe(struct if (cpu_is_at91sam9260() || cpu_is_at91sam9263()) mmc->caps |= MMC_CAP_4_BIT_DATA; else - printk("AT91 MMC: 4 wire bus mode not supported" + dev_warn(&pdev->dev, "4 wire bus mode not supported" " - using 1 wire\n"); } /* +* Reserve GPIOs ... board init code makes sure these pins are set +* up as GPIOs with the right direction (input, except for vcc) +*/ + if (host->board->det_pin) { + ret = gpio_request(host->board->det_pin, "mmc_detect"); + if (ret < 0) { + dev_dbg(&pdev->dev, "couldn't claim card detect pin\n"); + goto fail5; + } + } + if (host->board->wp_pin) { + ret = gpio_request(host->board->wp_pin, "mmc_wp"); + if (ret < 0) { + dev_dbg(&pdev->dev, "couldn't claim wp sense pin\n"); + goto fail4; + } + } + if (host->board->vcc_pin) { + ret = gpio_request(host->board->vcc_p
Re: [PATCH 14/24] USB: ohci: merge ohci_finish_controller_resume with ohci_resume
On 10/04/2012 05:17 PM, Florian Fainelli : > Merge ohci_finish_controller_resume with ohci_resume as suggested by Alan > Stern. Since ohci_finish_controller_resume no longer exists, update the > various OHCI drivers to call ohci_resume() instead. Some drivers used to set > themselves the bit HCD_FLAG_HW_ACCESSIBLE, which is now handled by > ohci_resume(). > > Signed-off-by: Florian Fainelli > --- > drivers/usb/host/ohci-at91.c |2 +- Seems ok for AT91, so Acked-by: Nicolas Ferre Thanks Florian, bye, > drivers/usb/host/ohci-ep93xx.c |2 +- > drivers/usb/host/ohci-exynos.c |5 + > drivers/usb/host/ohci-hcd.c | 41 +++-- > drivers/usb/host/ohci-hub.c | 42 > -- > drivers/usb/host/ohci-omap.c |2 +- > drivers/usb/host/ohci-platform.c |2 +- > drivers/usb/host/ohci-pxa27x.c |2 +- > drivers/usb/host/ohci-s3c2410.c |3 +-- > drivers/usb/host/ohci-spear.c|2 +- > drivers/usb/host/ohci-tmio.c |2 +- > 11 files changed, 48 insertions(+), 57 deletions(-) > > diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c > index 0bf72f9..908d84a 100644 > --- a/drivers/usb/host/ohci-at91.c > +++ b/drivers/usb/host/ohci-at91.c > @@ -705,7 +705,7 @@ static int ohci_hcd_at91_drv_resume(struct > platform_device *pdev) > if (!clocked) > at91_start_clock(); > > - ohci_finish_controller_resume(hcd); > + ohci_resume(hcd, false); > return 0; > } > #else > diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c > index dbfbd1d..a982f04 100644 > --- a/drivers/usb/host/ohci-ep93xx.c > +++ b/drivers/usb/host/ohci-ep93xx.c > @@ -194,7 +194,7 @@ static int ohci_hcd_ep93xx_drv_resume(struct > platform_device *pdev) > > ep93xx_start_hc(&pdev->dev); > > - ohci_finish_controller_resume(hcd); > + ohci_resume(hcd, false); > return 0; > } > #endif > diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c > index fc3091b..53c5a989 100644 > --- a/drivers/usb/host/ohci-exynos.c > +++ b/drivers/usb/host/ohci-exynos.c > @@ -252,10 +252,7 @@ static int exynos_ohci_resume(struct device *dev) > if (pdata && pdata->phy_init) > pdata->phy_init(pdev, S5P_USB_PHY_HOST); > > - /* Mark hardware accessible again as we are out of D3 state by now */ > - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); > - > - ohci_finish_controller_resume(hcd); > + ohci_resume(hcd, false); > > return 0; > } > diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c > index 5d30992..568bdb3 100644 > --- a/drivers/usb/host/ohci-hcd.c > +++ b/drivers/usb/host/ohci-hcd.c > @@ -1003,13 +1003,50 @@ static int __maybe_unused ohci_suspend(struct usb_hcd > *hcd, bool do_wakeup) > > static int __maybe_unused ohci_resume(struct usb_hcd *hcd, bool hibernated) > { > + struct ohci_hcd *ohci = hcd_to_ohci(hcd); > + int port; > + boolneed_reinit = false; > + > set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); > > /* Make sure resume from hibernation re-enumerates everything */ > if (hibernated) > - ohci_usb_reset(hcd_to_ohci(hcd)); > + ohci_usb_reset(ohci); > + > + /* See if the controller is already running or has been reset */ > + ohci->hc_control = ohci_readl(ohci, &ohci->regs->control); > + if (ohci->hc_control & (OHCI_CTRL_IR | OHCI_SCHED_ENABLES)) { > + need_reinit = true; > + } else { > + switch (ohci->hc_control & OHCI_CTRL_HCFS) { > + case OHCI_USB_OPER: > + case OHCI_USB_RESET: > + need_reinit = true; > + } > + } > + > + /* If needed, reinitialize and suspend the root hub */ > + if (need_reinit) { > + spin_lock_irq(&ohci->lock); > + ohci_rh_resume(ohci); > + ohci_rh_suspend(ohci, 0); > + spin_unlock_irq(&ohci->lock); > + } > + > + /* Normally just turn on port power and enable interrupts */ > + else { > + ohci_dbg(ohci, "powerup ports\n"); > + for (port = 0; port < ohci->num_ports; port++) > + ohci_writel(ohci, RH_PS_PPS, > + &ohci->regs->roothub.portstatus[port]); > + > + ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrenable); > +
[PATCH 0/8] at91: 3.7 fixes patch series
Hi all, I am posting this patch series just before sending a pull-request to Arnd and Olof. There are 2 new patches that I have just cooked today about external IRQ handling: please review. I would like you to double check that I have not made any mistake while collecting the other patches... Thanks, best regards, Bo Shen (2): ARM: at91/i2c: change id to let i2c-gpio work ARM: at91/i2c: change id to let i2c-at91 work Ivan Shugov (1): ARM: at91: at91sam9g10: fix SOC type detection Jean-Christophe PLAGNIOL-VILLARD (1): ARM: at91: drop duplicated config SOC_AT91SAM9 entry Josh Wu (1): ARM: at91/tc: fix typo in the DT document Marek Belisko (1): ARM: at91/dts: at91sam9g20ek_common: Fix typos in buttons labels. Nicolas Ferre (2): ARM: at91: fix external interrupts in non-DT case ARM: at91: fix external interrupt specification in board code Documentation/devicetree/bindings/arm/atmel-at91.txt | 2 +- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 4 ++-- arch/arm/mach-at91/Kconfig | 10 ++ arch/arm/mach-at91/at91rm9200.c | 2 +- arch/arm/mach-at91/at91rm9200_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9260.c | 4 ++-- arch/arm/mach-at91/at91sam9260_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9261.c | 4 ++-- arch/arm/mach-at91/at91sam9261_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9rl_devices.c | 4 ++-- arch/arm/mach-at91/board-neocore926.c| 2 +- arch/arm/mach-at91/board-sam9261ek.c | 2 +- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/generic.h | 3 ++- arch/arm/mach-at91/irq.c | 9 +++-- arch/arm/mach-at91/setup.c | 4 ++-- 18 files changed, 35 insertions(+), 35 deletions(-) -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/8] ARM: at91/tc: fix typo in the DT document
From: Josh Wu Signed-off-by: Josh Wu Signed-off-by: Nicolas Ferre Cc: stable [v3.4] --- Documentation/devicetree/bindings/arm/atmel-at91.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt index ecc81e3..d187e9f 100644 --- a/Documentation/devicetree/bindings/arm/atmel-at91.txt +++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt @@ -8,7 +8,7 @@ PIT Timer required properties: shared across all System Controller members. TC/TCLIB Timer required properties: -- compatible: Should be "atmel,-pit". +- compatible: Should be "atmel,-tcb". can be "at91rm9200" or "at91sam9x5" - reg: Should contain registers location and length - interrupts: Should contain all interrupts for the TC block -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/8] ARM: at91: fix external interrupts in non-DT case
Management of external interrupts has changed but the non-DT code has not integrated these changes. Add a mask to pass external irq specification from SoC specific code to the at91_aic_init() function. Signed-off-by: Nicolas Ferre Cc: stable [v3.6] --- arch/arm/mach-at91/generic.h | 3 ++- arch/arm/mach-at91/irq.c | 9 +++-- arch/arm/mach-at91/setup.c | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index f496506..b62f560e 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h @@ -26,7 +26,8 @@ extern void __init at91_dt_initialize(void); extern void __init at91_init_irq_default(void); extern void __init at91_init_interrupts(unsigned int priority[]); extern void __init at91x40_init_interrupts(unsigned int priority[]); -extern void __init at91_aic_init(unsigned int priority[]); +extern void __init at91_aic_init(unsigned int priority[], +unsigned int ext_irq_mask); extern int __init at91_aic_of_init(struct device_node *node, struct device_node *parent); extern int __init at91_aic5_of_init(struct device_node *node, diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c index 1e02c0e..febc2ee 100644 --- a/arch/arm/mach-at91/irq.c +++ b/arch/arm/mach-at91/irq.c @@ -502,14 +502,19 @@ int __init at91_aic5_of_init(struct device_node *node, /* * Initialize the AIC interrupt controller. */ -void __init at91_aic_init(unsigned int *priority) +void __init at91_aic_init(unsigned int *priority, unsigned int ext_irq_mask) { unsigned int i; int irq_base; - if (at91_aic_pm_init()) + at91_extern_irq = kzalloc(BITS_TO_LONGS(n_irqs) + * sizeof(*at91_extern_irq), GFP_KERNEL); + + if (at91_aic_pm_init() || at91_extern_irq == NULL) panic("Unable to allocate bit maps\n"); + *at91_extern_irq = ext_irq_mask; + at91_aic_base = ioremap(AT91_AIC, 512); if (!at91_aic_base) panic("Unable to ioremap AIC registers\n"); diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index 6a3d4bb..0b32c81 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -47,7 +47,7 @@ void __init at91_init_irq_default(void) void __init at91_init_interrupts(unsigned int *priority) { /* Initialize the AIC interrupt controller */ - at91_aic_init(priority); + at91_aic_init(priority, at91_extern_irq); /* Enable GPIO interrupts */ at91_gpio_irq_setup(); -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/8] ARM: at91: fix external interrupt specification in board code
Since the switch to sparse irq, we have to add the NR_IRQS_LEGACY offset to static irq numbers. It has been forgotten on these SPI irq definitions in board code. Signed-off-by: Nicolas Ferre Cc: stable [v3.6] --- arch/arm/mach-at91/board-neocore926.c | 2 +- arch/arm/mach-at91/board-sam9261ek.c | 2 +- arch/arm/mach-at91/board-sam9263ek.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c index 9cda3fd..6960778 100644 --- a/arch/arm/mach-at91/board-neocore926.c +++ b/arch/arm/mach-at91/board-neocore926.c @@ -129,7 +129,7 @@ static struct spi_board_info neocore926_spi_devices[] = { .max_speed_hz = 125000 * 16, .bus_num= 0, .platform_data = &ads_info, - .irq= AT91SAM9263_ID_IRQ1, + .irq= NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1, }, #endif }; diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 27b3af1..a9167dd 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c @@ -309,7 +309,7 @@ static struct spi_board_info ek_spi_devices[] = { .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ .bus_num= 0, .platform_data = &ads_info, - .irq= AT91SAM9261_ID_IRQ0, + .irq= NR_IRQS_LEGACY + AT91SAM9261_ID_IRQ0, .controller_data = (void *) AT91_PIN_PA28, /* CS pin */ }, #endif diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 073e174..b87dbe2 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c @@ -132,7 +132,7 @@ static struct spi_board_info ek_spi_devices[] = { .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ .bus_num= 0, .platform_data = &ads_info, - .irq= AT91SAM9263_ID_IRQ1, + .irq= NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1, }, #endif }; -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/8] ARM: at91/dts: at91sam9g20ek_common: Fix typos in buttons labels.
From: Marek Belisko Signed-off-by: Marek Belisko Signed-off-by: Nicolas Ferre --- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi index b06c0db..e6391a4 100644 --- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi +++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi @@ -126,14 +126,14 @@ #size-cells = <0>; btn3 { - label = "Buttin 3"; + label = "Button 3"; gpios = <&pioA 30 1>; linux,code = <0x103>; gpio-key,wakeup; }; btn4 { - label = "Buttin 4"; + label = "Button 4"; gpios = <&pioA 31 1>; linux,code = <0x104>; gpio-key,wakeup; -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 6/8] ARM: at91/i2c: change id to let i2c-gpio work
From: Bo Shen The i2c core driver will turn the platform device ID to busnum When using platfrom device ID as -1, it means dynamically assigned the busnum. When writing code, we need to make sure the busnum, and call i2c_register_board_info(int busnum, ...) to register device if using -1, we do not know the value of busnum In order to solve this issue, set the platform device ID as a fix number Here using 0 to match the busnum used in i2c_regsiter_board_info() Signed-off-by: Bo Shen Acked-by: Jean Delvare Signed-off-by: Nicolas Ferre Cc: stable [very long time] --- arch/arm/mach-at91/at91rm9200_devices.c | 2 +- arch/arm/mach-at91/at91sam9260_devices.c | 2 +- arch/arm/mach-at91/at91sam9261_devices.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index a563189..7cd8053 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c @@ -479,7 +479,7 @@ static struct i2c_gpio_platform_data pdata = { static struct platform_device at91rm9200_twi_device = { .name = "i2c-gpio", - .id = -1, + .id = 0, .dev.platform_data = &pdata, }; diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index a76b868..44385a4 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c @@ -389,7 +389,7 @@ static struct i2c_gpio_platform_data pdata = { static struct platform_device at91sam9260_twi_device = { .name = "i2c-gpio", - .id = -1, + .id = 0, .dev.platform_data = &pdata, }; diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 9752f17..0256a00 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c @@ -285,7 +285,7 @@ static struct i2c_gpio_platform_data pdata = { static struct platform_device at91sam9261_twi_device = { .name = "i2c-gpio", - .id = -1, + .id = 0, .dev.platform_data = &pdata, }; diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 8dde220..23b6384 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c @@ -567,7 +567,7 @@ static struct i2c_gpio_platform_data pdata = { static struct platform_device at91sam9263_twi_device = { .name = "i2c-gpio", - .id = -1, + .id = 0, .dev.platform_data = &pdata, }; diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index d6ca054..3d2c81d 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c @@ -314,7 +314,7 @@ static struct i2c_gpio_platform_data pdata = { static struct platform_device at91sam9rl_twi_device = { .name = "i2c-gpio", - .id = -1, + .id = 0, .dev.platform_data = &pdata, }; -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 8/8] ARM: at91: drop duplicated config SOC_AT91SAM9 entry
From: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Acked-by: Nicolas Ferre --- arch/arm/mach-at91/Kconfig | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index b142071..0436242 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -21,19 +21,13 @@ config SOC_AT91SAM9 bool select CPU_ARM926T select GENERIC_CLOCKEVENTS + select MULTI_IRQ_HANDLER + select SPARSE_IRQ menu "Atmel AT91 System-on-Chip" comment "Atmel AT91 Processor" -config SOC_AT91SAM9 - bool - select AT91_SAM9_SMC - select AT91_SAM9_TIME - select CPU_ARM926T - select MULTI_IRQ_HANDLER - select SPARSE_IRQ - config SOC_AT91RM9200 bool "AT91RM9200" select CPU_ARM920T -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 7/8] ARM: at91/i2c: change id to let i2c-at91 work
From: Bo Shen The i2c core driver will turn the platform device ID to busnum When using platfrom device ID as -1, it means dynamically assigned the busnum. When writing code, we need to make sure the busnum, and call i2c_register_board_info(int busnum, ...) to register device if using -1, we do not know the value of busnum In order to solve this issue, set the platform device ID as a fix number Here using 0 to match the busnum used in i2c_regsiter_board_info() Signed-off-by: Bo Shen Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/at91rm9200.c | 2 +- arch/arm/mach-at91/at91rm9200_devices.c | 2 +- arch/arm/mach-at91/at91sam9260.c | 4 ++-- arch/arm/mach-at91/at91sam9260_devices.c | 2 +- arch/arm/mach-at91/at91sam9261.c | 4 ++-- arch/arm/mach-at91/at91sam9261_devices.c | 2 +- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 2 +- arch/arm/mach-at91/at91sam9rl_devices.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index b4f0565..5269825 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c @@ -187,7 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), - CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk), + CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200.0", &twi_clk), /* fake hclk clock */ CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), CLKDEV_CON_ID("pioA", &pioA_clk), diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 7cd8053..1e122bc 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c @@ -512,7 +512,7 @@ static struct resource twi_resources[] = { static struct platform_device at91rm9200_twi_device = { .name = "i2c-at91rm9200", - .id = -1, + .id = 0, .resource = twi_resources, .num_resources = ARRAY_SIZE(twi_resources), }; diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index ad29f93..f820261 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c @@ -211,8 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), - CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk), - CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk), + CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk), + CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi_clk), /* more usart lookup table for DT entries */ CLKDEV_CON_DEV_ID("usart", "f200.serial", &mck), CLKDEV_CON_DEV_ID("usart", "fffb.serial", &usart0_clk), diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 44385a4..aa1e587 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c @@ -421,7 +421,7 @@ static struct resource twi_resources[] = { }; static struct platform_device at91sam9260_twi_device = { - .id = -1, + .id = 0, .resource = twi_resources, .num_resources = ARRAY_SIZE(twi_resources), }; diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 8d999eb..04295c0 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c @@ -178,8 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), - CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk), - CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk), + CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261.0", &twi_clk), + CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi_clk), CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioB", &pioB_clk), CLKDEV_CON_ID("pioC", &pioC_clk), diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at
[PATCH 2/8] ARM: at91: at91sam9g10: fix SOC type detection
From: Ivan Shugov Newer at91sam9g10 SoC revision can't be detected, so the kernel can't boot with this kind of kernel panic: "AT91: Impossible to detect the SOC type" CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177 CPU: VIVT data cache, VIVT instruction cache Machine: Atmel AT91SAM9G10-EK Ignoring tag cmdline (using the default kernel command line) bootconsole [earlycon0] enabled Memory policy: ECC disabled, Data cache writeback Kernel panic - not syncing: AT91: Impossible to detect the SOC type [] (unwind_backtrace+0x0/0xe0) from [] (panic+0x78/0x1cc) [] (panic+0x78/0x1cc) from [] (at91_map_io+0x90/0xc8) [] (at91_map_io+0x90/0xc8) from [] (paging_init+0x564/0x6d0) [] (paging_init+0x564/0x6d0) from [] (setup_arch+0x464/0x704) [] (setup_arch+0x464/0x704) from [] (start_kernel+0x6c/0x2d4) [] (start_kernel+0x6c/0x2d4) from [<20008040>] (0x20008040) The reason for this is that the Debug Unit Chip ID Register has changed between Engineering Sample and definitive revision of the SoC. Changing the check of cidr to socid will address the problem. We do not integrate this check to the list just above because we also have to make sure that the extended id is disregarded. Signed-off-by: Ivan Shugov [nicolas.fe...@atmel.com: change commit message] Signed-off-by: Nicolas Ferre Cc: stable [v3.1] # since commit 8c3583b6 --- arch/arm/mach-at91/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index da9881b..6a3d4bb 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -151,7 +151,7 @@ static void __init soc_detect(u32 dbgu_base) } /* at91sam9g10 */ - if ((cidr & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { + if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { at91_soc_initdata.type = AT91_SOC_SAM9G10; at91_boot_soc = at91sam9261_soc; } -- 1.7.11.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[GIT PULL] at91: fixes for 3.7-rc3
Arnd, Olof, This is the first Atmel AT91 "fixes" update for the 3.7 kernel. The following changes since commit 6f0c0580b70c89094b3422ba81118c7b959c7556: Linux 3.7-rc2 (2012-10-20 12:11:32 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-fixes for you to fetch changes up to 08d04a135a1c2e24c4d4bc7bbafee5e0e58f80c6: ARM: at91: drop duplicated config SOC_AT91SAM9 entry (2012-10-24 18:08:48 +0200) A mix of typos and critical fixes. The most important ones are a duplicated definition of a Kconfig variable and the handling of external interrupts for non-DT case. The new at91sam9g10 was suffering a recognition issue due to an ID mis-interpreted: this was leading to a kernel panic. Bo Shen (2): ARM: at91/i2c: change id to let i2c-gpio work ARM: at91/i2c: change id to let i2c-at91 work Ivan Shugov (1): ARM: at91: at91sam9g10: fix SOC type detection Jean-Christophe PLAGNIOL-VILLARD (1): ARM: at91: drop duplicated config SOC_AT91SAM9 entry Josh Wu (1): ARM: at91/tc: fix typo in the DT document Marek Belisko (1): ARM: at91/dts: at91sam9g20ek_common: Fix typos in buttons labels. Nicolas Ferre (2): ARM: at91: fix external interrupts in non-DT case ARM: at91: fix external interrupt specification in board code Documentation/devicetree/bindings/arm/atmel-at91.txt | 2 +- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 4 ++-- arch/arm/mach-at91/Kconfig | 10 ++ arch/arm/mach-at91/at91rm9200.c | 2 +- arch/arm/mach-at91/at91rm9200_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9260.c | 4 ++-- arch/arm/mach-at91/at91sam9260_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9261.c | 4 ++-- arch/arm/mach-at91/at91sam9261_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9263_devices.c | 4 ++-- arch/arm/mach-at91/at91sam9rl_devices.c | 4 ++-- arch/arm/mach-at91/board-neocore926.c| 2 +- arch/arm/mach-at91/board-sam9261ek.c | 2 +- arch/arm/mach-at91/board-sam9263ek.c | 2 +- arch/arm/mach-at91/generic.h | 3 ++- arch/arm/mach-at91/irq.c | 9 +++-- arch/arm/mach-at91/setup.c | 4 ++-- 18 files changed, 35 insertions(+), 35 deletions(-) Thanks, best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 00/10] net/macb: driver enhancement concerning GEM support, ring logic and cleanup
This is an enhancement work that began several years ago. I try to catchup with some performance improvement that has been implemented then by Havard. The ring index logic and the TX error path modification are the biggest changes but some cleanup/debugging have been added along the way. The GEM revision will benefit from the Gigabit support. Newer pinctrl infrastructure support is added but it is optional. The series has been tested on several Atmel AT91 SoC with the two MACB/GEM flavors. v4: - remove unneeded device tree header includes - modified the computation of available entries in ring buffer v3: - rebased on net-next to take into account current effor to merge at91_ether with macb drivers - add additional patch to use the new pinctrl infrastructure v2: - modify the tx error handling: now uses a workqueue - information provided by ethtool -i were not accurate: removed Havard Skinnemoen (4): net/macb: memory barriers cleanup net/macb: change debugging messages net/macb: clean up ring buffer logic net/macb: Offset first RX buffer by two bytes Jean-Christophe PLAGNIOL-VILLARD (1): net/macb: add pinctrl consumer support Nicolas Ferre (4): net/macb: remove macb_get_drvinfo() net/macb: tx status is more than 8 bits now net/macb: ethtool interface: add register dump feature net/macb: better manage tx errors Patrice Vilchez (1): net/macb: Add support for Gigabit Ethernet mode drivers/net/ethernet/cadence/at91_ether.c | 6 +- drivers/net/ethernet/cadence/macb.c | 448 +- drivers/net/ethernet/cadence/macb.h | 30 +- 3 files changed, 337 insertions(+), 147 deletions(-) -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 02/10] net/macb: memory barriers cleanup
From: Havard Skinnemoen Remove a couple of unneeded barriers and document the remaining ones. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 0931cb7..e7f554d 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -373,7 +373,9 @@ static void macb_tx(struct macb *bp) BUG_ON(skb == NULL); + /* Make hw descriptor updates visible to CPU */ rmb(); + bufstat = bp->tx_ring[tail].ctrl; if (!(bufstat & MACB_BIT(TX_USED))) @@ -416,7 +418,10 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, if (frag == last_frag) break; } + + /* Make descriptor updates visible to hardware */ wmb(); + return 1; } @@ -437,12 +442,14 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, frag_len); offset += RX_BUFFER_SIZE; bp->rx_ring[frag].addr &= ~MACB_BIT(RX_USED); - wmb(); if (frag == last_frag) break; } + /* Make descriptor updates visible to hardware */ + wmb(); + skb->protocol = eth_type_trans(skb, bp->dev); bp->stats.rx_packets++; @@ -462,6 +469,8 @@ static void discard_partial_frame(struct macb *bp, unsigned int begin, for (frag = begin; frag != end; frag = NEXT_RX(frag)) bp->rx_ring[frag].addr &= ~MACB_BIT(RX_USED); + + /* Make descriptor updates visible to hardware */ wmb(); /* @@ -480,7 +489,9 @@ static int macb_rx(struct macb *bp, int budget) for (; budget > 0; tail = NEXT_RX(tail)) { u32 addr, ctrl; + /* Make hw descriptor updates visible to CPU */ rmb(); + addr = bp->rx_ring[tail].addr; ctrl = bp->rx_ring[tail].ctrl; @@ -675,6 +686,8 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) bp->tx_ring[entry].addr = mapping; bp->tx_ring[entry].ctrl = ctrl; + + /* Make newly initialized descriptor visible to hardware */ wmb(); entry = NEXT_TX(entry); @@ -783,9 +796,6 @@ static void macb_init_rings(struct macb *bp) static void macb_reset_hw(struct macb *bp) { - /* Make sure we have the write buffer for ourselves */ - wmb(); - /* * Disable RX and TX (XXX: Should we halt the transmission * more gracefully?) -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 03/10] net/macb: change debugging messages
From: Havard Skinnemoen Convert some noisy netdev_dbg() statements to netdev_vdbg(). Defining DEBUG will no longer fill up the logs; VERBOSE_DEBUG still does. Add one more verbose debug for ISR status. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics, add ISR status] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index e7f554d..b161d73 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -314,7 +314,7 @@ static void macb_tx(struct macb *bp) status = macb_readl(bp, TSR); macb_writel(bp, TSR, status); - netdev_dbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); + netdev_vdbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { int i; @@ -381,7 +381,7 @@ static void macb_tx(struct macb *bp) if (!(bufstat & MACB_BIT(TX_USED))) break; - netdev_dbg(bp->dev, "skb %u (data %p) TX complete\n", + netdev_vdbg(bp->dev, "skb %u (data %p) TX complete\n", tail, skb->data); dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len, DMA_TO_DEVICE); @@ -407,7 +407,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, len = MACB_BFEXT(RX_FRMLEN, bp->rx_ring[last_frag].ctrl); - netdev_dbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n", + netdev_vdbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n", first_frag, last_frag, len); skb = netdev_alloc_skb(bp->dev, len + RX_OFFSET); @@ -454,7 +454,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, bp->stats.rx_packets++; bp->stats.rx_bytes += len; - netdev_dbg(bp->dev, "received skb of length %u, csum: %08x\n", + netdev_vdbg(bp->dev, "received skb of length %u, csum: %08x\n", skb->len, skb->csum); netif_receive_skb(skb); @@ -536,7 +536,7 @@ static int macb_poll(struct napi_struct *napi, int budget) work_done = 0; - netdev_dbg(bp->dev, "poll: status = %08lx, budget = %d\n", + netdev_vdbg(bp->dev, "poll: status = %08lx, budget = %d\n", (unsigned long)status, budget); work_done = macb_rx(bp, budget); @@ -575,6 +575,8 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) break; } + netdev_vdbg(bp->dev, "isr = 0x%08lx\n", (unsigned long)status); + if (status & MACB_RX_INT_FLAGS) { /* * There's no point taking any more interrupts @@ -586,7 +588,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) macb_writel(bp, IDR, MACB_RX_INT_FLAGS); if (napi_schedule_prep(&bp->napi)) { - netdev_dbg(bp->dev, "scheduling RX softirq\n"); + netdev_vdbg(bp->dev, "scheduling RX softirq\n"); __napi_schedule(&bp->napi); } } @@ -648,8 +650,8 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) u32 ctrl; unsigned long flags; -#ifdef DEBUG - netdev_dbg(bp->dev, +#if defined(DEBUG) && defined(VERBOSE_DEBUG) + netdev_vdbg(bp->dev, "start_xmit: len %u head %p data %p tail %p end %p\n", skb->len, skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb)); @@ -671,12 +673,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) } entry = bp->tx_head; - netdev_dbg(bp->dev, "Allocated ring entry %u\n", entry); + netdev_vdbg(bp->dev, "Allocated ring entry %u\n", entry); mapping = dma_map_single(&bp->pdev->dev, skb->data, len, DMA_TO_DEVICE); bp->tx_skb[entry].skb = skb; bp->tx_skb[entry].mapping = mapping; - netdev_dbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n", + netdev_vdbg(bp->dev, "Mapped skb data %p to DMA addr %08lx\n", skb->data, (unsigned long)mapping); ctrl = MACB_BF(TX_FRMLEN, len); -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 04/10] net/macb: remove macb_get_drvinfo()
This function has little meaning so remove it altogether and let ethtool core fill in the fields automatically. Signed-off-by: Nicolas Ferre Reviewed-by: Ben Hutchings Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index b161d73..4db52f3 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -1225,20 +1225,9 @@ static int macb_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) return phy_ethtool_sset(phydev, cmd); } -static void macb_get_drvinfo(struct net_device *dev, -struct ethtool_drvinfo *info) -{ - struct macb *bp = netdev_priv(dev); - - strcpy(info->driver, bp->pdev->dev.driver->name); - strcpy(info->version, "$Revision: 1.14 $"); - strcpy(info->bus_info, dev_name(&bp->pdev->dev)); -} - const struct ethtool_ops macb_ethtool_ops = { .get_settings = macb_get_settings, .set_settings = macb_set_settings, - .get_drvinfo= macb_get_drvinfo, .get_link = ethtool_op_get_link, .get_ts_info= ethtool_op_get_ts_info, }; -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 07/10] net/macb: ethtool interface: add register dump feature
Add macb_get_regs() ethtool function and its helper function: macb_get_regs_len(). The version field is deduced from the IP revision which gives the "MACB or GEM" information. An additional version field is reserved. Signed-off-by: Nicolas Ferre Reviewed-by: Ben Hutchings Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 40 + drivers/net/ethernet/cadence/macb.h | 3 +++ 2 files changed, 43 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index c432d41..78488b4 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -1273,9 +1273,49 @@ static int macb_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) return phy_ethtool_sset(phydev, cmd); } +static int macb_get_regs_len(struct net_device *netdev) +{ + return MACB_GREGS_NBR * sizeof(u32); +} + +static void macb_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + struct macb *bp = netdev_priv(dev); + unsigned int tail, head; + u32 *regs_buff = p; + + regs->version = (macb_readl(bp, MID) & ((1 << MACB_REV_SIZE) - 1)) + | MACB_GREGS_VERSION; + + tail = macb_tx_ring_wrap(bp->tx_tail); + head = macb_tx_ring_wrap(bp->tx_head); + + regs_buff[0] = macb_readl(bp, NCR); + regs_buff[1] = macb_or_gem_readl(bp, NCFGR); + regs_buff[2] = macb_readl(bp, NSR); + regs_buff[3] = macb_readl(bp, TSR); + regs_buff[4] = macb_readl(bp, RBQP); + regs_buff[5] = macb_readl(bp, TBQP); + regs_buff[6] = macb_readl(bp, RSR); + regs_buff[7] = macb_readl(bp, IMR); + + regs_buff[8] = tail; + regs_buff[9] = head; + regs_buff[10] = macb_tx_dma(bp, tail); + regs_buff[11] = macb_tx_dma(bp, head); + + if (macb_is_gem(bp)) { + regs_buff[12] = gem_readl(bp, USRIO); + regs_buff[13] = gem_readl(bp, DMACFG); + } +} + const struct ethtool_ops macb_ethtool_ops = { .get_settings = macb_get_settings, .set_settings = macb_set_settings, + .get_regs_len = macb_get_regs_len, + .get_regs = macb_get_regs, .get_link = ethtool_op_get_link, .get_ts_info= ethtool_op_get_ts_info, }; diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 024a270..232dca6 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -10,6 +10,9 @@ #ifndef _MACB_H #define _MACB_H +#define MACB_GREGS_NBR 16 +#define MACB_GREGS_VERSION 1 + /* MACB register offsets */ #define MACB_NCR 0x #define MACB_NCFGR 0x0004 -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 10/10] net/macb: add pinctrl consumer support
From: Jean-Christophe PLAGNIOL-VILLARD If no pinctrl available just report a warning as some architecture may not need to do anything. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD [nicolas.fe...@atmel.com: adapt the error path, remove unneeded headers] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index c1f20b0..c374875 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "macb.h" @@ -1472,6 +1473,7 @@ static int __init macb_probe(struct platform_device *pdev) struct phy_device *phydev; u32 config; int err = -ENXIO; + struct pinctrl *pinctrl; regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!regs) { @@ -1479,6 +1481,15 @@ static int __init macb_probe(struct platform_device *pdev) goto err_out; } + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) { + err = PTR_ERR(pinctrl); + if (err == -EPROBE_DEFER) + goto err_out; + + dev_warn(&pdev->dev, "No pinctrl provided\n"); + } + err = -ENOMEM; dev = alloc_etherdev(sizeof(*bp)); if (!dev) -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 01/10] net/macb: Add support for Gigabit Ethernet mode
From: Patrice Vilchez Add Gigabit Ethernet mode to GEM cadence IP and enable RGMII connection. Signed-off-by: Patrice Vilchez Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 15 --- drivers/net/ethernet/cadence/macb.h | 4 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 6a4f499..0931cb7 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -152,13 +152,17 @@ static void macb_handle_link_change(struct net_device *dev) reg = macb_readl(bp, NCFGR); reg &= ~(MACB_BIT(SPD) | MACB_BIT(FD)); + if (macb_is_gem(bp)) + reg &= ~GEM_BIT(GBE); if (phydev->duplex) reg |= MACB_BIT(FD); if (phydev->speed == SPEED_100) reg |= MACB_BIT(SPD); + if (phydev->speed == SPEED_1000) + reg |= GEM_BIT(GBE); - macb_writel(bp, NCFGR, reg); + macb_or_gem_writel(bp, NCFGR, reg); bp->speed = phydev->speed; bp->duplex = phydev->duplex; @@ -216,7 +220,10 @@ static int macb_mii_probe(struct net_device *dev) } /* mask with MAC supported features */ - phydev->supported &= PHY_BASIC_FEATURES; + if (macb_is_gem(bp)) + phydev->supported &= PHY_GBIT_FEATURES; + else + phydev->supported &= PHY_BASIC_FEATURES; phydev->advertising = phydev->supported; @@ -1388,7 +1395,9 @@ static int __init macb_probe(struct platform_device *pdev) bp->phy_interface = err; } - if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) + if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII) + macb_or_gem_writel(bp, USRIO, GEM_BIT(RGMII)); + else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII) #if defined(CONFIG_ARCH_AT91) macb_or_gem_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN))); diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index a362751..33a050f 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -149,6 +149,8 @@ #define MACB_IRXFCS_SIZE 1 /* GEM specific NCFGR bitfields. */ +#define GEM_GBE_OFFSET 10 +#define GEM_GBE_SIZE 1 #define GEM_CLK_OFFSET 18 #define GEM_CLK_SIZE 3 #define GEM_DBW_OFFSET 21 @@ -252,6 +254,8 @@ /* Bitfields in USRIO (AT91) */ #define MACB_RMII_OFFSET 0 #define MACB_RMII_SIZE 1 +#define GEM_RGMII_OFFSET 0 /* GEM gigabit mode */ +#define GEM_RGMII_SIZE 1 #define MACB_CLKEN_OFFSET 1 #define MACB_CLKEN_SIZE1 -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 09/10] net/macb: Offset first RX buffer by two bytes
From: Havard Skinnemoen Make the ethernet frame payload word-aligned, possibly making the memcpy into the skb a bit faster. This will be even more important after we eliminate the copy altogether. Also eliminate the redundant RX_OFFSET constant -- it has the same definition and purpose as NET_IP_ALIGN. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: adapt to newer kernel] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index d5b52ff..c1f20b0 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -33,9 +33,6 @@ #define RX_RING_SIZE 512 /* must be power of 2 */ #define RX_RING_BYTES (sizeof(struct macb_dma_desc) * RX_RING_SIZE) -/* Make the IP header word-aligned (the ethernet header is 14 bytes) */ -#define RX_OFFSET 2 - #define TX_RING_SIZE 128 /* must be power of 2 */ #define TX_RING_BYTES (sizeof(struct macb_dma_desc) * TX_RING_SIZE) @@ -498,7 +495,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, { unsigned int len; unsigned int frag; - unsigned int offset = 0; + unsigned int offset; struct sk_buff *skb; struct macb_dma_desc *desc; @@ -509,7 +506,16 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, macb_rx_ring_wrap(first_frag), macb_rx_ring_wrap(last_frag), len); - skb = netdev_alloc_skb(bp->dev, len + RX_OFFSET); + /* +* The ethernet header starts NET_IP_ALIGN bytes into the +* first buffer. Since the header is 14 bytes, this makes the +* payload word-aligned. +* +* Instead of calling skb_reserve(NET_IP_ALIGN), we just copy +* the two padding bytes into the skb so that we avoid hitting +* the slowpath in memcpy(), and pull them off afterwards. +*/ + skb = netdev_alloc_skb(bp->dev, len + NET_IP_ALIGN); if (!skb) { bp->stats.rx_dropped++; for (frag = first_frag; ; frag++) { @@ -525,7 +531,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, return 1; } - skb_reserve(skb, RX_OFFSET); + offset = 0; + len += NET_IP_ALIGN; skb_checksum_none_assert(skb); skb_put(skb, len); @@ -549,10 +556,11 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, /* Make descriptor updates visible to hardware */ wmb(); + __skb_pull(skb, NET_IP_ALIGN); skb->protocol = eth_type_trans(skb, bp->dev); bp->stats.rx_packets++; - bp->stats.rx_bytes += len; + bp->stats.rx_bytes += skb->len; netdev_vdbg(bp->dev, "received skb of length %u, csum: %08x\n", skb->len, skb->csum); netif_receive_skb(skb); @@ -1012,6 +1020,7 @@ static void macb_init_hw(struct macb *bp) __macb_set_hwaddr(bp); config = macb_mdc_clk_div(bp); + config |= MACB_BF(RBOF, NET_IP_ALIGN); /* Make eth data aligned */ config |= MACB_BIT(PAE);/* PAuse Enable */ config |= MACB_BIT(DRFCS); /* Discard Rx FCS */ config |= MACB_BIT(BIG);/* Receive oversized frames */ -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 08/10] net/macb: better manage tx errors
Handle all TX errors, not only underruns. TX error management is deferred to a dedicated workqueue. Reinitialize the TX ring after treating all remaining frames, and restart the controller when everything has been cleaned up properly. Napi is not stopped during this task as the driver only handles napi for RX for now. With this sequence, we do not need a special check during the xmit method as the packets will be caught by TX disable during workqueue execution. Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 166 drivers/net/ethernet/cadence/macb.h | 1 + 2 files changed, 113 insertions(+), 54 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 78488b4..d5b52ff 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -44,6 +44,16 @@ #define MACB_RX_INT_FLAGS (MACB_BIT(RCOMP) | MACB_BIT(RXUBR) \ | MACB_BIT(ISR_ROVR)) +#define MACB_TX_ERR_FLAGS (MACB_BIT(ISR_TUND) \ + | MACB_BIT(ISR_RLE) \ + | MACB_BIT(TXERR)) +#define MACB_TX_INT_FLAGS (MACB_TX_ERR_FLAGS | MACB_BIT(TCOMP)) + +/* + * Graceful stop timeouts in us. We should allow up to + * 1 frame time (10 Mbits/s, full-duplex, ignoring collisions) + */ +#define MACB_HALT_TIMEOUT 1230 /* Ring buffer accessors */ static unsigned int macb_tx_ring_wrap(unsigned int index) @@ -339,66 +349,113 @@ static void macb_update_stats(struct macb *bp) *p += __raw_readl(reg); } -static void macb_tx(struct macb *bp) +static int macb_halt_tx(struct macb *bp) { - unsigned int tail; - unsigned int head; - u32 status; + unsigned long halt_time, timeout; + u32 status; - status = macb_readl(bp, TSR); - macb_writel(bp, TSR, status); + macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(THALT)); - netdev_vdbg(bp->dev, "macb_tx status = 0x%03lx\n", (unsigned long)status); + timeout = jiffies + usecs_to_jiffies(MACB_HALT_TIMEOUT); + do { + halt_time = jiffies; + status = macb_readl(bp, TSR); + if (!(status & MACB_BIT(TGO))) + return 0; - if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { - int i; - netdev_err(bp->dev, "TX %s, resetting buffers\n", - status & MACB_BIT(UND) ? - "underrun" : "retry limit exceeded"); + usleep_range(10, 250); + } while (time_before(halt_time, timeout)); - /* Transfer ongoing, disable transmitter, to avoid confusion */ - if (status & MACB_BIT(TGO)) - macb_writel(bp, NCR, macb_readl(bp, NCR) & ~MACB_BIT(TE)); + return -ETIMEDOUT; +} - head = bp->tx_head; +static void macb_tx_error_task(struct work_struct *work) +{ + struct macb *bp = container_of(work, struct macb, tx_error_task); + struct macb_tx_skb *tx_skb; + struct sk_buff *skb; + unsigned inttail; - /*Mark all the buffer as used to avoid sending a lost buffer*/ - for (i = 0; i < TX_RING_SIZE; i++) - bp->tx_ring[i].ctrl = MACB_BIT(TX_USED); + netdev_vdbg(bp->dev, "macb_tx_error_task: t = %u, h = %u\n", + bp->tx_tail, bp->tx_head); - /* Add wrap bit */ - bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP); + /* Make sure nobody is trying to queue up new packets */ + netif_stop_queue(bp->dev); - /* free transmit buffer in upper layer*/ - for (tail = bp->tx_tail; tail != head; tail++) { - struct macb_tx_skb *tx_skb; - struct sk_buff *skb; + /* +* Stop transmission now +* (in case we have just queued new packets) +*/ + if (macb_halt_tx(bp)) + /* Just complain for now, reinitializing TX path can be good */ + netdev_err(bp->dev, "BUG: halt tx timed out\n"); - rmb(); + /* No need for the lock here as nobody will interrupt us anymore */ - tx_skb = macb_tx_skb(bp, tail); - skb = tx_skb->skb; + /* +* Treat frames in TX queue including the ones that caused the error. +* Free transmit buffers in upper layer. +*/ + for (tail = bp->tx_tail; tail != bp->tx_head; tail++) { + struct macb_dma_desc*desc; + u32 ctrl;
[PATCH v4 06/10] net/macb: clean up ring buffer logic
From: Havard Skinnemoen Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize the chances of messing this up. This makes the code slightly smaller, and hopefully faster as well. Also, doing the ring buffer management this way will simplify things a lot when making the ring sizes configurable in the future. Available number of descriptors in ring buffer function by David Laight. Signed-off-by: Havard Skinnemoen [nicolas.fe...@atmel.com: split patch in topics, adapt to newer kernel] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/at91_ether.c | 6 +- drivers/net/ethernet/cadence/macb.c | 172 +++--- drivers/net/ethernet/cadence/macb.h | 22 ++-- 3 files changed, 127 insertions(+), 73 deletions(-) diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c index b92815a..0d6392d 100644 --- a/drivers/net/ethernet/cadence/at91_ether.c +++ b/drivers/net/ethernet/cadence/at91_ether.c @@ -156,7 +156,7 @@ static int at91ether_start(struct net_device *dev) int i; lp->rx_ring = dma_alloc_coherent(&lp->pdev->dev, - MAX_RX_DESCR * sizeof(struct dma_desc), + MAX_RX_DESCR * sizeof(struct macb_dma_desc), &lp->rx_ring_dma, GFP_KERNEL); if (!lp->rx_ring) { netdev_err(lp->dev, "unable to alloc rx ring DMA buffer\n"); @@ -170,7 +170,7 @@ static int at91ether_start(struct net_device *dev) netdev_err(lp->dev, "unable to alloc rx data DMA buffer\n"); dma_free_coherent(&lp->pdev->dev, - MAX_RX_DESCR * sizeof(struct dma_desc), + MAX_RX_DESCR * sizeof(struct macb_dma_desc), lp->rx_ring, lp->rx_ring_dma); lp->rx_ring = NULL; return -ENOMEM; @@ -256,7 +256,7 @@ static int at91ether_close(struct net_device *dev) netif_stop_queue(dev); dma_free_coherent(&lp->pdev->dev, - MAX_RX_DESCR * sizeof(struct dma_desc), + MAX_RX_DESCR * sizeof(struct macb_dma_desc), lp->rx_ring, lp->rx_ring_dma); lp->rx_ring = NULL; diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index cd6d431..c432d41 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -30,25 +30,14 @@ #include "macb.h" #define RX_BUFFER_SIZE 128 -#define RX_RING_SIZE 512 -#define RX_RING_BYTES (sizeof(struct dma_desc) * RX_RING_SIZE) +#define RX_RING_SIZE 512 /* must be power of 2 */ +#define RX_RING_BYTES (sizeof(struct macb_dma_desc) * RX_RING_SIZE) /* Make the IP header word-aligned (the ethernet header is 14 bytes) */ #define RX_OFFSET 2 -#define TX_RING_SIZE 128 -#define DEF_TX_RING_PENDING(TX_RING_SIZE - 1) -#define TX_RING_BYTES (sizeof(struct dma_desc) * TX_RING_SIZE) - -#define TX_RING_GAP(bp)\ - (TX_RING_SIZE - (bp)->tx_pending) -#define TX_BUFFS_AVAIL(bp) \ - (((bp)->tx_tail <= (bp)->tx_head) ? \ -(bp)->tx_tail + (bp)->tx_pending - (bp)->tx_head : \ -(bp)->tx_tail - (bp)->tx_head - TX_RING_GAP(bp)) -#define NEXT_TX(n) (((n) + 1) & (TX_RING_SIZE - 1)) - -#define NEXT_RX(n) (((n) + 1) & (RX_RING_SIZE - 1)) +#define TX_RING_SIZE 128 /* must be power of 2 */ +#define TX_RING_BYTES (sizeof(struct macb_dma_desc) * TX_RING_SIZE) /* minimum number of free TX descriptors before waking up TX process */ #define MACB_TX_WAKEUP_THRESH (TX_RING_SIZE / 4) @@ -56,6 +45,51 @@ #define MACB_RX_INT_FLAGS (MACB_BIT(RCOMP) | MACB_BIT(RXUBR) \ | MACB_BIT(ISR_ROVR)) +/* Ring buffer accessors */ +static unsigned int macb_tx_ring_wrap(unsigned int index) +{ + return index & (TX_RING_SIZE - 1); +} + +static unsigned int macb_tx_ring_avail(struct macb *bp) +{ + return (bp->tx_tail - bp->tx_head) & (TX_RING_SIZE - 1); +} + +static struct macb_dma_desc *macb_tx_desc(struct macb *bp, unsigned int index) +{ + return &bp->tx_ring[macb_tx_ring_wrap(index)]; +} + +static struct macb_tx_skb *macb_tx_skb(struct macb *bp, unsigned int index) +{ + return &bp->tx_skb[macb_tx_ring_wrap(index)]; +} + +static dma
[PATCH v4 05/10] net/macb: tx status is more than 8 bits now
On some revision of GEM, TSR status register has more information. Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 4db52f3..cd6d431 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -314,7 +314,7 @@ static void macb_tx(struct macb *bp) status = macb_readl(bp, TSR); macb_writel(bp, TSR, status); - netdev_vdbg(bp->dev, "macb_tx status = %02lx\n", (unsigned long)status); + netdev_vdbg(bp->dev, "macb_tx status = 0x%03lx\n", (unsigned long)status); if (status & (MACB_BIT(UND) | MACB_BIT(TSR_RLE))) { int i; -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net/at91_ether: fix the use of macb structure
On 11/03/2012 08:04 PM, David Miller : > From: Nicolas Ferre > Date: Tue, 30 Oct 2012 12:30:28 +0100 > >> Due to the use of common structure in at91_ether and macb drivers, >> change the name of DMA descriptor structures in at91_ether as well: >> dma_desc => macb_dma_desc >> >> Signed-off-by: Nicolas Ferre > > This does not apply to net-next, respin it if this change is > still relevant. This one is not relevant anymore. Best regards, -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/