1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-22 12:23:10 +02:00

cgminer update to 2.3.2, update the BIT_ENDIAN patch

This commit is contained in:
Xiangfu 2012-04-08 22:08:52 +08:00
parent 0bd9efe6fa
commit 9d550b847a
3 changed files with 48 additions and 37 deletions

View File

@ -9,13 +9,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cgminer
PKG_VERSION:=20120315
PKG_REV:=22ff7a406951f97af57cbca75d282c4bbf41a3e7
PKG_RELEASE:=3
PKG_VERSION:=20120408
PKG_REV:=ef76ec8a77d473382303b39de1247b75a4c4ae71
PKG_RELEASE:=1
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
PKG_SOURCE_URL:=git://github.com/kanoi/cgminer.git
PKG_SOURCE_URL:=git://github.com/ckolivas/cgminer.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
@ -47,11 +47,10 @@ CONFIGURE_ARGS += --disable-opencl --disable-adl --enable-icarus
TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
define Package/cgminer/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/cgminer $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cgminer $(1)/usr/bin
$(INSTALL_BIN) $(FILES_DIR)/cgminer $(1)/etc/init.d
$(CP) $(PKG_BUILD_DIR)/miner.php $(1)/usr/share/cgminer
endef
$(eval $(call BuildPackage,cgminer))

View File

@ -1,17 +1,41 @@
From 01cd959ba71d577c8a13efbdc868b46515c88334 Mon Sep 17 00:00:00 2001
From 1a19591a7f4cfa873f2c6fe58b48d7588187e4c7 Mon Sep 17 00:00:00 2001
From: Xiangfu <xiangfu@openmobilefree.net>
Date: Sun, 19 Feb 2012 22:20:22 +0800
Subject: [PATCH 1/2] add-MIPSED-to-icarus-for-BIG_ENDIAN.patch
Subject: [PATCH] add-MIPSED-to-icarus-for-BIG_ENDIAN.patch
---
icarus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
cgminer.c | 4 ++--
icarus.c | 2 +-
uthash.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cgminer.c b/cgminer.c
index cfb0216..2976092 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1102,7 +1102,7 @@ static bool work_decode(const json_t *val, struct work *work)
memset(work->hash, 0, sizeof(work->hash));
-#ifdef __BIG_ENDIAN__
+#if defined(__BIG_ENDIAN__) || defined(MIPSEB)
int swapcounter = 0;
for (swapcounter = 0; swapcounter < 32; swapcounter++)
(((uint32_t*) (work->data))[swapcounter]) = swab32(((uint32_t*) (work->data))[swapcounter]);
@@ -1479,7 +1479,7 @@ static bool submit_upstream_work(const struct work *work)
return rc;
}
-#ifdef __BIG_ENDIAN__
+#if defined(__BIG_ENDIAN__) || defined(MIPSEB)
int swapcounter = 0;
for (swapcounter = 0; swapcounter < 32; swapcounter++)
(((uint32_t*) (work->data))[swapcounter]) = swab32(((uint32_t*) (work->data))[swapcounter]);
diff --git a/icarus.c b/icarus.c
index 48dabe5..c4c3736 100644
index 276cd8c..0ad7398 100644
--- a/icarus.c
+++ b/icarus.c
@@ -290,7 +290,7 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
@@ -294,7 +294,7 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
if (nonce == 0 && ret)
return 0xffffffff;
@ -20,6 +44,19 @@ index 48dabe5..c4c3736 100644
nonce = swab32(nonce);
#endif
work->blk.nonce = 0xffffffff;
diff --git a/uthash.h b/uthash.h
index 4cedb9c..f55fc77 100644
--- a/uthash.h
+++ b/uthash.h
@@ -500,7 +500,7 @@ do {
#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2)
#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3)
#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
-#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
+#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) || defined(MIPSEB)
#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8))
--
1.7.5.4

View File

@ -1,25 +0,0 @@
From 6334588efe26a774f4ebaac345073f8ad5f9172c Mon Sep 17 00:00:00 2001
From: Xiangfu <xiangfu@openmobilefree.net>
Date: Wed, 21 Mar 2012 13:54:53 +0800
Subject: [PATCH 2/2] Increase the MAX_DEVICES to 64
---
miner.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/miner.h b/miner.h
index 5f5fd68..e1cc07f 100644
--- a/miner.h
+++ b/miner.h
@@ -473,7 +473,7 @@ extern int add_pool_details(bool live, char *url, char *user, char *pass);
#define ADD_POOL_OK 0
#define MAX_GPUDEVICES 16
-#define MAX_DEVICES 32
+#define MAX_DEVICES 64
#define MAX_POOLS (32)
#define MIN_INTENSITY -10
--
1.7.5.4