| // SPDX-License-Identifier: GPL-2.0 |
| * Copyright 2022 Google LLC |
| #include <atsha204a-i2c.h> |
| #define MERCURY_AA1_ATSHA204A_OTP_MAC0 4 |
| #define MERCURY_AA1_ATSHA204A_OTP_MAC1 5 |
| int mercury_aa1_read_mac(u8 *mac) |
| ret = uclass_get_device_by_name(UCLASS_MISC, "atsha204a@64", &dev); |
| ret = atsha204a_wakeup(dev); |
| ret = atsha204a_read(dev, ATSHA204A_ZONE_OTP, false, |
| MERCURY_AA1_ATSHA204A_OTP_MAC0, buf); |
| ret = atsha204a_read(dev, ATSHA204A_ZONE_OTP, false, |
| MERCURY_AA1_ATSHA204A_OTP_MAC1, buf + 4); |
| memcpy(mac, buf, ARP_HLEN); |