Calculate printout based on same core routines.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-/***************************************************************************
+'n/***************************************************************************
* Copyright (C) 2007-2010 by Øyvind Harboe *
* *
* This program is free software; you can redistribute it and/or modify *
* Copyright (C) 2007-2010 by Øyvind Harboe *
* *
* This program is free software; you can redistribute it and/or modify *
- *jtag_speed = 64000/khz;
+ int speed;
+ /* Round speed up to nearest divisor.
+ *
+ * E.g. 16000kHz
+ * (64000 + 15999) / 16000 = 4
+ * (4 + 1) / 2 = 2
+ * 2 * 2 = 4
+ *
+ * 64000 / 4 = 16000
+ *
+ * E.g. 15999
+ * (64000 + 15998) / 15999 = 5
+ * (5 + 1) / 2 = 3
+ * 3 * 2 = 6
+ *
+ * 64000 / 6 = 10666
+ *
+ */
+ speed = (64000 + (khz -1)) / khz;
+ speed = (speed + 1 ) / 2;
+ speed *= 2;
+ if (speed > 8190)
+ {
+ /* maximum dividend */
+ speed = 8190;
+ }
+ *jtag_speed = speed;
return ERROR_INVALID_ARGUMENTS;
}
return ERROR_INVALID_ARGUMENTS;
}
- LOG_USER("jtag_speed %d => JTAG clk=%f", speed, 64.0/(float)speed);
+ int khz;
+ speed &= ~1;
+ zy1000_speed_div(speed, &khz);
+ LOG_USER("jtag_speed %d => JTAG clk=%d kHz", speed, khz);
ZY1000_POKE(ZY1000_JTAG_BASE + 0x14, 0x100);
ZY1000_POKE(ZY1000_JTAG_BASE + 0x14, 0x100);
- ZY1000_POKE(ZY1000_JTAG_BASE + 0x1c, speed&~1);
+ ZY1000_POKE(ZY1000_JTAG_BASE + 0x1c, speed);
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)