-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbitmain-spi-s3_1.0.0.bb
56 lines (47 loc) · 1.39 KB
/
bitmain-spi-s3_1.0.0.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
DESCRIPTION = "Kernel Module Bitmain spi Fpga Driver"
HOMEPAGE = "http://www.example.com"
SECTION = "kernel/modules"
PRIORITY = "optional"
LICENSE = "CLOSED"
KERNEL_VERSION="3.8.13"
RRECOMMENDS_${PN} = "kernel (= ${KERNEL_VERSION})"
DEPENDS = "virtual/kernel"
PR = "r0"
SRC_URI = " \
file://bitmain-asic-drv.c \
file://bitmain-asic.h \
file://fpga.c \
file://fpga.h \
file://sha2.c \
file://sha2.h \
file://spi.c \
file://spi.h \
file://Makefile \
"
S = "${WORKDIR}"
inherit module
do_compile () {
echo "compile bitmain-spi"
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
if [ x"C1" == x"${Miner_TYPE}" ]; then
export BOARD_TYPE="-DC1_02"
elif [ x"C2" == x"${Miner_TYPE}" ]; then
export BOARD_TYPE="-DC1_02"
elif [ x"S5" == x"${Miner_TYPE}" ]; then
export BOARD_TYPE="-DS5"
elif [ x"S2" == x"${Miner_TYPE}" ]; then
export BOARD_TYPE="-DS2"
elif [ x"S4+" == x"${Miner_TYPE}" ]; then
export BOARD_TYPE="-DS4_PLUS"
fi
oe_runmake 'MODPATH="${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers"' \
'KERNEL_SOURCE="${STAGING_KERNEL_DIR}"' \
'KDIR="${STAGING_KERNEL_DIR}"' \
'KERNEL_VERSION="${KERNEL_VERSION}"' \
'CC="${KERNEL_CC}"' \
'LD="${KERNEL_LD}"'
}
do_install () {
install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/bitmain
install -m 0644 ${S}/bitmain_spi*${KERNEL_OBJECT_SUFFIX} ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/bitmain
}