mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
Merge git://git.denx.de/u-boot-net
This commit is contained in:
commit
df13a44377
33 changed files with 221 additions and 118 deletions
12
Kconfig
12
Kconfig
|
@ -76,22 +76,16 @@ config DISTRO_DEFAULTS
|
|||
imply USE_BOOTCOMMAND
|
||||
select CMD_BOOTZ if ARM && !ARM64
|
||||
select CMD_BOOTI if ARM64
|
||||
select CMD_DHCP if NET && CMD_NET
|
||||
select CMD_PXE if NET && CMD_NET
|
||||
select CMD_DHCP if CMD_NET
|
||||
select CMD_PING if CMD_NET
|
||||
select CMD_PXE if NET
|
||||
select CMD_EXT2
|
||||
select CMD_EXT4
|
||||
select CMD_FAT
|
||||
select CMD_FS_GENERIC
|
||||
imply CMD_MII if NET
|
||||
select CMD_PING if NET
|
||||
select CMD_PART if PARTITIONS
|
||||
select HUSH_PARSER
|
||||
select BOOTP_BOOTPATH if NET && CMD_NET
|
||||
select BOOTP_DNS if NET && CMD_NET
|
||||
select BOOTP_GATEWAY if NET && CMD_NET
|
||||
select BOOTP_HOSTNAME if NET && CMD_NET
|
||||
select BOOTP_PXE if NET && CMD_NET
|
||||
select BOOTP_SUBNETMASK if NET && CMD_NET
|
||||
select CMDLINE_EDITING
|
||||
select AUTO_COMPLETE
|
||||
select SYS_LONGHELP
|
||||
|
|
127
cmd/Kconfig
127
cmd/Kconfig
|
@ -1021,46 +1021,127 @@ config CMD_SETEXPR
|
|||
|
||||
endmenu
|
||||
|
||||
menu "Network commands"
|
||||
|
||||
if NET
|
||||
|
||||
config CMD_NET
|
||||
bool "bootp, tftpboot"
|
||||
menuconfig CMD_NET
|
||||
bool "Network commands"
|
||||
default y
|
||||
|
||||
if CMD_NET
|
||||
|
||||
config CMD_BOOTP
|
||||
bool "bootp"
|
||||
default y
|
||||
help
|
||||
Network commands.
|
||||
bootp - boot image via network using BOOTP/TFTP protocol
|
||||
|
||||
config CMD_DHCP
|
||||
bool "dhcp"
|
||||
depends on CMD_BOOTP
|
||||
help
|
||||
Boot image via network using DHCP/TFTP protocol
|
||||
|
||||
config BOOTP_BOOTPATH
|
||||
bool "Request & store 'rootpath' from BOOTP/DHCP server"
|
||||
default y
|
||||
depends on CMD_BOOTP
|
||||
help
|
||||
Even though the config is called BOOTP_BOOTPATH, it stores the
|
||||
path in the variable 'rootpath'.
|
||||
|
||||
config BOOTP_DNS
|
||||
bool "Request & store 'dnsip' from BOOTP/DHCP server"
|
||||
default y
|
||||
depends on CMD_BOOTP
|
||||
help
|
||||
The primary DNS server is stored as 'dnsip'. If two servers are
|
||||
returned, you must set BOOTP_DNS2 to store that second server IP
|
||||
also.
|
||||
|
||||
config BOOTP_DNS2
|
||||
bool "Store 'dnsip2' from BOOTP/DHCP server"
|
||||
depends on BOOTP_DNS
|
||||
help
|
||||
If a DHCP client requests the DNS server IP from a DHCP server,
|
||||
it is possible that more than one DNS serverip is offered to the
|
||||
client. If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS
|
||||
server IP will be stored in the additional environment
|
||||
variable "dnsip2". The first DNS serverip is always
|
||||
stored in the variable "dnsip", when BOOTP_DNS is defined.
|
||||
|
||||
config BOOTP_GATEWAY
|
||||
bool "Request & store 'gatewayip' from BOOTP/DHCP server"
|
||||
default y
|
||||
depends on CMD_BOOTP
|
||||
|
||||
config BOOTP_HOSTNAME
|
||||
bool "Request & store 'hostname' from BOOTP/DHCP server"
|
||||
default y
|
||||
depends on CMD_BOOTP
|
||||
help
|
||||
The name may or may not be qualified with the local domain name.
|
||||
|
||||
config BOOTP_SUBNETMASK
|
||||
bool "Request & store 'netmask' from BOOTP/DHCP server"
|
||||
default y
|
||||
depends on CMD_BOOTP
|
||||
|
||||
config BOOTP_PXE
|
||||
bool "Send PXE client arch to BOOTP/DHCP server"
|
||||
default y
|
||||
depends on CMD_BOOTP && CMD_PXE
|
||||
help
|
||||
Supported for ARM, ARM64, and x86 for now.
|
||||
|
||||
config BOOTP_PXE_CLIENTARCH
|
||||
hex
|
||||
depends on BOOTP_PXE
|
||||
default 0x16 if ARM64
|
||||
default 0x15 if ARM
|
||||
default 0 if X86
|
||||
|
||||
config BOOTP_VCI_STRING
|
||||
string
|
||||
depends on CMD_BOOTP
|
||||
default "U-Boot.armv7" if CPU_V7 || CPU_V7M
|
||||
default "U-Boot.armv8" if ARM64
|
||||
default "U-Boot.arm" if ARM
|
||||
default "U-Boot"
|
||||
|
||||
config CMD_TFTPBOOT
|
||||
bool "tftpboot"
|
||||
default y
|
||||
help
|
||||
tftpboot - boot image via network using TFTP protocol
|
||||
|
||||
config CMD_TFTPPUT
|
||||
bool "tftp put"
|
||||
depends on CMD_TFTPBOOT
|
||||
help
|
||||
TFTP put command, for uploading files to a server
|
||||
|
||||
config CMD_TFTPSRV
|
||||
bool "tftpsrv"
|
||||
depends on CMD_TFTPBOOT
|
||||
help
|
||||
Act as a TFTP server and boot the first received file
|
||||
|
||||
config NET_TFTP_VARS
|
||||
bool "Control TFTP timeout and count through environment"
|
||||
depends on CMD_TFTPBOOT
|
||||
default y
|
||||
help
|
||||
If set, allows controlling the TFTP timeout through the
|
||||
environment variable tftptimeout, and the TFTP maximum
|
||||
timeout count through the variable tftptimeoutcountmax.
|
||||
If unset, timeout and maximum are hard-defined as 1 second
|
||||
and 10 timouts per TFTP transfer.
|
||||
|
||||
config CMD_RARP
|
||||
bool "rarpboot"
|
||||
help
|
||||
Boot image via network using RARP/TFTP protocol
|
||||
|
||||
config CMD_DHCP
|
||||
bool "dhcp"
|
||||
depends on CMD_NET
|
||||
help
|
||||
Boot image via network using DHCP/TFTP protocol
|
||||
|
||||
config CMD_PXE
|
||||
bool "pxe"
|
||||
depends on CMD_NET
|
||||
select MENU
|
||||
help
|
||||
Boot image via network using PXE protocol
|
||||
|
||||
config CMD_NFS
|
||||
bool "nfs"
|
||||
default y
|
||||
|
@ -1097,6 +1178,8 @@ config CMD_LINK_LOCAL
|
|||
help
|
||||
Acquire a network IP address using the link-local protocol
|
||||
|
||||
endif
|
||||
|
||||
config CMD_ETHSW
|
||||
bool "ethsw"
|
||||
help
|
||||
|
@ -1105,9 +1188,13 @@ config CMD_ETHSW
|
|||
operations such as enabling / disabling a port and
|
||||
viewing/maintaining the filtering database (FDB)
|
||||
|
||||
endif
|
||||
config CMD_PXE
|
||||
bool "pxe"
|
||||
select MENU
|
||||
help
|
||||
Boot image via network using PXE protocol
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
menu "Misc commands"
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ efi_status_t efi_init_obj_list(void)
|
|||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
#endif
|
||||
#ifdef CONFIG_CMD_NET
|
||||
#ifdef CONFIG_NET
|
||||
ret = efi_net_register();
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
|
@ -511,7 +511,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
|
|||
|
||||
bootefi_device_path = efi_dp_from_part(desc, part);
|
||||
} else {
|
||||
#ifdef CONFIG_CMD_NET
|
||||
#ifdef CONFIG_NET
|
||||
bootefi_device_path = efi_dp_from_eth();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
|
||||
|
||||
#ifdef CONFIG_CMD_BOOTP
|
||||
static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
return netboot_common(BOOTP, cmdtp, argc, argv);
|
||||
|
@ -24,7 +25,9 @@ U_BOOT_CMD(
|
|||
"boot image via network using BOOTP/TFTP protocol",
|
||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_TFTPBOOT
|
||||
int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
int ret;
|
||||
|
@ -40,6 +43,7 @@ U_BOOT_CMD(
|
|||
"boot image via network using TFTP protocol",
|
||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_TFTPPUT
|
||||
static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
|
|
|
@ -44,6 +44,7 @@ CONFIG_SYS_OMAP24_I2C_SPEED=1000
|
|||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_NAND=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_USB=y
|
||||
|
|
|
@ -38,6 +38,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_FAT_WRITE=y
|
||||
|
|
|
@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_FAT_WRITE=y
|
||||
|
|
|
@ -40,6 +40,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_FAT_WRITE=y
|
||||
|
|
|
@ -37,6 +37,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_FAT_WRITE=y
|
||||
|
|
|
@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_FAT_WRITE=y
|
||||
|
|
|
@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
CONFIG_FAT_WRITE=y
|
||||
|
|
|
@ -36,6 +36,7 @@ CONFIG_MTD_NOR_FLASH=y
|
|||
CONFIG_NAND=y
|
||||
CONFIG_SPL_NAND_SIMPLE=y
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_PHY_ADDR=31
|
||||
CONFIG_DM_SERIAL=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
|
|
|
@ -41,6 +41,7 @@ CONFIG_SPL_OF_TRANSLATE=y
|
|||
CONFIG_SPI_FLASH=y
|
||||
CONFIG_SPI_FLASH_BAR=y
|
||||
CONFIG_SPI_FLASH_STMICRO=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_PHY_GIGE=y
|
||||
CONFIG_MVNETA=y
|
||||
CONFIG_PCI=y
|
||||
|
|
|
@ -20,6 +20,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
|
|||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_MMC_MESON_GX=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_PHY_ADDR=8
|
||||
CONFIG_PHY_MESON_GXL=y
|
||||
CONFIG_DM_ETH=y
|
||||
|
|
|
@ -20,6 +20,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
|
|||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_MMC_MESON_GX=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_PHY_ADDR=8
|
||||
CONFIG_PHY_MESON_GXL=y
|
||||
CONFIG_DM_ETH=y
|
||||
|
|
|
@ -20,6 +20,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
|
|||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_MMC_MESON_GX=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_PHY_ADDR=8
|
||||
CONFIG_PHY_MESON_GXL=y
|
||||
CONFIG_DM_ETH=y
|
||||
|
|
|
@ -33,6 +33,7 @@ CONFIG_MMC_OMAP_HS=y
|
|||
CONFIG_PHY_MICREL=y
|
||||
CONFIG_PHY_MICREL_KSZ90X1=y
|
||||
CONFIG_DRIVER_TI_CPSW=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_OMAP3_SPI=y
|
||||
|
|
|
@ -36,6 +36,7 @@ CONFIG_SPL_DM=y
|
|||
CONFIG_DM_GPIO=y
|
||||
# CONFIG_MMC is not set
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_DM_SERIAL=y
|
||||
CONFIG_SYS_NS16550=y
|
||||
CONFIG_LPC32XX_SSP=y
|
||||
|
|
|
@ -44,6 +44,7 @@ CONFIG_FPGA_SPARTAN3=y
|
|||
CONFIG_SYS_I2C_DW=y
|
||||
# CONFIG_MMC is not set
|
||||
CONFIG_MTD_NOR_FLASH=y
|
||||
CONFIG_PHY_ADDR_ENABLE=y
|
||||
CONFIG_PHY_MICREL=y
|
||||
CONFIG_PHY_MICREL_KSZ90X1=y
|
||||
CONFIG_NETDEVICES=y
|
||||
|
|
|
@ -155,9 +155,20 @@ config ETHOC
|
|||
help
|
||||
This MAC is present in OpenRISC and Xtensa XTFPGA boards.
|
||||
|
||||
config FEC_MXC_SHARE_MDIO
|
||||
bool "Share the MDIO bus for FEC controller"
|
||||
depends on FEC_MXC
|
||||
|
||||
config FEC_MXC_MDIO_BASE
|
||||
hex "MDIO base address for the FEC controller"
|
||||
depends on FEC_MXC_SHARE_MDIO
|
||||
help
|
||||
This specifies the MDIO registers base address. It is used when
|
||||
two FEC controllers share MDIO bus.
|
||||
|
||||
config FEC_MXC
|
||||
bool "FEC Ethernet controller"
|
||||
depends on MX5 || MX6
|
||||
depends on MX5 || MX6 || MX7
|
||||
help
|
||||
This driver supports the 10/100 Fast Ethernet controller for
|
||||
NXP i.MX processors.
|
||||
|
|
|
@ -807,7 +807,16 @@ static int fec_recv(struct eth_device *dev)
|
|||
uint16_t bd_status;
|
||||
ulong addr, size, end;
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_DM_ETH
|
||||
*packetp = memalign(ARCH_DMA_MINALIGN, FEC_MAX_PKT_SIZE);
|
||||
if (*packetp == 0) {
|
||||
printf("%s: error allocating packetp\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
#else
|
||||
ALLOC_CACHE_ALIGN_BUFFER(uchar, buff, FEC_MAX_PKT_SIZE);
|
||||
#endif
|
||||
|
||||
/* Check if any critical events have happened */
|
||||
ievent = readl(&fec->eth->ievent);
|
||||
|
@ -883,8 +892,13 @@ static int fec_recv(struct eth_device *dev)
|
|||
#ifdef CONFIG_FEC_MXC_SWAP_PACKET
|
||||
swap_packet((uint32_t *)addr, frame_length);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DM_ETH
|
||||
memcpy(*packetp, (char *)addr, frame_length);
|
||||
#else
|
||||
memcpy(buff, (char *)addr, frame_length);
|
||||
net_process_received_packet(buff, frame_length);
|
||||
#endif
|
||||
len = frame_length;
|
||||
} else {
|
||||
if (bd_status & FEC_RBD_ERR)
|
||||
|
@ -998,18 +1012,9 @@ static void fec_free_descs(struct fec_priv *fec)
|
|||
free(fec->tbd_base);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DM_ETH
|
||||
struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id)
|
||||
#else
|
||||
struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id)
|
||||
#endif
|
||||
struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id)
|
||||
{
|
||||
#ifdef CONFIG_DM_ETH
|
||||
struct fec_priv *priv = dev_get_priv(dev);
|
||||
struct ethernet_regs *eth = priv->eth;
|
||||
#else
|
||||
struct ethernet_regs *eth = (struct ethernet_regs *)(ulong)base_addr;
|
||||
#endif
|
||||
struct ethernet_regs *eth = (struct ethernet_regs *)base_addr;
|
||||
struct mii_dev *bus;
|
||||
int ret;
|
||||
|
||||
|
@ -1141,12 +1146,12 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
|
|||
#endif
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_MX28
|
||||
#ifdef CONFIG_FEC_MXC_MDIO_BASE
|
||||
/*
|
||||
* The i.MX28 has two ethernet interfaces, but they are not equal.
|
||||
* Only the first one can access the MDIO bus.
|
||||
*/
|
||||
base_mii = MXS_ENET0_BASE;
|
||||
base_mii = CONFIG_FEC_MXC_MDIO_BASE;
|
||||
#else
|
||||
base_mii = addr;
|
||||
#endif
|
||||
|
@ -1202,10 +1207,19 @@ static int fecmxc_read_rom_hwaddr(struct udevice *dev)
|
|||
return fec_get_hwaddr(priv->dev_id, pdata->enetaddr);
|
||||
}
|
||||
|
||||
static int fecmxc_free_pkt(struct udevice *dev, uchar *packet, int length)
|
||||
{
|
||||
if (packet)
|
||||
free(packet);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct eth_ops fecmxc_ops = {
|
||||
.start = fecmxc_init,
|
||||
.send = fecmxc_send,
|
||||
.recv = fecmxc_recv,
|
||||
.free_pkt = fecmxc_free_pkt,
|
||||
.stop = fecmxc_halt,
|
||||
.write_hwaddr = fecmxc_set_hwaddr,
|
||||
.read_rom_hwaddr = fecmxc_read_rom_hwaddr,
|
||||
|
@ -1237,7 +1251,6 @@ static int fecmxc_probe(struct udevice *dev)
|
|||
struct eth_pdata *pdata = dev_get_platdata(dev);
|
||||
struct fec_priv *priv = dev_get_priv(dev);
|
||||
struct mii_dev *bus = NULL;
|
||||
int dev_id = -1;
|
||||
uint32_t start;
|
||||
int ret;
|
||||
|
||||
|
@ -1258,9 +1271,13 @@ static int fecmxc_probe(struct udevice *dev)
|
|||
}
|
||||
|
||||
fec_reg_setup(priv);
|
||||
priv->dev_id = (dev_id == -1) ? 0 : dev_id;
|
||||
|
||||
bus = fec_get_miibus(dev, dev_id);
|
||||
priv->dev_id = dev->seq;
|
||||
#ifdef CONFIG_FEC_MXC_MDIO_BASE
|
||||
bus = fec_get_miibus((ulong)CONFIG_FEC_MXC_MDIO_BASE, dev->seq);
|
||||
#else
|
||||
bus = fec_get_miibus((ulong)priv->eth, dev->seq);
|
||||
#endif
|
||||
if (!bus) {
|
||||
ret = -ENOMEM;
|
||||
goto err_mii;
|
||||
|
@ -1275,12 +1292,11 @@ static int fecmxc_probe(struct udevice *dev)
|
|||
|
||||
return 0;
|
||||
|
||||
err_timeout:
|
||||
free(priv->phydev);
|
||||
err_phy:
|
||||
mdio_unregister(bus);
|
||||
free(bus);
|
||||
err_mii:
|
||||
err_timeout:
|
||||
fec_free_descs(priv);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1326,6 +1342,9 @@ static int fecmxc_ofdata_to_platdata(struct udevice *dev)
|
|||
|
||||
static const struct udevice_id fecmxc_ids[] = {
|
||||
{ .compatible = "fsl,imx6q-fec" },
|
||||
{ .compatible = "fsl,imx6sl-fec" },
|
||||
{ .compatible = "fsl,imx6sx-fec" },
|
||||
{ .compatible = "fsl,imx6ul-fec" },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
|
|
@ -890,6 +890,15 @@ static void mvneta_mac_addr_set(struct mvneta_port *pp, unsigned char *addr,
|
|||
mvneta_set_ucast_addr(pp, addr[5], queue);
|
||||
}
|
||||
|
||||
static int mvneta_write_hwaddr(struct udevice *dev)
|
||||
{
|
||||
mvneta_mac_addr_set(dev_get_priv(dev),
|
||||
((struct eth_pdata *)dev_get_platdata(dev))->enetaddr,
|
||||
rxq_def);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Handle rx descriptor fill by setting buf_cookie and buf_phys_addr */
|
||||
static void mvneta_rx_desc_fill(struct mvneta_rx_desc *rx_desc,
|
||||
u32 phys_addr, u32 cookie)
|
||||
|
@ -1753,6 +1762,7 @@ static const struct eth_ops mvneta_ops = {
|
|||
.send = mvneta_send,
|
||||
.recv = mvneta_recv,
|
||||
.stop = mvneta_stop,
|
||||
.write_hwaddr = mvneta_write_hwaddr,
|
||||
};
|
||||
|
||||
static int mvneta_ofdata_to_platdata(struct udevice *dev)
|
||||
|
|
|
@ -13,12 +13,20 @@ menuconfig PHYLIB
|
|||
|
||||
if PHYLIB
|
||||
|
||||
config PHY_ADDR_ENABLE
|
||||
bool "Limit phy address"
|
||||
default y if ARCH_SUNXI
|
||||
help
|
||||
Select this if you want to control which phy address is used
|
||||
|
||||
if PHY_ADDR_ENABLE
|
||||
config PHY_ADDR
|
||||
int "PHY address"
|
||||
default 1 if ARCH_SUNXI
|
||||
default 0
|
||||
help
|
||||
The address of PHY on MII bus. Usually in range of 0 to 31.
|
||||
endif
|
||||
|
||||
config B53_SWITCH
|
||||
bool "Broadcom BCM53xx (RoboSwitch) Ethernet switch PHY support."
|
||||
|
|
|
@ -182,6 +182,7 @@ struct zynq_gem_priv {
|
|||
int phy_of_handle;
|
||||
struct mii_dev *bus;
|
||||
struct clk clk;
|
||||
u32 max_speed;
|
||||
bool int_pcs;
|
||||
};
|
||||
|
||||
|
@ -341,6 +342,12 @@ static int zynq_phy_init(struct udevice *dev)
|
|||
|
||||
priv->phydev->supported &= supported | ADVERTISED_Pause |
|
||||
ADVERTISED_Asym_Pause;
|
||||
if (priv->max_speed) {
|
||||
ret = phy_set_supported(priv->phydev, priv->max_speed);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
priv->phydev->advertising = priv->phydev->supported;
|
||||
|
||||
if (priv->phy_of_handle > 0)
|
||||
|
@ -704,6 +711,8 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
|
|||
}
|
||||
priv->interface = pdata->phy_interface;
|
||||
|
||||
priv->max_speed = fdtdec_get_uint(gd->fdt_blob, priv->phy_of_handle,
|
||||
"max-speed", SPEED_1000);
|
||||
priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, node,
|
||||
"is-internal-pcspma");
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
/* FEC Ethernet on SoC */
|
||||
#ifdef CONFIG_CMD_NET
|
||||
#define CONFIG_FEC_MXC
|
||||
#define CONFIG_FEC_MXC_MDIO_BASE MXS_ENET0_BASE
|
||||
#define CONFIG_MX28_FEC_MAC_IN_OCOTP
|
||||
#endif
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
|
|||
#define BOOT_TARGET_DEVICES_DHCP(func)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_PXE
|
||||
#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
|
||||
#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
|
||||
#else
|
||||
#define BOOT_TARGET_DEVICES_PXE(func)
|
||||
|
|
|
@ -172,7 +172,7 @@
|
|||
# define BOOT_TARGET_DEVICES_USB(func)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CMD_PXE)
|
||||
#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
|
||||
# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
|
||||
#else
|
||||
# define BOOT_TARGET_DEVICES_PXE(func)
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
#define BOOT_TARGET_DEVICES_USB(func)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CMD_PXE)
|
||||
#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
|
||||
#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
|
||||
#else
|
||||
#define BOOT_TARGET_DEVICES_PXE(func)
|
||||
|
|
|
@ -117,11 +117,7 @@ static inline int pci_eth_init(bd_t *bis)
|
|||
return num;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DM_ETH
|
||||
struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id);
|
||||
#else
|
||||
struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id);
|
||||
#endif
|
||||
struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id);
|
||||
|
||||
#ifdef CONFIG_PHYLIB
|
||||
struct phy_device;
|
||||
|
|
|
@ -22,5 +22,5 @@ obj-y += efi_watchdog.o
|
|||
obj-$(CONFIG_LCD) += efi_gop.o
|
||||
obj-$(CONFIG_DM_VIDEO) += efi_gop.o
|
||||
obj-$(CONFIG_PARTITIONS) += efi_disk.o
|
||||
obj-$(CONFIG_CMD_NET) += efi_net.o
|
||||
obj-$(CONFIG_NET) += efi_net.o
|
||||
obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
|
||||
|
|
|
@ -747,7 +747,7 @@ struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
|
|||
return start;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CMD_NET
|
||||
#ifdef CONFIG_NET
|
||||
struct efi_device_path *efi_dp_from_eth(void)
|
||||
{
|
||||
#ifndef CONFIG_DM_ETH
|
||||
|
|
51
net/Kconfig
51
net/Kconfig
|
@ -22,55 +22,4 @@ config NETCONSOLE
|
|||
Support the 'nc' input/output device for networked console.
|
||||
See README.NetConsole for details.
|
||||
|
||||
config NET_TFTP_VARS
|
||||
bool "Control TFTP timeout and count through environment"
|
||||
depends on CMD_NET
|
||||
default y
|
||||
help
|
||||
If set, allows controlling the TFTP timeout through the
|
||||
environment variable tftptimeout, and the TFTP maximum
|
||||
timeout count through the variable tftptimeoutcountmax.
|
||||
If unset, timeout and maximum are hard-defined as 1 second
|
||||
and 10 timouts per TFTP transfer.
|
||||
|
||||
config BOOTP_BOOTPATH
|
||||
bool "Enable BOOTP BOOTPATH"
|
||||
depends on CMD_NET
|
||||
|
||||
config BOOTP_DNS
|
||||
bool "Enable bootp DNS"
|
||||
depends on CMD_NET
|
||||
|
||||
config BOOTP_GATEWAY
|
||||
bool "Enable BOOTP gateway"
|
||||
depends on CMD_NET
|
||||
|
||||
config BOOTP_HOSTNAME
|
||||
bool "Enable BOOTP hostname"
|
||||
depends on CMD_NET
|
||||
|
||||
config BOOTP_PXE
|
||||
bool "Enable BOOTP PXE"
|
||||
depends on CMD_NET
|
||||
|
||||
config BOOTP_SUBNETMASK
|
||||
bool "Enable BOOTP subnetmask"
|
||||
depends on CMD_NET
|
||||
depends on CMD_NET
|
||||
|
||||
config BOOTP_PXE_CLIENTARCH
|
||||
hex
|
||||
depends on CMD_NET
|
||||
default 0x16 if ARM64
|
||||
default 0x15 if ARM
|
||||
default 0 if X86
|
||||
|
||||
config BOOTP_VCI_STRING
|
||||
string
|
||||
depends on CMD_NET
|
||||
default "U-Boot.armv7" if CPU_V7 || CPU_V7M
|
||||
default "U-Boot.armv8" if ARM64
|
||||
default "U-Boot.arm" if ARM
|
||||
default "U-Boot"
|
||||
|
||||
endif # if NET
|
||||
|
|
14
net/Makefile
14
net/Makefile
|
@ -8,23 +8,23 @@
|
|||
#ccflags-y += -DDEBUG
|
||||
|
||||
obj-y += checksum.o
|
||||
obj-$(CONFIG_CMD_NET) += arp.o
|
||||
obj-$(CONFIG_CMD_NET) += bootp.o
|
||||
obj-$(CONFIG_NET) += arp.o
|
||||
obj-$(CONFIG_CMD_BOOTP) += bootp.o
|
||||
obj-$(CONFIG_CMD_CDP) += cdp.o
|
||||
obj-$(CONFIG_CMD_DNS) += dns.o
|
||||
ifdef CONFIG_DM_ETH
|
||||
obj-$(CONFIG_CMD_NET) += eth-uclass.o
|
||||
obj-$(CONFIG_NET) += eth-uclass.o
|
||||
else
|
||||
obj-$(CONFIG_CMD_NET) += eth_legacy.o
|
||||
obj-$(CONFIG_NET) += eth_legacy.o
|
||||
endif
|
||||
obj-$(CONFIG_CMD_NET) += eth_common.o
|
||||
obj-$(CONFIG_NET) += eth_common.o
|
||||
obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
|
||||
obj-$(CONFIG_CMD_NET) += net.o
|
||||
obj-$(CONFIG_NET) += net.o
|
||||
obj-$(CONFIG_CMD_NFS) += nfs.o
|
||||
obj-$(CONFIG_CMD_PING) += ping.o
|
||||
obj-$(CONFIG_CMD_RARP) += rarp.o
|
||||
obj-$(CONFIG_CMD_SNTP) += sntp.o
|
||||
obj-$(CONFIG_CMD_NET) += tftp.o
|
||||
obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
|
||||
|
||||
# Disable this warning as it is triggered by:
|
||||
# sprintf(buf, index ? "foo%d" : "foo", index)
|
||||
|
|
Loading…
Add table
Reference in a new issue