Migrating FS Bus from PICOMOD6 to PICOMOD7A

  • Hi:


    I have some problems when migrating a desing from Picomod6 to Picmod7A. With Picomod6 I have a DM9000 connected without problems using FS BUs but when I change to Picomod7A and recompile with the new starter kit, things go wrong with interrups. I use pin 29 in the 140 pin Picomod7A connector.


    However, I can access to DAVICOM chip as you can see on kernel log:


    eth1: dm9000e at d08d4040,d08d6044 IRQ 173 MAC: 00:0a:e7:05:00:07 (eeprom).


    The problem is only one interrupt is detected in dm9000.c driver. I have written traces in the interrupt function, but only one is displayed as follows:


    dm9000_interrupt(): Rec. interrupt: int Status 80
    dm9000_interrupt(): re-enable interrupt mask 83 db->io_addrs D08D4040


    I can see other traces trying to send data, but TX or RX interrupts are not notified to dm9000.c driver:


    dm9000_start_xmit() : Move data to DM9000 TX RAM
    dm9000_send_packet() len 90


    and no data is TX or RX.


    Is it possible that IRQ 173 is being used for other resources of PICOMOD7A?


    Any idea will be considered.


    Thanks

  • Can you tell me how you get to the IRQ number 173?


    Have you already checked if the interrupt line is actually active? If yes, then the problem is the IRQ configuration. If the line is not active, then the controller does not generate the interrupt.


    Do you use the correct IRQ type? Sometimes people use an edge interrupt despite the fact that the device generates a level interrupt. This may work for a while but is generally wrong because it may result in missing interrupts. For example consider a low level interrupt that is handled by a falling edge interrupt. If not all active interrupt sources are handled during the service routine/thread, but the routine returns nonetheless, then there is never a next interrupt because the level is still low, i.e. active. But as the interrupt is only triggered by a falling edge, it will never trigger again.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Can you tell me how you get to the IRQ number 173?


    I use the following code to configure EXT_INT 29 in function 'picomod7a_machine_init()'


    s3c_gpio_cfgpin(S5PV210_GPH3(5), S3C_GPIO_SFN(0xF)); // IRQ_DM9000 Ext INT 29
    s3c_gpio_setpull(S5PV210_GPH3(5), S3C_GPIO_PULL_DOWN);


    I assume that IRQ is configured as LEVEL HIGH. With an oscilloscope, I see IRQ pin on DAVICOM changing, but after the first IRQ, level stand al HIGH level.


    IRQ 173 appears when I trace 'dm9000_probe()' function, inside file 'dm9000.c'.


    Could it be that irq is not served correctly so it is not desactivated on Davicom pin?

  • When you register the dm9000 platform device, you have to give a struct resource as part of the platform data. There the interrupt and the interrupt flags are defined. Can you show me this section of code, too? Thanks.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • OK. Code is as follows:


    /**********************************************/
    /* DM9000 by NUCLEO */
    /**********************************************/
    #if defined (CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
    static struct resource modius_dm9000_resource[] = {
    [0] = { // ADDRESS PORT
    .start = MODIUS_EXPBUS_PA_BASE + MODIUS_PA_DM9000,
    .end = MODIUS_EXPBUS_PA_BASE + MODIUS_PA_DM9000 + 0x03,
    .flags = IORESOURCE_MEM,
    },
    [1] = { // DATA PORT
    .start = MODIUS_EXPBUS_PA_BASE + MODIUS_PA_DM9000 + 0x04,
    .end = MODIUS_EXPBUS_PA_BASE + MODIUS_PA_DM9000 + 0x04 + 0x03,
    .flags = IORESOURCE_MEM,
    },
    [2] = { // IRQs
    .start = MODIUS_ETHIRQ,
    .end = MODIUS_ETHIRQ,
    .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
    }
    };


    /* for the moment we limit to 16bit IO */


    static struct dm9000_plat_data modius_dm9000_platdata = {
    .flags = /*DM9000_PLATF_8BITONLY*/ DM9000_PLATF_16BITONLY,
    };


    static struct platform_device modius_device_dm9000 = {
    .name = "dm9000",
    .id = 0,
    .num_resources = ARRAY_SIZE(modius_dm9000_resource),
    .resource = modius_dm9000_resource,
    .dev = {
    .platform_data = &modius_dm9000_platdata,
    }
    };
    #endif



    where


    /* arch/arm/mach-s5pv210/include/mach/modius-map.h
    *
    * Copyright (c) 2014 NUCLEO CC, S.L.
    * Juan Ignacio López <juanignacio.lopez@nucleodf.com>
    *
    * Machine NUCLEO MODIUS - Memory map definitions
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License version 2 as
    * published by the Free Software Foundation.
    */


    /* needs arch/map.h including with this */


    /* Extensions to use Picomod7 FS - expansion bus with MODIUS board from NUCLEO
    * Peripherals that live in the CS0 areas:
    * - UART 16c554 (4 ports)
    * - DM9000 (Ethernet controller)
    */


    #ifndef __ASM_ARCH_MODIUSMAP_H
    #define __ASM_ARCH_MODIUSMAP_H


    #define MODIUS_EXPBUS_PA_BASE (S5PV210_PA_SROM_BANK1) /* CS1 */


    /* physical address if local-bus attached devices */
    /* peripherals physical offset addresses */


    #define MODIUS_PA_UARTA (0x00000000) /* 8 bits, serial 16c554A port A */
    #define MODIUS_PA_UARTB (0x00000010) /* 8 bits, serial 16c554A port B */
    #define MODIUS_PA_UARTC (0x00000020) /* 8 bits, serial 16c554A port C */
    #define MODIUS_PA_UARTD (0x00000030) /* 8 bits, serial 16c554A port D */
    #define MODIUS_PA_DM9000 (0x00000040) /* 16 bits, Ethernet controller */

    /* GPIO IRQ usage */


    #define MODIUS_UART_A_IRQ IRQ_EINT(26) // GPH3(2)
    #define MODIUS_UART_B_IRQ IRQ_EINT(27) // GPH3(3)
    #define MODIUS_UART_C_IRQ IRQ_EINT(28) // GPH3(4)
    #define MODIUS_UART_D_IRQ IRQ_EINT(30) // GPH3(6)
    #define MODIUS_ETHIRQ IRQ_EINT(29) // GPH3(5)




    #endif /* __ASM_ARCH_MODIUSMAP_H */



    Please, do not hesitate to ask for more code if needed.

  • This looks OK. The resource shows IRQ_EINT(29) and HIGH-Level, the pin GPH_3(5) (=EINT29) is configured as IRQ with pulldown, everything seems right. And you are sure that your IRQ line is connected to pin 98 of the PicoMOD7A board?


    Oops now I see that you are using pin 29. This is not GPH_3(5), this is GPH_2(5) which is EINT21.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • OK. I see. I had information about PICOMOD7 GPIO reference card, not PICOMOD7A !!!! So, all external GPIOS GPH3(x) in my code must be GPH2(x).


    Now, interrupts work fine, but it appears that some kind of interferences are produced between AX88796 and dm9000 chips when I unplug RJ45 cable on davicom side. I'll investigate deeper. For the moment, problem is solved...


    Thank you very much indeed.