summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-05-11 20:07:54 -0700
committerArmin Kuster <akuster808@gmail.com>2018-05-17 08:27:42 -0700
commit28abd55f75feb2d9d36dc0d5b704728032f5e33e (patch)
tree34817511542957a397ab5ab62f4cfa9f2371bbfa
parent93be3e083fa7746f7c1c2fd08f6ce5c3b2d7aa9d (diff)
downloadmeta-openembedded-28abd55f75feb2d9d36dc0d5b704728032f5e33e.tar.gz
flashrom: Fix build with libusb 1.0.22
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch39
-rw-r--r--meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb1
2 files changed, 40 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch b/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch
new file mode 100644
index 000000000..df8028627
--- /dev/null
+++ b/meta-oe/recipes-bsp/flashrom/flashrom/0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch
@@ -0,0 +1,39 @@
1From e5f68189ab3602b1042cc8423fd6a3a23abd5455 Mon Sep 17 00:00:00 2001
2From: Alex James <theracermaster@gmail.com>
3Date: Sat, 14 Apr 2018 22:59:57 -0500
4Subject: [PATCH] ch341a_spi: Avoid deprecated libusb functions
5
6libusb 1.0.22 marked libusb_set_debug as deprecated. For such versions
7of libusb, use libusb_set_option instead.
8
9Change-Id: Ib71ebe812316eaf49136979a942a946ef9e4d487
10Signed-off-by: Alex James <theracermaster@gmail.com>
11Reviewed-on: https://review.coreboot.org/25681
12Tested-by: Nico Huber <nico.h@gmx.de>
13Reviewed-by: David Hendricks <david.hendricks@gmail.com>
14---
15Upstream-Status: Backport
16 ch341a_spi.c | 7 ++++++-
17 1 file changed, 6 insertions(+), 1 deletion(-)
18
19diff --git a/ch341a_spi.c b/ch341a_spi.c
20index 6eb2804..d880510 100644
21--- a/ch341a_spi.c
22+++ b/ch341a_spi.c
23@@ -444,7 +444,12 @@ int ch341a_spi_init(void)
24 return -1;
25 }
26
27- libusb_set_debug(NULL, 3); // Enable information, warning and error messages (only).
28+ /* Enable information, warning, and error messages (only). */
29+#if LIBUSB_API_VERSION < 0x01000106
30+ libusb_set_debug(NULL, 3);
31+#else
32+ libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_INFO);
33+#endif
34
35 uint16_t vid = devs_ch341a_spi[0].vendor_id;
36 uint16_t pid = devs_ch341a_spi[0].device_id;
37--
382.17.0
39
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb b/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb
index 9eac876ba..1c1724668 100644
--- a/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb
+++ b/meta-oe/recipes-bsp/flashrom/flashrom_1.0.bb
@@ -8,6 +8,7 @@ DEPENDS = "pciutils libusb libusb-compat"
8SRC_URI = "https://download.flashrom.org/releases/flashrom-${PV}.tar.bz2 \ 8SRC_URI = "https://download.flashrom.org/releases/flashrom-${PV}.tar.bz2 \
9 file://sst26.patch \ 9 file://sst26.patch \
10 file://0001-platform-Add-riscv-to-known-platforms.patch \ 10 file://0001-platform-Add-riscv-to-known-platforms.patch \
11 file://0001-ch341a_spi-Avoid-deprecated-libusb-functions.patch \
11 " 12 "
12SRC_URI[md5sum] = "42d999990c735d88653627cefcc13b9a" 13SRC_URI[md5sum] = "42d999990c735d88653627cefcc13b9a"
13SRC_URI[sha256sum] = "3702fa215ba5fb5af8e54c852d239899cfa1389194c1e51cb2a170c4dc9dee64" 14SRC_URI[sha256sum] = "3702fa215ba5fb5af8e54c852d239899cfa1389194c1e51cb2a170c4dc9dee64"