I found quit a bit of the source for sgminer after writing the bin image(PiZero_GX10_171229_V1.1.img) to an SD card and looking at deleted files.
Not sure if this has already been discovered. Not sure if there's enough to actually compile a working version.
Here's some of what I found:
#ifndef __DEVICE_BAIKAL_H__
#define __DEVICE_BAIKAL_H__
#include "miner.h"
#define BAIKAL_MAXMINERS (16)
#define BAIKAL_MAXASICS (200)
#define BAIKAL_WORK_FIFO (255)
#define BAIKAL_CLK_MIN (150)
#define BAIKAL_CLK_DEF (300)
#define BAIKAL_CLK_MAX (300)
#define BAIKAL_CUTOFF_TEMP (85)
#define BAIKAL_FANSPEED_DEF (100)
#define BAIKAL_FANSPEED_MAX (100)
#define BAIKAL_RECOVER_TEMP (60)
#define BAIKAL_RESET (0x01)
#define BAIKAL_GET_INFO (0x02)
#define BAIKAL_SET_OPTION (0x03)
#define BAIKAL_SEND_WORK (0x04)
#define BAIKAL_GET_RESULT (0x05)
#define BAIKAL_SET_ID (0x06)
#define BAIKAL_SET_IDLE (0x07)
#define BAIKAL_MINER_TYPE_NONE (0x00)
#define BAIKAL_MINER_TYPE_MINI (0x01)
#define BAIKAL_MINER_TYPE_CUBE (0x02)
#define BAIKAL_ENABLE_SETCLK (0)
struct asic_info {
uint32_t nonce;
uint32_t error;
};
struct miner_info {
int thr_id;
int asic_count;
int unit_count;
int temp;
int clock;
bool working;
bool overheated;
uint8_t fw_ver;
uint8_t hw_ver;
uint8_t asic_ver;
uint32_t nonce;
uint32_t error;
double working_diff;
struct asic_info asics[BAIKAL_MAXASICS];
cgtimer_t start_time;
};
struct baikal_info {
struct pool pool;
int miner_count;
int clock;
uint8_t cutofftemp;
uint8_t fanspeed; // percent
uint8_t recovertemp;
pthread_t *process_thr;
uint8_t work_idx;
struct work *works[BAIKAL_WORK_FIFO];
struct miner_info miners[BAIKAL_MAXMINERS];
uint8_t miner_type;
};
typedef struct {
uint8_t miner_id;
uint8_t cmd;
uint8_t param;
uint8_t dest;
uint8_t data[512];
uint32_t len;
} baikal_msg;
#endif /* __DEVICE_BAIKAL_H__ */