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
efd393c8
Commit
efd393c8
authored
Oct 10, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeprom: don't pass redundant parameters to eeprom_phtrans
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
4ed88edb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
10 deletions
+9
-10
eeprom.c
dev/eeprom.c
+1
-1
rxts_calibrator.c
dev/rxts_calibrator.c
+3
-3
sdb-eeprom.c
dev/sdb-eeprom.c
+1
-1
eeprom.h
include/eeprom.h
+1
-1
cmd_calib.c
shell/cmd_calib.c
+3
-4
No files found.
dev/eeprom.c
View file @
efd393c8
...
...
@@ -227,7 +227,7 @@ int eeprom_match_sfp(struct s_sfpinfo * sfp)
return
0
;
}
int
8_t
eeprom_phtrans
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
*
val
,
int
eeprom_phtrans
(
uint32_t
*
val
,
uint8_t
write
)
{
int8_t
ret
;
...
...
dev/rxts_calibrator.c
View file @
efd393c8
...
...
@@ -213,7 +213,7 @@ static int calib_t24p_master(uint32_t *value)
{
int
rv
;
rv
=
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
value
,
0
);
rv
=
eeprom_phtrans
(
value
,
0
);
if
(
rv
<
0
)
{
pp_printf
(
"Error %d while reading EEPROM
\n
"
,
rv
);
return
rv
;
...
...
@@ -241,9 +241,9 @@ static int calib_t24p_slave(uint32_t *value)
* Let's see if we have a matching value in EEPROM:
* accept a 200ps difference, otherwise rewrite eeprom
*/
rv
=
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
&
prev
,
0
/* rd */
);
rv
=
eeprom_phtrans
(
&
prev
,
0
/* rd */
);
if
(
rv
<
0
||
(
prev
<
*
value
-
200
)
||
(
prev
>
*
value
+
200
))
{
rv
=
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
value
,
1
);
rv
=
eeprom_phtrans
(
value
,
1
);
pp_printf
(
"Wrote new t24p value: %d ps (%s)
\n
"
,
*
value
,
rv
<
0
?
"Failed"
:
"Success"
);
}
...
...
dev/sdb-eeprom.c
View file @
efd393c8
...
...
@@ -381,7 +381,7 @@ int eeprom_match_sfp(struct s_sfpinfo * sfp)
* Phase transition ("calibration" file)
*/
#define VALIDITY_BIT 0x80000000
int
8_t
eeprom_phtrans
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
*
valp
,
int
eeprom_phtrans
(
uint32_t
*
valp
,
uint8_t
write
)
{
int
ret
=
-
1
;
...
...
include/eeprom.h
View file @
efd393c8
...
...
@@ -34,7 +34,7 @@ int eeprom_match_sfp(struct s_sfpinfo *sfp);
int
eeprom_get_sfp
(
struct
s_sfpinfo
*
sfp
,
uint8_t
add
,
uint8_t
pos
);
int
8_t
eeprom_phtrans
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
*
val
,
int
eeprom_phtrans
(
uint32_t
*
val
,
uint8_t
write
);
int8_t
eeprom_init_erase
(
uint8_t
i2cif
,
uint8_t
i2c_addr
);
...
...
shell/cmd_calib.c
View file @
efd393c8
...
...
@@ -27,9 +27,9 @@ static int cmd_calibration(const char *args[])
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"force"
))
{
if
(
measure_t24p
(
&
trans
)
<
0
)
return
-
1
;
return
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
&
trans
,
1
);
return
eeprom_phtrans
(
&
trans
,
1
);
}
else
if
(
!
args
[
0
])
{
if
(
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
&
trans
,
0
)
>
0
)
{
if
(
eeprom_phtrans
(
&
trans
,
0
)
>
0
)
{
mprintf
(
"Found phase transition in EEPROM: %dps
\n
"
,
trans
);
cal_phase_transition
=
trans
;
...
...
@@ -39,8 +39,7 @@ static int cmd_calibration(const char *args[])
if
(
measure_t24p
(
&
trans
)
<
0
)
return
-
1
;
cal_phase_transition
=
trans
;
return
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
&
trans
,
1
);
return
eeprom_phtrans
(
&
trans
,
1
);
}
}
...
...
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