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
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
6504322e
Commit
6504322e
authored
Oct 08, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MAC address: use locally assigned, document it
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
642e3865
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
eeprom.c
dev/eeprom.c
+3
-0
sdb-storage.c
dev/sdb-storage.c
+3
-0
wrpc.in
doc/wrpc.in
+5
-2
wrc_main.c
wrc_main.c
+0
-4
No files found.
dev/eeprom.c
View file @
6504322e
...
...
@@ -392,6 +392,9 @@ int get_persistent_mac(uint8_t portnum, uint8_t * mac)
if
(
class
!=
0x28
&&
class
!=
0x42
)
continue
;
rom
=
wrpc_w1_bus
.
devs
[
i
].
rom
;
mac
[
0
]
=
0x22
;
mac
[
1
]
=
0x33
;
mac
[
2
]
=
rom
>>
32
;
mac
[
3
]
=
rom
>>
24
;
mac
[
4
]
=
rom
>>
16
;
mac
[
5
]
=
rom
>>
8
;
...
...
dev/sdb-storage.c
View file @
6504322e
...
...
@@ -317,6 +317,9 @@ int get_persistent_mac(uint8_t portnum, uint8_t * mac)
if
(
class
!=
0x28
&&
class
!=
0x42
)
continue
;
rom
=
wrpc_w1_bus
.
devs
[
i
].
rom
;
mac
[
0
]
=
0x22
;
mac
[
1
]
=
0x33
;
mac
[
2
]
=
rom
>>
32
;
mac
[
3
]
=
rom
>>
24
;
mac
[
4
]
=
rom
>>
16
;
mac
[
5
]
=
rom
>>
8
;
...
...
doc/wrpc.in
View file @
6504322e
...
...
@@ -512,8 +512,11 @@ First you should make sure your board has a proper @sc{mac} address assigned:
@example
wrc# mac get
@end example
If the result of above command is @t
{
MAC
-
address:
22
:
33
:
44
:
55
:
66
:
77
}
, this means
@sc
{
mac
}
was not yet configured and stored in the Flash
/
EEPROM. You should get
If the result of above command is @t
{
MAC
-
address:
22
:
33
:ww:xx:yy:zz
}
, this means
@sc
{
mac
}
was not yet configured and stored in the Flash
/
EEPROM. The value is
based on thermometer serial number as is unique among SPEC devices,
globally accepted as ``locally assigned'', but you might want to assign your own address. A value @t
{
22
:
33
:
44
:
55
:
66
:
77
}
is the final fallback if no
thermometer is found
(
very unlikely
)
. You should get
the @sc
{
mac
}
for your board from its manufacturer. To configure the address and
store it into the Flash
/
EEPROM
(
so that it's automatically loaded every time the
@sc
{
wrpc
}
starts
)
you should type two commands in the @sc
{
wrpc
}
shell:
...
...
wrc_main.c
View file @
6504322e
...
...
@@ -66,10 +66,6 @@ static void wrc_initialize(void)
/*init storage (Flash / W1 EEPROM / I2C EEPROM*/
storage_init
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
);
mac_addr
[
0
]
=
0x08
;
//
mac_addr
[
1
]
=
0x00
;
// CERN OUI
mac_addr
[
2
]
=
0x30
;
//
if
(
get_persistent_mac
(
ONEWIRE_PORT
,
mac_addr
)
==
-
1
)
{
mprintf
(
"Unable to determine MAC address
\n
"
);
mac_addr
[
0
]
=
0x22
;
//
...
...
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