-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow each target to define the way to obtain its MAC address
At the moment only 2 targets defines it: PandABlocks: MAC from a qspi memory PAndABrick: MAC from a secure EEPROM This is part of a solution for issue #67
- Loading branch information
1 parent
55f26d9
commit d3b3ca2
Showing
5 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
get_mac_address() | ||
{ | ||
cat /qspi/MAC | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
get_mac_address() { | ||
# Trying to address 0 sends a 0 byte which wakes up the EEPROM | ||
i2ctransfer -a -y 0 r1@0x0 &>/dev/null | ||
# Send command to read 32 bytes of OTP zone starting at offset 0 | ||
i2ctransfer -y 0 w8@0x64 0x3 0x7 0x2 0x81 0x0 0x0 0x0a 0x27 | ||
resp=$(i2ctransfer -y 0 r35@0x64) | ||
# Extract the MAC address and format it | ||
resp=${resp:85:29} | ||
resp=${resp//0x/} | ||
resp=${resp// /:} | ||
echo $resp | ||
} |
Empty file.
Empty file.