Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ee321a5 authored by Dedy Lansky's avatar Dedy Lansky Committed by Lior David
Browse files

wil6210: use OEM MAC address from OTP



In addition to existing MAC address field in OTP, new field added for
OEM MAC address.
wil6210 gives precedence to the new OEM MAC address and will use it if
its valid.

Change-Id: I8f3e1be8832505d5d2eea7a9ffbe68fddda9c475
Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
Signed-off-by: default avatarLior David <liord@codeaurora.org>
parent 862331f3
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -1399,6 +1399,13 @@ static int wil_get_otp_info(struct wil6210_priv *wil)
	u8 mac[8];
	int mac_addr;

	/* OEM MAC has precedence */
	mac_addr = RGF_OTP_OEM_MAC;
	wil_memcpy_fromio_32(mac, wil->csr + HOSTADDR(mac_addr), sizeof(mac));

	if (is_valid_ether_addr(mac)) {
		wil_info(wil, "using OEM MAC %pM\n", mac);
	} else {
		if (wil->hw_version >= HW_VER_TALYN_MB)
			mac_addr = RGF_OTP_MAC_TALYN_MB;
		else
@@ -1406,6 +1413,8 @@ static int wil_get_otp_info(struct wil6210_priv *wil)

		wil_memcpy_fromio_32(mac, wil->csr + HOSTADDR(mac_addr),
				     sizeof(mac));
	}

	if (!is_valid_ether_addr(mac)) {
		u8 dummy_mac[ETH_ALEN] = {
			0x00, 0xde, 0xad, 0x12, 0x34, 0x56,
+1 −0
Original line number Diff line number Diff line
@@ -357,6 +357,7 @@ struct RGF_ICR {
	#define REVISION_ID_SPARROW_D0	(0x3)

#define RGF_OTP_MAC_TALYN_MB		(0x8a0304)
#define RGF_OTP_OEM_MAC			(0x8a0334)
#define RGF_OTP_MAC			(0x8a0620)

/* Talyn-MB */