From 128590bee0036dab4d0ce2d9957f1eefcc8882cd Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 28 Jan 2013 21:20:25 -0300 Subject: [PATCH] ubb-patgen/ubb-patgen.c: new option -I inter_s to select "unsafe" frequencies --- ubb-patgen/README | 8 ++++---- ubb-patgen/ubb-patgen.c | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ubb-patgen/README b/ubb-patgen/README index a250030..82fdada 100644 --- a/ubb-patgen/README +++ b/ubb-patgen/README @@ -63,10 +63,6 @@ bus clk = 100.962 kHz (+0.96%) This warning can be suppressed with the option -q. -The option -F works like -f but also allows frequencies that may -exceed the hardware's capabilities. As a consequence, the MMC -controller may hang. - The frequency can also be specified as the cycle time with the option -i: @@ -75,6 +71,10 @@ option -i: The meaning of an appended + or - changes here, e.g., 10us+ selects a slower clock (producing an interval of at least 10 us). +The options -F and -I work like -f and -i but also allows +frequencies that may exceed the hardware's capabilities. As a +consequence, the MMC controller may hang. + Clock output ------------ diff --git a/ubb-patgen/ubb-patgen.c b/ubb-patgen/ubb-patgen.c index 84206f6..2a07eb1 100644 --- a/ubb-patgen/ubb-patgen.c +++ b/ubb-patgen/ubb-patgen.c @@ -691,9 +691,9 @@ static void usage(const char *name) { fprintf(stderr, "usage: %s\n" -" %s [-q] (-f|-F) freq_hz|-i interval_s\n" -" %s [-q] [(-f|-F) freq_hz|-i interval_s] -c [active_s]\n" -" %s [-q] [(-f|-F) freq_hz|-i interval_s]\n" +" %s [-q] (-f|-F) freq_hz|(-i|-I) interval_s\n" +" %s [-q] [(-f|-F) freq_hz|(-i|-I) interval_s] -c [active_s]\n" +" %s [-q] [(-f|-F) freq_hz|(-i|-I) interval_s]\n" " [-C|-t 0|1... [-d debounce_s]] [-w wait_s] [-m mask] [-p]\n" " file|pattern\n\n" " -c output bus clock on CLK without sending a pattern\n" @@ -703,6 +703,7 @@ static void usage(const char *name) " -F freq_hz like -f, but also allow \"overclocking\"\n" " -i inter_s set bus clock such that one cycle equals the specified " "interval\n" +" -I inter_s like -i, but also allow \"overclocking\"\n" " -m mask use only the DATx lines specified in the mask (default: 0xf)\n" " -p force interpretation of argument as pattern (and not file)\n" " -q quiet. Don't pretty-print frequencies; don't report clock\n" @@ -749,7 +750,7 @@ int main(int argc, char **argv) unsigned long tmp; const char *p; - while ((c = getopt(argc, argv, "cCd:f:F:i:m:pqt:w:")) != EOF) + while ((c = getopt(argc, argv, "cCd:f:F:i:I:m:pqt:w:")) != EOF) switch (c) { case 'c': clk_only = 1; @@ -772,6 +773,9 @@ int main(int argc, char **argv) if (!frequency(optarg, &bus_hz, &bus_rel)) usage(*argv); break; + case 'I': + all = 1; + /* fall through */ case 'i': if (!interval(optarg, &bus_hz, &bus_rel)) usage(*argv);