diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-09-23 10:22:15 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-09-23 10:22:15 +0100 |
commit | 8b4ace9c50842c5b83401ea7b179dcab940387e1 (patch) | |
tree | 230f3135ceaace633cf93e9838b185c4a6664c2e /dev-embedded/smdk-dltool | |
parent | 9ee6d97c2883d42f204a533a8bc1f4562df778fb (diff) |
gentoo resync : 23.09.2020
Diffstat (limited to 'dev-embedded/smdk-dltool')
6 files changed, 20 insertions, 392 deletions
diff --git a/dev-embedded/smdk-dltool/Manifest b/dev-embedded/smdk-dltool/Manifest index 469efaadeff0..744b5d3a49d1 100644 --- a/dev-embedded/smdk-dltool/Manifest +++ b/dev-embedded/smdk-dltool/Manifest @@ -1,8 +1,6 @@ -AUX smdk-dltool-0.20-add-S3C64xx-support.patch 2057 BLAKE2B fec0c1684e5b94231fe5eafbbf53f82d0f1a77a21b7a59c0fe56564841e341fbb806ed5aea15aaef41ef2b9fcc9a552b57326058c7ac275d1c37e93e910fa1f8 SHA512 7ae02b298390ab3bbdfe27c3f5cea55c8f2b75f60853227f37adee7a547ef2d1069286a633e2017a79440f257c25d4f26fe1eaad0ef51c04a067af8d1b815d64 -AUX smdk-dltool-0.20-build.patch 430 BLAKE2B 8a4bbe4170780554f7171f0fd5bc548367688240bfebab40f51c4efbad44df7f6b6fe2c1c700e908275fd9f38ee17ab39ba23843a176daf45a407c7e432ac6b6 SHA512 8bd0918ebe2f7f583dd076ed9b4cc01e6d9dc397fe52981e97029727872552d4d01838c1602d170d2c1bb92e9a4759fef7eecc31336bcad22adb2c0e84e5d297 +AUX smdk-dltool-0.20-add-S3C64xx-support.patch 2022 BLAKE2B dd30445f49c092181ebb39c59673766c18020a71bf9c8378081b499fcd8ab6c360c53e06794d76d1a5ee7848ec83e6e83f6d4b8d757c841dd46def452295e3d6 SHA512 8d1ad92ec2927f7dcab474cd5df5c5c72b0f9d5934620a924166c6915df2bd7a6f0eb72fa86055a1141cba7ad8513a96cd57ad31a02d0c140f3b2467f6b9623b +AUX smdk-dltool-0.20-build.patch 364 BLAKE2B 59d431de84ac65abbeb5a902036c7b696b59d8b96c28179d4950163a48b8873dc237d937b63aae9c2aeb0c59a27f91f87fc20bb6c554ffe38911ee7bdcd17a7e SHA512 6bd0a75df43e38f88b07d490b320e1812f9651dc8e72e903e77b800cf901e3edca60b05bc1cc78b1715de6871de5e95a7fec72482a58b77ea9480e65bfd5cd45 AUX smdk-dltool-0.20-libusb-1.0-r1.patch 8859 BLAKE2B 333b774375e8ea48e811cd54fe6e6bbfa0c8c5ece0fa2cda806a6d60022b4f791ed06131930e829cab5ca5600bb1948ab8f852542048f9fcb2967e4682c51457 SHA512 7c1a39c7b6da1e2aecd651be6d78ec30383cd9a7858c40477e84bddd2cb80b8138a6cae55e3f6be71bd8aad03ff31dc3250f1579c63c106953fef2fb62e3e3bf -AUX smdk-dltool-0.20-libusb-1.0.patch 8207 BLAKE2B 499e1abf30b30960cbf998a9c06ca22062b8231938fb1ff87e9877fe4613e94c79c0561a67b885a21a11fb56dc670917f82737ca8597c37f723f5e63df3b9c9a SHA512 2c3f47ac0fbf573b8be17721639123607ec4aaf69e1eef602089d75ef614ba761b6f6d0182cbaa0abc57ef0bd5a2c61120b3369c9c73c29cd466fda3f5a99ab4 DIST smdk-tools-v0.20.tar.gz 5170 BLAKE2B c414938ff98155dd16f64378a5c3524bb2fd7e21b074cb6e656ffc2aa5b7b8cc8cbe27600472a8ef20570818e253f63f1b1460784200aaf0a4fb321f79b0cfdc SHA512 2b0fd113bc9e6e6c07ad4163d404bffa8044150a2da55a8903192b9dcbead5e31d97a9315b561526f0cb2a65e415f34941bea0db3ac40e73048901fe95ff3a17 -EBUILD smdk-dltool-0.20-r3.ebuild 834 BLAKE2B 1146b2cadeb55606412fa197fc3dd33ef48dbefb0c758c5cbcb17b439790e9354535d6c61307dab6a18bf1b2a087fbee9fb301ae53128d61e618c0938d8b2293 SHA512 e9286ccb956faeceffd459c523442a2dd09f329c4d3514e5d55f57f2256bceb6ff73f0acdc83ebcb54f37855f007a6d8f7c6a92876b269e7e44f6be212013843 -EBUILD smdk-dltool-0.20-r4.ebuild 837 BLAKE2B 244d5dfd17acc0fd6763b25bc1c4e4dc2616ab8e49f094584a0d9b99168e308c9804e5d6d0341d3dfc9b30e07f1cc9543056d2882329a5d6a97f789c00ba6340 SHA512 0b9edf675277de1100212371edbdbf0a2a35cf10ad6801b5d88b52b9d4c22b09c9c07e6e436c31ad188c664adc43e5334df6d9589eb842aa97b08446ddb9ba30 +EBUILD smdk-dltool-0.20-r4.ebuild 813 BLAKE2B ec48e8336e15e9327d3cfb5518149b0e91c8ad684de65f263c1ba639fc4a9e9c0aedc6334b324fee4bef2a6b0030f4910534da0c707d86f3ca859a4bba0160fd SHA512 9b978e80e159eb802cc51d6b16f266f0eff3a0c41d16937d3704889e78bb4194cb8d4b4d6625b6fe7e3089737e663bb393689fc2c4aa9286ef48ae9c97f59614 MISC metadata.xml 247 BLAKE2B e46b8f2d053251af5cb591bb2ee5e35089c4e8174ee2e7a3c504db23f844b65083d4a3e5198da3977ad3e98b67cab2e0de686a3c62009b487c1e64785a8ff65d SHA512 15df289e0f962f564551f61ada3cfef0311f6af639887def780bf5ad3be105515c8d24c950ff340ed35d89b9cd994af3540322b684c5dec3b43ec6bb0041aa4e diff --git a/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-add-S3C64xx-support.patch b/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-add-S3C64xx-support.patch index 5b615aeb119b..f2864b012a27 100644 --- a/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-add-S3C64xx-support.patch +++ b/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-add-S3C64xx-support.patch @@ -6,13 +6,13 @@ Subject: [PATCH] Add S3C64xx support Author: unknown URL: http://dev.odroid.com/frs/download.php/22/Linux-dltool.tar.gz --- - dltool/dltool.c | 19 ++++++++++++++----- + dltool.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) -diff --git a/dltool/dltool.c b/dltool/dltool.c +diff --git a/dltool.c b/dltool.c index 4e2d238..e76e607 100644 ---- a/dltool/dltool.c -+++ b/dltool/dltool.c +--- a/dltool.c ++++ b/dltool.c @@ -26,6 +26,8 @@ char *dl_file = "download.dat"; char *dl_udev = NULL; char *dl_ubus = NULL; diff --git a/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-build.patch b/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-build.patch index c6e3b767394b..9b7162d77cd5 100644 --- a/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-build.patch +++ b/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-build.patch @@ -1,7 +1,7 @@ respect env build settings ---- a/releases/smdk-tools-v0.20/dltool/Makefile -+++ b/releases/smdk-tools-v0.20/dltool/Makefile +--- a/Makefile ++++ b/Makefile @@ -7,8 +7,13 @@ .PHONY: clean diff --git a/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-libusb-1.0.patch b/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-libusb-1.0.patch deleted file mode 100644 index 889a439c7fb0..000000000000 --- a/dev-embedded/smdk-dltool/files/smdk-dltool-0.20-libusb-1.0.patch +++ /dev/null @@ -1,338 +0,0 @@ -migrate to libusb-1 by me (Mike Frysinger) - ---- a/Makefile -+++ b/Makefile -@@ -10,8 +10,8 @@ - CFLAGS ?= -O2 -g - CFLAGS += -Wall - PKG_CONFIG ?= pkg-config --CPPFLAGS += $(shell $(PKG_CONFIG) --cflags libusb) --LDLIBS = $(shell $(PKG_CONFIG) --libs libusb) -+CPPFLAGS += $(shell $(PKG_CONFIG) --cflags libusb-1.0) -+LDLIBS = $(shell $(PKG_CONFIG) --libs libusb-1.0) - - all: dltool - ---- a/dltool.c -+++ b/dltool.c -@@ -13,9 +13,11 @@ - #include <stdio.h> - #include <getopt.h> - #include <fcntl.h> -+#include <errno.h> -+#include <unistd.h> - - --#include <usb.h> -+#include <libusb.h> - - unsigned int debug = 0; - unsigned long dl_addr = 0x30000000L; -@@ -23,12 +25,22 @@ unsigned long dl_size = 0L; - unsigned char *dl_data = NULL; - - char *dl_file = "download.dat"; --char *dl_udev = NULL; --char *dl_ubus = NULL; -+libusb_context *ctx = NULL; -+libusb_device_handle *devh = NULL; - - int ep_out = 0; - - #define DBG(x) if (debug) { printf x; } -+#define err(fmt, args...) \ -+ do { \ -+ if (devh) \ -+ libusb_close(devh); \ -+ if (ctx) \ -+ libusb_exit(ctx); \ -+ fprintf(stderr, "dltool: " fmt "\n", ## args); \ -+ exit(1); \ -+ } while (0) -+#define errp(fmt, args...) err(fmt ": %s", ## args, strerror(errno)) - - void write_u32(unsigned char *dp, unsigned long val) - { -@@ -108,25 +120,30 @@ void calc_cksum(unsigned char *data, ssize_t len) - cp[1] = cksum >> 8; - } - --int verify_device(struct usb_device *dev) -+int verify_device(libusb_device *dev) - { -+ struct libusb_device_descriptor desc; -+ -+ if (libusb_get_device_descriptor(dev, &desc)) -+ return 0; -+ - DBG(("dev %p: configurations %d\n", -- dev, dev->descriptor.bNumConfigurations)); -+ dev, desc.bNumConfigurations)); - -- if (dev->descriptor.bNumConfigurations != 1) -+ if (desc.bNumConfigurations != 1) - return 0; - -- DBG(("\t=> bLength %d\n", dev->descriptor.bLength)); -- DBG(("\t=> bType %d\n", dev->descriptor.bDescriptorType)); -- DBG(("\t=> bcdUSB %x\n", dev->descriptor.bcdUSB)); -- DBG(("\t=> idVendor %x\n", dev->descriptor.idVendor)); -- DBG(("\t=> idProduct %x\n", dev->descriptor.idProduct)); -+ DBG(("\t=> bLength %d\n", desc.bLength)); -+ DBG(("\t=> bType %d\n", desc.bDescriptorType)); -+ DBG(("\t=> bcdUSB %x\n", desc.bcdUSB)); -+ DBG(("\t=> idVendor %x\n", desc.idVendor)); -+ DBG(("\t=> idProduct %x\n", desc.idProduct)); - -- if (dev->descriptor.idVendor == 0x5345 && dev->descriptor.idProduct == 0x1234) { -+ if (desc.idVendor == 0x5345 && desc.idProduct == 0x1234) { - ep_out = 3; - return 1; - } -- else if(dev->descriptor.idVendor == 0x4e8 && dev->descriptor.idProduct == 0x1234){ -+ else if(desc.idVendor == 0x4e8 && desc.idProduct == 0x1234){ - printf("S3C64XX Detected!\n"); - ep_out = 2; - return 1; -@@ -173,6 +190,12 @@ struct option long_opts[] = { - .val = 'x', - }, - { -+ .name = "help", -+ .has_arg = 0, -+ .flag = NULL, -+ .val = 'h', -+ }, -+ { - .name = NULL - } - }; -@@ -181,12 +204,14 @@ int flg_show = 0; - - int main(int argc, char **argv) - { -- struct usb_bus *bus, *busp; -- struct usb_device *result = NULL; -- struct usb_device *found = NULL; -+ ssize_t num_devs, i; -+ libusb_device **list; -+ libusb_device *found; -+ int dl_ubus = -1; -+ int dl_udev = -1; -+ uint8_t bus_num, dev_num; - unsigned long fsize; -- usb_dev_handle *devh; -- int ret; -+ int ret, transferred; - - printf("SMDK42XX,S3C64XX USB Download Tool\n"); - printf("Version 0.20 (c) 2004,2005,2006" -@@ -197,7 +222,7 @@ int main(int argc, char **argv) - int index = 0; - int c; - -- c = getopt_long(argc, argv, "a:b:d:f:s", long_opts, &index); -+ c = getopt_long(argc, argv, "a:b:d:f:shx", long_opts, &index); - - DBG(("option index %d\n",c )); - -@@ -218,117 +243,127 @@ int main(int argc, char **argv) - break; - - case 'b': -- dl_ubus = optarg; -+ dl_ubus = atoi(optarg); - break; - - case 'd': -- dl_udev = optarg; -+ dl_udev = atoi(optarg); - break; - - case 'x': - debug = 1; -+ break; -+ -+ case 'h': -+ puts( -+ "Usage: dltool [options]\n" -+ "\n" -+ "-a <download addr>\n" -+ "-b <bus #>\n" -+ "-d <dev #>\n" -+ "-f <file>\n" -+ "-s Show found devices\n" -+ "-x Enable debug\n" -+ ); -+ return 0; - } - } - -- usb_init(); -- usb_find_busses(); -- usb_find_devices(); -- -- bus = usb_get_busses(); -- -- DBG(("usb_get_busses: %p\n", bus)); -- -- for (busp = bus; busp != NULL; busp = busp->next) { -- struct usb_device *dev; -- -- DBG(("bus %p: dirname %s\n", busp, busp->dirname)); -- -- if (dl_ubus) { -- if (strcmp(busp->dirname, dl_ubus) != 0) -- continue; -+ ret = libusb_init(&ctx); -+ if (ret) -+ errp("could not initialize usb stack"); -+ -+ bus_num = dev_num = 0; -+ found = NULL; -+ num_devs = libusb_get_device_list(ctx, &list); -+ for (i = 0; i < num_devs; ++i) { -+ libusb_device *dev = list[i]; -+ bus_num = libusb_get_bus_number(dev); -+ dev_num = libusb_get_device_address(dev); -+ -+ DBG(("bus %u; dev %u (%p)\n", bus_num, dev_num, dev)); -+ -+ if (dl_ubus >= 0 && bus_num != dl_ubus) -+ continue; -+ -+ if (!verify_device(dev)) -+ continue; -+ -+ if (flg_show) { -+ printf("bus %u: device %u\n", bus_num, dev_num); -+ continue; - } - -- for (dev = busp->devices; dev != NULL; dev = dev->next) { -- DBG(("dev %p filename %s\n", dev, dev->filename)); -+ if (dl_udev >= 0 && dev_num != dl_udev) -+ continue; - -- if (!verify_device(dev)) -- continue; -- -- if (flg_show) { -- printf("bus %s: device %s\n", -- busp->dirname, dev->filename); -- continue; -- } -- -- found = dev; -- -- if (dl_udev) { -- if (strcmp(dev->filename, dl_udev) == 0) { -- result = dev; -- break; -- } -- } -- } -- -- if (result != NULL) -- break; -+ found = dev; -+ break; - } - - if (flg_show) - return 0; - -- DBG(("device %p, found %p\n", result, found)); -+ DBG(("found %p\n", found)); - -- if (result == NULL && found != NULL) -- result = found; -- -- if (result == NULL) { -- fprintf(stderr, "failed to find device\n"); -- return 1; -- } -+ if (found == NULL) -+ err("failed to find device\n"); - -- printf("=> found device: bus %s, dev %s\n", -- result->bus->dirname, result->filename); -+ printf("=> found device: bus %u, dev %u\n", -+ bus_num, dev_num); - - dl_data = load_file(dl_file, &dl_size, &fsize); -- if (dl_data == NULL) { -- printf("failed to load %s\n", dl_file); -- return 1; -- } -+ if (dl_data == NULL) -+ errp("failed to load %s", dl_file); - - printf("=> loaded %ld bytes from %s\n", fsize, dl_file); - -- devh = usb_open(result); -- if (devh == NULL) { -- perror("usb_open"); -- return 1; -- } -+ ret = libusb_open(found, &devh); -+ if (ret == 0) { -+ /* -+ * Seems to break some recovery modes :( -+ * http://crosbug.com/26083 -+ * These fail: -+ * smdk-dltool -a 0x02021400 -f bl1.bin -+ * smdk-dltool -a 0x02023400 -f bl2.bin -+ */ -+#if 0 -+ uint8_t configuration; -+ struct libusb_config_descriptor *config; -+ libusb_get_active_config_descriptor(found, &config); -+ configuration = config->bConfigurationValue; -+ libusb_free_config_descriptor(config); -+ libusb_set_configuration(devh, configuration); -+#endif -+ } else -+ errp("libusb_open"); - - DBG(("claim interface\n")); - -- if (usb_claim_interface(devh, 0) < 0) { -- perror("usb_claim_interface"); -- usb_close(devh); -- return 1; -- } -+ ret = libusb_claim_interface(devh, 0); -+ if (ret) -+ errp("libusb_claim_interface"); - - printf("=> Downloading %ld bytes to 0x%08lx\n", dl_size, dl_addr); - - write_header(dl_data, dl_addr, dl_size); - calc_cksum(dl_data, dl_size); - -- //ret = usb_bulk_write(devh, 3, (void *)dl_data, dl_size, 5*1000*1000); -- ret = usb_bulk_write(devh, ep_out, (void *)dl_data, dl_size, 5*1000*1000); -+ //ret = libusb_bulk_transfer(devh, 3, dl_data, dl_size, &transferred, 5*1000*1000); -+ ret = libusb_bulk_transfer(devh, ep_out, dl_data, dl_size, &transferred, 5*1000*1000); - printf("=> usb_bulk_write() returned %d\n", ret); - -- if (ret != dl_size) { -- printf("failed to write %ld bytes\n", dl_size); -+ if (ret || transferred != dl_size) { -+ printf("failed to write %ld bytes (wrote %d): %s\n", -+ dl_size, transferred, strerror(errno)); -+ ret = 1; - } - - free(dl_data); - -- usb_release_interface(devh, 0); -- usb_close(devh); -+ libusb_release_interface(devh, 0); -+ libusb_close(devh); -+ libusb_exit(ctx); - -- return 0; -+ return ret; - } diff --git a/dev-embedded/smdk-dltool/smdk-dltool-0.20-r3.ebuild b/dev-embedded/smdk-dltool/smdk-dltool-0.20-r3.ebuild deleted file mode 100644 index d15dedcb728c..000000000000 --- a/dev-embedded/smdk-dltool/smdk-dltool-0.20-r3.ebuild +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="4" - -inherit toolchain-funcs eutils - -DESCRIPTION="Tool to communicate with Samsung SMDK boards" -HOMEPAGE="http://www.fluff.org/ben/smdk/tools/" -SRC_URI="http://www.fluff.org/ben/smdk/tools/downloads/smdk-tools-v${PV}.tar.gz" - -# Email sent to author on 2012-01-18 querying about license -LICENSE="all-rights-reserved" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" -RESTRICT="mirror bindist" - -RDEPEND="virtual/libusb:1" -DEPEND="${RDEPEND}" - -S=${WORKDIR}/releases/smdk-tools-v${PV}/dltool - -src_prepare() { - epatch "${FILESDIR}"/${P}-add-S3C64xx-support.patch - epatch "${FILESDIR}"/${P}-build.patch - epatch "${FILESDIR}"/${P}-libusb-1.0.patch - tc-export CC PKG_CONFIG -} - -src_install() { - newbin dltool smdk-usbdl - dodoc readme.txt -} diff --git a/dev-embedded/smdk-dltool/smdk-dltool-0.20-r4.ebuild b/dev-embedded/smdk-dltool/smdk-dltool-0.20-r4.ebuild index a0fec4846a4f..ece10a6cf42a 100644 --- a/dev-embedded/smdk-dltool/smdk-dltool-0.20-r4.ebuild +++ b/dev-embedded/smdk-dltool/smdk-dltool-0.20-r4.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="4" +EAPI=7 -inherit toolchain-funcs eutils +inherit toolchain-funcs DESCRIPTION="Tool to communicate with Samsung SMDK boards" HOMEPAGE="http://www.fluff.org/ben/smdk/tools/" @@ -13,18 +13,20 @@ SRC_URI="http://www.fluff.org/ben/smdk/tools/downloads/smdk-tools-v${PV}.tar.gz" LICENSE="all-rights-reserved" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" RESTRICT="mirror bindist" RDEPEND="virtual/libusb:1" DEPEND="${RDEPEND}" -S=${WORKDIR}/releases/smdk-tools-v${PV}/dltool +S="${WORKDIR}/releases/smdk-tools-v${PV}/dltool" -src_prepare() { - epatch "${FILESDIR}"/${P}-add-S3C64xx-support.patch - epatch "${FILESDIR}"/${P}-build.patch - epatch "${FILESDIR}"/${P}-libusb-1.0-r1.patch +PATCHES=( + "${FILESDIR}"/${P}-add-S3C64xx-support.patch + "${FILESDIR}"/${P}-build.patch + "${FILESDIR}"/${P}-libusb-1.0-r1.patch +) + +src_configure() { tc-export CC PKG_CONFIG } |