From mboxrd@z Thu Jan 1 00:00:00 1970 From: Purna Chandra Mandal Date: Thu, 7 Jan 2016 10:44:45 +0530 Subject: [U-Boot] [PATCH v2 12/13] drivers: net: add Microchip PIC32 ethernet controller driver. In-Reply-To: References: <1451916152.27601.131.camel@microchip.com> <568D00EE.7050107@microchip.com> Message-ID: <568DF445.9000904@microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01/07/2016 12:11 AM, Joe Hershberger wrote: > [...] > +static int pic32_eth_probe(struct udevice *dev) > +{ > + struct eth_pdata *pdata = dev_get_platdata(dev); > + struct pic32eth_device *priv = dev_get_priv(dev); > + void __iomem *iobase; > + int phy_addr = 0; > + > +#if defined(CONFIG_PHY_ADDR) > + phy_addr = CONFIG_PHY_ADDR; >>> Doesn't this usually come from the device tree these days? >> Yes, device-tree option is more meaningful. Could you please point me some reference for this? > Eg: > drivers/net/zynq_gem.c:682: priv->phyaddr = > fdtdec_get_int(gd->fdt_blob, offset, "reg", -1); Thanks. Will incorporate phy_addr into device-tree. >>>> +#endif >>>> + iobase = pic32_ioremap((ulong)pdata->iobase); >>>> + >>>> + /* initialize */ >>>> + priv->phy_addr = phy_addr; >>>> + priv->phyif = pdata->phy_interface; >>>> + priv->ectl_regs = (struct pic32_ectl_regs *)(iobase); >>>> + priv->emac_regs = (struct pic32_emac_regs *)(iobase + PIC32_EMAC1CFG1); >>>> + >>>> + gpio_request_by_name_nodev(gd->fdt_blob, dev->of_offset, >>>> + "reset-gpios", 0, >>>> + &priv->rst_gpio, GPIOD_IS_OUT); >>>> + _mdio_init(priv); >>>> + >>>> + return _phy_init(priv, dev); >>>> +} >>>> [...]