AnsweredAssumed Answered

How to enable ETH1 in uClinux

Question asked by HoJuly on Apr 30, 2014
Latest reply on May 5, 2014 by HoJuly

Hi !

 

    I want to enable ETH1 in buildroot 2013R1-R2. So try to change the file "arch/blackfin/mach-bf609/boards/ezkit.c", add new defines according to"CONFIG_STMMAC_ETH". The codes been added as follows:

 

#define CONFIG_STMMAC_ETH1_ENABLE 1
#if defined(CONFIG_STMMAC_ETH1_ENABLE)
static struct stmmac_mdio_bus_data phy1_private_data = {
.phy_mask = 1,
};

static struct stmmac_dma_cfg eth1_dma_cfg = {
.pbl = 2,
};

int stmmac1_ptp_clk_init(struct platform_device *pdev)
{
bfin_write32(PADS0_EMAC_PTP_CLKSEL, 0);
return 0;
}

static struct plat_stmmacenet_data eth1_private_data = {
.has_gmac = 1,
.bus_id   = 1,
.enh_desc = 1,
.phy_addr = 1,
.mdio_bus_data = &phy1_private_data,
.dma_cfg  = &eth1_dma_cfg,
.force_thresh_dma_mode = 1,
.interface = PHY_INTERFACE_MODE_RMII,
.init = stmmac1_ptp_clk_init,
};

static struct platform_device bfin_eth1_device = {
.name           = "stmmaceth",
.id             = 1,
.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,
  },
},
.dev = {
  .power.can_wakeup = 1,
  .platform_data = &eth1_private_data,
}
};
#endif

 

 

and:

#if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE)

&bfin_eth_device,

#if defined(CONFIG_STMMAC_ETH1_ENABLE)

&bfin_eth1_device,

#endif

#endif

 

      Now build uImage and download into bf609-ezkit. After the uClinux starts, I type into the following cmds:

 

  root:/> ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 8E:69:D1:12:BC:26 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:77 Base address:0x2000

root:/>
root:/> ifconfig eth1 up
eth1: device MAC address 8e:69:d1:12:bc:26
stmmac_open: Cannot attach to PHY (error: -19)
ifconfig: SIOCSIFFLAGS: No such device

 

 

     The "eth1" I just configured doesn't work. Then what's the matter?

 

Thanks for help!

Outcomes