mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool
@ 2021-10-11 14:55 Ahmad Fatoum
  2021-10-11 14:55 ` [PATCH 2/2] scripts: add target tool for rk-usb-loader Ahmad Fatoum
  2021-10-12  7:43 ` [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2021-10-11 14:55 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Similar to d297e90323f3 ("scripts: omap3-usb-loader: make proper
use of pkg-config --cflags"), tools using libusb-1.0 should
include <libusb.h> and not assume its parent directory will be
found by the search path, regardless of pkg-config.

Also, .gitignore was missing an entry for the new tool and
hosttools_defconfig should enable all useful host tools.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/sandbox/configs/hosttools_defconfig | 1 +
 scripts/.gitignore                       | 1 +
 scripts/rk-usb-loader.c                  | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/configs/hosttools_defconfig b/arch/sandbox/configs/hosttools_defconfig
index 7d3385312488..0b62b648c744 100644
--- a/arch/sandbox/configs/hosttools_defconfig
+++ b/arch/sandbox/configs/hosttools_defconfig
@@ -4,3 +4,4 @@ CONFIG_ARCH_IMX_USBLOADER=y
 CONFIG_MVEBU_HOSTTOOLS=y
 CONFIG_OMAP3_USB_LOADER=y
 CONFIG_OMAP4_HOSTTOOL_USBBOOT=y
+CONFIG_RK_USB_LOADER=y
diff --git a/scripts/.gitignore b/scripts/.gitignore
index cf645ec74661..bc6e5dbc43df 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -31,6 +31,7 @@ omap4_usbboot
 omap4_usbboot-target
 omap3-usb-loader
 omap3-usb-loader-target
+rk-usb-loader
 mips-relocs
 rsatoc
 stm32image
diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
index 627af7259ed0..c742023c60d9 100644
--- a/scripts/rk-usb-loader.c
+++ b/scripts/rk-usb-loader.c
@@ -25,7 +25,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <libusb-1.0/libusb.h>
+#include <libusb.h>
 
 #include "../common.h"
 #include "../common.c"
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] scripts: add target tool for rk-usb-loader
  2021-10-11 14:55 [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool Ahmad Fatoum
@ 2021-10-11 14:55 ` Ahmad Fatoum
  2021-10-12  7:43 ` [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2021-10-11 14:55 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Having rk-usb-loader as a target tool as well makes it easy to
cross-compile it. Add the boilerplate.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Could be squashed into previous commit as well.
---
 arch/sandbox/configs/targettools_defconfig | 1 +
 scripts/.gitignore                         | 1 +
 scripts/Kconfig                            | 7 +++++++
 scripts/Makefile                           | 3 +++
 scripts/rk-usb-loader-target.c             | 1 +
 5 files changed, 13 insertions(+)
 create mode 100644 scripts/rk-usb-loader-target.c

diff --git a/arch/sandbox/configs/targettools_defconfig b/arch/sandbox/configs/targettools_defconfig
index d06074790c02..22845def617c 100644
--- a/arch/sandbox/configs/targettools_defconfig
+++ b/arch/sandbox/configs/targettools_defconfig
@@ -7,3 +7,4 @@ CONFIG_MVEBU_KWBOOT_TARGET=y
 CONFIG_ARCH_IMX_USBLOADER_TARGET=y
 CONFIG_OMAP3_USB_LOADER_TARGET=y
 CONFIG_OMAP4_USBBOOT_TARGET=y
+CONFIG_RK_USB_LOADER_TARGET=y
diff --git a/scripts/.gitignore b/scripts/.gitignore
index bc6e5dbc43df..ae70c92af8a3 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -32,6 +32,7 @@ omap4_usbboot-target
 omap3-usb-loader
 omap3-usb-loader-target
 rk-usb-loader
+rk-usb-loader-target
 mips-relocs
 rsatoc
 stm32image
diff --git a/scripts/Kconfig b/scripts/Kconfig
index b633e3011f55..9b744deba9aa 100644
--- a/scripts/Kconfig
+++ b/scripts/Kconfig
@@ -175,4 +175,11 @@ config OMAP4_USBBOOT_TARGET
 	  Say Y here to build the omap4 usb loader tool for the target.
 	  The cross toolchain needs libusb-1.0 to compile this tool.
 
+config RK_USB_LOADER_TARGET
+	bool "Rockchip USB loader for target"
+	depends on HAS_TARGET_LIBUSB_1_0
+	help
+	  Say Y here to build the rockchip usb loader tool for the target.
+	  The cross toolchain needs libusb-1.0 to compile this tool.
+
 endmenu
diff --git a/scripts/Makefile b/scripts/Makefile
index 433a30143105..dc5fa75f908b 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -47,11 +47,14 @@ userprogs-always-$(CONFIG_IMD_TARGET)			+= bareboximd-target
 userprogs-always-$(CONFIG_OMAP3_USB_LOADER_TARGET)	+= omap3-usb-loader-target
 userprogs-always-$(CONFIG_OMAP4_USBBOOT_TARGET)		+= omap4_usbboot-target
 userprogs-always-$(CONFIG_MVEBU_KWBOOT_TARGET)		+= kwboot-target
+userprogs-always-$(CONFIG_RK_USB_LOADER_TARGET)		+= rk-usb-loader-target
 
 omap3-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
 omap3-usb-loader-target-userldlibs += `$(CROSS_PKG_CONFIG) --libs libusb-1.0`
 omap4_usbboot-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
 omap4_usbboot-target-userldlibs += -lpthread `$(CROSS_PKG_CONFIG) --libs libusb-1.0`
+rk-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
+rk-usb-loader-target-userldlibs += `$(CROSS_PKG_CONFIG) --libs libusb-1.0`
 
 userccflags += -I $(srctree)/$(src)/include -isystem $(srctree)/scripts/include
 
diff --git a/scripts/rk-usb-loader-target.c b/scripts/rk-usb-loader-target.c
new file mode 100644
index 000000000000..fe1540d752a0
--- /dev/null
+++ b/scripts/rk-usb-loader-target.c
@@ -0,0 +1 @@
+#include "rk-usb-loader.c"
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool
  2021-10-11 14:55 [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool Ahmad Fatoum
  2021-10-11 14:55 ` [PATCH 2/2] scripts: add target tool for rk-usb-loader Ahmad Fatoum
@ 2021-10-12  7:43 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2021-10-12  7:43 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, Oct 11, 2021 at 04:55:05PM +0200, Ahmad Fatoum wrote:
> Similar to d297e90323f3 ("scripts: omap3-usb-loader: make proper
> use of pkg-config --cflags"), tools using libusb-1.0 should
> include <libusb.h> and not assume its parent directory will be
> found by the search path, regardless of pkg-config.
> 
> Also, .gitignore was missing an entry for the new tool and
> hosttools_defconfig should enable all useful host tools.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  arch/sandbox/configs/hosttools_defconfig | 1 +
>  scripts/.gitignore                       | 1 +
>  scripts/rk-usb-loader.c                  | 2 +-
>  3 files changed, 3 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/sandbox/configs/hosttools_defconfig b/arch/sandbox/configs/hosttools_defconfig
> index 7d3385312488..0b62b648c744 100644
> --- a/arch/sandbox/configs/hosttools_defconfig
> +++ b/arch/sandbox/configs/hosttools_defconfig
> @@ -4,3 +4,4 @@ CONFIG_ARCH_IMX_USBLOADER=y
>  CONFIG_MVEBU_HOSTTOOLS=y
>  CONFIG_OMAP3_USB_LOADER=y
>  CONFIG_OMAP4_HOSTTOOL_USBBOOT=y
> +CONFIG_RK_USB_LOADER=y
> diff --git a/scripts/.gitignore b/scripts/.gitignore
> index cf645ec74661..bc6e5dbc43df 100644
> --- a/scripts/.gitignore
> +++ b/scripts/.gitignore
> @@ -31,6 +31,7 @@ omap4_usbboot
>  omap4_usbboot-target
>  omap3-usb-loader
>  omap3-usb-loader-target
> +rk-usb-loader
>  mips-relocs
>  rsatoc
>  stm32image
> diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
> index 627af7259ed0..c742023c60d9 100644
> --- a/scripts/rk-usb-loader.c
> +++ b/scripts/rk-usb-loader.c
> @@ -25,7 +25,7 @@
>  #include <sys/types.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> -#include <libusb-1.0/libusb.h>
> +#include <libusb.h>
>  
>  #include "../common.h"
>  #include "../common.c"
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-12  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 14:55 [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool Ahmad Fatoum
2021-10-11 14:55 ` [PATCH 2/2] scripts: add target tool for rk-usb-loader Ahmad Fatoum
2021-10-12  7:43 ` [PATCH 1/2] fixup! scripts: Add rk-usb-loader tool Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox