Merge branch 'master' of git://git.denx.de/u-boot-net

This commit is contained in:
Tom Rini 2016-07-06 15:55:21 -04:00
commit 246fa47840
6 changed files with 51 additions and 11 deletions

View File

@ -80,7 +80,7 @@ static int dw_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
return ret;
}
#if CONFIG_DM_ETH
#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO)
static int dw_mdio_reset(struct mii_dev *bus)
{
struct udevice *dev = bus->priv;
@ -126,7 +126,7 @@ static int dw_mdio_init(const char *name, void *priv)
bus->read = dw_mdio_read;
bus->write = dw_mdio_write;
snprintf(bus->name, sizeof(bus->name), "%s", name);
#ifdef CONFIG_DM_ETH
#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO)
bus->reset = dw_mdio_reset;
#endif
@ -690,11 +690,15 @@ static const struct eth_ops designware_eth_ops = {
static int designware_eth_ofdata_to_platdata(struct udevice *dev)
{
struct dw_eth_pdata *dw_pdata = dev_get_platdata(dev);
#ifdef CONFIG_DM_GPIO
struct dw_eth_dev *priv = dev_get_priv(dev);
#endif
struct eth_pdata *pdata = &dw_pdata->eth_pdata;
const char *phy_mode;
const fdt32_t *cell;
#ifdef CONFIG_DM_GPIO
int reset_flags = GPIOD_IS_OUT;
#endif
int ret = 0;
pdata->iobase = dev_get_addr(dev);
@ -712,6 +716,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev)
if (cell)
pdata->max_speed = fdt32_to_cpu(*cell);
#ifdef CONFIG_DM_GPIO
if (fdtdec_get_bool(gd->fdt_blob, dev->of_offset,
"snps,reset-active-low"))
reset_flags |= GPIOD_ACTIVE_LOW;
@ -724,6 +729,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev)
} else if (ret == -ENOENT) {
ret = 0;
}
#endif
return ret;
}

View File

@ -8,7 +8,9 @@
#ifndef _DW_ETH_H
#define _DW_ETH_H
#include <asm/gpio.h>
#ifdef CONFIG_DM_GPIO
#include <asm-generic/gpio.h>
#endif
#define CONFIG_TX_DESCR_NUM 16
#define CONFIG_RX_DESCR_NUM 16
@ -234,7 +236,10 @@ struct dw_eth_dev {
#ifndef CONFIG_DM_ETH
struct eth_device *dev;
#endif
#ifdef CONFIG_DM_GPIO
struct gpio_desc reset_gpio;
#endif
struct phy_device *phydev;
struct mii_dev *bus;
};

View File

@ -147,6 +147,32 @@ struct phy_driver aqr105_driver = {
.shutdown = &gen10g_shutdown,
};
struct phy_driver aqr106_driver = {
.name = "Aquantia AQR106",
.uid = 0x3a1b4d0,
.mask = 0xfffffff0,
.features = PHY_10G_FEATURES,
.mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
MDIO_MMD_PHYXS | MDIO_MMD_AN |
MDIO_MMD_VEND1),
.config = &aquantia_config,
.startup = &aquantia_startup,
.shutdown = &gen10g_shutdown,
};
struct phy_driver aqr107_driver = {
.name = "Aquantia AQR107",
.uid = 0x3a1b4e0,
.mask = 0xfffffff0,
.features = PHY_10G_FEATURES,
.mmds = (MDIO_MMD_PMAPMD | MDIO_MMD_PCS|
MDIO_MMD_PHYXS | MDIO_MMD_AN |
MDIO_MMD_VEND1),
.config = &aquantia_config,
.startup = &aquantia_startup,
.shutdown = &gen10g_shutdown,
};
struct phy_driver aqr405_driver = {
.name = "Aquantia AQR405",
.uid = 0x3a1b4b2,
@ -165,6 +191,8 @@ int phy_aquantia_init(void)
phy_register(&aq1202_driver);
phy_register(&aq2104_driver);
phy_register(&aqr105_driver);
phy_register(&aqr106_driver);
phy_register(&aqr107_driver);
phy_register(&aqr405_driver);
return 0;

View File

@ -666,12 +666,12 @@ static int rtl_send_common(pci_dev_t dev, unsigned long dev_iobase,
puts("tx timeout/error\n");
printf("%s elapsed time : %lu\n", __func__, currticks()-stime);
#endif
ret = 0;
ret = -ETIMEDOUT;
} else {
#ifdef DEBUG_RTL8169_TX
puts("tx done\n");
#endif
ret = length;
ret = 0;
}
/* Delay to make net console (nc) work properly */
udelay(20);

View File

@ -16,6 +16,7 @@ typedef volatile unsigned short vu_short;
typedef volatile unsigned char vu_char;
#include <config.h>
#include <errno.h>
#include <asm-offsets.h>
#include <linux/bitops.h>
#include <linux/types.h>

View File

@ -132,7 +132,7 @@ static char *dirname(char *path)
/**************************************************************************
RPC_ADD_CREDENTIALS - Add RPC authentication/verifier entries
**************************************************************************/
static long *rpc_add_credentials(long *p)
static uint32_t *rpc_add_credentials(uint32_t *p)
{
int hl;
int hostnamelen;
@ -241,7 +241,7 @@ static void nfs_mount_req(char *path)
pathlen = strlen(path);
p = &(data[0]);
p = (uint32_t *)rpc_add_credentials((long *)p);
p = rpc_add_credentials(p);
*p++ = htonl(pathlen);
if (pathlen & 3)
@ -268,7 +268,7 @@ static void nfs_umountall_req(void)
return;
p = &(data[0]);
p = (uint32_t *)rpc_add_credentials((long *)p);
p = rpc_add_credentials(p);
len = (uint32_t *)p - (uint32_t *)&(data[0]);
@ -289,7 +289,7 @@ static void nfs_readlink_req(void)
int len;
p = &(data[0]);
p = (uint32_t *)rpc_add_credentials((long *)p);
p = rpc_add_credentials(p);
memcpy(p, filefh, NFS_FHSIZE);
p += (NFS_FHSIZE / 4);
@ -312,7 +312,7 @@ static void nfs_lookup_req(char *fname)
fnamelen = strlen(fname);
p = &(data[0]);
p = (uint32_t *)rpc_add_credentials((long *)p);
p = rpc_add_credentials(p);
memcpy(p, dirfh, NFS_FHSIZE);
p += (NFS_FHSIZE / 4);
@ -337,7 +337,7 @@ static void nfs_read_req(int offset, int readlen)
int len;
p = &(data[0]);
p = (uint32_t *)rpc_add_credentials((long *)p);
p = rpc_add_credentials(p);
memcpy(p, filefh, NFS_FHSIZE);
p += (NFS_FHSIZE / 4);