1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-01 18:55:36 +00:00
Commit Graph

58 Commits

Author SHA1 Message Date
Denis Ahrens
f553c50b7b ztex: if we had only errors in one round we do not count the errors
to detect a totally non working fpga we only do that if the last
round had some valid nonces.

if we would count the errors the automatic megahertz adaption
would drop and never recover.
2013-01-01 22:52:46 +01:00
Denis Ahrens
ccee686aee ztex: precheck the secondary solutions to avoid hw errors
the ztex bitstreams gives back the latest checked nonce and
its hash7 value and two possible solutions.

every 250ms the latest nonce is checked and compared with hash7
to count hw errors and adapt the MHz value. one change is to
use the solutions even if the latest nonce is not correct. the
original java ztex code also does it this way.

since the second solution is often not correct we have alot
of hw errors. now we always check the second solution before
we submit it to the cgminer main code.

the java code also ignores all hw errors 500ms after a sendHash.
we now do the same. this can possibly yield in a higher MHz rate.
but the chance is so low nobody will ever notice in practice.
2013-01-01 22:52:46 +01:00
Denis Ahrens
01d7b261eb libztex: fixed a typo 2012-12-21 05:15:32 +01:00
Denis Ahrens
29ff10743f libztex: check returnvalue of libusb_claim_interface() and release the
interface in case of early exit
2012-12-21 05:07:18 +01:00
Denis Ahrens
e2c8a1d0f6 libztex: avoid the use of libusb_error_name()
libusb_error_name() is only available in libusb-1.0.9 and newer
2012-12-10 09:49:44 +01:00
Denis Ahrens
0559d0bb6a libztex: in case the selectFpga() failed set the selected fpga to unknown
after libztex_selectFpga() failed we can not be sure which fpga is now
selected. can be the old one or maybe even the new one. so set the
selected fpga variable to unknown so that the next call must set it
again.
2012-12-09 23:56:36 +01:00
Denis Ahrens
f5a575966c libztex: use a function for the twice called firmware reset code 2012-12-09 12:06:42 +01:00
Denis Ahrens
9b1d0c9d95 libztex: removed an unused struct member (ztex->valid) 2012-12-09 11:39:56 +01:00
Con Kolivas
b53fa540b4 Merge pull request #347 from denis2342/ztex
Ztex: more whitespace and style fixes
2012-12-08 12:38:58 -08:00
Denis Ahrens
dba007287c ztex: more style and whitespace fixes 2012-12-08 19:29:36 +01:00
Con Kolivas
c1b0143dac Merge pull request #346 from denis2342/ztex
libztex: silenced another warning
2012-12-08 03:58:44 -08:00
Denis Ahrens
44c0f72a53 libztex: silenced another warning 2012-12-08 12:56:03 +01:00
Con Kolivas
77ef4c210f Include the correct config header in libztex and include it before other includes. 2012-12-08 21:19:22 +11:00
Denis Ahrens
b7753e3317 libztex: fixed some warnings and removed some whitespaces 2012-12-07 14:11:31 +01:00
Denis Ahrens
69a688f53d libztex: silenced some warnings 2012-12-07 05:05:37 +01:00
Denis Ahrens
b48b2cc8c4 libztex: Read bitstream file in 2kb blocks with simpler and faster code
optimized libztex_configureFpgaLS() like it was done some commits
ago to libztex_configureFpgaHS()
2012-12-06 16:47:03 +01:00
Denis Ahrens
1203f1f621 libztex: Add firmware download support for ZTEX 1.15d and 1.15x
The correct firmware file is automatically determined based on the ZTEX
descriptor in the dummy firmware.
2012-12-04 11:56:32 +01:00
Peter Stuge
f967392877 libztex: Factor out local version of libusb_get_string_descriptor_ascii() 2012-12-04 11:56:29 +01:00
Denis Ahrens
90b3e6adbd libztex: Make log messages say bitstream when refering to bitstreams 2012-12-04 11:39:03 +01:00
Denis Ahrens
d9479b2cee libztex: Don't return error when a bitstream was already configured
The high speed and low speed configureFpga functions should not return
an error when no bitstream needs to be downloaded. These codepaths are
not executed for now, because all calls to configureFpga set the force
parameter to true. Future commits may change that, allowing cgminer to
start mining immediately if each hardware has already been correctly
configured with firmware and bitstream(s).
2012-12-04 11:39:03 +01:00
Denis Ahrens
b70edef9f5 libztex: Read bitstream file in 64kb blocks with simpler and faster code 2012-12-04 11:39:03 +01:00
Denis Ahrens
a5b2845096 libztex: Verify that the mining firmware is not a dummy firmware 2012-12-04 11:39:03 +01:00
Denis Ahrens
843e9120b3 libztex: Match mining firmware ZTEX descriptor against the dummy firmware
The first 8 bytes are matched, which ensures that the mining firmware
actually fits the hardware, assuming that the correct dummy firmware
is present in the device.
2012-12-04 11:37:37 +01:00
Denis Ahrens
8d7ad82806 libztex: Start download sequence only after reading in the new firmware
The download sequence starts with a reset command, which tells the board
that a new firmware is about to be downloaded. The board gets unhappy if
no new firmware is actually sent, so only send the reset command AFTER
the new firmware has actually been successfully read.
2012-12-04 11:07:10 +01:00
Peter Stuge
584dc5acd5 libztex: Download mining firmware to all devices with dummy firmware
When one or more ZTEX devices with dummy firmware are found on startup,
the correct firmware is downloaded to each device, and then USB devices
are rescanned until all devices have reattached with the mining firmware.

This allows to discover and configure all ZTEX devices and start mining
directly, without first running the ZTEX Java software to download a
firmware to the device.
2012-12-04 11:06:28 +01:00
Denis Ahrens
b28dbc2e1c ztex: Harmonize low-speed FPGA configuration code with high-speed code 2012-11-26 04:15:27 +01:00
Denis Ahrens
4629553ad6 ztex: Display FPGA clock frequency with only one decimal 2012-11-26 04:15:27 +01:00
Peter Stuge
1c204dc927 libztex: Silence warning: comparison between signed and unsigned 2012-11-26 04:15:18 +01:00
Peter Stuge
972ddf74c7 libztex: Work around ZTEX USB firmware bug exposed by the FreeBSD libusb
The ZTEX USB firmware doesn't correctly support GET_DESCRIPTOR requests
for string descriptors, specifically the device always returns the full
string descriptor, even if the request wLength is shorter. The FreeBSD
implementation of libusb_get_string_descriptor_ascii() first requests 4
(four) bytes to validate the start of the string descriptor, and since
the device sends back too many bytes the USB host controller signals an
error to FreeBSD which returns the error to us.

In order to avoid this mess the libusb_get_string_descriptor_ascii()
call is replaced with the way libusb-1.0 works; which makes only a
single request to read the entire string descriptor.
2012-11-23 03:42:47 +01:00
Con Kolivas
dc7fc13e93 Convert libztex to nmsleep where possible. 2012-11-18 22:23:03 +11:00
Con Kolivas
346d09c36d Reorder libztex header include order to fix missing struct definition. 2012-09-24 14:37:23 +10:00
Con Kolivas
9e76aed66d Initialise cnt in libztex.c 2012-08-18 23:23:14 +10:00
Con Kolivas
a916be0b09 Repeating on timeout in ztex could make the code never return. 2012-08-17 16:42:14 +10:00
Con Kolivas
567751410e Offset libusb reads/writes by length written as well in ztex. 2012-08-16 22:30:06 +10:00
Con Kolivas
280539bf98 Cope with timeouts and partial reads in ztex code. 2012-08-16 22:26:19 +10:00
Luke Dashjr
d3fa59d76f Abstract generally useful FPGA code into fpgautils.c 2012-06-12 02:35:45 +00:00
nelisky
ed60e33a94 Some tweaks to reporting and logging.
- Adding fpga number to the ztex string representation
- Removing usb details from the ztex string representation
- First frequency set no longer reports a bogus old freq
2012-05-04 08:33:13 -07:00
nelisky
0080aea432 Trying harder to get 1.15y working 2012-05-03 13:24:59 -07:00
nelisky
57a72d51fb Blind implementation of multi-fpga board 1.15y. 2012-05-02 07:26:52 -07:00
nelisky
719b0c7cee HS bitstream configuration 2012-04-30 09:29:36 -07:00
nelisky
316ebc3b04 Code style cleanup 2012-04-25 04:54:51 -07:00
nelisky
6bb3c40d20 Annotating frequency changes with the changed from value 2012-04-25 04:53:35 -07:00
nelisky
5f5e1063f4 Firmware 15d4 support
Not yet using suspend and while we have fpga counting implemented it isn't being used yet, thus only the groundwork for quad board support is done, not actually working yet.
2012-04-22 08:14:54 -07:00
Con Kolivas
b97e6aa5a0 Presumably we should return false when the capability is missing in libztex_checkCapability. 2012-04-22 10:57:23 +10:00
Con Kolivas
bd46119c11 Style police on libztex.c. 2012-04-21 14:02:22 +10:00
nelisky
9ba2e21793 Some cleanup 2012-04-18 01:54:51 -07:00
nelisky
c280dd0dae Moving space indentation to tabs
For consistency with cgminer sources
2012-04-17 01:51:53 -07:00
nelisky
f9d4d92b9a Some cleanup 2012-04-17 01:25:55 -07:00
nelisky
3067a414fc leak fix 2012-04-16 11:41:17 -07:00
nelisky
57a2764eb5 Small tweaks to freq reporting 2012-04-16 11:39:36 -07:00