Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
31
Issues
31
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
db2c5eea
Commit
db2c5eea
authored
Oct 10, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev/eeprom.c: fix missing bits in legacy eeprom layout
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
f28a586b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
eeprom.c
dev/eeprom.c
+37
-0
No files found.
dev/eeprom.c
View file @
db2c5eea
...
...
@@ -358,3 +358,40 @@ int8_t eeprom_init_readcmd(uint8_t i2cif, uint8_t i2c_addr, uint8_t *buf,
return
i
;
}
#ifdef CONFIG_W1
#include <w1.h>
/*
* The "persistent mac" thing was part of onewire.c, and it's not something
* I can understand, I admit.
*
* Now, cards with w1 eeprom already use sdb-eeprom.c as far as I
* know, while this eeprom.c file is still selected for devices that
* have i2c eeprom and never saved a persistent mac address. But maybe
* they prefer w1 for temperature (well, sockitowm will go)
*/
int8_t
set_persistent_mac
(
uint8_t
portnum
,
uint8_t
*
mac
)
{
pp_printf
(
"Can't save persistent MAC address
\n
"
);
return
-
1
;
}
int32_t
get_persistent_mac
(
uint8_t
portnum
,
uint8_t
*
mac
)
{
int
i
,
class
;
uint64_t
rom
;
pp_printf
(
"%s: Using W1 serial number
\n
"
,
__func__
);
for
(
i
=
0
;
i
<
W1_MAX_DEVICES
;
i
++
)
{
class
=
w1_class
(
wrpc_w1_bus
.
devs
+
i
);
if
(
class
!=
0x28
&&
class
!=
0x42
)
continue
;
rom
=
wrpc_w1_bus
.
devs
[
i
].
rom
;
mac
[
3
]
=
rom
>>
24
;
mac
[
4
]
=
rom
>>
16
;
mac
[
5
]
=
rom
>>
8
;
}
return
0
;
}
#endif
/* CONFIG_W1 */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment