-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
udelay.c: Enable providing delay calibration value through CLI #134
base: master
Are you sure you want to change the base?
Conversation
This commit implements --delay option to retrieve and provide the calibration loop delay through the command line. The delay calibration procedure can take up to few seconds, which adds up when executed a number of times consecutively. Therefore, this provides a means to execute it only once, and then re-use the calibrated value on subsequent runs. Also, it implements a sanity check, expecting the value to land within 10% of the theoretical delay expectance, otherwise it ignores the provided value and runs the calibration procedure instead. modified: cli_classic.c modified: flashrom.8.tmpl modified: programmer.h modified: udelay.c Change-Id: Iea2a7f62300663bc0a32ed4abced57c8c55c90c8 Signed-off-by: Hrvoje Cavrak <hrvoje@hrvoje.org>
cli_classic.c
Outdated
" -d | --delay <value> set loop delay calibration manually\n" | ||
" --delay get show loop delay calibration\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to rename it since the delay is a bit too generic I think. loop-delay maybe? Also what is the unit of the delay?
But let's move to gerrit and other devs will comment on this I think too.
cli_classic.c
Outdated
@@ -156,6 +159,7 @@ int main(int argc, char *argv[]) | |||
{"help", 0, NULL, 'h'}, | |||
{"version", 0, NULL, 'R'}, | |||
{"output", 1, NULL, 'o'}, | |||
{"delay", 1, NULL, 'd'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 1, part indentation is misaligned.
udelay.c
Outdated
@@ -221,6 +221,25 @@ void myusec_calibrate_delay(void) | |||
msg_pinfo("OK.\n"); | |||
} | |||
|
|||
void set_external_calibration(unsigned long external_micro) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The '{' should go to the next line
udelay.c
Outdated
} | ||
} | ||
|
||
unsigned long get_calibration_value(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The '{' should go to the next line
Fixed, submitted through Gerrit. |
This commit implements --delay option to retrieve and provide the calibration
loop delay through the command line. The delay calibration procedure can take
up to few seconds, which adds up when executed a number of times consecutively.
Therefore, this provides a means to execute it only once, and then re-use the
calibrated value on subsequent runs. Also, it implements a sanity check,
expecting the value to land within 10% of the theoretical delay expectance,
otherwise it ignores the provided value and runs the calibration procedure
instead.
Change-Id: Iea2a7f62300663bc0a32ed4abced57c8c55c90c8
Signed-off-by: Hrvoje Cavrak hrvoje@hrvoje.org