AnsweredAssumed Answered

Net Driver for bf609

Question asked by chrischen on Sep 26, 2012
Latest reply on Sep 27, 2012 by chrischen

hi,

     I modify the ezkit.c for net configuration. because my board change the ethernet port. the code behind:

 

#if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE)
#include <linux/stmmac.h>

static unsigned short pins[] = P_RMII1;/* P_RMII0 */

static struct stmmac_mdio_bus_data phy_private_data = {
    .bus_id = 0,
    .phy_mask = 1,
};

static struct plat_stmmacenet_data eth_private_data = {
    .bus_id   = 0,
    .enh_desc = 1,
    .phy_addr = 1,
    .mdio_bus_data = &phy_private_data,
};

static struct platform_device bfin_eth_device = {
    .name           = "stmmaceth",
    .id             = 0,
    .num_resources  = 2,
    .resource       = (struct resource[]) {
        {
            .start  = EMAC1_MACCFG,
            .end    = EMAC1_MACCFG + 0x1274,
            .flags  = IORESOURCE_MEM,
        },
        {
            .name   = "macirq",
            .start  = IRQ_EMAC1_STAT,
            .end    = IRQ_EMAC1_STAT,
            .flags  = IORESOURCE_IRQ,
        },
    },

     But  there  is  something  wrong  in  my  target  board. there  are  the messages.

 

TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
Hardware Trace:
   0 Target : <0x001875f0> { _dump_stack + 0x0 }
     Source : <0x00005148> { _bfin_gpio_irq_request + 0x13c } JUMP.L
   1 Target : <0x00005148> { _bfin_gpio_irq_request + 0x13c }
     Source : <0x000050cc> { _bfin_gpio_irq_request + 0xc0 } IF CC JUMP pcrel
   2 Target : <0x000050c0> { _bfin_gpio_irq_request + 0xb4 }
     Source : <0x0000504a> { _bfin_gpio_irq_request + 0x3e } IF !CC JUMP pcrel
   3 Target : <0x00005028> { _bfin_gpio_irq_request + 0x1c }
     Source : <0x0000501c> { _bfin_gpio_irq_request + 0x10 } IF CC JUMP pcrel (BP)
   4 Target : <0x0000500c> { _bfin_gpio_irq_request + 0x0 }
     Source : <0x00009704> { _bfin_gpio_irq_type + 0xb0 } JUMP.L
   5 Target : <0x00009700> { _bfin_gpio_irq_type + 0xac }
     Source : <0x000b4826> { _snprintf + 0x12 } RTS
   6 Target : <0x000b4822> { _snprintf + 0xe }
     Source : <0x000b4366> { _vsnprintf + 0xa2 } RTS
   7 Target : <0x000b433c> { _vsnprintf + 0x78 }
     Source : <0x000b3d28> { _number + 0x1a8 } RTS
   8 Target : <0x000b3d20> { _number + 0x1a0 }
     Source : <0x000b3d02> { _number + 0x182 } IF CC JUMP pcrel
   9 Target : <0x000b3cd0> { _number + 0x150 }
     Source : <0x000b3cb6> { _number + 0x136 } IF !CC JUMP pcrel
  10 Target : <0x000b3cae> { _number + 0x12e }
     Source : <0x000b3d40> { _number + 0x1c0 } IF CC JUMP pcrel
  11 Target : <0x000b3d2a> { _number + 0x1aa }
     Source : <0x000b3caa> { _number + 0x12a } IF CC JUMP pcrel (BP)
  12 Target : <0x000b3ca6> { _number + 0x126 }
     Source : <0x000b3c8e> { _number + 0x10e } IF CC JUMP pcrel (BP)
  13 Target : <0x000b3c8a> { _number + 0x10a }
     Source : <0x000b3c80> { _number + 0x100 } IF CC JUMP pcrel (BP)
  14 Target : <0x000b3c7a> { _number + 0xfa }
     Source : <0x000b3c56> { _number + 0xd6 } IF CC JUMP pcrel
  15 Target : <0x000b3c2a> { _number + 0xaa }
     Source : <0x000b3e3c> { _number + 0x2bc } JUMP.S
Stack info:
SP: [0x0401de54] <0x0401de54> /* kernel dynamic memory */
FP: (0x0401debc)
Memory from 0x0401de50 to 0401e000
0401de50: 00000000 [ff0a0210] 0401de78  0000514c  0021b588  00000008  00225688  041e23a0
0401de70: 0401deac  0000004c  0401debc  00009708  0021b588  00225688  0401deac  0000004c
0401de90: 00000001  0000009c  000ae00c  00000000  ffffffff  000000e7  000000e7  6f697067
0401deb0: 7172692d  00313332  00212d54 (0401def0)<00037aee> 0021b588  00225688  041e23a0
0401ded0: 0000a414  00000001  000000e7  000000e7  00000000  0022867c  0023adb4  048ba8a0
0401def0:(0401df28) 00037f9c  041e23a0  002256bc  0000a414  00225688  000000e7  0000ffff
0401df10: 00000000  0401df48  0401df40  0401df30  0004c93a  000801b0 (0401df54) 00038138
0401df30: 000000e7  00000000  0000a414  00225688  00004001  00000000  048ba840  0023b64c
0401df50: 00208008 (0401df90) 0023be50  00250908  0023be18  00208008  000000e7  00000000
0401df70: 00000000  00000000  00250904  00000000  30757063  00004001  001c7cb0  00000000
0401df90:(0401dfb0)
00000000  00000000  00000000  00000000  0021edd8  00250650
0401dfb0:(0401dfe0) 0023819a  00250908  00250650  00250938  00000000  00000000  00000000
0401dfd0: 00000000  00000000  00000000  00000000 (00000000)<000015e6> 00000000  00000000
0401dff0: 00000000  00000000  ffffffff  00002806
Return addresses in stack:
   frame  1 : <0x00037aee> { ___irq_set_trigger + 0x2a }
   frame  5 : <0x00001106> { _do_one_initcall + 0x106 }
   frame  7 : <0x000015e6> { _kernel_thread_helper + 0x6 }
bfin-gpio: GPIO 76 is already reserved as Peripheral by emac1 !
setting trigger mode 1 for irq 231 failed (_bfin_gpio_irq_type+0x0/0x1cc)
eth0: device MAC address 22:f4:6b:62:68:3f
stmmac: probed
eth0: PHY ID 20005c90 at 1 IRQ 0 (stmmac-0:01) active
dma_alloc_init: dma_page @ 0x0489e000 - 256 pages at 0x07f00000
No MAC Management Counters available
IP-Config: Gateway not on directly connected network.
Freeing unused kernel memory: 3436k freed


BusyBox v1.17.4 (2012-07-17 21:35:24 CST) hush - the humble shell

root:/> PHY: stmmac-0:01 - Link is Up - 100/Full

 

     I  try  to find  where  the  GPIO  76  be  used,  but  i  failed. I  need  help!

Outcomes