/external/u-boot/board/compulab/cm_t54/ |
D | cm_t54.c | 126 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 …]
|
/external/u-boot/board/compulab/cm_t3517/ |
D | cm_t3517.c | 132 static int am3517_get_efuse_enetaddr(u8 *enetaddr) in am3517_get_efuse_enetaddr() argument 137 enetaddr[0] = (u8)((msb >> 16) & 0xff); in am3517_get_efuse_enetaddr() 138 enetaddr[1] = (u8)((msb >> 8) & 0xff); in am3517_get_efuse_enetaddr() 139 enetaddr[2] = (u8)(msb & 0xff); in am3517_get_efuse_enetaddr() 140 enetaddr[3] = (u8)((lsb >> 16) & 0xff); in am3517_get_efuse_enetaddr() 141 enetaddr[4] = (u8)((lsb >> 8) & 0xff); in am3517_get_efuse_enetaddr() 142 enetaddr[5] = (u8)(lsb & 0xff); in am3517_get_efuse_enetaddr() 144 return is_valid_ethaddr(enetaddr); in am3517_get_efuse_enetaddr() 158 static inline int am3517_get_efuse_enetaddr(u8 *enetaddr) { return 1; } in am3517_get_efuse_enetaddr() argument 168 unsigned char enetaddr[6]; in cm_t3517_handle_mac_address() local [all …]
|
/external/u-boot/board/compulab/cm_t335/ |
D | cm_t335.c | 85 static void get_efuse_mac_addr(uchar *enetaddr) in get_efuse_mac_addr() argument 92 enetaddr[0] = mac_hi & 0xFF; in get_efuse_mac_addr() 93 enetaddr[1] = (mac_hi & 0xFF00) >> 8; in get_efuse_mac_addr() 94 enetaddr[2] = (mac_hi & 0xFF0000) >> 16; in get_efuse_mac_addr() 95 enetaddr[3] = (mac_hi & 0xFF000000) >> 24; in get_efuse_mac_addr() 96 enetaddr[4] = mac_lo & 0xFF; in get_efuse_mac_addr() 97 enetaddr[5] = (mac_lo & 0xFF00) >> 8; in get_efuse_mac_addr() 106 uchar enetaddr[6]; in handle_mac_address() local 109 rv = eth_env_get_enetaddr("ethaddr", enetaddr); in handle_mac_address() 113 rv = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); in handle_mac_address() [all …]
|
/external/u-boot/net/ |
D | net_rand.h | 19 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()
|
D | eth-uclass.c | 138 return pdata->enetaddr; in eth_get_ethaddr() 192 if (!is_valid_ethaddr(pdata->enetaddr)) { in eth_write_hwaddr() 194 dev->name, pdata->enetaddr); in eth_write_hwaddr() 229 eth_parse_enetaddr(value, pdata->enetaddr); in on_ethaddr() 233 memset(pdata->enetaddr, 0, ARP_HLEN); in on_ethaddr() 499 if (!is_zero_ethaddr(pdata->enetaddr) && in eth_post_probe() 500 memcmp(pdata->enetaddr, env_enetaddr, ARP_HLEN)) { in eth_post_probe() 504 pdata->enetaddr); in eth_post_probe() 510 memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN); in eth_post_probe() 511 } else if (is_valid_ethaddr(pdata->enetaddr)) { in eth_post_probe() [all …]
|
D | eth_legacy.c | 119 eth_parse_enetaddr(value, dev->enetaddr); in on_ethaddr() 123 memset(dev->enetaddr, 0, ARP_HLEN); in on_ethaddr() 142 if (!is_zero_ethaddr(dev->enetaddr) && in eth_write_hwaddr() 143 memcmp(dev->enetaddr, env_enetaddr, ARP_HLEN)) { in eth_write_hwaddr() 147 dev->enetaddr); in eth_write_hwaddr() 152 memcpy(dev->enetaddr, env_enetaddr, ARP_HLEN); in eth_write_hwaddr() 153 } else if (is_valid_ethaddr(dev->enetaddr)) { in eth_write_hwaddr() 155 dev->enetaddr); in eth_write_hwaddr() 156 } else if (is_zero_ethaddr(dev->enetaddr)) { in eth_write_hwaddr() 158 net_random_ethaddr(dev->enetaddr); in eth_write_hwaddr() [all …]
|
D | eth_common.c | 16 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()
|
/external/u-boot/board/timll/devkit8000/ |
D | devkit8000.c | 90 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()
|
/external/u-boot/doc/ |
D | README.enetaddr | 21 - 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 eth_parse_enetaddr(const char *addr, uchar *enetaddr); 83 uchar enetaddr[6]; 84 eth_parse_enetaddr(addr, enetaddr); 85 /* enetaddr now equals { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 } */ 87 * int eth_env_get_enetaddr(char *name, uchar *enetaddr); [all …]
|
/external/u-boot/drivers/usb/eth/ |
D | lan78xx.c | 161 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 …]
|
D | lan75xx.c | 135 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()
|
D | asix.c | 295 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 …]
|
D | lan7x.c | 304 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()
|
D | smsc95xx.c | 364 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 …]
|
/external/u-boot/board/compulab/cl-som-am57x/ |
D | eth.c | 96 uint8_t enetaddr[6]; in cl_som_am57x_handle_mac_address() local 98 ret = eth_env_get_enetaddr(env_name, enetaddr); in cl_som_am57x_handle_mac_address() 102 ret = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS); in cl_som_am57x_handle_mac_address() 104 if (ret || !is_valid_ethaddr(enetaddr)) in cl_som_am57x_handle_mac_address() 105 cl_som_am57x_efuse_read_mac_addr(enetaddr, port_num); in cl_som_am57x_handle_mac_address() 107 if (!is_valid_ethaddr(enetaddr)) in cl_som_am57x_handle_mac_address() 110 ret = eth_env_set_enetaddr(env_name, enetaddr); in cl_som_am57x_handle_mac_address()
|
/external/u-boot/drivers/net/ |
D | cs8900.c | 132 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()
|
D | bcm-sf2-eth.c | 142 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()
|
D | at91_emac.c | 460 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()
|
D | sunxi_emac.c | 329 static int _sunxi_write_hwaddr(struct emac_eth_dev *priv, u8 *enetaddr) in _sunxi_write_hwaddr() argument 334 enetaddr_lo = enetaddr[2] | (enetaddr[1] << 8) | (enetaddr[0] << 16); in _sunxi_write_hwaddr() 335 enetaddr_hi = enetaddr[5] | (enetaddr[4] << 8) | (enetaddr[3] << 16); in _sunxi_write_hwaddr() 343 static int _sunxi_emac_eth_init(struct emac_eth_dev *priv, u8 *enetaddr) in _sunxi_emac_eth_init() argument 366 _sunxi_write_hwaddr(priv, enetaddr); in _sunxi_emac_eth_init() 530 return _sunxi_emac_eth_init(dev->priv, pdata->enetaddr); in sunxi_emac_eth_start()
|
D | lpc32xx_eth.c | 432 writel((unsigned long) (dev->enetaddr[0] | in lpc32xx_eth_write_hwaddr() 433 (dev->enetaddr[1] << 8)), ®s->sa2); in lpc32xx_eth_write_hwaddr() 434 writel((unsigned long) (dev->enetaddr[2] | in lpc32xx_eth_write_hwaddr() 435 (dev->enetaddr[3] << 8)), ®s->sa1); in lpc32xx_eth_write_hwaddr() 436 writel((unsigned long) (dev->enetaddr[4] | in lpc32xx_eth_write_hwaddr() 437 (dev->enetaddr[5] << 8)), ®s->sa0); in lpc32xx_eth_write_hwaddr() 483 writel((unsigned long) (dev->enetaddr[0] | in lpc32xx_eth_init() 484 (dev->enetaddr[1] << 8)), ®s->sa2); in lpc32xx_eth_init() 485 writel((unsigned long) (dev->enetaddr[2] | in lpc32xx_eth_init() 486 (dev->enetaddr[3] << 8)), ®s->sa1); in lpc32xx_eth_init() [all …]
|
D | ax88180.c | 545 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()
|
D | smc911x.c | 24 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()
|
/external/u-boot/arch/arm/mach-stm32mp/ |
D | cpu.c | 294 uchar enetaddr[6]; in setup_mac_address() local 298 if (eth_env_get_enetaddr("ethaddr", enetaddr)) in setup_mac_address() 313 enetaddr[i] = ((uint8_t *)&otp)[i]; in setup_mac_address() 315 if (!is_valid_ethaddr(enetaddr)) { in setup_mac_address() 316 pr_err("invalid MAC address in OTP %pM", enetaddr); in setup_mac_address() 319 pr_debug("OTP MAC address = %pM\n", enetaddr); in setup_mac_address() 320 ret = !eth_env_set_enetaddr("ethaddr", enetaddr); in setup_mac_address() 323 enetaddr, ret); in setup_mac_address()
|
/external/u-boot/board/dhelectronics/dh_imx6/ |
D | dh_imx6.c | 281 unsigned char enetaddr[6]; in setup_dhcom_mac_from_fuse() local 284 ret = eth_env_get_enetaddr("ethaddr", enetaddr); in setup_dhcom_mac_from_fuse() 288 imx_get_mac_from_fuse(0, enetaddr); in setup_dhcom_mac_from_fuse() 290 if (is_valid_ethaddr(enetaddr)) { in setup_dhcom_mac_from_fuse() 291 eth_env_set_enetaddr("ethaddr", enetaddr); in setup_dhcom_mac_from_fuse() 301 ret = i2c_read(EEPROM_I2C_ADDRESS, 0xfa, 0x1, enetaddr, 0x6); in setup_dhcom_mac_from_fuse() 307 if (is_valid_ethaddr(enetaddr)) in setup_dhcom_mac_from_fuse() 308 eth_env_set_enetaddr("ethaddr", enetaddr); in setup_dhcom_mac_from_fuse()
|
/external/u-boot/board/compulab/cl-som-imx7/ |
D | cl-som-imx7.c | 180 unsigned char enetaddr[6]; in cl_som_imx7_handle_mac_address() local 182 ret = eth_env_get_enetaddr(env_var, enetaddr); in cl_som_imx7_handle_mac_address() 186 ret = cl_eeprom_read_mac_addr(enetaddr, eeprom_bus); in cl_som_imx7_handle_mac_address() 190 ret = is_valid_ethaddr(enetaddr); in cl_som_imx7_handle_mac_address() 194 return eth_env_set_enetaddr(env_var, enetaddr); in cl_som_imx7_handle_mac_address()
|