Home
last modified time | relevance | path

Searched refs:enetaddr (Results 1 – 25 of 113) sorted by relevance

12345

/third_party/uboot/u-boot-2020.01/board/compulab/cm_t54/
Dcm_t54.c126 uint8_t enetaddr[6]; in ft_board_setup() local
129 if (eth_env_get_enetaddr("usbethaddr", enetaddr)) { in ft_board_setup()
131 enetaddr, 6, 1); in ft_board_setup()
137 static void generate_mac_addr(uint8_t *enetaddr) in generate_mac_addr() argument
147 enetaddr[0] = 0x02; in generate_mac_addr()
148 enetaddr[1] = readl(reg + 0x10) & 0xff; in generate_mac_addr()
149 enetaddr[2] = readl(reg + 0xC) & 0xff; in generate_mac_addr()
150 enetaddr[3] = readl(reg + 0x8) & 0xff; in generate_mac_addr()
151 enetaddr[4] = readl(reg) & 0xff; in generate_mac_addr()
152 enetaddr[5] = (readl(reg) >> 8) & 0xff; in generate_mac_addr()
[all …]
/third_party/uboot/u-boot-2020.01/board/compulab/cm_t335/
Dcm_t335.c86 static void get_efuse_mac_addr(uchar *enetaddr) in get_efuse_mac_addr() argument
93 enetaddr[0] = mac_hi & 0xFF; in get_efuse_mac_addr()
94 enetaddr[1] = (mac_hi & 0xFF00) >> 8; in get_efuse_mac_addr()
95 enetaddr[2] = (mac_hi & 0xFF0000) >> 16; in get_efuse_mac_addr()
96 enetaddr[3] = (mac_hi & 0xFF000000) >> 24; in get_efuse_mac_addr()
97 enetaddr[4] = mac_lo & 0xFF; in get_efuse_mac_addr()
98 enetaddr[5] = (mac_lo & 0xFF00) >> 8; in get_efuse_mac_addr()
107 uchar enetaddr[6]; in handle_mac_address() local
110 rv = eth_env_get_enetaddr("ethaddr", enetaddr); in handle_mac_address()
114 rv = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); in handle_mac_address()
[all …]
/third_party/uboot/u-boot-2020.01/net/
Dnet_rand.h19 unsigned char enetaddr[ARP_HLEN]; in seed_mac() local
23 memcpy(enetaddr, eth_get_ethaddr(), ARP_HLEN); in seed_mac()
25 seed = enetaddr[5]; in seed_mac()
26 seed ^= enetaddr[4] << 8; in seed_mac()
27 seed ^= enetaddr[3] << 16; in seed_mac()
28 seed ^= enetaddr[2] << 24; in seed_mac()
29 seed ^= enetaddr[1]; in seed_mac()
30 seed ^= enetaddr[0] << 8; in seed_mac()
Deth-uclass.c139 return pdata->enetaddr; in eth_get_ethaddr()
193 if (!is_valid_ethaddr(pdata->enetaddr)) { in eth_write_hwaddr()
195 dev->name, pdata->enetaddr); in eth_write_hwaddr()
230 string_to_enetaddr(value, pdata->enetaddr); in on_ethaddr()
234 memset(pdata->enetaddr, 0, ARP_HLEN); in on_ethaddr()
523 if (!eth_dev_get_mac_address(dev, pdata->enetaddr) || in eth_post_probe()
524 !is_valid_ethaddr(pdata->enetaddr)) { in eth_post_probe()
532 if (!is_zero_ethaddr(pdata->enetaddr) && in eth_post_probe()
533 memcmp(pdata->enetaddr, env_enetaddr, ARP_HLEN)) { in eth_post_probe()
537 pdata->enetaddr); in eth_post_probe()
[all …]
Deth_legacy.c120 string_to_enetaddr(value, dev->enetaddr); in on_ethaddr()
124 memset(dev->enetaddr, 0, ARP_HLEN); in on_ethaddr()
143 if (!is_zero_ethaddr(dev->enetaddr) && in eth_write_hwaddr()
144 memcmp(dev->enetaddr, env_enetaddr, ARP_HLEN)) { in eth_write_hwaddr()
148 dev->enetaddr); in eth_write_hwaddr()
153 memcpy(dev->enetaddr, env_enetaddr, ARP_HLEN); in eth_write_hwaddr()
154 } else if (is_valid_ethaddr(dev->enetaddr)) { in eth_write_hwaddr()
156 dev->enetaddr); in eth_write_hwaddr()
157 } else if (is_zero_ethaddr(dev->enetaddr)) { in eth_write_hwaddr()
159 net_random_ethaddr(dev->enetaddr); in eth_write_hwaddr()
[all …]
Deth_common.c16 uchar *enetaddr) in eth_env_get_enetaddr_by_index() argument
20 return eth_env_get_enetaddr(enetvar, enetaddr); in eth_env_get_enetaddr_by_index()
24 uchar *enetaddr) in eth_env_set_enetaddr_by_index() argument
28 return eth_env_set_enetaddr(enetvar, enetaddr); in eth_env_set_enetaddr_by_index()
/third_party/uboot/u-boot-2020.01/board/timll/devkit8000/
Ddevkit8000.c90 uchar enetaddr[6]; in misc_init_r() local
105 if (!eth_env_get_enetaddr("ethaddr", enetaddr)) { in misc_init_r()
108 enetaddr[0] = 0x02; /* locally administered */ in misc_init_r()
109 enetaddr[1] = readl(&id_base->die_id_1) & 0xff; in misc_init_r()
110 enetaddr[2] = (die_id_0 & 0xff000000) >> 24; in misc_init_r()
111 enetaddr[3] = (die_id_0 & 0x00ff0000) >> 16; in misc_init_r()
112 enetaddr[4] = (die_id_0 & 0x0000ff00) >> 8; in misc_init_r()
113 enetaddr[5] = (die_id_0 & 0x000000ff); in misc_init_r()
114 eth_env_set_enetaddr("ethaddr", enetaddr); in misc_init_r()
/third_party/uboot/u-boot-2020.01/doc/
DREADME.enetaddr21 - ethernet data (struct eth_device -> enetaddr)
36 struct eth_device->enetaddr. If they differ, a warning is printed, and the
39 eth_device->enetaddr, and a warning will be printed.
41 locally-assigned MAC is written to eth_device->enetaddr.
64 then only use the enetaddr member of the eth_device structure. This is done
79 * void string_to_enetaddr(const char *addr, uchar *enetaddr);
83 uchar enetaddr[6];
84 string_to_enetaddr(addr, enetaddr);
85 /* enetaddr now equals { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 } */
87 * int eth_env_get_enetaddr(char *name, uchar *enetaddr);
[all …]
/third_party/uboot/u-boot-2020.01/drivers/usb/eth/
Dlan78xx.c161 static int lan78xx_read_otp_mac(unsigned char *enetaddr, in lan78xx_read_otp_mac() argument
166 memset(enetaddr, 0, 6); in lan78xx_read_otp_mac()
171 enetaddr); in lan78xx_read_otp_mac()
172 if (!ret && is_valid_ethaddr(enetaddr)) { in lan78xx_read_otp_mac()
174 debug("MAC address read from OTP %pM\n", enetaddr); in lan78xx_read_otp_mac()
177 debug("MAC address read from OTP invalid %pM\n", enetaddr); in lan78xx_read_otp_mac()
179 memset(enetaddr, 0, 6); in lan78xx_read_otp_mac()
199 static int lan78xx_read_mac(unsigned char *enetaddr, in lan78xx_read_mac() argument
228 ret = lan7x_read_eeprom_mac(enetaddr, udev); in lan78xx_read_mac()
244 return lan78xx_read_otp_mac(enetaddr, udev); in lan78xx_read_mac()
[all …]
Dlan75xx.c135 unsigned char *enetaddr = pdata->enetaddr; in lan75xx_write_hwaddr() local
136 u32 addr_lo = get_unaligned_le32(&enetaddr[0]); in lan75xx_write_hwaddr()
137 u32 addr_hi = (u32)get_unaligned_le16(&enetaddr[4]); in lan75xx_write_hwaddr()
158 debug("MAC addr %pM written\n", enetaddr); in lan75xx_write_hwaddr()
250 ret = lan7x_read_eeprom_mac(pdata->enetaddr, udev); in lan75xx_read_rom_hwaddr()
252 memset(pdata->enetaddr, 0, 6); in lan75xx_read_rom_hwaddr()
278 lan7x_read_eeprom_mac(pdata->enetaddr, udev); in lan75xx_eth_probe()
Dasix.c295 static int asix_write_hwaddr_common(struct ueth_data *dev, uint8_t *enetaddr) in asix_write_hwaddr_common() argument
300 memcpy(buf, enetaddr, ETH_ALEN); in asix_write_hwaddr_common()
336 struct asix_private *priv, uint8_t *enetaddr) in asix_read_mac_common() argument
348 memcpy(enetaddr + i * 2, buf, 2); in asix_read_mac_common()
356 memcpy(enetaddr, buf, ETH_ALEN); in asix_read_mac_common()
423 static int asix_init_common(struct ueth_data *dev, uint8_t *enetaddr) in asix_init_common() argument
434 if (asix_write_hwaddr_common(dev, enetaddr) < 0) in asix_init_common()
502 return asix_init_common(dev, eth->enetaddr); in asix_init()
587 return asix_write_hwaddr_common(dev, eth->enetaddr); in asix_write_hwaddr()
732 if (asix_read_mac_common(ss, priv, eth->enetaddr)) in asix_eth_get_info()
[all …]
Dlan7x.c304 int lan7x_read_eeprom_mac(unsigned char *enetaddr, struct usb_device *udev) in lan7x_read_eeprom_mac() argument
308 memset(enetaddr, 0, 6); in lan7x_read_eeprom_mac()
310 ret = lan7x_read_eeprom(udev, 0, 1, enetaddr); in lan7x_read_eeprom_mac()
312 if ((ret == 0) && (enetaddr[0] == EEPROM_INDICATOR)) { in lan7x_read_eeprom_mac()
315 enetaddr); in lan7x_read_eeprom_mac()
316 if ((ret == 0) && is_valid_ethaddr(enetaddr)) { in lan7x_read_eeprom_mac()
319 enetaddr); in lan7x_read_eeprom_mac()
323 debug("MAC address read from EEPROM invalid %pM\n", enetaddr); in lan7x_read_eeprom_mac()
325 memset(enetaddr, 0, 6); in lan7x_read_eeprom_mac()
Dsmsc95xx.c364 static int smsc95xx_init_mac_address(unsigned char *enetaddr, in smsc95xx_init_mac_address() argument
370 ret = smsc95xx_read_eeprom(udev, EEPROM_MAC_OFFSET, ETH_ALEN, enetaddr); in smsc95xx_init_mac_address()
374 if (is_valid_ethaddr(enetaddr)) { in smsc95xx_init_mac_address()
391 unsigned char *enetaddr) in smsc95xx_write_hwaddr_common() argument
393 u32 addr_lo = get_unaligned_le32(&enetaddr[0]); in smsc95xx_write_hwaddr_common()
394 u32 addr_hi = get_unaligned_le16(&enetaddr[4]); in smsc95xx_write_hwaddr_common()
407 debug("MAC %pM\n", enetaddr); in smsc95xx_write_hwaddr_common()
472 unsigned char *enetaddr) in smsc95xx_init_common() argument
522 if (!priv->have_hwaddr && smsc95xx_init_mac_address(enetaddr, udev) == in smsc95xx_init_common()
530 ret = smsc95xx_write_hwaddr_common(udev, priv, enetaddr); in smsc95xx_init_common()
[all …]
/third_party/uboot/u-boot-2020.01/board/dhelectronics/dh_imx6/
Ddh_imx6.c134 unsigned char enetaddr[6]; in setup_dhcom_mac_from_fuse() local
137 ret = eth_env_get_enetaddr("ethaddr", enetaddr); in setup_dhcom_mac_from_fuse()
141 imx_get_mac_from_fuse(0, enetaddr); in setup_dhcom_mac_from_fuse()
143 if (is_valid_ethaddr(enetaddr)) { in setup_dhcom_mac_from_fuse()
144 eth_env_set_enetaddr("ethaddr", enetaddr); in setup_dhcom_mac_from_fuse()
160 ret = i2c_eeprom_read(dev, 0xfa, enetaddr, 0x6); in setup_dhcom_mac_from_fuse()
166 if (is_valid_ethaddr(enetaddr)) in setup_dhcom_mac_from_fuse()
167 eth_env_set_enetaddr("ethaddr", enetaddr); in setup_dhcom_mac_from_fuse()
/third_party/uboot/u-boot-2020.01/drivers/net/
Dcs8900.c132 dev->enetaddr[i * 2] = Addr & 0xFF; in cs8900_get_enetaddr()
133 dev->enetaddr[i * 2 + 1] = Addr >> 8; in cs8900_get_enetaddr()
149 uchar *enetaddr = dev->enetaddr; in cs8900_init() local
162 put_reg(dev, PP_IA + 0, enetaddr[0] | (enetaddr[1] << 8)); in cs8900_init()
163 put_reg(dev, PP_IA + 2, enetaddr[2] | (enetaddr[3] << 8)); in cs8900_init()
164 put_reg(dev, PP_IA + 4, enetaddr[4] | (enetaddr[5] << 8)); in cs8900_init()
Dbcm-sf2-eth.c142 dev->enetaddr[0], dev->enetaddr[1], dev->enetaddr[2], in bcm_sf2_eth_write_hwaddr()
143 dev->enetaddr[3], dev->enetaddr[4], dev->enetaddr[5]); in bcm_sf2_eth_write_hwaddr()
145 return eth->set_mac_addr(dev->enetaddr); in bcm_sf2_eth_write_hwaddr()
Dat91_emac.c460 netdev->enetaddr[5], netdev->enetaddr[4], netdev->enetaddr[3], in at91emac_write_hwaddr()
461 netdev->enetaddr[2], netdev->enetaddr[1], netdev->enetaddr[0]); in at91emac_write_hwaddr()
462 writel( (netdev->enetaddr[0] | netdev->enetaddr[1] << 8 | in at91emac_write_hwaddr()
463 netdev->enetaddr[2] << 16 | netdev->enetaddr[3] << 24), in at91emac_write_hwaddr()
465 writel((netdev->enetaddr[4] | netdev->enetaddr[5] << 8), &emac->sa2h); in at91emac_write_hwaddr()
Dlpc32xx_eth.c433 writel((unsigned long) (dev->enetaddr[0] | in lpc32xx_eth_write_hwaddr()
434 (dev->enetaddr[1] << 8)), &regs->sa2); in lpc32xx_eth_write_hwaddr()
435 writel((unsigned long) (dev->enetaddr[2] | in lpc32xx_eth_write_hwaddr()
436 (dev->enetaddr[3] << 8)), &regs->sa1); in lpc32xx_eth_write_hwaddr()
437 writel((unsigned long) (dev->enetaddr[4] | in lpc32xx_eth_write_hwaddr()
438 (dev->enetaddr[5] << 8)), &regs->sa0); in lpc32xx_eth_write_hwaddr()
484 writel((unsigned long) (dev->enetaddr[0] | in lpc32xx_eth_init()
485 (dev->enetaddr[1] << 8)), &regs->sa2); in lpc32xx_eth_init()
486 writel((unsigned long) (dev->enetaddr[2] | in lpc32xx_eth_init()
487 (dev->enetaddr[3] << 8)), &regs->sa1); in lpc32xx_eth_init()
[all …]
Dsmc911x.c24 uchar *m = dev->enetaddr; in smc911x_handle_mac_address()
268 dev->enetaddr[0] = addrl; in smc911x_initialize()
269 dev->enetaddr[1] = addrl >> 8; in smc911x_initialize()
270 dev->enetaddr[2] = addrl >> 16; in smc911x_initialize()
271 dev->enetaddr[3] = addrl >> 24; in smc911x_initialize()
272 dev->enetaddr[4] = addrh; in smc911x_initialize()
273 dev->enetaddr[5] = addrh >> 8; in smc911x_initialize()
Dsunxi_emac.c331 static int _sunxi_write_hwaddr(struct emac_eth_dev *priv, u8 *enetaddr) in _sunxi_write_hwaddr() argument
336 enetaddr_lo = enetaddr[2] | (enetaddr[1] << 8) | (enetaddr[0] << 16); in _sunxi_write_hwaddr()
337 enetaddr_hi = enetaddr[5] | (enetaddr[4] << 8) | (enetaddr[3] << 16); in _sunxi_write_hwaddr()
345 static int _sunxi_emac_eth_init(struct emac_eth_dev *priv, u8 *enetaddr) in _sunxi_emac_eth_init() argument
368 _sunxi_write_hwaddr(priv, enetaddr); in _sunxi_emac_eth_init()
536 return _sunxi_emac_eth_init(dev->priv, pdata->enetaddr); in sunxi_emac_eth_start()
Dax88180.c545 dev->enetaddr[0] | (((unsigned short)dev->enetaddr[1]) << 8); in ax88180_init()
549 dev->enetaddr[2] | (((unsigned short)dev->enetaddr[3]) << 8); in ax88180_init()
553 dev->enetaddr[4] | (((unsigned short)dev->enetaddr[5]) << 8); in ax88180_init()
692 dev->enetaddr[0] = (unsigned char)macid0_val; in ax88180_read_mac_addr()
693 dev->enetaddr[1] = (unsigned char)(macid0_val >> 8); in ax88180_read_mac_addr()
694 dev->enetaddr[2] = (unsigned char)macid1_val; in ax88180_read_mac_addr()
695 dev->enetaddr[3] = (unsigned char)(macid1_val >> 8); in ax88180_read_mac_addr()
696 dev->enetaddr[4] = (unsigned char)macid2_val; in ax88180_read_mac_addr()
697 dev->enetaddr[5] = (unsigned char)(macid2_val >> 8); in ax88180_read_mac_addr()
Drtl8169.c849 static void rtl8169_common_start(struct udevice *dev, unsigned char *enetaddr, in rtl8169_common_start() argument
852 static void rtl8169_common_start(pci_dev_t dev, unsigned char *enetaddr, in rtl8169_common_start()
872 txb[0] = enetaddr[0]; in rtl8169_common_start()
873 txb[1] = enetaddr[1]; in rtl8169_common_start()
874 txb[2] = enetaddr[2]; in rtl8169_common_start()
875 txb[3] = enetaddr[3]; in rtl8169_common_start()
876 txb[4] = enetaddr[4]; in rtl8169_common_start()
877 txb[5] = enetaddr[5]; in rtl8169_common_start()
890 rtl8169_common_start(dev, plat->enetaddr, priv->iobase); in rtl8169_eth_start()
901 dev->enetaddr, dev->iobase); in rtl_reset()
[all …]
/third_party/uboot/u-boot-2020.01/arch/arm/mach-stm32mp/
Dcpu.c458 uchar enetaddr[6]; in setup_mac_address() local
462 if (eth_env_get_enetaddr("ethaddr", enetaddr)) in setup_mac_address()
477 enetaddr[i] = ((uint8_t *)&otp)[i]; in setup_mac_address()
479 if (!is_valid_ethaddr(enetaddr)) { in setup_mac_address()
480 pr_err("invalid MAC address in OTP %pM\n", enetaddr); in setup_mac_address()
483 pr_debug("OTP MAC address = %pM\n", enetaddr); in setup_mac_address()
484 ret = !eth_env_set_enetaddr("ethaddr", enetaddr); in setup_mac_address()
487 enetaddr, ret); in setup_mac_address()
/third_party/uboot/u-boot-2020.01/lib/
Dnet_utils.c45 void string_to_enetaddr(const char *addr, uint8_t *enetaddr) in string_to_enetaddr() argument
50 if (!enetaddr) in string_to_enetaddr()
54 enetaddr[i] = addr ? simple_strtoul(addr, &end, 16) : 0; in string_to_enetaddr()
/third_party/uboot/u-boot-2020.01/board/compulab/cl-som-imx7/
Dcl-som-imx7.c181 unsigned char enetaddr[6]; in cl_som_imx7_handle_mac_address() local
183 ret = eth_env_get_enetaddr(env_var, enetaddr); in cl_som_imx7_handle_mac_address()
187 ret = cl_eeprom_read_mac_addr(enetaddr, eeprom_bus); in cl_som_imx7_handle_mac_address()
191 ret = is_valid_ethaddr(enetaddr); in cl_som_imx7_handle_mac_address()
195 return eth_env_set_enetaddr(env_var, enetaddr); in cl_som_imx7_handle_mac_address()

12345